From bd03747dc1229f87137b8b6c35a4b740a8fc7871 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 4 Jul 2014 10:32:32 +0200 Subject: [PATCH] Added button for toolpaths preview --- lib/Slic3r/GUI/MainFrame.pm | 2 +- lib/Slic3r/GUI/Plater.pm | 19 +++++++++++++++---- var/joystick.png | Bin 0 -> 559 bytes 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100755 var/joystick.png diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 09b43f149..da1094ce3 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -55,7 +55,7 @@ sub new { $sizer->SetSizeHints($self); $self->SetSizer($sizer); $self->Fit; - $self->SetMinSize([760, 470]); + $self->SetMinSize([760, 490]); $self->SetSize($self->GetMinSize); $self->Show; $self->Layout; diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 41a9620d4..c6a9f3cd5 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -149,10 +149,13 @@ sub new { }); # right pane buttons - $self->{btn_export_gcode} = Wx::Button->new($self, -1, "Export G-code…", wxDefaultPosition, wxDefaultSize, wxBU_LEFT); - $self->{btn_export_stl} = Wx::Button->new($self, -1, "Export STL…", wxDefaultPosition, wxDefaultSize, wxBU_LEFT); + $self->{btn_export_gcode} = Wx::Button->new($self, -1, "Export G-code…", wxDefaultPosition, [-1, 30], wxBU_LEFT); + $self->{btn_export_stl} = Wx::Button->new($self, -1, "Export STL…", wxDefaultPosition, [-1, 30], wxBU_LEFT); + $self->{btn_toolpaths_preview} = Wx::Button->new($self, -1, "Toolpaths preview…", wxDefaultPosition, [-1, 30], wxBU_LEFT); $self->{btn_export_gcode}->SetFont($Slic3r::GUI::small_font); $self->{btn_export_stl}->SetFont($Slic3r::GUI::small_font); + $self->{btn_toolpaths_preview}->SetFont($Slic3r::GUI::small_font); + $self->{btn_toolpaths_preview}->Disable; if ($Slic3r::GUI::have_button_icons) { my %icons = qw( @@ -162,6 +165,7 @@ sub new { arrange bricks.png export_gcode cog_go.png export_stl brick_go.png + toolpaths_preview joystick.png increase add.png decrease delete.png @@ -183,6 +187,7 @@ sub new { Slic3r::thread_cleanup(); }); EVT_BUTTON($self, $self->{btn_export_stl}, \&export_stl); + EVT_BUTTON($self, $self->{btn_toolpaths_preview}, \&toolpaths_preview); if ($self->{htoolbar}) { EVT_TOOL($self, TB_ADD, sub { $self->add; }); @@ -323,6 +328,7 @@ sub new { my $right_buttons_sizer = Wx::BoxSizer->new(wxVERTICAL); $right_buttons_sizer->Add($presets, 0, wxEXPAND, 0) if defined $presets; $right_buttons_sizer->Add($self->{btn_export_gcode}, 0, wxEXPAND | wxTOP, 8); + $right_buttons_sizer->Add($self->{btn_toolpaths_preview}, 0, wxEXPAND | wxTOP, 2); $right_buttons_sizer->Add($self->{btn_export_stl}, 0, wxEXPAND | wxTOP, 2); my $right_top_sizer = Wx::BoxSizer->new(wxHORIZONTAL); @@ -792,8 +798,11 @@ sub split_object { sub schedule_background_process { my ($self) = @_; - $self->{apply_config_timer}->Start(PROCESS_DELAY, 1) # 1 = one shot - if defined $self->{apply_config_timer}; + + if (defined $self->{apply_config_timer}) { + $self->{apply_config_timer}->Start(PROCESS_DELAY, 1); # 1 = one shot + $self->{btn_toolpaths_preview}->Disable; + } } sub async_apply_config { @@ -879,6 +888,7 @@ sub stop_background_process { $self->statusbar->SetCancelCallback(undef); $self->statusbar->StopBusy; $self->statusbar->SetStatusText(""); + $self->{btn_toolpaths_preview}->Disable; if ($self->{process_thread}) { Slic3r::debugf "Killing background process.\n"; @@ -991,6 +1001,7 @@ sub on_process_completed { $self->{process_thread} = undef; return if !$result; + $self->{btn_toolpaths_preview}->Enable; # if we have an export filename, start a new thread for exporting G-code if ($self->{export_gcode_output_file}) { diff --git a/var/joystick.png b/var/joystick.png new file mode 100755 index 0000000000000000000000000000000000000000..62168f56f2cc2f816ab5ccd61e23582124773d1b GIT binary patch literal 559 zcmV+~0?_@5P)C7C+PJG?~lg zv_tF}9Lz9`k3b+0_INxX0$taGolfVSr|u82E+>M?WOC7HG|+4|1%cb`#%MGOIbj_M zI2hS%mi2l)L9kpdg&$2I%d&`!F+pIF98JJ?fOI--`g}g{MGB{HPUg5ozHumu0!fn4 zYPI0^`%mkDgH5_o(=;ga86JN7P;YOp@%r+`{n@dDa=9GlLEG(iGIue5Fc`$0xxvNb z6PU4NE4`ciE`KK9QmM;Qsg$<~sF({%i$^+^?KoQxsb_Z&~CSx=zu3>E?rbA z6%vtHm{mkRo6W?TzSB98NQh{UKnc2aI2_s_t8l*)3rD)3UuzRkk`jD2k+1;!akJU{ xbDN;s?V?_<+oCyiON~@Sqwc?8=JcFTu|F2lW40ifwh{mU002ovPDHLkV1k___RjzS literal 0 HcmV?d00001