ENH:fix mapping rules when printing from SD card

jira:[STUDIO-9699]

Change-Id: I6019875b312cd29d20d69c876d195e5da1a88d18
This commit is contained in:
tao wang 2025-01-10 22:09:40 +08:00 committed by lane.wei
parent 41c3289c24
commit 062d4745dd
2 changed files with 13 additions and 5 deletions

View File

@ -2321,7 +2321,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
}
confirm_dlg.on_show();
}
}
else
{
this->on_send_print();
@ -4200,7 +4200,6 @@ void SelectMachineDialog::set_default_from_sdcard()
m_sizer_ams_mapping_right->Layout();
m_filament_panel_right_sizer->Layout();
m_filament_right_panel->Layout();
m_mapping_popup.set_show_type(ShowType::LEFT_AND_RIGHT);
} else {
m_filament_left_panel->Hide();
@ -4209,7 +4208,6 @@ void SelectMachineDialog::set_default_from_sdcard()
m_sizer_ams_mapping->SetCols(8);
m_sizer_ams_mapping->Layout();
m_filament_panel_sizer->Layout();
m_mapping_popup.set_show_type(ShowType::RIGHT);
}
//init MaterialItem
@ -4252,7 +4250,7 @@ void SelectMachineDialog::set_default_from_sdcard()
}
item->Bind(wxEVT_LEFT_UP, [this, item, materials](wxMouseEvent& e) {});
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, fo](wxMouseEvent& e) {
item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, diameters_count, filament_map, fo](wxMouseEvent& e) {
MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) {
int id = iter->first;
@ -4278,6 +4276,16 @@ void SelectMachineDialog::set_default_from_sdcard()
pos.y += item->GetRect().height;
m_mapping_popup.Move(pos);
if (diameters_count > 1) {
if (obj_ && can_hybrid_mapping(obj_->m_extder_data)) {
m_mapping_popup.set_show_type(ShowType::LEFT_AND_RIGHT);
} else if (filament_map[m_current_filament_id] == 1) {
m_mapping_popup.set_show_type(ShowType::LEFT);
} else if (filament_map[m_current_filament_id] == 2) {
m_mapping_popup.set_show_type(ShowType::RIGHT);
}
}
if (obj_ &&
obj_->has_ams() &&
(m_checkbox_list["use_ams"]->getValue() == "on") &&

View File

@ -3994,7 +3994,7 @@ void AMSControl::SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadTy
if (model == EXT_AMS && ams->m_info.ext_type == AMSModelOriginType::GENERIC_EXT){
if (m_ams_info.size() == 0 && m_ext_info.size() == 1) {
left = true;
length = 49;
length = 50;
} else {
length = left ? 110 : 82;
}