FIX: generate a wipe tower when add filament

STUDIO-2538

Change-Id: I8cca134eb9302b2ff30252ef36ed8c24c834b22c
(cherry picked from commit aeb5408c9eee844970bbef94e49978568c1de541)
This commit is contained in:
zhimin.zeng 2023-03-23 10:48:56 +08:00 committed by Lane.Wei
parent 8ebd6cfc9e
commit 872a54303c
2 changed files with 10 additions and 5 deletions

View file

@ -342,9 +342,10 @@ std::vector<unsigned int> Print::extruders(bool conside_custom_gcode) const
if (conside_custom_gcode) {
//BBS
int num_extruders = m_config.filament_colour.size();
for (auto plate_data : m_model.plates_custom_gcodes) {
for (auto item : plate_data.second.gcodes) {
if (item.type == CustomGCode::Type::ToolChange)
if (item.type == CustomGCode::Type::ToolChange && item.extruder <= num_extruders)
extruders.push_back((unsigned int)(item.extruder - 1));
}
}