From 6d371884a19a7ef859b0f77df9a0f3333c798c9a Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 9 Mar 2017 21:37:56 +0100 Subject: [PATCH] Remember manual control settings --- lib/Slic3r/GUI/Controller/ManualControlDialog.pm | 9 ++------- lib/Slic3r/GUI/Controller/PrinterPanel.pm | 10 ++++++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/Slic3r/GUI/Controller/ManualControlDialog.pm b/lib/Slic3r/GUI/Controller/ManualControlDialog.pm index ea5a61f30..ca6ff1737 100644 --- a/lib/Slic3r/GUI/Controller/ManualControlDialog.pm +++ b/lib/Slic3r/GUI/Controller/ManualControlDialog.pm @@ -15,7 +15,7 @@ use base qw(Wx::Dialog Class::Accessor); __PACKAGE__->mk_accessors(qw(sender writer config2 x_homed y_homed)); sub new { - my ($class, $parent, $config, $sender) = @_; + my ($class, $parent, $config, $sender, $manual_control_config) = @_; my $self = $class->SUPER::new($parent, -1, "Manual Control", wxDefaultPosition, [500,400], wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); @@ -23,12 +23,7 @@ sub new { $self->writer(Slic3r::GCode::Writer->new); $self->writer->config->apply_dynamic($config); - $self->config2({ - xy_travel_speed => 130, - z_travel_speed => 10, - temperature => '', - bed_temperature => '', - }); + $self->config2($manual_control_config); my $bed_sizer = Wx::FlexGridSizer->new(2, 3, 1, 1); $bed_sizer->AddGrowableCol(1, 1); diff --git a/lib/Slic3r/GUI/Controller/PrinterPanel.pm b/lib/Slic3r/GUI/Controller/PrinterPanel.pm index 6fbabf15a..7cfe9fc59 100644 --- a/lib/Slic3r/GUI/Controller/PrinterPanel.pm +++ b/lib/Slic3r/GUI/Controller/PrinterPanel.pm @@ -9,7 +9,7 @@ use Wx::Event qw(EVT_BUTTON EVT_MOUSEWHEEL EVT_TIMER EVT_SCROLLWIN); use base qw(Wx::Panel Class::Accessor); __PACKAGE__->mk_accessors(qw(printer_name config sender jobs - printing status_timer temp_timer)); + printing status_timer temp_timer manual_control_config)); use constant CONNECTION_TIMEOUT => 3; # seconds use constant STATUS_TIMER_INTERVAL => 1000; # milliseconds @@ -21,6 +21,12 @@ sub new { $self->printer_name($printer_name || 'Printer'); $self->config($config); + $self->manual_control_config({ + xy_travel_speed => 130, + z_travel_speed => 10, + temperature => '', + bed_temperature => '', + }); $self->jobs([]); # set up the timer that polls for updates @@ -171,7 +177,7 @@ sub new { $left_sizer->Add($btn, 0, wxTOP, 15); EVT_BUTTON($self, $btn, sub { my $dlg = Slic3r::GUI::Controller::ManualControlDialog->new - ($self, $self->config, $self->sender); + ($self, $self->config, $self->sender, $self->manual_control_config); $dlg->ShowModal; }); }