mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
ENH:optimize the switching of multiple AMS and vams
Change-Id: I031e3248164aa2fc243c6ebf7418c535119e7ffc
This commit is contained in:
parent
7481da52d6
commit
d9395e6405
3 changed files with 46 additions and 23 deletions
|
@ -556,9 +556,19 @@ AmsTray *MachineObject::get_curr_tray()
|
|||
Ams* curr_ams = get_curr_Ams();
|
||||
if (!curr_ams) return nullptr;
|
||||
|
||||
auto it = curr_ams->trayList.find(m_tray_now);
|
||||
if (it != curr_ams->trayList.end())
|
||||
return it->second;
|
||||
try {
|
||||
int tray_index = atoi(m_tray_now.c_str());
|
||||
int ams_index = atoi(curr_ams->id.c_str());
|
||||
|
||||
std::string tray_now_index = std::to_string(tray_index - ams_index * 4);
|
||||
auto it = curr_ams->trayList.find(tray_now_index);
|
||||
if (it != curr_ams->trayList.end())
|
||||
return it->second;
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue