mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-05 23:01:17 +00:00
Preserve nozzle variant tuning and cooling controls
Include variant-aware validation, temperature and pressure controls, named nozzle selection, and filament sidebar refresh. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -78,12 +78,12 @@ void ConfigManipulation::set_option_label(const std::string& opt_key, const wxSt
|
||||
cb_set_option_label(opt_key, label, opt_index);
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config) {
|
||||
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index) {
|
||||
if (is_msg_dlg_already_exist)
|
||||
return;
|
||||
|
||||
int temperature_range_low, temperature_range_high;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
|
||||
|
||||
// Get the selected filament type
|
||||
std::string filament_type = "";
|
||||
@@ -123,16 +123,16 @@ void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrint
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config)
|
||||
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config, unsigned int variant_index)
|
||||
{
|
||||
if (is_msg_dlg_already_exist)
|
||||
return;
|
||||
|
||||
int temperature_range_low, temperature_range_high;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
|
||||
|
||||
if (config->has("nozzle_temperature")) {
|
||||
if (config->opt_int("nozzle_temperature", 0) < temperature_range_low || config->opt_int("nozzle_temperature", 0) > temperature_range_high) {
|
||||
if (config->opt_int("nozzle_temperature", variant_index) < temperature_range_low || config->opt_int("nozzle_temperature", variant_index) > temperature_range_high) {
|
||||
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
|
||||
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
|
||||
@@ -143,17 +143,17 @@ void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *conf
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config)
|
||||
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index)
|
||||
{
|
||||
if (is_msg_dlg_already_exist)
|
||||
return;
|
||||
|
||||
int temperature_range_low, temperature_range_high;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
|
||||
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
|
||||
|
||||
if (config->has("nozzle_temperature_initial_layer")) {
|
||||
if (config->opt_int("nozzle_temperature_initial_layer", 0) < temperature_range_low ||
|
||||
config->opt_int("nozzle_temperature_initial_layer", 0) > temperature_range_high)
|
||||
if (config->opt_int("nozzle_temperature_initial_layer", variant_index) < temperature_range_low ||
|
||||
config->opt_int("nozzle_temperature_initial_layer", variant_index) > temperature_range_high)
|
||||
{
|
||||
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
|
||||
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
|
||||
@@ -1295,15 +1295,15 @@ int ConfigManipulation::show_spiral_mode_settings_dialog(bool is_object_config)
|
||||
return answer;
|
||||
}
|
||||
|
||||
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high)
|
||||
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index)
|
||||
{
|
||||
bool range_low_exist = false, range_high_exist = false;
|
||||
if (config->has("nozzle_temperature_range_low")) {
|
||||
range_low = config->opt_int("nozzle_temperature_range_low", (unsigned int) 0);
|
||||
range_low = config->opt_int("nozzle_temperature_range_low", variant_index);
|
||||
range_low_exist = true;
|
||||
}
|
||||
if (config->has("nozzle_temperature_range_high")) {
|
||||
range_high = config->opt_int("nozzle_temperature_range_high", (unsigned int) 0);
|
||||
range_high = config->opt_int("nozzle_temperature_range_high", variant_index);
|
||||
range_high_exist = true;
|
||||
}
|
||||
return range_low_exist && range_high_exist;
|
||||
|
||||
Reference in New Issue
Block a user