diff --git a/resources/info/filament_info.json b/resources/info/filament_info.json index bd82c0d534..82923dfa8a 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", @@ -26,12 +26,12 @@ "PVA", "BVOH", "PCTG", + "PETG", + "PETG-CF", "SBS" ], "high_low_compatible_filament":[ "HIPS", - "PETG", - "PETG-CF", "PE", "PP", "EVA", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index bfaa5db343..0544fcfb51 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1006,22 +1006,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) @@ -1065,21 +1072,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("Cannot 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; } // Orca: this g92e0 regex is used copied from PrusaSlicer @@ -1104,6 +1128,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 efa555f9e9..72b4727e2a 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -870,6 +870,14 @@ enum FilamentTempType { HighLowCompatible, Undefine }; + +enum FilamentCompatibilityType { + Compatible, + HighLowMixed, + HighMidMixed, + LowMidMixed +}; + // The complete print tray with possibly multiple objects. class Print : public PrintBaseWithState { @@ -1072,7 +1080,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 55ac09c130..21092ff257 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 44d9add6ea..c737b74076 100644 --- a/src/slic3r/GUI/CalibrationWizardPresetPage.cpp +++ b/src/slic3r/GUI/CalibrationWizardPresetPage.cpp @@ -1525,7 +1525,7 @@ bool CalibrationPresetPage::is_filaments_compatiable(const std::map