mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 16:25:52 +08:00
Used filament outputs (gcode comments) in more computer-parseable format (#4969)
* Used filament outputs (gcode comments) in more computer-parseable format * Auto stash before rebase of "refs/heads/filament_calculations" * Used filament outputs (gcode comments) in more computer-parseable format * Auto stash before rebase of "refs/heads/filament_calculations"
This commit is contained in:
parent
8ded7fbb85
commit
0ed96db439
@ -337,26 +337,26 @@ sub export {
|
||||
my $filament_weight = $extruded_volume * $extruder->filament_density / 1000;
|
||||
my $filament_cost = $filament_weight * ($extruder->filament_cost / 1000);
|
||||
$self->print->set_filament_stats($extruder->id, $used_filament);
|
||||
|
||||
printf $fh "; filament used = %.1fmm (%.1fcm3)\n",
|
||||
$used_filament, $extruded_volume/1000;
|
||||
|
||||
printf $fh "; filament_length_m = %.4f \n", $used_filament/1000;
|
||||
printf $fh "; filament_volume_cm3 = %.4f\n", $extruded_volume/1000;
|
||||
if ($filament_weight > 0) {
|
||||
$self->print->total_weight($self->print->total_weight + $filament_weight);
|
||||
printf $fh "; filament used = %.1fg\n",
|
||||
printf $fh "; filament mass_g = %.2f\n",
|
||||
$filament_weight;
|
||||
if ($filament_cost > 0) {
|
||||
$self->print->total_cost($self->print->total_cost + $filament_cost);
|
||||
printf $fh "; filament cost = %.1f\n",
|
||||
printf $fh "; filament_cost = %.2f\n",
|
||||
$filament_cost;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$self->print->total_used_filament($self->print->total_used_filament + $used_filament);
|
||||
$self->print->total_extruded_volume($self->print->total_extruded_volume + $extruded_volume);
|
||||
}
|
||||
printf $fh "; total filament cost = %.1f\n",
|
||||
printf $fh "; total_filament_cost = %.1f\n",
|
||||
$self->print->total_cost;
|
||||
|
||||
|
||||
# append full config
|
||||
print $fh "\n";
|
||||
foreach my $config ($self->print->config, $self->print->default_object_config, $self->print->default_region_config) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user