NEW:added check nozzle diameter and nozzle type

jira:[new]

Change-Id: Icc6951b861258f367d4f9c1784842965896555e4
This commit is contained in:
tao wang 2023-07-19 16:47:25 +08:00 committed by Lane.Wei
parent aecb5a3a67
commit ca02ea749e
6 changed files with 216 additions and 6 deletions

View file

@ -1864,6 +1864,20 @@ int MachineObject::command_set_chamber_light(LIGHT_EFFECT effect, int on_time, i
return this->publish_json(j.dump());
}
int MachineObject::command_set_printer_nozzle(std::string nozzle_type, float diameter)
{
BOOST_LOG_TRIVIAL(info) << "command_set_printer_nozzle, nozzle_type = " << nozzle_type << " diameter = " << diameter;
json j;
j["system"]["command"] = "set_accessories";
j["system"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
j["system"]["accessory_type"] = "nozzle";
j["system"]["nozzle_type"] = nozzle_type;
j["system"]["nozzle_diameter"] = diameter;
return this->publish_json(j.dump());
}
int MachineObject::command_set_work_light(LIGHT_EFFECT effect, int on_time, int off_time, int loops, int interval)
{
json j;
@ -3299,6 +3313,17 @@ int MachineObject::parse_json(std::string payload)
;
}
try {
if (jj.contains("nozzle_type")) {
if (jj["nozzle_type"].is_string()) {
nozzle_type = jj["nozzle_type"].get<std::string>();
}
}
}
catch (...) {
;
}
#pragma region upgrade
try {
if (jj.contains("upgrade_state")) {