From 5655f786f4d4342acdc4c8fb128e09dc6e305646 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 1 Dec 2015 20:54:06 +0100 Subject: [PATCH] Change order in DLP projection --- lib/Slic3r/GUI/Projector.pm | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/Slic3r/GUI/Projector.pm b/lib/Slic3r/GUI/Projector.pm index d2cef6eda..129f6a439 100644 --- a/lib/Slic3r/GUI/Projector.pm +++ b/lib/Slic3r/GUI/Projector.pm @@ -610,8 +610,10 @@ sub stop_print { $self->screen->project_layers(undef); # send custom end G-code - $self->sender->send($_, 1) for grep !/^;/, split /\n/, $self->config->end_gcode; - $self->sender->disconnect if $self->sender; + if ($self->sender) { + $self->sender->send($_, 1) for grep !/^;/, split /\n/, $self->config->end_gcode; + $self->sender->disconnect; + } } sub is_projecting { @@ -655,8 +657,7 @@ sub project_next_layer { } # TODO: we should block until G1 commands have been performed, see note below - # TODO: subtract this waiting time from the settle_time - $self->delay(2, sub { + $self->delay($self->config2->{settle_time}, sub { $self->project_layer($self->_layer_num); # get exposure time @@ -666,25 +667,17 @@ sub project_next_layer { } $self->delay($time, sub { - $self->settle; + $self->screen->project_layers(undef); + $self->project_next_layer; }); }); } -sub settle { - my ($self) = @_; - - Slic3r::debugf "settling\n"; - $self->screen->project_layers(undef); - $self->delay($self->config2->{settle_time}, sub { - $self->project_next_layer; - }); -} - sub DESTROY { my ($self) = @_; $self->timer->Stop if $self->timer; + $self->sender->disconnect if $self->sender; } package Slic3r::GUI::Projector::Screen;