Merge branch 'merge-upstream'

Signed-off-by: SoftFever <softfeverever@gmail.com>

# Conflicts:
#	src/libslic3r/Preset.cpp
#	src/libslic3r/PrintConfig.cpp
#	src/libslic3r/PrintConfig.hpp
This commit is contained in:
SoftFever 2023-09-30 08:44:32 +08:00
commit 59bab91da9
579 changed files with 23269 additions and 11097 deletions

View file

@ -109,39 +109,6 @@ void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPri
}
}
void ConfigManipulation::check_bed_temperature_difference(int bed_type, DynamicPrintConfig* config)
{
if (is_msg_dlg_already_exist)
return;
if (config->has("bed_temperature_difference") && config->has("temperature_vitrification")) {
int bed_temp_difference = config->opt_int("bed_temperature_difference", 0);
int vitrification = config->opt_int("temperature_vitrification", 0);
const ConfigOptionInts* bed_temp_1st_layer_opt = config->option<ConfigOptionInts>(get_bed_temp_1st_layer_key((BedType)bed_type));
const ConfigOptionInts* bed_temp_opt = config->option<ConfigOptionInts>(get_bed_temp_key((BedType)bed_type));
if (bed_temp_1st_layer_opt != nullptr && bed_temp_opt != nullptr) {
int first_layer_bed_temp = bed_temp_1st_layer_opt->get_at(0);
int bed_temp = bed_temp_opt->get_at(0);
if (first_layer_bed_temp - bed_temp > bed_temp_difference) {
const wxString msg_text = wxString::Format(_L("Bed temperature of other layer is lower than bed temperature of initial layer for more than %d degree centigrade.\nThis may cause model broken free from build plate during printing"), bed_temp_difference);
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;
}
if (first_layer_bed_temp > vitrification || bed_temp > vitrification) {
const wxString msg_text = wxString::Format(
_L("Bed temperature is higher than vitrification temperature of this filament.\nThis may cause nozzle blocked and printing failure\nPlease keep the printer open during the printing process to ensure air circulation or reduce the temperature of the hot bed"));
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::check_filament_max_volumetric_speed(DynamicPrintConfig *config)
{
@ -163,6 +130,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
@ -285,6 +278,12 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
config->opt_enum<TimelapseType>("timelapse_type") == TimelapseType::tlTraditional))
{
wxString msg_text = _(L("Spiral mode only works when wall loops is 1, support is disabled, top shell layers is 0, sparse infill density is 0 and timelapse type is traditional."));
auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) {
msg_text += _(L(" But machines with I3 structure will not generate timelapse videos."));
}
if (is_global_config)
msg_text += "\n\n" + _(L("Change these settings automatically? \n"
"Yes - Change these settings and enable spiral mode automatically\n"