mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
added total cost/weight to Extruder statistics, mocked up addendum to status bar change.
This commit is contained in:
parent
3846d9e734
commit
203a965b3d
5 changed files with 30 additions and 6 deletions
|
@ -321,8 +321,8 @@ sub export {
|
|||
$self->print->clear_filament_stats;
|
||||
$self->print->total_used_filament(0);
|
||||
$self->print->total_extruded_volume(0);
|
||||
my $total_filament_weight = 0.0;
|
||||
my $total_filament_cost = 0.0;
|
||||
$self->print->total_weight(0);
|
||||
$self->print->total_cost(0);
|
||||
foreach my $extruder (@{$gcodegen->writer->extruders}) {
|
||||
my $used_filament = $extruder->used_filament;
|
||||
my $extruded_volume = $extruder->extruded_volume;
|
||||
|
@ -333,11 +333,11 @@ sub export {
|
|||
printf $fh "; filament used = %.1fmm (%.1fcm3)\n",
|
||||
$used_filament, $extruded_volume/1000;
|
||||
if ($filament_weight > 0) {
|
||||
$total_filament_weight += $filament_weight;
|
||||
$self->print->total_weight($self->print->total_weight + $filament_weight);
|
||||
printf $fh "; filament used = %.1fg\n",
|
||||
$filament_weight;
|
||||
if ($filament_cost > 0) {
|
||||
$total_filament_cost += $filament_cost;
|
||||
$self->print->total_cost($self->print->total_cost + $filament_cost);
|
||||
printf $fh "; filament cost = %.1f\n",
|
||||
$filament_cost;
|
||||
}
|
||||
|
@ -347,7 +347,7 @@ sub export {
|
|||
$self->print->total_extruded_volume($self->print->total_extruded_volume + $extruded_volume);
|
||||
}
|
||||
printf $fh "; total filament cost = %.1f\n",
|
||||
$total_filament_cost;
|
||||
$self->print->total_cost;
|
||||
|
||||
# append full config
|
||||
print $fh "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue