ENH: generate wipe tower when custom change gcode filament

Change-Id: Ia0c81453f09457a9d1d56fbcdce79112953c0208
This commit is contained in:
zhimin.zeng authored and Lane.Wei committed 2023-01-10 19:08:26 +08:00
1 parent 75c5d7b267
commit 4284d2ddb0
10 files changed
+58 -11

No files matched your search

+9 -1
View File
@@ -327,10 +327,18 @@ std::vector<unsigned int> Print::support_material_extruders() const
}
// returns 0-based indices of used extruders
std::vector<unsigned int> Print::extruders() const
std::vector<unsigned int> Print::extruders(bool conside_custom_gcode) const
{
std::vector<unsigned int> extruders = this->object_extruders();
append(extruders, this->support_material_extruders());
if (conside_custom_gcode) {
for (auto item : m_model.custom_gcode_per_print_z.gcodes) {
if (item.type == CustomGCode::Type::ToolChange)
extruders.push_back((unsigned int)item.extruder);
}
}
sort_remove_duplicates(extruders);
return extruders;
}