diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 46add2bc7..fd1534a93 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2090,11 +2090,24 @@ int MachineObject::command_set_chamber_light(LIGHT_EFFECT effect, int on_time, i j["system"]["led_off_time"] = off_time; j["system"]["loop_times"] = loops; j["system"]["interval_time"] = interval; - return this->publish_json(j.dump()); } +int MachineObject::command_set_chamber_light2(LIGHT_EFFECT effect, int on_time /*= 500*/, int off_time /*= 500*/, int loops /*= 1*/, int interval /*= 1000*/) +{ + json j; + j["system"]["command"] = "ledctrl"; + j["system"]["led_node"] = "chamber_light2"; + j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++); + j["system"]["led_mode"] = light_effect_str(effect); + j["system"]["led_on_time"] = on_time; + j["system"]["led_off_time"] = off_time; + j["system"]["loop_times"] = loops; + j["system"]["interval_time"] = interval; + return this->publish_json(j.dump()); +} + int MachineObject::command_set_printer_nozzle(std::string nozzle_type, float diameter) { nozzle_setting_hold_count = HOLD_COUNT_MAX * 2; diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 7029206e3..809300a34 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -1048,6 +1048,7 @@ public: int command_ams_refresh_rfid(std::string tray_id); int command_ams_control(std::string action); int command_set_chamber_light(LIGHT_EFFECT effect, int on_time = 500, int off_time = 500, int loops = 1, int interval = 1000); + int command_set_chamber_light2(LIGHT_EFFECT effect, int on_time = 500, int off_time = 500, int loops = 1, int interval = 1000); int command_set_work_light(LIGHT_EFFECT effect, int on_time = 500, int off_time = 500, int loops = 1, int interval = 1000); int command_start_extrusion_cali(int tray_index, int nozzle_temp, int bed_temp, float max_volumetric_speed, std::string setting_id = ""); int command_stop_extrusion_cali(); diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 53a8f0ef3..b6cf311a6 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -4553,10 +4553,12 @@ void StatusPanel::on_lamp_switch(wxCommandEvent &event) // do not update when timeout > 0 set_hold_count(this->m_switch_lamp_timeout); obj->command_set_chamber_light(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_ON); + obj->command_set_chamber_light2(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_ON); } else { m_switch_lamp->SetValue(false); set_hold_count(this->m_switch_lamp_timeout); obj->command_set_chamber_light(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_OFF); + obj->command_set_chamber_light2(MachineObject::LIGHT_EFFECT::LIGHT_EFFECT_OFF); } }