ENH: support mix mapping

jira: [STUDIO-13673]
Change-Id: Ic1c89457f5154c108dbab41850ed49561aa34fde
(cherry picked from commit 12942e0545424e2528cc3f3c9aa6947b76469b3d)
This commit is contained in:
xin.zhang
2025-08-20 14:06:36 +08:00
committed by Noisyfox
parent 964a35e9b0
commit 299b821c5f
14 changed files with 45 additions and 27 deletions

View File

@@ -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" ],

View File

@@ -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",

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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": [],

View File

@@ -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,

View File

@@ -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,

View File

@@ -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",

View File

@@ -225,7 +225,6 @@ public:
std::vector<MappingItem*> 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;

View File

@@ -71,6 +71,9 @@ public:
/*extruder*/
static bool get_printer_can_set_nozzle(std::string type_str) { return get_value_from_config<bool>(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<bool>(type_str, "print", "support_ams_ext_mix_print"); }
/*calibration*/
static std::vector<std::string> get_unsupport_auto_cali_filaments(std::string type_str) { return get_value_from_config<std::vector<std::string>>(type_str, "auto_cali_not_support_filaments"); }
@@ -103,6 +106,25 @@ public:
return T();
};
template<typename T>
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<nlohmann::json>(type_str, item1);
if (json_item1.contains(item2))
{
return json_item1[item2].get<T>();
}
}
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";

View File

@@ -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;
}
}

View File

@@ -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