ENH: add protection for chamber temperature

As title. Also add time for waiting chamber temp in printing time

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I8054080d2e8821e421a6d03222b8b25365b5977f
This commit is contained in:
xun.zhang 2023-08-15 14:19:31 +08:00 committed by Lane.Wei
parent b16fc2a38b
commit 13bb1552aa
6 changed files with 48 additions and 3 deletions

View file

@ -162,6 +162,32 @@ void ConfigManipulation::check_filament_max_volumetric_speed(DynamicPrintConfig
}
void ConfigManipulation::check_chamber_temperature(DynamicPrintConfig* config)
{
const static std::map<std::string, int>recommend_temp_map = {
{"PLA",45},
{"PLA-CF",45},
{"PVA",45},
{"TPU",50},
{"PETG",55},
{"PETG-CF",55}
};
bool support_chamber_temp_control=GUI::wxGetApp().preset_bundle->printers.get_selected_preset().config.opt_bool("support_chamber_temp_control");
if (support_chamber_temp_control&&config->has("chamber_temperatures")) {
std::string filament_type = config->option<ConfigOptionStrings>("filament_type")->get_at(0);
auto iter = recommend_temp_map.find(filament_type);
if (iter!=recommend_temp_map.end()) {
if (iter->second < config->option<ConfigOptionInts>("chamber_temperatures")->get_at(0)) {
wxString msg_text = wxString::Format(_L("Current chamber temperature is higher than the material's safe temperature,it may result in material softening and clogging.The maximum safe temperature for the material is %d"), iter->second);
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
is_msg_dlg_already_exist = true;
dialog.ShowModal();
is_msg_dlg_already_exist = false;
}
}
}
}
void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config)
{
// #ys_FIXME_to_delete

View file

@ -78,6 +78,7 @@ public:
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config);
void check_bed_temperature_difference(int bed_type, DynamicPrintConfig* config);
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
void check_chamber_temperature(DynamicPrintConfig* config);
void set_is_BBL_Printer(bool is_bbl_printer) { is_BBL_Printer = is_bbl_printer; };
// SLA print
void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false);

View file

@ -2696,6 +2696,9 @@ 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_temperatures") {
m_config_manipulation.check_chamber_temperature(&filament_config);
}
on_value_change(opt_key, value);
};
@ -2866,7 +2869,7 @@ void TabFilament::toggle_options()
toggle_option(el, has_enable_overhang_bridge_fan);
bool support_air_filtration = this->m_preset_bundle->printers.get_selected_preset().config.opt_bool("support_air_filtration");
toggle_line("activate_air_filtration",support_air_filtration);
toggle_line("activate_air_filtration",is_BBL_printer && support_air_filtration);
for (auto elem : { "during_print_exhaust_fan_speed","complete_print_exhaust_fan_speed" })
toggle_line(elem, m_config->opt_bool("activate_air_filtration",0));
@ -2884,7 +2887,7 @@ void TabFilament::toggle_options()
}
bool support_chamber_temp_control = this->m_preset_bundle->printers.get_selected_preset().config.opt_bool("support_chamber_temp_control");
toggle_line("chamber_temperatures", support_chamber_temp_control);
toggle_line("chamber_temperatures", is_BBL_printer&&support_chamber_temp_control);
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"})