ENH:set the max nozzle temper using config file

jira:[STUDIO-9307]

Change-Id: I5e45fa584a6949c77abf60894ea87b4de4ab7fce
This commit is contained in:
tao wang 2024-12-24 17:56:22 +08:00 committed by lane.wei
parent f1b1d522a7
commit 1b53d6d8cc
11 changed files with 47 additions and 36 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

@ -4,11 +4,11 @@
"print": {
"2D": {
"laser": {
"power": [10, 40]
"power": [ 10, 40 ]
}
},
"ipcam": {
"resolution_supported": ["1080p"],
"resolution_supported": [ "1080p" ],
"virtual_camera": "enabled",
"liveview": {
"remote": "tutk"
@ -19,6 +19,7 @@
"model_download": "enabled"
}
},
"nozzle_temp_range": [ 20, 350 ],
"support_motor_noise_cali": false,
"support_tunnel_mqtt": true,
"support_mqtt_alive": true,
@ -48,7 +49,7 @@
"support_user_preset": false
},
"model_id": "O1D",
"printer_modes": ["fdm", "laser", "cut"],
"printer_modes": [ "fdm", "laser", "cut" ],
"compatible_machine": [],
"printer_type": "O1D",
"printer_thumbnail_image": "printer_thumbnail",

View File

@ -3190,6 +3190,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()) {
@ -3346,12 +3355,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

@ -967,9 +967,11 @@ public:
bool is_support_filament_setting_inprinting{false};
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

@ -35,7 +35,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 */
@ -1396,8 +1395,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));
@ -1411,8 +1410,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);
@ -2843,6 +2842,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--;
@ -2873,15 +2880,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 {