ENH: seperate wipe tower weight from model

jira:STUDIO-4353

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ia8a030314ab995c57a0990d08a966382f6f0eecc
This commit is contained in:
xun.zhang
2023-09-12 11:51:53 +08:00
committed by Lane.Wei
parent 394a602e8f
commit 81bab138b5
5 changed files with 176 additions and 47 deletions

View File

@@ -1002,6 +1002,21 @@ namespace DoExport {
total_cost += weight * extruder->filament_cost() * 0.001;
}
for (auto volume : result.print_statistics.wipe_tower_volumes_per_extruder) {
total_extruded_volume += volume.second;
size_t extruder_id = volume.first;
auto extruder = std::find_if(extruders.begin(), extruders.end(), [extruder_id](const Extruder& extr) {return extr.id() == extruder_id; });
if (extruder == extruders.end())
continue;
double s = PI * sqr(0.5* extruder->filament_diameter());
double weight = volume.second * extruder->filament_density() * 0.001;
total_used_filament += volume.second/s;
total_weight += weight;
total_cost += weight * extruder->filament_cost() * 0.001;
}
print_statistics.total_extruded_volume = total_extruded_volume;
print_statistics.total_used_filament = total_used_filament;
print_statistics.total_weight = total_weight;