Introduce minimal chamber temperature field (gcode chamber_min_temperature (#14340)

Introduce minimal chamber temperature field (gcode chamber_min_temperature)
This commit is contained in:
Ioannis Giannakas
2026-06-27 13:27:01 +01:00
committed by GitHub
parent 8cb2e4e01e
commit 0e4928f200
8 changed files with 69 additions and 6 deletions

View File

@@ -3034,6 +3034,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
this->placeholder_parser().set("bed_temperature_initial_layer_vector", new ConfigOptionString());
this->placeholder_parser().set("chamber_temperature", new ConfigOptionInts(m_config.chamber_temperature));
this->placeholder_parser().set("overall_chamber_temperature", new ConfigOptionInt(max_chamber_temp));
this->placeholder_parser().set("chamber_minimal_temperature", new ConfigOptionInts(m_config.chamber_minimal_temperature));
this->placeholder_parser().set("enable_high_low_temp_mix", new ConfigOptionBool(!print.need_check_multi_filaments_compatibility()));
this->placeholder_parser().set("min_vitrification_temperature", new ConfigOptionInt(min_temperature_vitrification));

View File

@@ -1339,7 +1339,7 @@ static std::vector<std::string> s_Preset_filament_options {/*"filament_colour",
"filament_loading_speed", "filament_loading_speed_start",
"filament_unloading_speed", "filament_unloading_speed_start", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance",
"filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters",
"filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow", "activate_chamber_temp_control",
"filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow", "activate_chamber_temp_control", "chamber_minimal_temperature",
"filament_long_retractions_when_cut","filament_retraction_distances_when_cut", "idle_temperature",
//BBS filament change length while the extruder color
"filament_change_length","filament_flush_volumetric_speed","filament_flush_temp", "filament_cooling_before_tower",

View File

@@ -205,6 +205,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"is_infill_first",
// Orca
"chamber_temperature",
"chamber_minimal_temperature",
"thumbnails",
"thumbnails_format",
"seam_gap",

View File

@@ -6557,6 +6557,21 @@ void PrintConfigDef::init_fff_params()
def->max = max_temp;
def->set_default_value(new ConfigOptionInts{0});
def = this->add("chamber_minimal_temperature", coInts);
def->label = L("Minimal");
def->tooltip = L("This is the chamber temperature at which printing should start, while the chamber continues heating "
"toward the \"Target\" chamber temperature. For example, set the Target to 60 and the Minimal to 50 to "
"begin printing once the chamber reaches 50°C, without waiting for the full 60°C.\n\n"
"It sets a G-code variable named chamber_minimal_temperature, which can be passed to your print start macro "
"or a heat soak macro, like this: PRINT_START (other variables) CHAMBER_MIN_TEMP=[chamber_minimal_temperature].\n\n"
"Unlike the \"Target\" chamber temperature, this option does not emit any M141/M191 commands; it only exposes "
"the value to your custom G-code. It should not exceed the \"Target\" chamber temperature.");
def->sidetext = L(u8"\u2103" /* °C */); // degrees Celsius, CIS languages need translation
def->full_label = L("Chamber minimal temperature");
def->min = 0;
def->max = max_temp;
def->set_default_value(new ConfigOptionInts{0});
def = this->add("nozzle_temperature", coInts);
def->label = L("Other layers");
def->tooltip = L("Nozzle temperature after the first layer");
@@ -11202,6 +11217,7 @@ TemperaturesConfigDef::TemperaturesConfigDef()
new_def("bed_temperature_initial_layer", coInts, "First layer bed temperature", "Vector of first layer bed temperatures for each extruder/filament. Provides the same value as first_layer_bed_temperature.")
new_def("bed_temperature_initial_layer_single", coInt, "First layer bed temperature (initial extruder)", "First layer bed temperature for the initial extruder. Same as bed_temperature_initial_layer[initial_extruder]")
new_def("chamber_temperature", coInts, "Chamber temperature", "Vector of chamber temperatures for each extruder/filament.")
new_def("chamber_minimal_temperature", coInts, "Chamber minimal temperature", "Vector of minimal chamber temperatures for each extruder/filament.")
new_def("overall_chamber_temperature", coInt, "Overall chamber temperature", "Overall chamber temperature. This value is the maximum chamber temperature of any extruder/filament used.")
new_def("first_layer_bed_temperature", coInts, "First layer bed temperature", "Vector of first layer bed temperatures for each extruder/filament. Provides the same value as bed_temperature_initial_layer.")
new_def("first_layer_temperature", coInts, "First layer temperature", "Vector of first layer temperatures for each extruder/filament.")

View File

@@ -1647,7 +1647,8 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBools, activate_chamber_temp_control))
((ConfigOptionInts , chamber_temperature))
((ConfigOptionInts , chamber_minimal_temperature))
// Orca: support adaptive bed mesh
((ConfigOptionFloat, preferred_orientation))
((ConfigOptionPoint, bed_mesh_min))

View File

@@ -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

View File

@@ -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

View File

@@ -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);
};