mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Use the embedded progress bar for feedback about slicing
This commit is contained in:
parent
83b69b18d0
commit
d889639d49
1 changed files with 8 additions and 12 deletions
|
@ -393,7 +393,6 @@ sub split_object {
|
||||||
sub export_gcode {
|
sub export_gcode {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $process_dialog;
|
|
||||||
eval {
|
eval {
|
||||||
# validate configuration
|
# validate configuration
|
||||||
Slic3r::Config->validate;
|
Slic3r::Config->validate;
|
||||||
|
@ -414,11 +413,7 @@ sub export_gcode {
|
||||||
$dlg->Destroy;
|
$dlg->Destroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
# show processbar dialog
|
$self->statusbar->StartBusy;
|
||||||
$process_dialog = Wx::ProgressDialog->new('Slicing...', "Processing input file...",
|
|
||||||
100, $self, 0);
|
|
||||||
$process_dialog->Pulse;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
my @warnings = ();
|
my @warnings = ();
|
||||||
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
|
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
|
||||||
|
@ -426,9 +421,8 @@ sub export_gcode {
|
||||||
output_file => $output_file,
|
output_file => $output_file,
|
||||||
status_cb => sub {
|
status_cb => sub {
|
||||||
my ($percent, $message) = @_;
|
my ($percent, $message) = @_;
|
||||||
if (&Wx::wxVERSION_STRING =~ / 2\.(8\.|9\.[2-9])/) {
|
$self->statusbar->SetProgress($percent);
|
||||||
$process_dialog->Update($percent, "$message...");
|
$self->statusbar->SetStatusText("$message...");
|
||||||
}
|
|
||||||
},
|
},
|
||||||
keep_meshes => 1,
|
keep_meshes => 1,
|
||||||
);
|
);
|
||||||
|
@ -439,8 +433,7 @@ sub export_gcode {
|
||||||
}
|
}
|
||||||
Slic3r::GUI::warning_catcher($self)->($_) for @warnings;
|
Slic3r::GUI::warning_catcher($self)->($_) for @warnings;
|
||||||
}
|
}
|
||||||
$process_dialog->Destroy;
|
$self->statusbar->StopBusy;
|
||||||
undef $process_dialog;
|
|
||||||
|
|
||||||
my $message = "Your files were successfully sliced";
|
my $message = "Your files were successfully sliced";
|
||||||
$message .= sprintf " in %d minutes and %.3f seconds",
|
$message .= sprintf " in %d minutes and %.3f seconds",
|
||||||
|
@ -457,7 +450,10 @@ sub export_gcode {
|
||||||
wxOK | wxICON_INFORMATION)->ShowModal;
|
wxOK | wxICON_INFORMATION)->ShowModal;
|
||||||
$print->cleanup;
|
$print->cleanup;
|
||||||
};
|
};
|
||||||
Slic3r::GUI::catch_error($self, sub { $process_dialog->Destroy if $process_dialog });
|
Slic3r::GUI::catch_error($self, sub {
|
||||||
|
$self->statusbar->StartBusy;
|
||||||
|
$self->statusbar->SetStatusText("");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub export_stl {
|
sub export_stl {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue