Some changes to DLP projector

This commit is contained in:
Alessandro Ranellucci 2015-12-18 00:56:56 +01:00
parent d0ad57b64d
commit 44825d91af
2 changed files with 8 additions and 5 deletions

View file

@ -39,7 +39,7 @@ sub new {
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
$self->config(Slic3r::Config->new_from_defaults(
qw(serial_port serial_speed bed_shape start_gcode end_gcode)
qw(serial_port serial_speed bed_shape start_gcode end_gcode z_offset)
));
$self->config->apply(wxTheApp->{mainframe}->config);
@ -599,8 +599,6 @@ sub start_print {
# send custom start G-code
$self->sender->send($_, 1) for grep !/^;/, split /\n/, $self->config->start_gcode;
$self->sender->send(sprintf("G1 Z%.5f F%d",
$self->config2->{z_lift}, $self->config2->{z_lift_speed}*60), 1);
}
$self->is_printing(1);
@ -621,6 +619,10 @@ sub start_print {
sub stop_print {
my ($self) = @_;
if ($self->sender) {
$self->sender->disconnect;
}
$self->is_printing(0);
$self->timer->Stop;
$self->_timer_cb(undef);
@ -633,7 +635,6 @@ sub print_completed {
# send custom end G-code
if ($self->sender) {
$self->sender->send($_, 1) for grep !/^;/, split /\n/, $self->config->end_gcode;
$self->sender->disconnect;
}
# call this before the on_print_completed callback otherwise buttons
@ -675,7 +676,7 @@ sub project_next_layer {
$self->on_project_layer->($self->_layer_num) if $self->on_project_layer;
if ($self->sender) {
my $z = $self->current_layer_height;
my $z = $self->current_layer_height + $self->config->z_offset;
my $F = $self->config2->{z_lift_speed} * 60;
if ($self->config2->{z_lift} != 0) {
$self->sender->send(sprintf("G1 Z%.5f F%d", $z + $self->config2->{z_lift}, $F), 1);

View file

@ -125,10 +125,12 @@ GCodeSender::disconnect()
this->io.post(boost::bind(&GCodeSender::do_close, this));
this->background_thread.join();
this->io.reset();
/*
if (this->error_status()) {
throw(boost::system::system_error(boost::system::error_code(),
"Error while closing the device"));
}
*/
}
bool