FIX: Ext auto fill when mapping item is empty

jira: [Ext auto fill]

Change-Id: I4a8844555e33fcf9f7054fc2e0e254621dec0a1d
(cherry picked from commit 8b4182d0c1de3e7f70fd1f17c032681f12af0045)
This commit is contained in:
hang.xu
2024-07-17 18:35:52 +08:00
committed by Noisyfox
parent cc4c03d76f
commit e5477ba206
3 changed files with 88 additions and 19 deletions

View File

@@ -914,7 +914,9 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
info.ams_id = ams->first.c_str();
info.slot_id = tray->first.c_str();
}
if ((!ext_first && !ext_second) || (ams->second->nozzle == 0 && ext_first) || (ams->second->nozzle == 1 && ext_second))
//first: left,nozzle=1,map=1 second: right,nozzle=0,map=2
if ((!ext_first && !ext_second) || (ams->second->nozzle == 0 && ext_second) || (ams->second->nozzle == 1 && ext_first))
{
tray_filaments.emplace(std::make_pair(tray_index, info));
}
@@ -925,7 +927,7 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
{
for (auto tray : vt_slot)
{
if ((tray.id == std::to_string(VIRTUAL_TRAY_MAIN_ID) && ext_first) || (tray.id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID) && ext_second))
if ((tray.id == std::to_string(VIRTUAL_TRAY_MAIN_ID) && ext_second) || (tray.id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID) && ext_first))
{
FilamentInfo info;