mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
NEW:Support setting filaments in printing
jira:[set filament] Change-Id: Ib37896f9101d93ca63c7edb0b1e6328045a5ddb3 (cherry picked from commit fa2dbd7ada18bc806be845673cce9eb4559cda80)
This commit is contained in:
@@ -3165,6 +3165,12 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
mc_print_line_number = atoi(jj["mc_print_line_number"].get<std::string>().c_str());
|
||||
}
|
||||
}
|
||||
if (!key_field_only) {
|
||||
if (jj.contains("flag3")) {
|
||||
int flag3 = jj["flag3"].get<int>();
|
||||
is_support_filament_setting_inprinting = get_flag_bits(flag3, 3);
|
||||
}
|
||||
}
|
||||
if (!key_field_only) {
|
||||
if (jj.contains("net")) {
|
||||
if (jj["net"].contains("conf")) {
|
||||
@@ -4308,6 +4314,14 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||
}
|
||||
}
|
||||
} else if (jj["command"].get<std::string>() == "ams_filament_setting" && !key_field_only) {
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// BBS trigger ams UI update
|
||||
ams_version = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user