diff --git a/resources/config.json b/resources/config.json index f5330647b..6e4fe7024 100644 --- a/resources/config.json +++ b/resources/config.json @@ -16,8 +16,9 @@ "FUNC_ALTER_RESOLUTION": false, "FUNC_PRINT_ALL": false, "FUNC_EXTRUSION_CALI": true, - "FUNC_VIRTUAL_TYAY": true, - "FUNC_PROMPT_SOUND": false + "FUNC_MOTOR_NOISE_CALI": false, + "FUNC_PROMPT_SOUND": false, + "FUNC_VIRTUAL_TYAY": true }, "camera_resolution": [ "720p" ], "bed_temperature_limit": 100, @@ -42,9 +43,10 @@ "FUNC_PRINT_WITHOUT_SD": false, "FUNC_ALTER_RESOLUTION": false, "FUNC_PRINT_ALL": false, - "FUNC_VIRTUAL_TYAY": true, + "FUNC_MOTOR_NOISE_CALI": false, + "FUNC_PROMPT_SOUND": false, "FUNC_EXTRUSION_CALI": true, - "FUNC_PROMPT_SOUND": false + "FUNC_VIRTUAL_TYAY": true }, "camera_resolution": [ "720p" ], "bed_temperature_limit": 100, @@ -61,6 +63,7 @@ "FUNC_EXTRUSION_CALI": false, "FUNC_LOCAL_TUNNEL": false, "FUNC_CHAMBER_TEMP": false, + "FUNC_MOTOR_NOISE_CALI": false, "FUNC_PROMPT_SOUND": false }, "model_id": "BL-P002", @@ -76,6 +79,7 @@ "FUNC_VIRTUAL_TYAY": true, "FUNC_EXTRUSION_CALI": false, "FUNC_LOCAL_TUNNEL": false, + "FUNC_MOTOR_NOISE_CALI": false, "FUNC_PROMPT_SOUND": false }, "model_id": "BL-P001", diff --git a/resources/printers/BL-P001.json b/resources/printers/BL-P001.json index c12776569..c1886daa5 100644 --- a/resources/printers/BL-P001.json +++ b/resources/printers/BL-P001.json @@ -12,6 +12,7 @@ "remote": "enabled" } }, + "support_motor_noise_cali":false, "support_tunnel_mqtt":false, "support_mqtt_alive":false, "support_command_ams_switch":false, diff --git a/resources/printers/BL-P002.json b/resources/printers/BL-P002.json index d38d930c8..3ff56857f 100644 --- a/resources/printers/BL-P002.json +++ b/resources/printers/BL-P002.json @@ -12,6 +12,7 @@ "remote": "enabled" } }, + "support_motor_noise_cali":false, "support_tunnel_mqtt":false, "support_mqtt_alive":false, "support_command_ams_switch":false, diff --git a/resources/printers/C11.json b/resources/printers/C11.json index bba1782a3..5947e5885 100644 --- a/resources/printers/C11.json +++ b/resources/printers/C11.json @@ -8,6 +8,7 @@ "local": "local" } }, + "support_motor_noise_cali":false, "support_tunnel_mqtt":false, "support_mqtt_alive":false, "support_command_ams_switch":false, diff --git a/resources/printers/C12.json b/resources/printers/C12.json index 3bceec77b..a9e6fdc96 100644 --- a/resources/printers/C12.json +++ b/resources/printers/C12.json @@ -8,6 +8,7 @@ "local": "local" } }, + "support_motor_noise_cali":false, "support_tunnel_mqtt":false, "support_mqtt_alive":false, "support_command_ams_switch":false, diff --git a/resources/printers/N1.json b/resources/printers/N1.json index fe7e59177..f898a90f3 100644 --- a/resources/printers/N1.json +++ b/resources/printers/N1.json @@ -18,7 +18,7 @@ "support_prompt_sound":true, "support_ams_humidity":false, "support_auto_recovery_step_loss":true, - "support_auto_leveling":true, + "support_auto_leveling":false, "support_update_remain":false, "support_timelapse":true, "support_filament_backup":true, diff --git a/src/slic3r/GUI/Calibration.cpp b/src/slic3r/GUI/Calibration.cpp index 53ea80b46..f5dc323b3 100644 --- a/src/slic3r/GUI/Calibration.cpp +++ b/src/slic3r/GUI/Calibration.cpp @@ -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; } @@ -218,6 +219,29 @@ 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_support_auto_leveling){ + select_bed_leveling->Show(); + }else{ + select_bed_leveling->Hide(); + m_checkbox_list["bed_leveling"]->SetValue(false); + } + + if (obj->is_support_motor_noise_cali) { + select_motor_noise->Show(); + } else { + select_motor_noise->Hide(); + m_checkbox_list["motor_noise"]->SetValue(false); + } + + if (!obj->is_calibration_running() && !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()) { @@ -283,7 +307,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() ); } } diff --git a/src/slic3r/GUI/Calibration.hpp b/src/slic3r/GUI/Calibration.hpp index db01e5955..2bacea5f7 100644 --- a/src/slic3r/GUI/Calibration.hpp +++ b/src/slic3r/GUI/Calibration.hpp @@ -42,6 +42,7 @@ private: wxWindow* select_xcam_cali { nullptr }; wxWindow* select_bed_leveling { nullptr }; wxWindow* select_vibration { nullptr }; + wxWindow* select_motor_noise { nullptr }; wxWindow* create_check_option(wxString title, wxWindow *parent, wxString tooltip, std::string param); diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index aabe720fb..83a4db71a 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1990,7 +1990,7 @@ bool MachineObject::is_support_command_calibration() return true; } -int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali) +int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise) { if (!is_support_command_calibration()) { // fixed gcode file @@ -2003,7 +2003,8 @@ int MachineObject::command_start_calibration(bool vibration, bool bed_leveling, json j; j["print"]["command"] = "calibration"; j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); - j["print"]["option"] = (vibration ? 1 << 2 : 0) + j["print"]["option"]= (motor_noise ? 1 << 3 : 0) + + (vibration ? 1 << 2 : 0) + (bed_leveling ? 1 << 1 : 0) + (xcam_cali ? 1 << 0 : 0); return this->publish_json(j.dump()); @@ -2857,6 +2858,12 @@ int MachineObject::parse_json(std::string payload) } } + if (jj.contains("support_motor_noise_cali")) { + if (jj["support_motor_noise_cali"].is_boolean()) { + is_support_motor_noise_cali = jj["support_motor_noise_cali"].get(); + } + } + if (jj.contains("support_timelapse")) { if (jj["support_timelapse"].is_boolean()) { is_support_timelapse = jj["support_timelapse"].get(); diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 8700bbd47..13c59503e 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -714,6 +714,7 @@ public: bool is_support_command_ams_switch{false}; bool is_support_mqtt_alive {false}; bool is_support_tunnel_mqtt{false}; + bool is_support_motor_noise_cali{false}; int nozzle_max_temperature = -1; int bed_temperature_limit = -1; @@ -817,7 +818,7 @@ public: // calibration printer bool is_support_command_calibration(); - int command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali); + int command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise); // PA calibration int command_start_pa_calibration(const X1CCalibInfos& pa_data, int mode = 0); // 0: automatic mode; 1: manual mode. default: automatic mode