ENH: support auto pa cali for multi_extruder printer
jira: none Change-Id: I835a0e20de81f9af7c40983e00bdb37ea6c95a68
This commit is contained in:
parent
50b3d0097e
commit
4e387d4ace
|
@ -143,6 +143,7 @@ struct PACalibExtruderInfo
|
|||
NozzleVolumeType nozzle_volume_type;
|
||||
float nozzle_diameter;
|
||||
std::string filament_id = "";
|
||||
bool use_nozzle_volume_type{true};
|
||||
};
|
||||
|
||||
struct PACalibTabInfo
|
||||
|
|
|
@ -1154,6 +1154,15 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||
return 0;
|
||||
};
|
||||
|
||||
int extruder_id = obj->get_extruder_id_by_ams_id(std::to_string(ams_id));
|
||||
NozzleVolumeType nozzle_volume_type = NozzleVolumeType::nvtNormal;
|
||||
if (obj->m_extder_data.extders[extruder_id].current_nozzle_flow_type == NozzleFlowType::NONE_FLOWTYPE) {
|
||||
MessageDialog dlg(nullptr, _L("There are unset nozzle types. Please set the nozzle types of all extruders before synchronizing."), _L("Warning"), wxICON_WARNING | wxOK);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
else {
|
||||
nozzle_volume_type = NozzleVolumeType(obj->m_extder_data.extders[extruder_id].current_nozzle_flow_type - 1);
|
||||
}
|
||||
if (obj->cali_version >= 0) {
|
||||
// add default item
|
||||
PACalibResult default_item;
|
||||
|
@ -1167,6 +1176,9 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
|||
std::vector<PACalibResult> cali_history = this->obj->pa_calib_tab;
|
||||
for (auto cali_item : cali_history) {
|
||||
if (cali_item.filament_id == ams_filament_id) {
|
||||
if (obj->is_multi_extruders() && (cali_item.extruder_id != extruder_id || cali_item.nozzle_volume_type != nozzle_volume_type)) {
|
||||
continue;
|
||||
}
|
||||
items.push_back(from_u8(cali_item.name));
|
||||
m_pa_profile_items.push_back(cali_item);
|
||||
}
|
||||
|
|
|
@ -273,6 +273,7 @@ void HistoryWindow::reqeust_history_result(MachineObject* obj)
|
|||
PACalibExtruderInfo cali_info;
|
||||
cali_info.nozzle_diameter = nozzle_value;
|
||||
cali_info.extruder_id = extruder_id;
|
||||
cali_info.use_nozzle_volume_type = false;
|
||||
CalibUtils::emit_get_PA_calib_infos(cali_info);
|
||||
m_tips->SetLabel(_L("Refreshing the historical Flow Dynamics Calibration records"));
|
||||
BOOST_LOG_TRIVIAL(info) << "request calib history";
|
||||
|
@ -348,7 +349,7 @@ void HistoryWindow::sync_history_data() {
|
|||
wxString preset_name = get_preset_name_by_filament_id(result.filament_id);
|
||||
auto preset_name_value = new Label(m_history_data_panel, preset_name);
|
||||
|
||||
wxString nozzle_name = generate_nozzle_id(result.nozzle_volume_type);
|
||||
wxString nozzle_name = get_nozzle_volume_type_name(result.nozzle_volume_type);
|
||||
auto nozzle_name_label = new Label(m_history_data_panel, nozzle_name);
|
||||
|
||||
auto k_str = wxString::Format("%.3f", result.k_value);
|
||||
|
@ -861,7 +862,7 @@ void NewCalibrationHistoryDialog::on_ok(wxCommandEvent &event)
|
|||
}
|
||||
|
||||
m_new_result.extruder_id = get_extruder_id(m_comboBox_extruder->GetSelection());
|
||||
m_new_result.nozzle_volume_type = NozzleVolumeType(m_comboBox_extruder->GetSelection());
|
||||
m_new_result.nozzle_volume_type = NozzleVolumeType(m_comboBox_nozzle_type->GetSelection());
|
||||
}
|
||||
|
||||
auto filament_item = map_filament_items[m_comboBox_filament->GetValue().ToStdString()];
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
#define CALIBRATION_SAVE_AMS_NAME_SIZE wxSize(FromDIP(20), FromDIP(24))
|
||||
#define CALIBRATION_SAVE_NUMBER_INPUT_SIZE wxSize(FromDIP(100), FromDIP(24))
|
||||
#define CALIBRATION_SAVE_INPUT_SIZE wxSize(FromDIP(240), FromDIP(24))
|
||||
#define FLOW_RATE_MAX_VALUE 1.15
|
||||
|
||||
|
@ -50,7 +52,7 @@ static wxString get_default_name(wxString filament_name, CalibMode mode){
|
|||
return filament_name;
|
||||
}
|
||||
|
||||
static wxString get_tray_name_by_tray_id(int tray_id)
|
||||
static wxString get_tray_name_by_tray_id(int tray_id)
|
||||
{
|
||||
wxString tray_name;
|
||||
if (tray_id == VIRTUAL_TRAY_MAIN_ID) {
|
||||
|
@ -119,14 +121,14 @@ CaliPASaveAutoPanel::CaliPASaveAutoPanel(
|
|||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
{
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_top_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
||||
create_panel(this);
|
||||
|
||||
|
||||
this->SetSizer(m_top_sizer);
|
||||
m_top_sizer->Fit(this);
|
||||
}
|
||||
|
@ -194,6 +196,11 @@ std::vector<std::pair<int, std::string>> CaliPASaveAutoPanel::default_naming(std
|
|||
|
||||
void CaliPASaveAutoPanel::sync_cali_result(const std::vector<PACalibResult>& cali_result, const std::vector<PACalibResult>& history_result)
|
||||
{
|
||||
if (m_obj && m_obj->is_multi_extruders()) {
|
||||
sync_cali_result_for_multi_extruder(cali_result, history_result);
|
||||
return;
|
||||
}
|
||||
|
||||
m_history_results = history_result;
|
||||
m_calib_results.clear();
|
||||
for (auto& item : cali_result) {
|
||||
|
@ -385,7 +392,7 @@ void CaliPASaveAutoPanel::save_to_result_from_widgets(wxWindow* window, bool* ou
|
|||
}
|
||||
m_calib_results[tray_id].name = into_u8(name);
|
||||
}
|
||||
|
||||
|
||||
auto childern = window->GetChildren();
|
||||
for (auto child : childern) {
|
||||
save_to_result_from_widgets(child, out_is_valid, out_msg);
|
||||
|
@ -438,6 +445,230 @@ bool CaliPASaveAutoPanel::get_result(std::vector<PACalibResult>& out_result) {
|
|||
}
|
||||
}
|
||||
|
||||
void CaliPASaveAutoPanel::sync_cali_result_for_multi_extruder(const std::vector<PACalibResult>& cali_result, const std::vector<PACalibResult>& history_result)
|
||||
{
|
||||
if (!m_obj)
|
||||
return;
|
||||
|
||||
m_is_all_failed = true;
|
||||
bool part_failed = false;
|
||||
if (cali_result.empty())
|
||||
part_failed = true;
|
||||
|
||||
m_history_results = history_result;
|
||||
m_calib_results.clear();
|
||||
for (auto &item : cali_result) {
|
||||
if (item.confidence == 0) {
|
||||
int tray_id = 4 * item.ams_id + item.slot_id;
|
||||
m_calib_results[tray_id] = item;
|
||||
}
|
||||
}
|
||||
m_grid_panel->DestroyChildren();
|
||||
auto grid_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
const int COLUMN_GAP = FromDIP(10);
|
||||
const int ROW_GAP = FromDIP(10);
|
||||
|
||||
wxStaticBoxSizer* left_sizer = new wxStaticBoxSizer(wxVERTICAL, m_grid_panel, "Left extruder");
|
||||
wxStaticBoxSizer* right_sizer = new wxStaticBoxSizer(wxVERTICAL, m_grid_panel, "Right extruder");
|
||||
grid_sizer->Add(left_sizer);
|
||||
grid_sizer->AddSpacer(COLUMN_GAP);
|
||||
grid_sizer->Add(right_sizer);
|
||||
|
||||
wxFlexGridSizer *left_grid_sizer = new wxFlexGridSizer(3, COLUMN_GAP, ROW_GAP);
|
||||
wxFlexGridSizer *right_grid_sizer = new wxFlexGridSizer(3, COLUMN_GAP, ROW_GAP);
|
||||
left_sizer->Add(left_grid_sizer);
|
||||
right_sizer->Add(right_grid_sizer);
|
||||
|
||||
// main extruder
|
||||
{
|
||||
left_grid_sizer->Add(new wxStaticText(m_grid_panel, wxID_ANY, ""), 1, wxEXPAND); // fill empty space
|
||||
|
||||
auto brand_title = new Label(m_grid_panel, _L("Name"), 0, CALIBRATION_SAVE_INPUT_SIZE);
|
||||
brand_title->SetFont(Label::Head_14);
|
||||
left_grid_sizer->Add(brand_title, 1, wxALIGN_CENTER);
|
||||
|
||||
auto k_title = new Label(m_grid_panel, _L("Factor K"), 0, CALIBRATION_SAVE_NUMBER_INPUT_SIZE);
|
||||
k_title->SetFont(Label::Head_14);
|
||||
left_grid_sizer->Add(k_title, 1, wxALIGN_CENTER);
|
||||
}
|
||||
|
||||
// deputy extruder
|
||||
{
|
||||
right_grid_sizer->Add(new wxStaticText(m_grid_panel, wxID_ANY, ""), 1, wxEXPAND); // fill empty space
|
||||
|
||||
auto brand_title = new Label(m_grid_panel, _L("Name"), 0, CALIBRATION_SAVE_INPUT_SIZE);
|
||||
brand_title->SetFont(Label::Head_14);
|
||||
right_grid_sizer->Add(brand_title, 1, wxALIGN_CENTER);
|
||||
|
||||
auto k_title = new Label(m_grid_panel, _L("Factor K"), 0, CALIBRATION_SAVE_NUMBER_INPUT_SIZE);
|
||||
k_title->SetFont(Label::Head_14);
|
||||
right_grid_sizer->Add(k_title, 1, wxALIGN_CENTER);
|
||||
}
|
||||
|
||||
std::vector<std::pair<int, std::string>> preset_names;
|
||||
for (auto &info : m_obj->selected_cali_preset) {
|
||||
preset_names.push_back({info.tray_id, info.name});
|
||||
}
|
||||
preset_names = default_naming(preset_names);
|
||||
|
||||
bool left_first_add_item = true;
|
||||
bool right_first_add_item = true;
|
||||
for (auto &item : cali_result) {
|
||||
bool result_failed = false;
|
||||
if (item.confidence != 0) {
|
||||
result_failed = true;
|
||||
part_failed = true;
|
||||
} else {
|
||||
m_is_all_failed = false;
|
||||
}
|
||||
|
||||
//wxBoxSizer *item_data_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto tray_title = new Label(m_grid_panel, "", 0, CALIBRATION_SAVE_AMS_NAME_SIZE);
|
||||
tray_title->SetFont(Label::Head_14);
|
||||
wxString tray_name = get_tray_name_by_tray_id(item.tray_id);
|
||||
tray_title->SetLabel(tray_name);
|
||||
|
||||
auto k_value = new GridTextInput(m_grid_panel, "", "", CALIBRATION_SAVE_NUMBER_INPUT_SIZE, item.tray_id, GridTextInputType::K);
|
||||
auto n_value = new GridTextInput(m_grid_panel, "", "", CALIBRATION_SAVE_NUMBER_INPUT_SIZE, item.tray_id, GridTextInputType::N);
|
||||
k_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
n_value->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
auto k_value_failed = new Label(m_grid_panel, _L("Failed"));
|
||||
auto n_value_failed = new Label(m_grid_panel, _L("Failed"));
|
||||
|
||||
auto comboBox_tray_name = new GridComboBox(m_grid_panel, CALIBRATION_SAVE_INPUT_SIZE, item.tray_id);
|
||||
auto tray_name_failed = new Label(m_grid_panel, " - ");
|
||||
wxArrayString selections;
|
||||
static std::vector<PACalibResult> filtered_results;
|
||||
filtered_results.clear();
|
||||
for (auto history : history_result) {
|
||||
if (history.filament_id == item.filament_id
|
||||
&& history.extruder_id == item.extruder_id
|
||||
&& history.nozzle_volume_type == item.nozzle_volume_type
|
||||
&& history.nozzle_diameter == item.nozzle_diameter) {
|
||||
filtered_results.push_back(history);
|
||||
selections.push_back(from_u8(history.name));
|
||||
}
|
||||
}
|
||||
comboBox_tray_name->Set(selections);
|
||||
|
||||
auto set_edit_mode = [this, k_value, n_value, k_value_failed, n_value_failed, comboBox_tray_name, tray_name_failed](std::string str) {
|
||||
if (str == "normal") {
|
||||
comboBox_tray_name->Show();
|
||||
tray_name_failed->Show(false);
|
||||
k_value->Show();
|
||||
n_value->Show();
|
||||
k_value_failed->Show(false);
|
||||
n_value_failed->Show(false);
|
||||
}
|
||||
if (str == "failed") {
|
||||
comboBox_tray_name->Show(false);
|
||||
tray_name_failed->Show();
|
||||
k_value->Show(false);
|
||||
n_value->Show(false);
|
||||
k_value_failed->Show();
|
||||
n_value_failed->Show();
|
||||
}
|
||||
|
||||
// hide n value
|
||||
n_value->Hide();
|
||||
n_value_failed->Hide();
|
||||
|
||||
m_grid_panel->Layout();
|
||||
m_grid_panel->Update();
|
||||
};
|
||||
|
||||
if (!result_failed) {
|
||||
set_edit_mode("normal");
|
||||
|
||||
auto k_str = wxString::Format("%.3f", item.k_value);
|
||||
auto n_str = wxString::Format("%.3f", item.n_coef);
|
||||
k_value->GetTextCtrl()->SetValue(k_str);
|
||||
n_value->GetTextCtrl()->SetValue(n_str);
|
||||
|
||||
for (auto &name : preset_names) {
|
||||
if (item.tray_id == name.first) { comboBox_tray_name->SetValue(from_u8(name.second)); }
|
||||
}
|
||||
|
||||
comboBox_tray_name->Bind(wxEVT_COMBOBOX, [this, comboBox_tray_name, k_value, n_value](auto &e) {
|
||||
int selection = comboBox_tray_name->GetSelection();
|
||||
auto history = filtered_results[selection];
|
||||
});
|
||||
} else {
|
||||
set_edit_mode("failed");
|
||||
}
|
||||
|
||||
if ((m_obj->is_main_extruder_on_left() && item.extruder_id == 0)
|
||||
|| (!m_obj->is_main_extruder_on_left() && item.extruder_id == 1)) {
|
||||
if (left_first_add_item) {
|
||||
wxString title_name = left_sizer->GetStaticBox()->GetLabel();
|
||||
title_name += " - ";
|
||||
title_name += get_nozzle_volume_type_name(item.nozzle_volume_type);
|
||||
left_sizer->GetStaticBox()->SetLabel(title_name);
|
||||
left_first_add_item = false;
|
||||
}
|
||||
|
||||
left_grid_sizer->Add(tray_title, 1, wxEXPAND);
|
||||
|
||||
if (comboBox_tray_name->IsShown()) {
|
||||
left_grid_sizer->Add(comboBox_tray_name, 1, wxEXPAND);
|
||||
} else {
|
||||
left_grid_sizer->Add(tray_name_failed, 1, wxEXPAND);
|
||||
}
|
||||
|
||||
if (k_value->IsShown()) {
|
||||
left_grid_sizer->Add(k_value, 1, wxEXPAND);
|
||||
} else {
|
||||
left_grid_sizer->Add(k_value_failed, 1, wxEXPAND);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (right_first_add_item) {
|
||||
wxString title_name = right_sizer->GetStaticBox()->GetLabel();
|
||||
title_name += " - ";
|
||||
title_name += get_nozzle_volume_type_name(item.nozzle_volume_type);
|
||||
right_sizer->GetStaticBox()->SetLabel(title_name);
|
||||
right_first_add_item = false;
|
||||
}
|
||||
right_grid_sizer->Add(tray_title, 1, wxEXPAND);
|
||||
|
||||
if (comboBox_tray_name->IsShown()) {
|
||||
right_grid_sizer->Add(comboBox_tray_name, 1, wxEXPAND);
|
||||
} else {
|
||||
right_grid_sizer->Add(tray_name_failed, 1, wxEXPAND);
|
||||
}
|
||||
|
||||
if (k_value->IsShown()) {
|
||||
right_grid_sizer->Add(k_value, 1, wxEXPAND);
|
||||
} else {
|
||||
right_grid_sizer->Add(k_value_failed, 1, wxEXPAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (left_first_add_item)
|
||||
left_sizer->Show(false);
|
||||
if (right_first_add_item)
|
||||
right_sizer->Show(false);
|
||||
|
||||
m_grid_panel->SetSizer(grid_sizer, true);
|
||||
m_grid_panel->Bind(wxEVT_LEFT_DOWN, [this](auto &e) { SetFocusIgnoringChildren(); });
|
||||
|
||||
if (part_failed) {
|
||||
m_part_failed_panel->Show();
|
||||
m_complete_text_panel->Show();
|
||||
if (m_is_all_failed) {
|
||||
m_complete_text_panel->Hide();
|
||||
}
|
||||
} else {
|
||||
m_complete_text_panel->Show();
|
||||
m_part_failed_panel->Hide();
|
||||
}
|
||||
|
||||
wxGetApp().UpdateDarkUIWin(this);
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
CaliPASaveManualPanel::CaliPASaveManualPanel(
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
|
@ -515,7 +746,7 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
|
|||
}
|
||||
|
||||
void CaliPASaveManualPanel::set_save_img() {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result_CN", 330));
|
||||
} else {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result", 330));
|
||||
|
@ -772,19 +1003,19 @@ void CaliSavePresetValuePanel::set_save_name_title(const wxString& title) {
|
|||
m_save_name_title->SetLabel(title);
|
||||
}
|
||||
|
||||
void CaliSavePresetValuePanel::get_value(double& value)
|
||||
{
|
||||
m_input_value->GetTextCtrl()->GetValue().ToDouble(&value);
|
||||
void CaliSavePresetValuePanel::get_value(double& value)
|
||||
{
|
||||
m_input_value->GetTextCtrl()->GetValue().ToDouble(&value);
|
||||
}
|
||||
|
||||
void CaliSavePresetValuePanel::get_save_name(std::string& name)
|
||||
{
|
||||
name = into_u8(m_input_name->GetTextCtrl()->GetValue());
|
||||
{
|
||||
name = into_u8(m_input_name->GetTextCtrl()->GetValue());
|
||||
}
|
||||
|
||||
void CaliSavePresetValuePanel::set_save_name(const std::string& name)
|
||||
{
|
||||
m_input_name->GetTextCtrl()->SetValue(name);
|
||||
{
|
||||
m_input_name->GetTextCtrl()->SetValue(name);
|
||||
}
|
||||
|
||||
void CaliSavePresetValuePanel::msw_rescale()
|
||||
|
@ -1301,7 +1532,7 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
|
|||
}
|
||||
|
||||
void CalibrationFlowCoarseSavePage::set_save_img() {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse_result_CN", 350));
|
||||
} else {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_coarse_result", 350));
|
||||
|
@ -1487,7 +1718,7 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
|
|||
}
|
||||
|
||||
void CalibrationFlowFineSavePage::set_save_img() {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
if (wxGetApp().app_config->get_language_code() == "zh-cn") {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_fine_result_CN", 350));
|
||||
} else {
|
||||
m_picture_panel->set_bmp(ScalableBitmap(this, "flow_rate_calibration_fine_result", 350));
|
||||
|
|
|
@ -98,6 +98,9 @@ public:
|
|||
bool get_result(std::vector<PACalibResult>& out_result);
|
||||
bool is_all_failed() { return m_is_all_failed; }
|
||||
|
||||
protected:
|
||||
void sync_cali_result_for_multi_extruder(const std::vector<PACalibResult> &cali_result, const std::vector<PACalibResult> &history_result);
|
||||
|
||||
protected:
|
||||
wxBoxSizer* m_top_sizer;
|
||||
wxPanel* m_complete_text_panel;
|
||||
|
@ -218,7 +221,7 @@ public:
|
|||
bool is_all_failed() { return m_is_all_failed; }
|
||||
|
||||
virtual bool Show(bool show = true) override;
|
||||
|
||||
|
||||
void msw_rescale() override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -245,29 +245,37 @@ void split_string(std::string s, std::vector<std::string>& v) {
|
|||
v.push_back(t);
|
||||
}
|
||||
|
||||
wxString generate_nozzle_id(NozzleVolumeType nozzle_type)
|
||||
wxString generate_nozzle_id(NozzleVolumeType nozzle_type, const std::string& diameter)
|
||||
{
|
||||
std::string nozzle_id;
|
||||
// HS00-0.4
|
||||
std::string nozzle_id = "H";
|
||||
switch (nozzle_type) {
|
||||
case NozzleVolumeType::nvtNormal: {
|
||||
nozzle_id = L("Normal");
|
||||
nozzle_id += "S";
|
||||
break;
|
||||
}
|
||||
case NozzleVolumeType::nvtBigTraffic: {
|
||||
nozzle_id = L("BigTraffic");
|
||||
nozzle_id += "H";
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
nozzle_id += "00";
|
||||
nozzle_id += "-";
|
||||
nozzle_id += diameter;
|
||||
return nozzle_id;
|
||||
}
|
||||
|
||||
NozzleVolumeType convert_to_nozzle_type(const std::string &str)
|
||||
{
|
||||
if (str.size() < 8) {
|
||||
assert(false);
|
||||
return NozzleVolumeType::nvtNormal;
|
||||
}
|
||||
NozzleVolumeType res = NozzleVolumeType::nvtNormal;
|
||||
if (str == "Normal")
|
||||
if (str[1] == 'S')
|
||||
res = NozzleVolumeType::nvtNormal;
|
||||
else if (str == "BigTraffic")
|
||||
else if (str[1] == 'H')
|
||||
res = NozzleVolumeType::nvtBigTraffic;
|
||||
return res;
|
||||
}
|
||||
|
@ -2315,8 +2323,8 @@ int MachineObject::command_start_pa_calibration(const X1CCalibInfos &pa_data, in
|
|||
j["print"]["filaments"][i]["nozzle_temp"] = pa_data.calib_datas[i].nozzle_temp;
|
||||
j["print"]["filaments"][i]["ams_id"] = pa_data.calib_datas[i].ams_id;
|
||||
j["print"]["filaments"][i]["slot_id"] = pa_data.calib_datas[i].slot_id;
|
||||
j["print"]["filaments"][i]["nozzle_id"] = generate_nozzle_id(pa_data.calib_datas[i].nozzle_volume_type).ToStdString();
|
||||
j["print"]["filaments"][i]["nozzle_diameter"] = pa_data.calib_datas[i].nozzle_diameter;
|
||||
j["print"]["filaments"][i]["nozzle_id"] = generate_nozzle_id(pa_data.calib_datas[i].nozzle_volume_type,to_string_nozzle_diameter(pa_data.calib_datas[i].nozzle_diameter)).ToStdString();
|
||||
j["print"]["filaments"][i]["nozzle_diameter"] = to_string_nozzle_diameter(pa_data.calib_datas[i].nozzle_diameter);
|
||||
j["print"]["filaments"][i]["max_volumetric_speed"] = std::to_string(pa_data.calib_datas[i].max_volumetric_speed);
|
||||
|
||||
if (i > 0) filament_ids += ",";
|
||||
|
@ -2355,7 +2363,7 @@ int MachineObject::command_set_pa_calibration(const std::vector<PACalibResult> &
|
|||
j["print"]["filaments"][i]["cali_idx"] = pa_calib_values[i].cali_idx;
|
||||
j["print"]["filaments"][i]["tray_id"] = pa_calib_values[i].tray_id;
|
||||
j["print"]["filaments"][i]["extruder_id"] = pa_calib_values[i].extruder_id;
|
||||
j["print"]["filaments"][i]["nozzle_id"] = generate_nozzle_id(pa_calib_values[i].nozzle_volume_type).ToStdString();
|
||||
j["print"]["filaments"][i]["nozzle_id"] = generate_nozzle_id(pa_calib_values[i].nozzle_volume_type, to_string_nozzle_diameter(pa_calib_values[i].nozzle_diameter)).ToStdString();
|
||||
j["print"]["filaments"][i]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib_values[i].nozzle_diameter);
|
||||
j["print"]["filaments"][i]["ams_id"] = pa_calib_values[i].ams_id;
|
||||
j["print"]["filaments"][i]["slot_id"] = pa_calib_values[i].slot_id;
|
||||
|
@ -2382,7 +2390,7 @@ int MachineObject::command_delete_pa_calibration(const PACalibIndexInfo& pa_cali
|
|||
j["print"]["command"] = "extrusion_cali_del";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["extruder_id"] = pa_calib.extruder_id;
|
||||
j["print"]["nozzle_id"] = generate_nozzle_id(pa_calib.nozzle_volume_type).ToStdString();
|
||||
j["print"]["nozzle_id"] = generate_nozzle_id(pa_calib.nozzle_volume_type, to_string_nozzle_diameter(pa_calib.nozzle_diameter)).ToStdString();
|
||||
j["print"]["filament_id"] = pa_calib.filament_id;
|
||||
j["print"]["cali_idx"] = pa_calib.cali_idx;
|
||||
j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(pa_calib.nozzle_diameter);
|
||||
|
@ -2400,7 +2408,8 @@ int MachineObject::command_get_pa_calibration_tab(const PACalibExtruderInfo &cal
|
|||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["filament_id"] = calib_info.filament_id;
|
||||
j["print"]["extruder_id"] = calib_info.extruder_id;
|
||||
j["print"]["nozzle_id"] = generate_nozzle_id(calib_info.nozzle_volume_type).ToStdString();
|
||||
if (calib_info.use_nozzle_volume_type)
|
||||
j["print"]["nozzle_id"] = generate_nozzle_id(calib_info.nozzle_volume_type, to_string_nozzle_diameter(calib_info.nozzle_diameter)).ToStdString();
|
||||
j["print"]["nozzle_diameter"] = to_string_nozzle_diameter(calib_info.nozzle_diameter);
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "extrusion_cali_get: " << j.dump();
|
||||
|
|
|
@ -256,10 +256,10 @@ wxSize Label::split_lines(wxDC &dc, int width, const wxString &text, wxString &m
|
|||
return dc.GetMultiLineTextExtent(multiline_text);
|
||||
}
|
||||
|
||||
Label::Label(wxWindow *parent, wxString const &text, long style) : Label(parent, Body_14, text, style) {}
|
||||
Label::Label(wxWindow *parent, wxString const &text, long style, wxSize size) : Label(parent, Body_14, text, style, size) {}
|
||||
|
||||
Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long style)
|
||||
: wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, style)
|
||||
Label::Label(wxWindow *parent, wxFont const &font, wxString const &text, long style, wxSize size)
|
||||
: wxStaticText(parent, wxID_ANY, text, wxDefaultPosition, size, style)
|
||||
{
|
||||
this->m_font = font;
|
||||
this->m_text = text;
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
class Label : public wxStaticText
|
||||
{
|
||||
public:
|
||||
Label(wxWindow *parent, wxString const &text = {}, long style = 0);
|
||||
Label(wxWindow *parent, wxString const &text = {}, long style = 0, wxSize size = wxDefaultSize);
|
||||
|
||||
Label(wxWindow *parent, wxFont const &font, wxString const &text = {}, long style = 0);
|
||||
Label(wxWindow *parent, wxFont const &font, wxString const &text = {}, long style = 0, wxSize size = wxDefaultSize);
|
||||
|
||||
void SetLabel(const wxString& label) override;
|
||||
|
||||
|
|
|
@ -55,6 +55,16 @@ void get_default_k_n_value(const std::string &filament_id, float &k, float &n)
|
|||
}
|
||||
}
|
||||
|
||||
wxString get_nozzle_volume_type_name(NozzleVolumeType type)
|
||||
{
|
||||
if (NozzleVolumeType::nvtNormal == type) {
|
||||
return _L("Normal");
|
||||
} else if (NozzleVolumeType::nvtBigTraffic == type) {
|
||||
return _L("BigTraffic");
|
||||
}
|
||||
return wxString();
|
||||
}
|
||||
|
||||
std::string get_calib_mode_name(CalibMode cali_mode, int stage)
|
||||
{
|
||||
switch(cali_mode) {
|
||||
|
|
|
@ -81,6 +81,7 @@ private:
|
|||
|
||||
|
||||
extern void get_default_k_n_value(const std::string &filament_id, float &k, float &n);
|
||||
extern wxString get_nozzle_volume_type_name(NozzleVolumeType type);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue