This commit is contained in:
Enrico Turri 2020-01-16 16:03:14 +01:00
commit 46819224ee
2 changed files with 9 additions and 7 deletions

View File

@ -146,11 +146,6 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
this->fill_wipe_tower_partitions(print.config(), object_bottom_z); this->fill_wipe_tower_partitions(print.config(), object_bottom_z);
this->collect_extruder_statistics(prime_multi_material); this->collect_extruder_statistics(prime_multi_material);
// Assign custom G-code actions from Model::custom_gcode_per_print_z to their respecive layers,
// ignoring the extruder switches, which were processed above, and ignoring color changes for extruders,
// that do not print above their respective print_z.
this->assign_custom_gcodes(print);
} }
void ToolOrdering::initialize_layers(std::vector<coordf_t> &zs) void ToolOrdering::initialize_layers(std::vector<coordf_t> &zs)

View File

@ -242,11 +242,10 @@ private:
struct WipeTowerData struct WipeTowerData
{ {
WipeTowerData(ToolOrdering &tool_ordering) : tool_ordering(tool_ordering) { clear(); }
// Following section will be consumed by the GCodeGenerator. // Following section will be consumed by the GCodeGenerator.
// Tool ordering of a non-sequential print has to be known to calculate the wipe tower. // Tool ordering of a non-sequential print has to be known to calculate the wipe tower.
// Cache it here, so it does not need to be recalculated during the G-code generation. // Cache it here, so it does not need to be recalculated during the G-code generation.
ToolOrdering tool_ordering; ToolOrdering &tool_ordering;
// Cache of tool changes per print layer. // Cache of tool changes per print layer.
std::unique_ptr<std::vector<WipeTower::ToolChangeResult>> priming; std::unique_ptr<std::vector<WipeTower::ToolChangeResult>> priming;
std::vector<std::vector<WipeTower::ToolChangeResult>> tool_changes; std::vector<std::vector<WipeTower::ToolChangeResult>> tool_changes;
@ -267,6 +266,14 @@ struct WipeTowerData
depth = 0.f; depth = 0.f;
brim_width = 0.f; brim_width = 0.f;
} }
private:
// Only allow the WipeTowerData to be instantiated internally by Print,
// as this WipeTowerData shares reference to Print::m_tool_ordering.
friend class Print;
WipeTowerData(ToolOrdering &tool_ordering) : tool_ordering(tool_ordering) { clear(); }
WipeTowerData(const WipeTowerData & /* rhs */) = delete;
WipeTowerData &operator=(const WipeTowerData & /* rhs */) = delete;
}; };
struct PrintStatistics struct PrintStatistics