mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-15 02:05:58 +08:00
Fix pausing when background process is scheduled but wasn't started yet
This commit is contained in:
parent
b8a629f0b6
commit
edc7fd2915
@ -807,7 +807,7 @@ sub async_apply_config {
|
|||||||
|
|
||||||
# pause process thread before applying new config
|
# pause process thread before applying new config
|
||||||
# since we don't want to touch data that is being used by the threads
|
# since we don't want to touch data that is being used by the threads
|
||||||
Slic3r::pause_threads();
|
$self->pause_background_process;
|
||||||
|
|
||||||
# apply new config
|
# apply new config
|
||||||
my $invalidated = $self->{print}->apply_config($self->GetFrame->config);
|
my $invalidated = $self->{print}->apply_config($self->GetFrame->config);
|
||||||
@ -818,7 +818,7 @@ sub async_apply_config {
|
|||||||
# kill current thread if any
|
# kill current thread if any
|
||||||
$self->stop_background_process;
|
$self->stop_background_process;
|
||||||
} else {
|
} else {
|
||||||
Slic3r::resume_threads();
|
$self->resume_background_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
# schedule a new process thread in case it wasn't running
|
# schedule a new process thread in case it wasn't running
|
||||||
@ -892,6 +892,26 @@ sub stop_background_process {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub pause_background_process {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
if ($self->{process_thread} || $self->{export_thread}) {
|
||||||
|
$self->pause_background_process;
|
||||||
|
} elsif (defined $self->{apply_config_timer} && $self->{apply_config_timer}->IsRunning) {
|
||||||
|
$self->{apply_config_timer}->Stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub resume_background_process {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
if ($self->{process_thread} || $self->{export_thread}) {
|
||||||
|
$self->resume_background_process;
|
||||||
|
} else {
|
||||||
|
$self->schedule_background_process;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub export_gcode {
|
sub export_gcode {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
@ -1242,7 +1262,7 @@ sub object_settings_dialog {
|
|||||||
object => $self->{objects}[$obj_idx],
|
object => $self->{objects}[$obj_idx],
|
||||||
model_object => $model_object,
|
model_object => $model_object,
|
||||||
);
|
);
|
||||||
Slic3r::pause_threads();
|
$self->pause_background_process;
|
||||||
$dlg->ShowModal;
|
$dlg->ShowModal;
|
||||||
|
|
||||||
# update thumbnail since parts may have changed
|
# update thumbnail since parts may have changed
|
||||||
@ -1256,7 +1276,7 @@ sub object_settings_dialog {
|
|||||||
$self->{print}->reload_object($obj_idx);
|
$self->{print}->reload_object($obj_idx);
|
||||||
$self->schedule_background_process;
|
$self->schedule_background_process;
|
||||||
} else {
|
} else {
|
||||||
Slic3r::resume_threads();
|
$self->resume_background_process;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user