mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
ENH:adjust the parsing of ams info data
jira:[none ] Change-Id: I8e5125ae313b48b3f64fe59ae45ee7b437a0119f (cherry picked from commit c38074d3cdc38f8e676a443f23b20d9477facea9) (cherry picked from commit c8ce030bd2de6b54a79e218d6073164956f6f0b9)
This commit is contained in:
@@ -4017,15 +4017,14 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||||||
if (!it->contains("id")) continue;
|
if (!it->contains("id")) continue;
|
||||||
std::string ams_id = (*it)["id"].get<std::string>();
|
std::string ams_id = (*it)["id"].get<std::string>();
|
||||||
|
|
||||||
int nozzle_id = 0; // Default nozzle id
|
int nozzle_id = MAIN_NOZZLE_ID; // Default nozzle id
|
||||||
int type_id = 1; // 0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
|
int type_id = 1; // 0:dummy 1:ams 2:ams-lite 3:n3f 4:n3s
|
||||||
|
|
||||||
if (it->contains("nozzle")) {
|
/*ams info*/
|
||||||
nozzle_id = (*it)["nozzle"].get<int>();
|
if (it->contains("info")) {
|
||||||
}
|
std::string info = (*it)["info"].get<std::string>();
|
||||||
|
type_id = get_flag_bits(info, 0, 3);
|
||||||
if (it->contains("type")) {
|
nozzle_id = get_flag_bits(info, 8, 3);
|
||||||
type_id = (*it)["type"].get<int>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ams_id_set.erase(ams_id);
|
ams_id_set.erase(ams_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user