mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-13 09:29:01 +08:00
Show estimated printing time after exporting gcode
fixes https://github.com/slic3r/Slic3r/issues/4758
This commit is contained in:
parent
233320384e
commit
1618aef2fa
@ -599,6 +599,7 @@ sub new {
|
|||||||
my @info = (
|
my @info = (
|
||||||
fil => "Used Filament",
|
fil => "Used Filament",
|
||||||
cost => "Cost",
|
cost => "Cost",
|
||||||
|
tim => "Time",
|
||||||
);
|
);
|
||||||
while (my $field = shift @info) {
|
while (my $field = shift @info) {
|
||||||
my $label = shift @info;
|
my $label = shift @info;
|
||||||
@ -2282,6 +2283,17 @@ sub on_export_completed {
|
|||||||
} else {
|
} else {
|
||||||
$message = "Export failed";
|
$message = "Export failed";
|
||||||
}
|
}
|
||||||
|
# Estimate print duration
|
||||||
|
{
|
||||||
|
my $estimator = Slic3r::GCode::TimeEstimator->new;
|
||||||
|
$estimator->parse_file($self->{export_gcode_output_file});
|
||||||
|
my $time = $estimator->time;
|
||||||
|
$self->{print_info_tim}->SetLabel(sprintf(
|
||||||
|
"%d minutes and %d seconds",
|
||||||
|
int($time / 60),
|
||||||
|
int($time % 60),
|
||||||
|
));
|
||||||
|
}
|
||||||
$self->{export_gcode_output_file} = undef;
|
$self->{export_gcode_output_file} = undef;
|
||||||
$self->statusbar->SetStatusText($message);
|
$self->statusbar->SetStatusText($message);
|
||||||
wxTheApp->notify($message);
|
wxTheApp->notify($message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user