diff --git a/resources/printers/BL-P001.json b/resources/printers/BL-P001.json index da71fcb1e0..2c94f0d256 100644 --- a/resources/printers/BL-P001.json +++ b/resources/printers/BL-P001.json @@ -46,7 +46,8 @@ "support_chamber": true, "support_chamber_temp_edit": false, "support_extrusion_cali": false, - "support_user_preset": false + "support_user_preset": false, + "support_ams_ext_mix_print": true }, "model_id": "BL-P001", "compatible_machine": [ "BL-P002", "C11", "C12", "C13" ], diff --git a/resources/printers/BL-P002.json b/resources/printers/BL-P002.json index 2ab18e94df..8df95d573e 100644 --- a/resources/printers/BL-P002.json +++ b/resources/printers/BL-P002.json @@ -46,7 +46,8 @@ "support_chamber": true, "support_chamber_temp_edit": false, "support_extrusion_cali": false, - "support_user_preset": false + "support_user_preset": false, + "support_ams_ext_mix_print": true }, "model_id": "BL-P002", "auto_pa_cali_thumbnail_image": "fd_calibration_auto", diff --git a/resources/printers/C11.json b/resources/printers/C11.json index c8fbedda23..fa1d729b3f 100644 --- a/resources/printers/C11.json +++ b/resources/printers/C11.json @@ -41,7 +41,8 @@ "support_chamber_temp_edit": false, "support_extrusion_cali": true, "support_user_preset": false, - "bed_temperature_limit": 100 + "bed_temperature_limit": 100, + "support_ams_ext_mix_print": true }, "model_id": "C11", "support_wrapping_detection": false, diff --git a/resources/printers/C12.json b/resources/printers/C12.json index 935223f176..121a1002af 100644 --- a/resources/printers/C12.json +++ b/resources/printers/C12.json @@ -41,7 +41,8 @@ "support_chamber_temp_edit": false, "support_extrusion_cali": true, "support_user_preset": false, - "bed_temperature_limit": 100 + "bed_temperature_limit": 100, + "support_ams_ext_mix_print": true }, "model_id": "C12", "support_wrapping_detection": false, diff --git a/resources/printers/C13.json b/resources/printers/C13.json index ff78eb3d64..47e7624bc3 100644 --- a/resources/printers/C13.json +++ b/resources/printers/C13.json @@ -50,7 +50,8 @@ "support_extrusion_cali": false, "support_user_preset": false, "bed_temperature_limit": 110, - "nozzle_max_temperature": 320 + "nozzle_max_temperature": 320, + "support_ams_ext_mix_print": true }, "model_id": "C13", "support_wrapping_detection": false, diff --git a/resources/printers/N1.json b/resources/printers/N1.json index 579f1a0732..877e1fbb1c 100644 --- a/resources/printers/N1.json +++ b/resources/printers/N1.json @@ -41,7 +41,8 @@ "support_chamber_temp_edit": false, "support_extrusion_cali": true, "support_user_preset": false, - "bed_temperature_limit": 80 + "bed_temperature_limit": 80, + "support_ams_ext_mix_print": false }, "model_id": "N1", "support_wrapping_detection": false, diff --git a/resources/printers/N2S.json b/resources/printers/N2S.json index 53de2333b4..fc97d41601 100644 --- a/resources/printers/N2S.json +++ b/resources/printers/N2S.json @@ -41,7 +41,8 @@ "support_chamber_temp_edit": false, "support_extrusion_cali": true, "support_user_preset": false, - "bed_temperature_limit": 100 + "bed_temperature_limit": 100, + "support_ams_ext_mix_print": false }, "model_id": "N2S", "compatible_machine": [], diff --git a/resources/printers/O1D.json b/resources/printers/O1D.json index 33661c1fa9..97a8700c37 100644 --- a/resources/printers/O1D.json +++ b/resources/printers/O1D.json @@ -60,7 +60,8 @@ "support_chamber_temp_switch_heating": 40, "support_extrusion_cali": false, "support_user_preset": false, - "support_refresh_nozzle": true + "support_refresh_nozzle": true, + "support_ams_ext_mix_print": true }, "model_id": "O1D", "support_wrapping_detection": true, diff --git a/resources/printers/O1E.json b/resources/printers/O1E.json index 922c138089..9371e7cb47 100644 --- a/resources/printers/O1E.json +++ b/resources/printers/O1E.json @@ -59,7 +59,8 @@ "support_chamber_temp_edit_range": [ 0, 65 ], "support_chamber_temp_switch_heating": 40, "support_extrusion_cali": false, - "support_user_preset": false + "support_user_preset": false, + "support_ams_ext_mix_print": true }, "model_id": "O1E", "support_wrapping_detection": true, diff --git a/resources/printers/O1S.json b/resources/printers/O1S.json index cd1204e927..5cc4b7933f 100644 --- a/resources/printers/O1S.json +++ b/resources/printers/O1S.json @@ -58,7 +58,8 @@ "support_chamber_temp_edit_range": [0, 65], "support_chamber_temp_switch_heating": 40, "support_extrusion_cali": false, - "support_user_preset": false + "support_user_preset": false, + "support_ams_ext_mix_print": true }, "model_id": "O1S", "auto_pa_cali_thumbnail_image": "fd_calibration_auto_single_o", diff --git a/src/slic3r/GUI/AmsMappingPopup.hpp b/src/slic3r/GUI/AmsMappingPopup.hpp index 9a06bca0d0..92e72218d9 100644 --- a/src/slic3r/GUI/AmsMappingPopup.hpp +++ b/src/slic3r/GUI/AmsMappingPopup.hpp @@ -225,7 +225,6 @@ public: std::vector m_mapping_item_list; bool m_has_unmatch_filament {false}; - bool m_supporting_mix_print {false}; //For single extruder, can ams and ext print together? int m_current_filament_id; ShowType m_show_type{ShowType::RIGHT}; std::string m_tag_material; diff --git a/src/slic3r/GUI/DeviceCore/DevConfigUtil.h b/src/slic3r/GUI/DeviceCore/DevConfigUtil.h index 6add560f7d..c57bf10580 100644 --- a/src/slic3r/GUI/DeviceCore/DevConfigUtil.h +++ b/src/slic3r/GUI/DeviceCore/DevConfigUtil.h @@ -71,6 +71,9 @@ public: /*extruder*/ static bool get_printer_can_set_nozzle(std::string type_str) { return get_value_from_config(type_str, "enable_set_nozzle_info"); }// can set nozzle from studio + /*print job*/ + static bool support_ams_ext_mix_print(std::string type_str) { return get_value_from_config(type_str, "print", "support_ams_ext_mix_print"); } + /*calibration*/ static std::vector get_unsupport_auto_cali_filaments(std::string type_str) { return get_value_from_config>(type_str, "auto_cali_not_support_filaments"); } @@ -103,6 +106,25 @@ public: return T(); }; + template + static T get_value_from_config(const std::string& type_str, const std::string& item1, const std::string& item2) + { + try + { + const auto& json_item1 = get_value_from_config(type_str, item1); + if (json_item1.contains(item2)) + { + return json_item1[item2].get(); + } + } + catch (...) + { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " failed to get " << item1 << ", " << item2; + } + + return T(); + } + static nlohmann::json get_json_from_config(const std::string& type_str, const std::string& key1, const std::string& key2 = std::string()) { std::string config_file = m_resource_file_path + "/printers/" + type_str + ".json"; diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 031f3ec8cc..f0218431fe 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -3405,12 +3405,12 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_) } } - if (!m_mapping_popup.m_supporting_mix_print && nozzle_nums == 1) { + if (!DevPrinterConfigUtil::support_ams_ext_mix_print(obj_->printer_type)) { bool useAms = _HasAms(m_ams_mapping_result); bool useExt = _HasExt(m_ams_mapping_result); if (useAms && useExt) { - show_status(PrintDialogStatus::PrintStatusAmsMappingMixInvalid); - return; + show_status(PrintDialogStatus::PrintStatusAmsMappingMixInvalid); + return; } } diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index 5c17a81a20..269150ef85 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -2392,19 +2392,6 @@ void SyncAmsInfoDialog::update_show_status() } } - if (!m_mapping_popup.m_supporting_mix_print && nozzle_nums == 1) { - bool useAms = false; - bool useExt = false; - for (auto iter = m_ams_mapping_result.begin(); iter != m_ams_mapping_result.end(); iter++) { - if (iter->tray_id != VIRTUAL_TRAY_MAIN_ID) { useAms = true; } - if (iter->tray_id == VIRTUAL_TRAY_MAIN_ID) { useExt = true; } - if (useAms && useExt) { - show_status(PrintDialogStatus::PrintStatusAmsMappingMixInvalid); - return; - } - } - } - // check ams and vt_slot mix use status { struct ExtruderStatus