NEW:[STUDIO-4016] Support motor noise cali for N1

Calibrated motor noise option, N1 supported.
And when none of the calibration options are selected, the start calibration button turns gray

Change-Id: I991034a13001f840016475171c33218ddc812d35
(cherry picked from commit 7224ccd2a114d553b6234a7d8616d253bef0ced4)
This commit is contained in:
hu.wang 2023-08-15 19:24:37 +08:00 committed by Lane.Wei
parent 09b6f4d8fd
commit 2cf9ee1dc5
5 changed files with 51 additions and 12 deletions

View file

@ -50,16 +50,16 @@ CalibrationDialog::CalibrationDialog(Plater *plater)
select_xcam_cali = create_check_option(_L("Micro lidar calibration"), cali_left_panel, _L("Micro lidar calibration"), "xcam_cali");
select_bed_leveling = create_check_option(_L("Bed leveling"), cali_left_panel, _L("Bed leveling"), "bed_leveling");
select_vibration = create_check_option(_L("Resonance frequency identification"), cali_left_panel, _L("Resonance frequency identification"), "vibration");
select_vibration = create_check_option(_L("Vibration compensation"), cali_left_panel, _L("Vibration compensation"), "vibration");
select_motor_noise = create_check_option(_L("Motor noise"), cali_left_panel, _L("Motor noise cancellation"), "motor_noise");
m_checkbox_list["xcam_cali"]->SetValue(true);
m_checkbox_list["bed_leveling"]->SetValue(true);
m_checkbox_list["vibration"]->SetValue(true);
cali_left_sizer->Add(0, FromDIP(18), 0, wxEXPAND, 0);
cali_left_sizer->Add(select_xcam_cali, 0, wxLEFT, FromDIP(15));
cali_left_sizer->Add(select_bed_leveling, 0, wxLEFT, FromDIP(15));
cali_left_sizer->Add(select_vibration, 0, wxLEFT, FromDIP(15));
cali_left_sizer->Add(select_motor_noise, 0, wxLEFT, FromDIP(15));
cali_left_sizer->Add(0, FromDIP(30), 0, wxEXPAND, 0);
auto cali_left_text_top = new wxStaticText(cali_left_panel, wxID_ANY, _L("Calibration program"), wxDefaultPosition, wxDefaultSize, 0);
@ -208,6 +208,7 @@ wxWindow* CalibrationDialog::create_check_option(wxString title, wxWindow* paren
text->Bind(wxEVT_LEFT_DOWN, [this, check](wxMouseEvent&) { check->SetValue(check->GetValue() ? false : true); });
m_checkbox_list[param] = check;
m_checkbox_list[param]->SetValue(true);
return checkbox;
}
@ -219,6 +220,30 @@ void CalibrationDialog::update_cali(MachineObject *obj)
select_xcam_cali->Show();
} else {
select_xcam_cali->Hide();
m_checkbox_list["xcam_cali"]->SetValue(false);
}
if(obj->is_function_supported(PrinterFunction::FUNC_AUTO_LEVELING)){
select_bed_leveling->Show();
}else{
select_bed_leveling->Hide();
m_checkbox_list["bed_leveling"]->SetValue(false);
}
if (obj->is_function_supported(PrinterFunction::FUNC_MOTOR_NOISE_CALI)) {
select_motor_noise->Show();
} else {
select_motor_noise->Hide();
m_checkbox_list["motor_noise"]->SetValue(false);
}
if (!m_checkbox_list["vibration"]->GetValue() && !m_checkbox_list["bed_leveling"]->GetValue() && !m_checkbox_list["xcam_cali"]->GetValue() &&
!m_checkbox_list["motor_noise"]->GetValue()) {
m_calibration_btn->Disable();
m_calibration_btn->SetLabel(_L("No step selected"));
return ;
} else {
m_calibration_btn->Enable();
}
if (obj->is_calibration_running() || obj->is_calibration_done()) {
@ -284,7 +309,8 @@ void CalibrationDialog::on_start_calibration(wxMouseEvent &event)
m_obj->command_start_calibration(
m_checkbox_list["vibration"]->GetValue(),
m_checkbox_list["bed_leveling"]->GetValue(),
m_checkbox_list["xcam_cali"]->GetValue()
m_checkbox_list["xcam_cali"]->GetValue(),
m_checkbox_list["motor_noise"]->GetValue()
);
}
}