FIX: fix bugs of calibration

Change-Id: I2d0f57105bdda2abc3fc7b218122d4df5a3161da
This commit is contained in:
Stone Li 2023-07-04 10:50:02 +08:00 committed by Lane.Wei
parent 32892514ff
commit 28b56c2efb
8 changed files with 116 additions and 57 deletions

View file

@ -51,7 +51,7 @@ CalibrationWizard::~CalibrationWizard()
void CalibrationWizard::on_cali_job_finished(wxCommandEvent& event)
{
this->on_cali_job_finished();
this->on_cali_job_finished(event.GetString());
event.Skip();
}
@ -198,6 +198,29 @@ bool CalibrationWizard::save_preset(const std::string &old_preset_name, const st
return true;
}
void CalibrationWizard::cache_preset_info(MachineObject* obj, float nozzle_dia)
{
if (!obj) return;
CalibrationPresetPage* preset_page = (static_cast<CalibrationPresetPage*>(preset_step->page));
std::map<int, Preset*> selected_filaments = preset_page->get_selected_filaments();
obj->selected_cali_preset.clear();
for (auto& item : selected_filaments) {
CaliPresetInfo result;
result.tray_id = item.first;
result.nozzle_diameter = nozzle_dia;
result.filament_id = item.second->filament_id;
result.setting_id = item.second->setting_id;
result.name = item.second->name;
obj->selected_cali_preset.push_back(result);
}
CaliPresetStage stage;
preset_page->get_cali_stage(stage, obj->cache_flow_ratio);
}
void CalibrationWizard::on_cali_go_home()
{
// can go home? confirm to continue
@ -370,23 +393,14 @@ void PressureAdvanceWizard::on_cali_start()
std::string setting_id;
BedType plate_type = BedType::btDefault;
// save preset info to machine object
CalibrationPresetPage* preset_page = (static_cast<CalibrationPresetPage*>(preset_step->page));
std::map<int, Preset*> selected_filaments = preset_page->get_selected_filaments();
curr_obj->selected_cali_preset.clear();
for (auto& item : selected_filaments) {
CaliPresetInfo result;
result.tray_id = item.first;
result.nozzle_diameter = nozzle_dia;
result.filament_id = item.second->filament_id;
result.setting_id = item.second->setting_id;
result.name = item.second->name;
curr_obj->selected_cali_preset.push_back(result);
}
preset_page->get_preset_info(nozzle_dia, plate_type);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
if (nozzle_dia < 0 || plate_type == BedType::btDefault) {
BOOST_LOG_TRIVIAL(error) << "CaliPreset: get preset info, nozzle and plate type error";
return;
@ -667,6 +681,8 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value)
std::map<int, Preset*> selected_filaments = preset_page->get_selected_filaments();
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
if (m_cali_method == CalibrationMethod::CALI_METHOD_AUTO) {
X1CCalibInfos calib_infos;
for (auto& item : selected_filaments) {
@ -894,11 +910,26 @@ void FlowRateWizard::set_cali_method(CalibrationMethod method)
CalibrationWizard::set_cali_method(method);
}
void FlowRateWizard::on_cali_job_finished()
void FlowRateWizard::on_cali_job_finished(wxString evt_data)
{
static_cast<CalibrationPresetPage*>(preset_step->page)->on_cali_finished_job();
int cali_stage = 0;
CalibMode obj_cali_mode = CalibUtils::get_calib_mode_by_name(evt_data.ToStdString(), cali_stage);
show_step(m_curr_step->next);
if (obj_cali_mode == m_mode) {
if (cali_stage == 1) {
if (m_curr_step != cali_coarse_step)
show_step(cali_coarse_step);
}
else if (cali_stage == 2) {
if (m_curr_step != cali_fine_step) {
show_step(cali_fine_step);
}
}
else
show_step(cali_coarse_step);
}
// change ui, hide
static_cast<CalibrationPresetPage*>(preset_step->page)->on_cali_finished_job();
}
@ -979,6 +1010,8 @@ void MaxVolumetricSpeedWizard::on_cali_start()
preset_page->get_preset_info(nozzle_dia, plate_type);
CalibrationWizard::cache_preset_info(curr_obj, nozzle_dia);
wxArrayString values = preset_page->get_custom_range_values();
Calib_Params params;
if (values.size() != 3) {
@ -1047,12 +1080,20 @@ void MaxVolumetricSpeedWizard::on_cali_save()
}
}
void MaxVolumetricSpeedWizard::on_cali_job_finished()
void MaxVolumetricSpeedWizard::on_cali_job_finished(wxString evt_data)
{
static_cast<CalibrationPresetPage*>(preset_step->page)->on_cali_finished_job();
int cali_stage = 0;
CalibMode obj_cali_mode = CalibUtils::get_calib_mode_by_name(evt_data.ToStdString(), cali_stage);
show_step(m_curr_step->next);
if (obj_cali_mode == m_mode) {
if (m_curr_step != cali_step) {
show_step(cali_step);
}
}
// change ui, hide
static_cast<CalibrationPresetPage*>(preset_step->page)->on_cali_finished_job();
}
void MaxVolumetricSpeedWizard::on_device_connected(MachineObject *obj)
{
CalibrationWizard::on_device_connected(obj);

View file

@ -42,7 +42,7 @@ public:
void on_cali_job_finished(wxCommandEvent& event);
virtual void on_cali_job_finished() {}
virtual void on_cali_job_finished(wxString evt_data) {}
CalibrationWizardPageStep* get_curr_step() { return m_curr_step; }
@ -62,6 +62,8 @@ public:
bool save_preset(const std::string &old_preset_name, const std::string &new_preset_name, const std::map<std::string, ConfigOption *> &key_values, std::string& message);
virtual void cache_preset_info(MachineObject* obj, float nozzle_dia);
protected:
void on_cali_go_home();
@ -121,7 +123,7 @@ public:
void set_cali_method(CalibrationMethod method) override;
void on_cali_job_finished() override;
void on_cali_job_finished(wxString evt_data) override;
protected:
void create_pages();
@ -142,7 +144,7 @@ public:
MaxVolumetricSpeedWizard(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
~MaxVolumetricSpeedWizard() {};
void on_cali_job_finished() override;
void on_cali_job_finished(wxString evt_data) override;
protected:
void create_pages();

View file

@ -51,7 +51,7 @@ void CaliPresetCaliStagePanel::create_panel(wxWindow* parent)
flow_ratio_input = new TextInput(input_panel, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_FROM_TO_INPUT_SIZE);
flow_ratio_input->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
float default_flow_ratio = 1.0f;
auto flow_ratio_str = wxString::Format("%.3f", default_flow_ratio);
auto flow_ratio_str = wxString::Format("%.2f", default_flow_ratio);
flow_ratio_input->GetTextCtrl()->SetValue(flow_ratio_str);
input_sizer->AddSpacer(FromDIP(18));
input_sizer->Add(flow_ratio_input, 0, wxTOP, FromDIP(10));
@ -73,7 +73,7 @@ void CaliPresetCaliStagePanel::create_panel(wxWindow* parent)
flow_ratio_input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this](auto& e) {
float flow_ratio = 0.0f;
if (!CalibUtils::validate_input_flow_ratio(flow_ratio_input->GetTextCtrl()->GetValue(), &flow_ratio)) {
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 0.2)"), wxEmptyString, wxICON_WARNING | wxOK);
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 2.0)"), wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
}
auto flow_ratio_str = wxString::Format("%.3f", flow_ratio);
@ -83,7 +83,7 @@ void CaliPresetCaliStagePanel::create_panel(wxWindow* parent)
flow_ratio_input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [this](auto& e) {
float flow_ratio = 0.0f;
if (!CalibUtils::validate_input_flow_ratio(flow_ratio_input->GetTextCtrl()->GetValue(), &flow_ratio)) {
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 0.2)"), wxEmptyString, wxICON_WARNING | wxOK);
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 2.0)"), wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
}
auto flow_ratio_str = wxString::Format("%.3f", flow_ratio);
@ -499,6 +499,8 @@ void CalibrationPresetPage::create_filament_list_panel(wxWindow* parent)
filament_comboBox_sizer->Add(fcb, 0, wxALIGN_CENTER);
filament_fgSizer->Add(filament_comboBox_sizer, 0);
fcb->Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
radio_btn->Bind(wxEVT_RADIOBUTTON, [this](wxCommandEvent& evt) {
wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
event.SetEventObject(this);
@ -533,6 +535,8 @@ void CalibrationPresetPage::create_ext_spool_panel(wxWindow* parent)
m_virtual_tray_comboBox->set_select_mode(CalibrationFilamentMode::CALI_MODEL_SINGLE);
radio_btn->SetValue(true);
m_virtual_tray_comboBox->Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
panel_sizer->Add(radio_btn, 0, wxALIGN_CENTER);
panel_sizer->Add(check_box, 0, wxALIGN_CENTER);
panel_sizer->Add(m_virtual_tray_comboBox, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
@ -785,7 +789,7 @@ void CalibrationPresetPage::on_recommend_input_value()
Preset *selected_filament_preset = selected_filaments.begin()->second;
if (selected_filament_preset) {
float flow_ratio = selected_filament_preset->config.option<ConfigOptionFloats>("filament_flow_ratio")->get_at(0);
m_cali_stage_panel->set_flow_ratio_value(float_to_string(flow_ratio));
m_cali_stage_panel->set_flow_ratio_value(wxString::Format("%.2f", flow_ratio));
}
}
else if (m_cali_mode == CalibMode::Calib_Vol_speed_Tower) {
@ -794,9 +798,9 @@ void CalibrationPresetPage::on_recommend_input_value()
double max_volumetric_speed = selected_filament_preset->config.option<ConfigOptionFloats>("filament_max_volumetric_speed")->get_at(0);
if (m_custom_range_panel) {
wxArrayString values;
values.push_back(float_to_string(max_volumetric_speed - 5));
values.push_back(float_to_string(max_volumetric_speed + 5));
values.push_back("0.5");
values.push_back(wxString::Format("%.2f", max_volumetric_speed - 5));
values.push_back(wxString::Format("%.2f", max_volumetric_speed + 5));
values.push_back(wxString::Format("%.2f", 0.5f));
m_custom_range_panel->set_values(values);
}
}
@ -818,11 +822,12 @@ void CalibrationPresetPage::check_filament_compatible()
m_tips_panel->set_params(0, 0, 0.0f);
if (!error_tips.empty()) {
wxString tips = from_u8(error_tips);
m_warning_panel->set_warning(tips);
} else {
wxString tips = wxString::Format(_L("%s is not compatible with %s"), m_comboBox_bed_type->GetValue(), incompatiable_filament_name);
m_warning_panel->set_warning(tips);
m_warning_panel->Show();
}
m_warning_panel->Show();
} else {
m_tips_panel->set_params(0, bed_temp, 0);
m_warning_panel->set_warning("");
@ -917,6 +922,7 @@ void CalibrationPresetPage::show_status(CaliPresetPageStatus status)
else {
m_sending_panel->Hide();
}
Layout();
}
float CalibrationPresetPage::get_nozzle_value()
@ -1154,12 +1160,12 @@ void CalibrationPresetPage::select_default_compatible_filament()
return;
if (m_ams_radiobox->GetValue()) {
std::vector<Preset*> multi_select_filaments;
for (auto &fcb : m_filament_comboBox_list) {
if (!fcb->GetRadioBox()->IsEnabled())
continue;
Preset* preset = const_cast<Preset *>(fcb->GetComboBox()->get_selected_preset());
std::vector<Preset *> multi_select_filaments;
if (m_cali_filament_mode == CalibrationFilamentMode::CALI_MODEL_SINGLE) {
if (is_filaments_compatiable({preset})) {
fcb->GetRadioBox()->SetValue(true);

View file

@ -344,25 +344,18 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
m_top_sizer->AddSpacer(FromDIP(20));
auto value_sizer = new wxBoxSizer(wxHORIZONTAL);
auto k_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor K"), wxDefaultPosition, wxDefaultSize, 0);
k_value_text->Wrap(-1);
k_value_text->SetFont(::Label::Head_14);
k_value_text->Wrap(-1);
auto n_value_text = new wxStaticText(parent, wxID_ANY, _L("Factor N"), wxDefaultPosition, wxDefaultSize, 0);
n_value_text->Wrap(-1);
n_value_text->SetFont(::Label::Head_14);
n_value_text->Wrap(-1);
n_value_text->Hide();
m_k_val = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0);
m_n_val = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0);
n_value_text->Hide();
m_n_val->Hide();
value_sizer->Add(k_value_text, 0, wxALIGN_CENTER_VERTICAL, 0);
value_sizer->AddSpacer(FromDIP(10));
value_sizer->Add(m_k_val, 0);
value_sizer->AddSpacer(FromDIP(50));
value_sizer->Add(n_value_text, 0, wxALIGN_CENTER_VERTICAL, 0);
value_sizer->AddSpacer(FromDIP(10));
value_sizer->Add(m_n_val, 0);
m_top_sizer->Add(value_sizer, 0, wxALIGN_CENTER);
m_top_sizer->Add(k_value_text, 0);
m_top_sizer->Add(m_k_val, 0);
m_top_sizer->AddSpacer(FromDIP(20));
@ -373,6 +366,8 @@ void CaliPASaveManualPanel::create_panel(wxWindow* parent)
m_save_name_input = new TextInput(parent, "", "", "", wxDefaultPosition, { CALIBRATION_TEXT_MAX_LENGTH, FromDIP(24) }, 0);
m_top_sizer->Add(m_save_name_input, 0, 0, 0);
m_top_sizer->AddSpacer(FromDIP(20));
Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
SetFocusIgnoringChildren();
});
@ -554,13 +549,14 @@ void CaliSavePresetValuePanel::create_panel(wxWindow *parent)
m_top_sizer->Add(m_record_picture, 0, wxALIGN_CENTER);
m_top_sizer->AddSpacer(FromDIP(20));
m_top_sizer->Add(m_value_title, 0, wxALIGN_CENTER);
m_top_sizer->Add(m_value_title, 0);
m_top_sizer->AddSpacer(FromDIP(10));
m_top_sizer->Add(m_input_value, 0, wxALIGN_CENTER);
m_top_sizer->Add(m_input_value, 0);
m_top_sizer->AddSpacer(FromDIP(20));
m_top_sizer->Add(m_save_name_title, 0, wxALIGN_CENTER);
m_top_sizer->Add(m_save_name_title, 0);
m_top_sizer->AddSpacer(FromDIP(10));
m_top_sizer->Add(m_input_name, 0, wxALIGN_CENTER);
m_top_sizer->Add(m_input_name, 0);
m_top_sizer->AddSpacer(FromDIP(20));
}
void CaliSavePresetValuePanel::set_img(const std::string& bmp_name_in)
@ -624,9 +620,9 @@ void CalibrationPASavePage::create_page(wxWindow* parent)
m_auto_panel = new CaliPASaveAutoPanel(parent, wxID_ANY);
m_p1p_panel = new CaliPASaveP1PPanel(parent, wxID_ANY);
m_top_sizer->Add(m_manual_panel, 0);
m_top_sizer->Add(m_auto_panel, 0);
m_top_sizer->Add(m_p1p_panel, 0);
m_top_sizer->Add(m_manual_panel, 0, wxEXPAND);
m_top_sizer->Add(m_auto_panel, 0, wxEXPAND);
m_top_sizer->Add(m_p1p_panel, 0, wxEXPAND);
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_PA_SAVE);
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
@ -837,7 +833,7 @@ void CalibrationFlowX1SavePage::save_to_result_from_widgets(wxWindow* window, bo
if (input->get_type() == GridTextInputType::FlowRatio) {
float flow_ratio = 0.0f;
if (!CalibUtils::validate_input_flow_ratio(input->GetTextCtrl()->GetValue(), &flow_ratio)) {
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 0.2)"), wxEmptyString, wxICON_WARNING | wxOK);
MessageDialog msg_dlg(nullptr, _L("Please input a valid value (0.0 < flow ratio < 2.0)"), wxEmptyString, wxICON_WARNING | wxOK);
msg_dlg.ShowModal();
*out_is_valid = false;
}
@ -909,7 +905,7 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
auto complete_text = new wxStaticText(parent, wxID_ANY, _L("Please find the best object on your plate"), wxDefaultPosition, wxDefaultSize, 0);
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(-1);
m_top_sizer->Add(complete_text, 0, 0, 0);
m_top_sizer->Add(complete_text, 0, wxALIGN_CENTER, 0);
m_top_sizer->AddSpacer(FromDIP(20));
m_record_picture = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
@ -967,6 +963,8 @@ void CalibrationFlowCoarseSavePage::create_page(wxWindow* parent)
m_top_sizer->Add(save_panel, 0, 0, 0);
save_panel->Hide();
m_top_sizer->AddSpacer(FromDIP(20));
checkBox_skip_calibration->Bind(wxEVT_TOGGLEBUTTON, [this, save_panel, checkBox_skip_calibration](wxCommandEvent& e) {
if (checkBox_skip_calibration->GetValue()) {
m_skip_fine_calibration = true;
@ -1037,6 +1035,7 @@ bool CalibrationFlowCoarseSavePage::Show(bool show) {
if (!curr_obj->selected_cali_preset.empty()) {
wxString default_name = get_default_name(curr_obj->selected_cali_preset[0].name, CalibMode::Calib_Flow_Rate);
set_default_name(default_name);
set_curr_flow_ratio(curr_obj->cache_flow_ratio);
}
}
else {
@ -1079,7 +1078,7 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
auto complete_text = new wxStaticText(parent, wxID_ANY, _L("Please find the best object on your plate"), wxDefaultPosition, wxDefaultSize, 0);
complete_text->SetFont(Label::Head_14);
complete_text->Wrap(-1);
m_top_sizer->Add(complete_text, 0, 0, 0);
m_top_sizer->Add(complete_text, 0, wxALIGN_CENTER, 0);
m_top_sizer->AddSpacer(FromDIP(20));
m_record_picture = new wxStaticBitmap(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0);
@ -1113,6 +1112,8 @@ void CalibrationFlowFineSavePage::create_page(wxWindow* parent)
m_save_name_input = new TextInput(parent, "", "", "", wxDefaultPosition, {CALIBRATION_TEXT_MAX_LENGTH, FromDIP(24)}, 0);
m_top_sizer->Add(m_save_name_input, 0, 0, 0);
m_top_sizer->AddSpacer(FromDIP(20));
m_optimal_block_fine->Bind(wxEVT_COMBOBOX, [this, fine_calc_result_text](auto& e) {
m_fine_flow_ratio = m_curr_flow_ratio * (100.0f + stof(m_optimal_block_fine->GetValue().ToStdString())) / 100.0f;
fine_calc_result_text->SetLabel(wxString::Format(_L("flow ratio : %s "), std::to_string(m_fine_flow_ratio)));
@ -1158,6 +1159,7 @@ bool CalibrationFlowFineSavePage::Show(bool show) {
if (!curr_obj->selected_cali_preset.empty()) {
wxString default_name = get_default_name(curr_obj->selected_cali_preset[0].name, CalibMode::Calib_Flow_Rate);
set_default_name(default_name);
set_curr_flow_ratio(curr_obj->cache_flow_ratio);
}
}
else {
@ -1205,7 +1207,7 @@ void CalibrationMaxVolumetricSpeedSavePage::create_page(wxWindow *parent)
set_save_img();
m_top_sizer->Add(m_save_preset_panel, 0);
m_top_sizer->Add(m_save_preset_panel, 0, wxEXPAND);
m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_COMMON_SAVE);
m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);

View file

@ -683,6 +683,7 @@ public:
// 2: reset when start calibration in start page
// 3: save tray_id, filament_id, setting_id, and name, nozzle_dia
std::vector<CaliPresetInfo> selected_cali_preset;
float cache_flow_ratio { 0.0 };
bool has_get_pa_calib_tab{ false };
std::vector<PACalibResult> pa_calib_tab;

View file

@ -480,13 +480,16 @@ void PrintJob::process()
BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
if (!m_completed_evt_data.empty())
evt->SetString(m_completed_evt_data);
else
evt->SetString(m_dev_id);
if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
int sel = wxGetApp().mainframe->get_calibration_curr_tab();
if (sel >= 0) {
evt->SetInt(sel);
}
}
evt->SetString(m_dev_id);
wxQueueEvent(m_plater, evt);
m_job_finished = true;
}

View file

@ -38,6 +38,7 @@ class PrintJob : public PlaterJob
std::string m_dev_id;
bool m_job_finished{ false };
int m_print_job_completed_id = 0;
wxString m_completed_evt_data;
std::function<void()> m_enter_ip_address_fun_fail{ nullptr };
std::function<void()> m_enter_ip_address_fun_success{ nullptr };
@ -90,7 +91,10 @@ public:
}
bool is_finished() { return m_job_finished; }
void set_print_job_finished_event(int event_id) { m_print_job_completed_id = event_id; }
void set_print_job_finished_event(int event_id, wxString evt_data = wxEmptyString) {
m_print_job_completed_id = event_id;
m_completed_evt_data = evt_data;
}
void on_success(std::function<void()> success);
void process() override;
void finalize() override;

View file

@ -865,7 +865,6 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
print_job->connection_type = obj_->connection_type();
print_job->cloud_print_only = obj_->is_cloud_print_only;
print_job->set_print_job_finished_event(wxGetApp().plater()->get_send_calibration_finished_event());
PrintPrepareData job_data;
job_data.is_from_plater = false;
@ -893,6 +892,7 @@ void CalibUtils::send_to_print(const CalibInfo &calib_info, std::string &error_m
print_job->has_sdcard = obj_->has_sdcard();
print_job->set_print_config(MachineBedTypeString[bed_type], true, false, false, false, true);
print_job->set_print_job_finished_event(wxGetApp().plater()->get_send_calibration_finished_event(), print_job->m_project_name);
print_job->start();
}