FIX:User preset material settings dependent on firmware

JIRA: 5167
Change-Id: I82cf26848594b01155883ad0aa2e9ee77d371fb2
This commit is contained in:
hu.wang 2023-11-08 15:04:46 +08:00 committed by Lane.Wei
parent 433a4b2a7f
commit efedf8b319
10 changed files with 32 additions and 5 deletions

View File

@ -37,7 +37,8 @@
"support_ai_monitoring":false, "support_ai_monitoring":false,
"support_first_layer_inspect":true, "support_first_layer_inspect":true,
"support_chamber_temp_edit":false, "support_chamber_temp_edit":false,
"support_extrusion_cali":false "support_extrusion_cali":false,
"support_user_preset":false
}, },
"model_id":"BL-P001", "model_id":"BL-P001",
"compatible_machine":["BL-P002", "C11", "C12", "C13"], "compatible_machine":["BL-P002", "C11", "C12", "C13"],
@ -78,5 +79,10 @@
"print": { "print": {
"support_tunnel_mqtt":true "support_tunnel_mqtt":true
} }
},
"01.06.06.00": {
"print": {
"support_user_preset":true
}
} }
} }

View File

@ -37,7 +37,8 @@
"support_ai_monitoring":false, "support_ai_monitoring":false,
"support_first_layer_inspect":true, "support_first_layer_inspect":true,
"support_chamber_temp_edit":false, "support_chamber_temp_edit":false,
"support_extrusion_cali":false "support_extrusion_cali":false,
"support_user_preset":false
}, },
"model_id": "BL-P002", "model_id": "BL-P002",
"compatible_machine":["BL-P001", "C11", "C12", "C13"], "compatible_machine":["BL-P001", "C11", "C12", "C13"],
@ -78,5 +79,10 @@
"print": { "print": {
"support_tunnel_mqtt":true "support_tunnel_mqtt":true
} }
},
"01.06.06.00": {
"print": {
"support_user_preset":true
}
} }
} }

View File

@ -33,6 +33,7 @@
"support_first_layer_inspect":false, "support_first_layer_inspect":false,
"support_chamber_temp_edit":false, "support_chamber_temp_edit":false,
"support_extrusion_cali":true, "support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100 "bed_temperature_limit": 100
}, },
"model_id": "C11", "model_id": "C11",

View File

@ -33,6 +33,7 @@
"support_first_layer_inspect":false, "support_first_layer_inspect":false,
"support_chamber_temp_edit":false, "support_chamber_temp_edit":false,
"support_extrusion_cali":true, "support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100 "bed_temperature_limit": 100
}, },
"model_id": "C12", "model_id": "C12",

View File

@ -39,6 +39,7 @@
"support_first_layer_inspect":true, "support_first_layer_inspect":true,
"support_chamber_temp_edit":true, "support_chamber_temp_edit":true,
"support_extrusion_cali":false, "support_extrusion_cali":false,
"support_user_preset":false,
"bed_temperature_limit": 110, "bed_temperature_limit": 110,
"nozzle_max_temperature": 320 "nozzle_max_temperature": 320
}, },

View File

@ -34,6 +34,7 @@
"support_first_layer_inspect":false, "support_first_layer_inspect":false,
"support_chamber_temp_edit":false, "support_chamber_temp_edit":false,
"support_extrusion_cali":true, "support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100 "bed_temperature_limit": 100
}, },
"model_id": "N1", "model_id": "N1",

View File

@ -1 +1 @@
01.08.00.01 01.08.00.02

View File

@ -762,6 +762,7 @@ bool AMSMaterialsSetting::Show(bool show)
void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_min, wxString temp_max, wxString k, wxString n) void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_min, wxString temp_max, wxString k, wxString n)
{ {
if (!obj) return;
update_widgets(); update_widgets();
// set default value // set default value
if (k.IsEmpty()) if (k.IsEmpty())
@ -784,7 +785,10 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
for (auto filament_it = preset_bundle->filaments.begin(); filament_it != preset_bundle->filaments.end(); filament_it++) { for (auto filament_it = preset_bundle->filaments.begin(); filament_it != preset_bundle->filaments.end(); filament_it++) {
//filter by system preset //filter by system preset
Preset& preset = *filament_it; Preset& preset = *filament_it;
if (preset_bundle->filaments.get_preset_base(*filament_it) != &preset) { /*The situation where the user preset is not displayed is as follows:
1. Not a root preset
2. Not system preset and the printer firmware does not support user preset */
if (preset_bundle->filaments.get_preset_base(*filament_it) != &preset || (!filament_it->is_system && !obj->is_support_user_preset)) {
continue; continue;
} }
@ -794,7 +798,7 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
// get printer_model // get printer_model
ConfigOption* printer_model_opt = printer_it->config.option("printer_model"); ConfigOption* printer_model_opt = printer_it->config.option("printer_model");
ConfigOptionString* printer_model_str = dynamic_cast<ConfigOptionString*>(printer_model_opt); ConfigOptionString* printer_model_str = dynamic_cast<ConfigOptionString*>(printer_model_opt);
if (!printer_model_str || !obj) if (!printer_model_str )
continue; continue;
// use printer_model as printer type // use printer_model as printer type

View File

@ -2961,6 +2961,12 @@ int MachineObject::parse_json(std::string payload)
} }
} }
if (jj.contains("support_user_preset")) {
if (jj["support_user_preset"].is_boolean()) {
is_support_user_preset = jj["support_user_preset"].get<bool>();
}
}
if (jj.contains("nozzle_max_temperature")) { if (jj.contains("nozzle_max_temperature")) {
if (jj["nozzle_max_temperature"].is_number_integer()) { if (jj["nozzle_max_temperature"].is_number_integer()) {
nozzle_max_temperature = jj["nozzle_max_temperature"].get<int>(); nozzle_max_temperature = jj["nozzle_max_temperature"].get<int>();

View File

@ -736,6 +736,7 @@ public:
bool is_support_tunnel_mqtt{false}; bool is_support_tunnel_mqtt{false};
bool is_support_motor_noise_cali{false}; bool is_support_motor_noise_cali{false};
bool is_support_wait_sending_finish{false}; bool is_support_wait_sending_finish{false};
bool is_support_user_preset{false};
int nozzle_max_temperature = -1; int nozzle_max_temperature = -1;
int bed_temperature_limit = -1; int bed_temperature_limit = -1;