NEW:support led control

jira:[device page]

Change-Id: Id1ce67262a2c70e93425c0c79f2f3b2fd0a747a6
(cherry picked from commit b89aa86a8ecabbafdd5a4201f0cec24a9db87db8)
This commit is contained in:
tao wang 2024-12-03 22:13:11 +08:00 committed by Noisyfox
parent f2598e0265
commit 592734dbf7
3 changed files with 17 additions and 1 deletions

View file

@ -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;