diff --git a/src/slic3r/GUI/DeviceCore/DevMapping.cpp b/src/slic3r/GUI/DeviceCore/DevMapping.cpp index e655f12db7..af3539f372 100644 --- a/src/slic3r/GUI/DeviceCore/DevMapping.cpp +++ b/src/slic3r/GUI/DeviceCore/DevMapping.cpp @@ -354,6 +354,27 @@ namespace Slic3r } } + // Orca: special cases that no AMS available, we select ext slot automatically because we don't have other choice anyway + if (tray_filaments.size() == 1 && devPrinterUtil::IsVirtualSlot(tray_filaments.begin()->first)) { + auto ext_tray = tray_filaments.begin(); + for (auto & r : result) { + if (r.tray_id < 0) { + r.tray_id = ext_tray->first; + + r.color = ext_tray->second.color; + r.type = ext_tray->second.type; + r.distance = ext_tray->second.distance; + r.filament_id = ext_tray->second.filament_id; + r.ctype = ext_tray->second.ctype; + r.colors = ext_tray->second.colors; + + /*for new ams mapping*/ + r.ams_id = ext_tray->second.ams_id; + r.slot_id = ext_tray->second.slot_id; + } + } + } + //check ams mapping result if (DevMappingUtil::is_valid_mapping_result(obj, result, true)) { diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 5454c62ca9..99e903dded 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -291,7 +291,6 @@ public: bool is_target_slot_unload() const; bool can_unload_filament(); - bool is_support_amx_ext_mix_mapping() const { return true;} void get_ams_colors(std::vector& ams_colors); diff --git a/src/slic3r/GUI/PrePrintChecker.cpp b/src/slic3r/GUI/PrePrintChecker.cpp index ef9c1447bb..7f21bc90a9 100644 --- a/src/slic3r/GUI/PrePrintChecker.cpp +++ b/src/slic3r/GUI/PrePrintChecker.cpp @@ -53,6 +53,7 @@ std::string PrePrintChecker::get_print_status_info(PrintDialogStatus status) case PrintStatusFilamentWarningHighChamberTempCloseDoor: return "PrintStatusFilamentWarningHighChamberTempCloseDoor"; case PrintStatusFilamentWarningHighChamberTempSoft: return "PrintStatusFilamentWarningHighChamberTempSoft"; case PrintStatusFilamentWarningUnknownHighChamberTempSoft: return "PrintStatusFilamentWarningUnknownHighChamberTempSoft"; + case PrintStatusWarningExtFilamentNotMatch: return "PrintStatusWarningExtFilamentNotMatch"; case PrintStatusReadingFinished: return "PrintStatusReadingFinished"; case PrintStatusSendingCanceled: return "PrintStatusSendingCanceled"; case PrintStatusAmsMappingSuccess: return "PrintStatusAmsMappingSuccess"; @@ -92,6 +93,7 @@ wxString PrePrintChecker::get_pre_state_msg(PrintDialogStatus status) case PrintStatusWarningKvalueNotUsed: return _L("Set dynamic flow calibration to 'OFF' to enable custom dynamic flow value."); case PrintStatusNotSupportedPrintAll: return _L("This printer does not support printing all plates."); case PrintStatusColorQuantityExceed: return _L("The current firmware supports a maximum of 16 materials. You can either reduce the number of materials to 16 or fewer on the Preparation Page, or try updating the firmware. If you are still restricted after the update, please wait for subsequent firmware support."); + case PrintStatusWarningExtFilamentNotMatch: return _L("The type of external filament is unknown or does not match with the filament type in the slicing file. Please make sure you have installed the correct filament in the external spool."); } return wxEmptyString; } diff --git a/src/slic3r/GUI/PrePrintChecker.hpp b/src/slic3r/GUI/PrePrintChecker.hpp index feac610628..8e4d4ed3f4 100644 --- a/src/slic3r/GUI/PrePrintChecker.hpp +++ b/src/slic3r/GUI/PrePrintChecker.hpp @@ -99,6 +99,7 @@ enum PrintDialogStatus : unsigned int { PrintStatusFilamentWarningHighChamberTempCloseDoor, PrintStatusFilamentWarningHighChamberTempSoft, PrintStatusFilamentWarningUnknownHighChamberTempSoft, + PrintStatusWarningExtFilamentNotMatch, PrintStatusFilamentWarningEnd, PrintStatusWarningEnd,//->end error<- diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 59c9956bd9..1d88bbc235 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1092,23 +1092,13 @@ bool SelectMachineDialog::do_ams_mapping(MachineObject *obj_,bool use_ams) //single nozzle else { - if (obj_->is_support_amx_ext_mix_mapping()){ - map_opt = { false, true, false, false }; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext - if (!use_ams) { - map_opt[1] = false; - map_opt[3] = true; - } - filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt); - //auto_supply_with_ext(obj_->vt_slot); - } - else { - map_opt = { false, true, false, false }; - if (!use_ams) { - map_opt[1] = false; - map_opt[3] = true; - } - filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt); + map_opt = { false, true, false, false }; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext + if (!use_ams) { + map_opt[1] = false; + map_opt[3] = true; } + filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt); + //auto_supply_with_ext(obj_->vt_slot); } if (filament_result == 0) { @@ -1147,7 +1137,7 @@ bool SelectMachineDialog::do_ams_mapping(MachineObject *obj_,bool use_ams) return true; } -bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str, std::string& mapping_array_str2, std::string &ams_mapping_info) +bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str, std::string& mapping_array_str2, std::string &ams_mapping_info) const { if (m_ams_mapping_result.empty()) return false; @@ -1438,7 +1428,7 @@ bool SelectMachineDialog::is_nozzle_type_match(DevExtderSystem data, wxString& e return true; } -int SelectMachineDialog::convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) +int SelectMachineDialog::convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) const { if (nozzle_id == (int)FilamentMapNozzleId::NOZZLE_LEFT) { return (int)CloudTaskNozzleId::NOZZLE_LEFT; @@ -1691,6 +1681,9 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorIsShown() && m_checkbox_list["flow_cali"]->getValue() == "auto") { const auto ¬_default_ams_names = _check_kval_not_default(obj_, m_ams_mapping_result); diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 302b37b553..f0e135f33e 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -500,12 +500,12 @@ public: bool Show(bool show); void show_init(); bool do_ams_mapping(MachineObject *obj_,bool use_ams); - bool get_ams_mapping_result(std::string& mapping_array_str, std::string& mapping_array_str2, std::string& ams_mapping_info); + bool get_ams_mapping_result(std::string& mapping_array_str, std::string& mapping_array_str2, std::string& ams_mapping_info) const; bool build_nozzles_info(std::string& nozzles_info); bool can_hybrid_mapping(DevExtderSystem data); void auto_supply_with_ext(std::vector slots); bool is_nozzle_type_match(DevExtderSystem data, wxString& error_message) const; - int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id); + int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) const; PrintFromType get_print_type() {return m_print_type;}; wxString format_steel_name(NozzleType type); diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index 4056d48fe5..bfb1e931be 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -1261,15 +1261,10 @@ bool SyncAmsInfoDialog::do_ams_mapping(MachineObject *obj_) } // single nozzle else { - if (obj_->is_support_amx_ext_mix_mapping()) { - map_opt = {false, true, false, true}; // four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext - filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt, std::vector(), - wxGetApp().app_config->get_bool("ams_sync_match_full_use_color_dist") ? false : true); - // auto_supply_with_ext(obj_->vt_slot); - } else { - map_opt = {false, true, false, false}; - filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt); - } + map_opt = {false, true, false, true}; // four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext + filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt, std::vector(), + wxGetApp().app_config->get_bool("ams_sync_match_full_use_color_dist") ? false : true); + // auto_supply_with_ext(obj_->vt_slot); } if (filament_result == 0) {