diff --git a/resources/info/filament_info.json b/resources/info/filament_info.json index 1f11536da..baa5473a1 100644 --- a/resources/info/filament_info.json +++ b/resources/info/filament_info.json @@ -1,5 +1,5 @@ { - "version": "1.0.0.3", + "version": "1.0.0.4", "high_temp_filament": [ "ABS", "ASA", @@ -25,12 +25,12 @@ "PLA-AERO", "PVA", "BVOH", - "PCTG" + "PCTG", + "PETG", + "PETG-CF" ], "high_low_compatible_filament":[ "HIPS", - "PETG", - "PETG-CF", "PE", "PP", "EVA", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index a6dacfa0e..f18f1d5e3 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -991,22 +991,29 @@ static StringObjectException layered_print_cleareance_valid(const Print &print, return {}; } -bool Print::check_multi_filaments_compatibility(const std::vector& filament_types) +FilamentCompatibilityType Print::check_multi_filaments_compatibility(const std::vector& filament_types) { bool has_high_temperature_filament = false; bool has_low_temperature_filament = false; + bool has_mid_temperature_filament = false; for (const auto& type : filament_types) { if (get_filament_temp_type(type) ==FilamentTempType::HighTemp) has_high_temperature_filament = true; else if (get_filament_temp_type(type) == FilamentTempType::LowTemp) has_low_temperature_filament = true; + else if (get_filament_temp_type(type) == FilamentTempType::HighLowCompatible) + has_mid_temperature_filament = true; } if (has_high_temperature_filament && has_low_temperature_filament) - return false; - - return true; + return FilamentCompatibilityType::HighLowMixed; + else if (has_high_temperature_filament && has_mid_temperature_filament) + return FilamentCompatibilityType::HighMidMixed; + else if (has_low_temperature_filament && has_mid_temperature_filament) + return FilamentCompatibilityType::LowMidMixed; + else + return FilamentCompatibilityType::Compatible; } bool Print::is_filaments_compatible(const std::vector& filament_types) @@ -1050,21 +1057,38 @@ int Print::get_compatible_filament_type(const std::set& filament_types) //BBS: this function is used to check whether multi filament can be printed StringObjectException Print::check_multi_filament_valid(const Print& print) { - if (!print.need_check_multi_filaments_compatibility()) - return {std::string()}; - auto print_config = print.config(); std::vector extruders = print.extruders(); std::vector filament_types; filament_types.reserve(extruders.size()); - for (const auto& extruder_idx : extruders) filament_types.push_back(print_config.filament_type.get_at(extruder_idx)); - if (!check_multi_filaments_compatibility(filament_types)) - return { L("Can not print multiple filaments which have large difference of temperature together. Otherwise, the extruder and nozzle may be blocked or damaged during printing") }; + auto compatibility = check_multi_filaments_compatibility(filament_types); + bool enable_mix_printing = !print.need_check_multi_filaments_compatibility(); - return {std::string()}; + StringObjectException ret; + + if(compatibility == FilamentCompatibilityType::HighLowMixed){ + if(enable_mix_printing){ + ret.string =L("Printing high-temp and low-temp filaments together may cause nozzle clogging or printer damage."); + ret.is_warning = true; + } + else{ + ret.string =L("Printing high-temp and low-temp filaments together may cause nozzle clogging or printer damage. If you still want to print, you can enable the option in Preferences."); + } + } + else if (compatibility == FilamentCompatibilityType::HighMidMixed) { + ret.is_warning = true; + ret.string =L("Printing high-temp and mid-temp filaments together may cause nozzle clogging or printer damage."); + + } + else if (compatibility == FilamentCompatibilityType::LowMidMixed) { + ret.is_warning = true; + ret.string = L("Printing mid-temp and low-temp filaments together may cause nozzle clogging or printer damage."); + } + + return ret; } // Precondition: Print::validate() requires the Print::apply() to be called its invocation. @@ -1084,6 +1108,10 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons* if (!ret.string.empty()) { ret.type = STRING_EXCEPT_FILAMENTS_DIFFERENT_TEMP; + if (ret.is_warning && warning != nullptr) { + *warning = ret; + return {}; + } return ret; } } diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 3977c6dc0..7661764d6 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -784,6 +784,14 @@ enum FilamentTempType { HighLowCompatible, Undefine }; + +enum FilamentCompatibilityType { + Compatible, + HighLowMixed, + HighMidMixed, + LowMidMixed +}; + // The complete print tray with possibly multiple objects. class Print : public PrintBaseWithState { @@ -980,7 +988,7 @@ public: Vec2d translate_to_print_space(const Point& point) const; static FilamentTempType get_filament_temp_type(const std::string& filament_type); static int get_hrc_by_nozzle_type(const NozzleType& type); - static bool check_multi_filaments_compatibility(const std::vector& filament_types); + static FilamentCompatibilityType check_multi_filaments_compatibility(const std::vector& filament_types); // similar to check_multi_filaments_compatibility, but the input is int, and may be negative (means unset) static bool is_filaments_compatible(const std::vector& types); // get the compatible filament type of a multi-material object diff --git a/src/libslic3r/PrintBase.hpp b/src/libslic3r/PrintBase.hpp index 912321ded..611ca5165 100644 --- a/src/libslic3r/PrintBase.hpp +++ b/src/libslic3r/PrintBase.hpp @@ -33,6 +33,7 @@ struct StringObjectException ObjectBase const *object = nullptr; std::string opt_key; StringExceptionType type; // warning type for tips + bool is_warning = false; std::vector params; // warning params for tips }; diff --git a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp index 91a02fb69..049e5e1f7 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -1562,7 +1562,7 @@ bool CalibrationPresetPage::is_filaments_compatiable(const std::map