mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-11 13:56:04 -06:00
NEW:support led control
jira:[device page] Change-Id: Id1ce67262a2c70e93425c0c79f2f3b2fd0a747a6 (cherry picked from commit b89aa86a8ecabbafdd5a4201f0cec24a9db87db8)
This commit is contained in:
parent
f2598e0265
commit
592734dbf7
3 changed files with 17 additions and 1 deletions
|
|
@ -2074,11 +2074,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;
|
||||
|
|
|
|||
|
|
@ -1076,6 +1076,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();
|
||||
|
|
|
|||
|
|
@ -4589,10 +4589,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue