ENH: add filament saved by multi extruder

1.Add filament flush,filament change count reduced by multi
extruder

NTOE: cases when printing by object haven't been handled

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Iaaea5f8ffae2345df5a6f1dc605342d835974d48
(cherry picked from commit ad65cdb909b29210117f690a119ef76b70373da4)
This commit is contained in:
xun.zhang
2024-07-22 20:09:58 +08:00
committed by Noisyfox
parent afac07c166
commit 067d1484ab
5 changed files with 97 additions and 5 deletions

View File

@@ -824,6 +824,17 @@ class ConstPrintRegionPtrsAdaptor : public ConstVectorOfPtrsAdaptor<PrintRegion>
};
*/
struct StatisticsByExtruderCount
{
// multi extruder always comes first
std::vector<int> filament_flush_weight{ 0,0 };
std::vector<int> filament_change_count{ 0,0 };
void clear() {
filament_flush_weight.clear();
filament_change_count.clear();
}
};
enum FilamentTempType {
HighTemp=0,
LowTemp,
@@ -929,6 +940,9 @@ public:
const PrintStatistics& print_statistics() const { return m_print_statistics; }
PrintStatistics& print_statistics() { return m_print_statistics; }
const StatisticsByExtruderCount statistics_by_extruder() const { return m_statistics_by_extruder_count; }
StatisticsByExtruderCount& statistics_by_extruder() { return m_statistics_by_extruder_count; }
// Wipe tower support.
bool has_wipe_tower() const;
const WipeTowerData& wipe_tower_data(size_t filaments_cnt = 0) const;
@@ -1060,6 +1074,7 @@ private:
// Estimated print time, filament consumed.
PrintStatistics m_print_statistics;
bool m_support_used {false};
StatisticsByExtruderCount m_statistics_by_extruder_count;
//BBS: plate's origin
Vec3d m_origin;