mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-27 00:24:00 -06:00
NEW:added check nozzle diameter and nozzle type
jira:[new] Change-Id: Icc6951b861258f367d4f9c1784842965896555e4
This commit is contained in:
parent
aecb5a3a67
commit
ca02ea749e
6 changed files with 216 additions and 6 deletions
|
@ -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")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue