ENH:set the max nozzle temper using config file

jira:[STUDIO-9307]

Change-Id: I5e45fa584a6949c77abf60894ea87b4de4ab7fce
(cherry picked from commit 1b53d6d8ccb57b560394e79b8cc4de3fe79fd165)
This commit is contained in:
tao wang 2024-12-24 17:56:22 +08:00 committed by Noisyfox
parent 09b7d41fe3
commit 17a97cd536
10 changed files with 43 additions and 33 deletions

View file

@ -3,7 +3,7 @@
"display_name": "Bambu Lab X1 Carbon",
"print": {
"ipcam": {
"resolution_supported": ["720p", "1080p"],
"resolution_supported": [ "720p", "1080p" ],
"virtual_camera": "enabled",
"liveview": {
"remote": "tutk"
@ -13,6 +13,7 @@
"model_download": "enabled"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": false,
"support_mqtt_alive": false,
@ -41,7 +42,7 @@
"support_user_preset": false
},
"model_id": "BL-P001",
"compatible_machine": ["BL-P002", "C11", "C12", "C13"],
"compatible_machine": [ "BL-P002", "C11", "C12", "C13" ],
"printer_type": "3DPrinter-X1-Carbon",
"printer_thumbnail_image": "printer_thumbnail",
"printer_connect_help_image": "input_access_code_x1",

View file

@ -3,7 +3,7 @@
"display_name": "Bambu Lab X1",
"print": {
"ipcam": {
"resolution_supported": ["720p", "1080p"],
"resolution_supported": [ "720p", "1080p" ],
"virtual_camera": "enabled",
"liveview": {
"remote": "tutk"
@ -13,6 +13,7 @@
"model_download": "enabled"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": false,
"support_mqtt_alive": false,
@ -41,7 +42,7 @@
"support_user_preset": false
},
"model_id": "BL-P002",
"compatible_machine": ["BL-P001", "C11", "C12", "C13"],
"compatible_machine": [ "BL-P001", "C11", "C12", "C13" ],
"printer_type": "3DPrinter-X1",
"printer_thumbnail_image": "printer_thumbnail",
"printer_connect_help_image": "input_access_code_x1",

View file

@ -3,11 +3,12 @@
"display_name": "Bambu Lab P1P",
"print": {
"ipcam": {
"resolution_supported": ["720p"],
"resolution_supported": [ "720p" ],
"liveview": {
"local": "local"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": false,
"support_mqtt_alive": false,
@ -37,7 +38,7 @@
"bed_temperature_limit": 100
},
"model_id": "C11",
"compatible_machine": ["BL-P001", "BL-P002", "C12", "C13"],
"compatible_machine": [ "BL-P001", "BL-P002", "C12", "C13" ],
"printer_type": "C11",
"ftp_folder": "sdcard/",
"printer_thumbnail_image": "printer_thumbnail_p1p",

View file

@ -3,11 +3,12 @@
"display_name": "Bambu Lab P1S",
"print": {
"ipcam": {
"resolution_supported": ["720p"],
"resolution_supported": [ "720p" ],
"liveview": {
"local": "local"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": false,
"support_mqtt_alive": false,
@ -37,7 +38,7 @@
"bed_temperature_limit": 100
},
"model_id": "C12",
"compatible_machine": ["BL-P001", "BL-P002", "C11", "C13"],
"compatible_machine": [ "BL-P001", "BL-P002", "C11", "C13" ],
"printer_type": "C12",
"ftp_folder": "sdcard/",
"printer_thumbnail_image": "printer_thumbnail_p1s",

View file

@ -3,7 +3,7 @@
"display_name": "Bambu Lab X1E",
"print": {
"ipcam": {
"resolution_supported": ["720p", "1080p"],
"resolution_supported": [ "720p", "1080p" ],
"virtual_camera": "enabled",
"liveview": {
"remote": "tutk"
@ -13,6 +13,7 @@
"model_download": "enabled"
}
},
"nozzle_temp_range": [ 20, 320 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": true,
"support_mqtt_alive": true,
@ -44,7 +45,7 @@
"nozzle_max_temperature": 320
},
"model_id": "C13",
"compatible_machine": ["BL-P001", "BL-P002", "C11", "C12"],
"compatible_machine": [ "BL-P001", "BL-P002", "C11", "C12" ],
"printer_type": "C13",
"printer_thumbnail_image": "printer_thumbnail",
"printer_connect_help_image": "input_access_code_x1",

View file

@ -3,12 +3,13 @@
"display_name": "Bambu Lab A1 mini",
"print": {
"ipcam": {
"resolution_supported": ["720p"],
"resolution_supported": [ "720p" ],
"liveview": {
"local": "local",
"remote": "tutk"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": true,
"support_tunnel_mqtt": true,
"support_mqtt_alive": true,

View file

@ -3,12 +3,13 @@
"display_name": "Bambu Lab A1",
"print": {
"ipcam": {
"resolution_supported": ["720p"],
"resolution_supported": [ "720p" ],
"liveview": {
"local": "local",
"remote": "tutk"
}
},
"nozzle_temp_range": [ 20, 300 ],
"support_motor_noise_cali": true,
"support_tunnel_mqtt": true,
"support_mqtt_alive": true,

View file

@ -3170,6 +3170,15 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
}
}
//nozzle temp range
if (jj.contains("nozzle_temp_range")) {
if (jj["nozzle_temp_range"].is_array()) {
for (auto it = jj["nozzle_temp_range"].begin(); it != jj["nozzle_temp_range"].end(); it++) {
nozzle_temp_range.push_back(it.value().get<int>());
}
}
}
//supported function
if (jj.contains("support_chamber_temp_edit")) {
if (jj["support_chamber_temp_edit"].is_boolean()) {
@ -3326,12 +3335,6 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
}
}
if (jj.contains("nozzle_max_temperature")) {
if (jj["nozzle_max_temperature"].is_number_integer()) {
nozzle_max_temperature = jj["nozzle_max_temperature"].get<int>();
}
}
if (jj.contains("bed_temperature_limit")) {
if (jj["bed_temperature_limit"].is_number_integer()) {
bed_temperature_limit = jj["bed_temperature_limit"].get<int>();

View file

@ -986,9 +986,11 @@ public:
bool is_support_command_homing { false };// fun[32]
bool installed_upgrade_kit{false};
int nozzle_max_temperature = -1;
int bed_temperature_limit = -1;
/*nozzle temp range*/
std::vector<int> nozzle_temp_range;
/* sdcard */
MachineObject::SdcardState sdcard_state { NO_SDCARD };
MachineObject::SdcardState get_sdcard_state();

View file

@ -36,7 +36,6 @@ static const wxFont SWITCH_FONT = Label::Body_10;
/* const values */
static const int bed_temp_range[2] = {20, 120};
static const int nozzle_temp_range[2] = {20, 300};
static const int nozzle_chamber_range[2] = {20, 60};
/* colors */
@ -1432,8 +1431,8 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
m_tempCtrl_nozzle = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_NORMAL_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"),
wxString("monitor_nozzle_temp_active"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
m_tempCtrl_nozzle->SetMinTemp(nozzle_temp_range[0]);
m_tempCtrl_nozzle->SetMaxTemp(nozzle_temp_range[1]);
m_tempCtrl_nozzle->SetMinTemp(20);
m_tempCtrl_nozzle->SetMaxTemp(300);
m_tempCtrl_nozzle->SetBorderWidth(FromDIP(2));
StateColor tempinput_text_colour(std::make_pair(DISCONNECT_TEXT_COL, (int) StateColor::Disabled), std::make_pair(NORMAL_TEXT_COL, (int) StateColor::Normal));
@ -1447,8 +1446,8 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
m_tempCtrl_nozzle_deputy = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_NORMAL_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"), wxString("monitor_nozzle_temp_active"),
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
m_tempCtrl_nozzle_deputy->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
m_tempCtrl_nozzle_deputy->SetMinTemp(nozzle_temp_range[0]);
m_tempCtrl_nozzle_deputy->SetMaxTemp(nozzle_temp_range[1]);
m_tempCtrl_nozzle_deputy->SetMinTemp(20);
m_tempCtrl_nozzle_deputy->SetMaxTemp(300);
m_tempCtrl_nozzle_deputy->SetBorderWidth(FromDIP(2));
m_tempCtrl_nozzle_deputy->SetTextColor(tempinput_text_colour);
@ -2870,6 +2869,14 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
m_tempCtrl_bed->SetCurrTemp((int) obj->bed_temp);
m_tempCtrl_bed->SetMaxTemp(obj->get_bed_temperature_limit());
if (obj->nozzle_temp_range.size() >= 2) {
m_tempCtrl_nozzle->SetMinTemp(obj->nozzle_temp_range[0]);
m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_temp_range[1]);
m_tempCtrl_nozzle_deputy->SetMinTemp(obj->nozzle_temp_range[0]);
m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_temp_range[1]);
}
// update temprature if not input temp target
if (m_temp_bed_timeout > 0) {
m_temp_bed_timeout--;
@ -2900,15 +2907,6 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
m_tempCtrl_nozzle_deputy->SetCurrTemp((int)obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].temp);
}
if (obj->nozzle_max_temperature > -1) {
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_max_temperature);
if (m_tempCtrl_nozzle_deputy && nozzle_num >= 2) m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_max_temperature);
}
else {
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(nozzle_temp_range[1]);
if (m_tempCtrl_nozzle_deputy && nozzle_num >= 2) m_tempCtrl_nozzle_deputy->SetMaxTemp(nozzle_temp_range[1]);
}
if (m_temp_nozzle_timeout > 0) {
m_temp_nozzle_timeout--;
} else {