Added button for toolpaths preview

This commit is contained in:
Alessandro Ranellucci 2014-07-04 10:32:32 +02:00
parent f0a57a83fd
commit bd03747dc1
3 changed files with 16 additions and 5 deletions

View File

@ -55,7 +55,7 @@ sub new {
$sizer->SetSizeHints($self); $sizer->SetSizeHints($self);
$self->SetSizer($sizer); $self->SetSizer($sizer);
$self->Fit; $self->Fit;
$self->SetMinSize([760, 470]); $self->SetMinSize([760, 490]);
$self->SetSize($self->GetMinSize); $self->SetSize($self->GetMinSize);
$self->Show; $self->Show;
$self->Layout; $self->Layout;

View File

@ -149,10 +149,13 @@ sub new {
}); });
# right pane buttons # right pane buttons
$self->{btn_export_gcode} = Wx::Button->new($self, -1, "Export G-code…", 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, wxDefaultSize, 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_gcode}->SetFont($Slic3r::GUI::small_font);
$self->{btn_export_stl}->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) { if ($Slic3r::GUI::have_button_icons) {
my %icons = qw( my %icons = qw(
@ -162,6 +165,7 @@ sub new {
arrange bricks.png arrange bricks.png
export_gcode cog_go.png export_gcode cog_go.png
export_stl brick_go.png export_stl brick_go.png
toolpaths_preview joystick.png
increase add.png increase add.png
decrease delete.png decrease delete.png
@ -183,6 +187,7 @@ sub new {
Slic3r::thread_cleanup(); Slic3r::thread_cleanup();
}); });
EVT_BUTTON($self, $self->{btn_export_stl}, \&export_stl); EVT_BUTTON($self, $self->{btn_export_stl}, \&export_stl);
EVT_BUTTON($self, $self->{btn_toolpaths_preview}, \&toolpaths_preview);
if ($self->{htoolbar}) { if ($self->{htoolbar}) {
EVT_TOOL($self, TB_ADD, sub { $self->add; }); EVT_TOOL($self, TB_ADD, sub { $self->add; });
@ -323,6 +328,7 @@ sub new {
my $right_buttons_sizer = Wx::BoxSizer->new(wxVERTICAL); my $right_buttons_sizer = Wx::BoxSizer->new(wxVERTICAL);
$right_buttons_sizer->Add($presets, 0, wxEXPAND, 0) if defined $presets; $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_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); $right_buttons_sizer->Add($self->{btn_export_stl}, 0, wxEXPAND | wxTOP, 2);
my $right_top_sizer = Wx::BoxSizer->new(wxHORIZONTAL); my $right_top_sizer = Wx::BoxSizer->new(wxHORIZONTAL);
@ -792,8 +798,11 @@ sub split_object {
sub schedule_background_process { sub schedule_background_process {
my ($self) = @_; 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 { sub async_apply_config {
@ -879,6 +888,7 @@ sub stop_background_process {
$self->statusbar->SetCancelCallback(undef); $self->statusbar->SetCancelCallback(undef);
$self->statusbar->StopBusy; $self->statusbar->StopBusy;
$self->statusbar->SetStatusText(""); $self->statusbar->SetStatusText("");
$self->{btn_toolpaths_preview}->Disable;
if ($self->{process_thread}) { if ($self->{process_thread}) {
Slic3r::debugf "Killing background process.\n"; Slic3r::debugf "Killing background process.\n";
@ -991,6 +1001,7 @@ sub on_process_completed {
$self->{process_thread} = undef; $self->{process_thread} = undef;
return if !$result; return if !$result;
$self->{btn_toolpaths_preview}->Enable;
# if we have an export filename, start a new thread for exporting G-code # if we have an export filename, start a new thread for exporting G-code
if ($self->{export_gcode_output_file}) { if ($self->{export_gcode_output_file}) {

BIN
var/joystick.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B