mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-05 20:56:02 +08:00
ENH: update the ext mapping logic
jira: [STUDIO-11970] Change-Id: Id4cd04da942c5457f0b17877a07c0e24b9c585ec
This commit is contained in:
parent
012b6f2395
commit
09d8050037
@ -1359,7 +1359,7 @@ void AmsMapingPopup::add_ext_ams_mapping(TrayData tray_data, MappingItem* item)
|
||||
}
|
||||
|
||||
item->Bind(wxEVT_LEFT_DOWN, [this, tray_data, item](wxMouseEvent& e) {
|
||||
if (!is_match_material(tray_data.filament_type)) return;
|
||||
if (m_ext_mapping_filatype_check && !is_match_material(tray_data.filament_type)) return;
|
||||
item->send_event(m_current_filament_id);
|
||||
Dismiss();
|
||||
});
|
||||
|
@ -207,6 +207,7 @@ class AmsMapingPopup : public PopupWindow
|
||||
{
|
||||
bool m_use_in_sync_dialog = false;
|
||||
bool m_ams_remain_detect_flag = false;
|
||||
bool m_ext_mapping_filatype_check = true;
|
||||
wxStaticText* m_title_text{ nullptr };
|
||||
|
||||
public:
|
||||
@ -288,6 +289,8 @@ public:
|
||||
public:
|
||||
void msw_rescale();
|
||||
|
||||
void EnableExtMappingFilaTypeCheck(bool to_check = true) { m_ext_mapping_filatype_check = to_check;} ;
|
||||
|
||||
private:
|
||||
ResetCallback m_reset_callback{nullptr};
|
||||
std::string m_material_index;
|
||||
|
@ -77,6 +77,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
||||
, m_mapping_tip_popup(AmsMapingTipPopup(this))
|
||||
, m_mapping_tutorial_popup(AmsTutorialPopup(this))
|
||||
{
|
||||
m_mapping_popup.EnableExtMappingFilaTypeCheck(false);
|
||||
|
||||
init_machine_bed_types();
|
||||
#ifdef __WINDOWS__
|
||||
SetDoubleBuffered(true);
|
||||
@ -1961,9 +1963,38 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
MachineObject* obj_ = dev->get_selected_machine();
|
||||
if (!obj_) return;
|
||||
|
||||
|
||||
std::vector<ConfirmBeforeSendInfo> confirm_text;
|
||||
|
||||
// check more than one using in same external spool
|
||||
std::unordered_set<string> main_external_spool_filas;
|
||||
std::unordered_set<string> deputy_external_spool_filas;
|
||||
for (const auto& mapping_info : m_ams_mapping_result) {
|
||||
if (mapping_info.ams_id == VIRTUAL_AMS_MAIN_ID_STR){
|
||||
main_external_spool_filas.insert(mapping_info.filament_id);
|
||||
} else if (mapping_info.ams_id == VIRTUAL_AMS_DEPUTY_ID_STR) {
|
||||
deputy_external_spool_filas.insert(mapping_info.filament_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (main_external_spool_filas.size() > 1 || deputy_external_spool_filas.size() > 1) {
|
||||
confirm_text.push_back(ConfirmBeforeSendInfo(_L("More than one filament types have been mapped to the same external spool, which may cause printing issues. The printer won't pause during printing.")));
|
||||
has_slice_warnings = true;
|
||||
} else {
|
||||
//check filaments type in external spool
|
||||
for (const auto& mapping_info : m_ams_mapping_result) {
|
||||
if (mapping_info.ams_id != VIRTUAL_AMS_MAIN_ID_STR && mapping_info.ams_id != VIRTUAL_AMS_DEPUTY_ID_STR) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& mapped_fila_id = obj_->get_filament_id(mapping_info.ams_id, mapping_info.slot_id);
|
||||
if (!mapped_fila_id.empty() && (mapped_fila_id != mapping_info.filament_id)) {
|
||||
confirm_text.push_back(ConfirmBeforeSendInfo(_L("The filament type setting of external spool is different from the filament in the slicing file.")));
|
||||
has_slice_warnings = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check Printer Model Id
|
||||
bool is_same_printer_type = is_same_printer_model();
|
||||
if (!is_same_printer_type && (m_print_type == PrintFromType::FROM_NORMAL)) {
|
||||
@ -1971,7 +2002,6 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
has_slice_warnings = true;
|
||||
}
|
||||
|
||||
|
||||
//check blacklist
|
||||
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user