Skip to content

Commit

Permalink
FIX:User preset material settings dependent on firmware
Browse files Browse the repository at this point in the history
JIRA: 5167
Change-Id: I82cf26848594b01155883ad0aa2e9ee77d371fb2
  • Loading branch information
bam-winterfell authored and lanewei120 committed Nov 9, 2023
1 parent 433a4b2 commit efedf8b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 5 deletions.
8 changes: 7 additions & 1 deletion resources/printers/BL-P001.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"support_ai_monitoring":false,
"support_first_layer_inspect":true,
"support_chamber_temp_edit":false,
"support_extrusion_cali":false
"support_extrusion_cali":false,
"support_user_preset":false
},
"model_id":"BL-P001",
"compatible_machine":["BL-P002", "C11", "C12", "C13"],
Expand Down Expand Up @@ -78,5 +79,10 @@
"print": {
"support_tunnel_mqtt":true
}
},
"01.06.06.00": {
"print": {
"support_user_preset":true
}
}
}
8 changes: 7 additions & 1 deletion resources/printers/BL-P002.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"support_ai_monitoring":false,
"support_first_layer_inspect":true,
"support_chamber_temp_edit":false,
"support_extrusion_cali":false
"support_extrusion_cali":false,
"support_user_preset":false
},
"model_id": "BL-P002",
"compatible_machine":["BL-P001", "C11", "C12", "C13"],
Expand Down Expand Up @@ -78,5 +79,10 @@
"print": {
"support_tunnel_mqtt":true
}
},
"01.06.06.00": {
"print": {
"support_user_preset":true
}
}
}
1 change: 1 addition & 0 deletions resources/printers/C11.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"support_first_layer_inspect":false,
"support_chamber_temp_edit":false,
"support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100
},
"model_id": "C11",
Expand Down
1 change: 1 addition & 0 deletions resources/printers/C12.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"support_first_layer_inspect":false,
"support_chamber_temp_edit":false,
"support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100
},
"model_id": "C12",
Expand Down
1 change: 1 addition & 0 deletions resources/printers/C13.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"support_first_layer_inspect":true,
"support_chamber_temp_edit":true,
"support_extrusion_cali":false,
"support_user_preset":false,
"bed_temperature_limit": 110,
"nozzle_max_temperature": 320
},
Expand Down
1 change: 1 addition & 0 deletions resources/printers/N1.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"support_first_layer_inspect":false,
"support_chamber_temp_edit":false,
"support_extrusion_cali":true,
"support_user_preset":false,
"bed_temperature_limit": 100
},
"model_id": "N1",
Expand Down
2 changes: 1 addition & 1 deletion resources/printers/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
01.08.00.01
01.08.00.02
8 changes: 6 additions & 2 deletions src/slic3r/GUI/AMSMaterialsSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
if (!obj) return;
update_widgets();
// set default value
if (k.IsEmpty())
Expand All @@ -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++) {
//filter by system preset
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;
}

Expand All @@ -794,7 +798,7 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
// get printer_model
ConfigOption* printer_model_opt = printer_it->config.option("printer_model");
ConfigOptionString* printer_model_str = dynamic_cast<ConfigOptionString*>(printer_model_opt);
if (!printer_model_str || !obj)
if (!printer_model_str )
continue;

// use printer_model as printer type
Expand Down
6 changes: 6 additions & 0 deletions src/slic3r/GUI/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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["nozzle_max_temperature"].is_number_integer()) {
nozzle_max_temperature = jj["nozzle_max_temperature"].get<int>();
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/DeviceManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ class MachineObject
bool is_support_tunnel_mqtt{false};
bool is_support_motor_noise_cali{false};
bool is_support_wait_sending_finish{false};
bool is_support_user_preset{false};

int nozzle_max_temperature = -1;
int bed_temperature_limit = -1;
Expand Down

0 comments on commit efedf8b

Please sign in to comment.