ENH: modify chamber_temperature to array

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I8c1afc85ff91ebf4458871fecba5f2f1f1e32f1d
This commit is contained in:
xun.zhang 2023-07-28 20:42:19 +08:00 committed by Lane.Wei
parent 947f870b32
commit 6ce4a6c5f2
6 changed files with 13 additions and 11 deletions

View file

@ -1777,6 +1777,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
{
int curr_bed_type = m_config.curr_bed_type.getInt();
int max_chamber_temp = *std::max_element(m_config.chamber_temperatures.values.begin(), m_config.chamber_temperatures.values.end());
std::string first_layer_bed_temp_str;
const ConfigOptionInts* first_bed_temp_opt = m_config.option<ConfigOptionInts>(get_bed_temp_1st_layer_key((BedType)curr_bed_type));
const ConfigOptionInts* bed_temp_opt = m_config.option<ConfigOptionInts>(get_bed_temp_key((BedType)curr_bed_type));
@ -1785,7 +1787,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
m_placeholder_parser.set("bed_temperature", new ConfigOptionInts(*bed_temp_opt));
m_placeholder_parser.set("bed_temperature_initial_layer_single", new ConfigOptionInt(first_bed_temp_opt->get_at(initial_extruder_id)));
m_placeholder_parser.set("bed_temperature_initial_layer_vector", new ConfigOptionString(""));
m_placeholder_parser.set("chamber_temperature", new ConfigOptionInt(m_config.chamber_temperature));
m_placeholder_parser.set("chamber_temperature", new ConfigOptionInts({max_chamber_temp}));
//support variables `first_layer_temperature` and `first_layer_bed_temperature`
m_placeholder_parser.set("first_layer_bed_temperature", new ConfigOptionInts(*first_bed_temp_opt));

View file

@ -811,7 +811,7 @@ static std::vector<std::string> s_Preset_filament_options {
"filament_wipe_distance", "additional_cooling_fan_speed",
"bed_temperature_difference", "nozzle_temperature_range_low", "nozzle_temperature_range_high",
//OrcaSlicer
"enable_pressure_advance", "pressure_advance", "chamber_temperature"
"enable_pressure_advance", "pressure_advance", "chamber_temperatures"
};
static std::vector<std::string> s_Preset_machine_limits_options {

View file

@ -145,7 +145,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
"wipe_distance",
"curr_bed_type",
"nozzle_volume",
"chamber_temperature",
"chamber_temperatures",
"required_nozzle_HRC",
"upward_compatible_machine",
//OrcaSlicer
@ -198,7 +198,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
osteps.emplace_back(posSlice);
} else if (
opt_key == "print_sequence"
|| opt_key == "chamber_temperature"
|| opt_key == "chamber_temperatures"
|| opt_key == "filament_type"
|| opt_key == "nozzle_temperature_initial_layer"
|| opt_key == "filament_minimal_purge_on_wipe_tower"

View file

@ -3050,14 +3050,14 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("chamber_temperature", coInt);
def = this->add("chamber_temperatures", coInts);
def->label = L("Chamber temperature");
def->tooltip = L("Target chamber temperature");
def->sidetext = L("°C");
def->full_label = L("Chamber temperature");
def->min = 0;
def->max = max_temp;
def->set_default_value(new ConfigOptionInt(0));
def->max = 60;
def->set_default_value(new ConfigOptionInts{0});
def = this->add("nozzle_temperature", coInts);
def->label = L("Other layers");
@ -4238,7 +4238,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height",
"z_hop_type","nozzle_hrc"
"z_hop_type","nozzle_hrc","chamber_temperature"
};
if (ignore.find(opt_key) != ignore.end()) {

View file

@ -946,7 +946,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBool, spiral_mode))
((ConfigOptionInt, standby_temperature_delta))
((ConfigOptionInts, nozzle_temperature))
((ConfigOptionInt, chamber_temperature))
((ConfigOptionInts, chamber_temperatures))
((ConfigOptionBools, wipe))
// BBS
((ConfigOptionInts, bed_temperature_difference))

View file

@ -2645,7 +2645,7 @@ void TabFilament::build()
optgroup->append_single_option_line("bed_temperature_difference");
optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
optgroup->append_single_option_line("chamber_temperature");
optgroup->append_single_option_line("chamber_temperatures");
line = { L("Nozzle"), L("Nozzle temperature when printing") };
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
@ -2862,7 +2862,7 @@ void TabFilament::toggle_options()
toggle_line("pressure_advance", true);
toggle_option("pressure_advance", m_config->opt_bool("enable_pressure_advance", 0));
}
toggle_line("chamber_temperature", !is_BBL_printer);
toggle_line("chamber_temperatures", !is_BBL_printer);
for (auto el :
{"cool_plate_temp", "cool_plate_temp_initial_layer", "eng_plate_temp", "eng_plate_temp_initial_layer", "textured_plate_temp", "textured_plate_temp_initial_layer"})
toggle_line(el, is_BBL_printer);