mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 19:32:18 +00:00
Introduce minimal chamber temperature field (gcode chamber_min_temperature (#14340)
Introduce minimal chamber temperature field (gcode chamber_min_temperature)
This commit is contained in:
committed by
GitHub
parent
8cb2e4e01e
commit
0e4928f200
@@ -220,6 +220,30 @@ void ConfigManipulation::check_chamber_temperature(DynamicPrintConfig* config)
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::check_chamber_minimal_temperature(DynamicPrintConfig* config)
|
||||
{
|
||||
// Orca: the minimal chamber temperature is a "start printing" threshold that is passed to the
|
||||
// print start macro. It must not exceed the target chamber temperature, otherwise the macro
|
||||
// could wait forever for a temperature the heater is never asked to reach.
|
||||
if (config->has("chamber_minimal_temperature") && config->has("chamber_temperature")) {
|
||||
const int chamber_min_temp = config->option<ConfigOptionInts>("chamber_minimal_temperature")->get_at(0);
|
||||
const int chamber_target_temp = config->option<ConfigOptionInts>("chamber_temperature")->get_at(0);
|
||||
if (chamber_min_temp > chamber_target_temp) {
|
||||
wxString msg_text = wxString::Format(_L("The minimal chamber temperature (%d℃) is higher than the target chamber temperature (%d℃). "
|
||||
"The minimal value is the threshold at which printing starts while the chamber keeps heating toward the target, "
|
||||
"so it should not exceed it. It will be clamped to the target."),
|
||||
chamber_min_temp, chamber_target_temp);
|
||||
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
|
||||
DynamicPrintConfig new_conf = *config;
|
||||
is_msg_dlg_already_exist = true;
|
||||
dialog.ShowModal();
|
||||
new_conf.set_key_value("chamber_minimal_temperature", new ConfigOptionInts({chamber_target_temp}));
|
||||
apply(config, &new_conf);
|
||||
is_msg_dlg_already_exist = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config, const bool is_plate_config)
|
||||
{
|
||||
// #ys_FIXME_to_delete
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
void check_adaptive_pressure_advance_model(DynamicPrintConfig* config);
|
||||
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
|
||||
void check_chamber_temperature(DynamicPrintConfig* config);
|
||||
void check_chamber_minimal_temperature(DynamicPrintConfig* config);
|
||||
void set_is_BBL_Printer(bool is_bbl_printer) { is_BBL_Printer = is_bbl_printer; };
|
||||
bool get_is_BBL_Printer() { return is_BBL_Printer; };
|
||||
// SLA print
|
||||
|
||||
@@ -3969,7 +3969,29 @@ void TabFilament::build()
|
||||
|
||||
optgroup = page->new_optgroup(L("Print chamber temperature"), L"param_chamber_temp");
|
||||
optgroup->append_single_option_line("activate_chamber_temp_control", "material_temperatures#print-chamber-temperature");
|
||||
optgroup->append_single_option_line("chamber_temperature", "material_temperatures#print-chamber-temperature");
|
||||
line = { L("Chamber temperature"), L("Target chamber temperature, and the minimal chamber temperature at which printing should start") };
|
||||
line.label_path = "material_temperatures#print-chamber-temperature";
|
||||
Option chamber_temp_target_opt = optgroup->get_option("chamber_temperature");
|
||||
chamber_temp_target_opt.opt.label = L("Target");
|
||||
line.append_option(chamber_temp_target_opt);
|
||||
Option chamber_min_temp_opt = optgroup->get_option("chamber_minimal_temperature");
|
||||
chamber_min_temp_opt.opt.label = L("Minimal");
|
||||
line.append_option(chamber_min_temp_opt);
|
||||
optgroup->append_line(line);
|
||||
optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) {
|
||||
DynamicPrintConfig& filament_config = m_preset_bundle->filaments.get_edited_preset().config;
|
||||
|
||||
update_dirty();
|
||||
if (opt_key == "chamber_temperature") {
|
||||
m_config_manipulation.check_chamber_temperature(&filament_config);
|
||||
m_config_manipulation.check_chamber_minimal_temperature(&filament_config);
|
||||
}
|
||||
else if (opt_key == "chamber_minimal_temperature") {
|
||||
m_config_manipulation.check_chamber_minimal_temperature(&filament_config);
|
||||
}
|
||||
|
||||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
||||
optgroup = page->new_optgroup(L("Print temperature"), L"param_extruder_temp");
|
||||
line = { L("Nozzle"), L("Nozzle temperature when printing") };
|
||||
@@ -4044,9 +4066,6 @@ void TabFilament::build()
|
||||
else if (opt_key == "nozzle_temperature_initial_layer") {
|
||||
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config);
|
||||
}
|
||||
else if (opt_key == "chamber_temperature") {
|
||||
m_config_manipulation.check_chamber_temperature(&filament_config);
|
||||
}
|
||||
|
||||
on_value_change(opt_key, value);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user