diff options
author | bubnikv <bubnikv@gmail.com> | 2018-09-17 13:01:02 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-09-17 13:01:02 +0300 |
commit | d934b63424ab76ddcd8a87f272838df611dfcd0c (patch) | |
tree | a0124fe8f74db9d66e8500100ec50c50ec92e7a4 /lib | |
parent | bb7f504296c99fdc35197dedda85d38e6ef387f0 (diff) |
Removed Print.pm,
ported execution of post processing scripts into C++ (WIP, waits for
update of boost::system module on our build server)
Removed other mention of the "Controller".
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Slic3r.pm | 1 | ||||
-rw-r--r-- | lib/Slic3r/GUI.pm | 5 | ||||
-rw-r--r-- | lib/Slic3r/GUI/MainFrame.pm | 7 | ||||
-rw-r--r-- | lib/Slic3r/Print.pm | 69 |
4 files changed, 1 insertions, 81 deletions
diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 020edd70f..44100db8c 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -49,7 +49,6 @@ use Slic3r::Model; use Slic3r::Point; use Slic3r::Polygon; use Slic3r::Polyline; -use Slic3r::Print; use Slic3r::Print::Object; use Slic3r::Print::Simple; use Slic3r::Surface; diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 01143aeee..216be3441 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -33,7 +33,6 @@ use constant MODEL_WILDCARD => join '|', @{&FILE_WILDCARDS}{qw(known stl obj amf # Datadir provided on the command line. our $datadir; -# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden. our $no_plater; our @cb; @@ -103,8 +102,6 @@ sub OnInit { print STDERR "Creating main frame...\n"; Wx::Image::FindHandlerType(wxBITMAP_TYPE_PNG) || Wx::Image::AddHandler(Wx::PNGHandler->new); $self->{mainframe} = my $frame = Slic3r::GUI::MainFrame->new( - # If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden. - no_controller => $self->{app_config}->get('no_controller'), no_plater => $no_plater, lang_ch_event => $LANGUAGE_CHANGE_EVENT, preferences_event => $PREFERENCES_EVENT, @@ -170,8 +167,6 @@ sub recreate_GUI{ my ($self) = @_; my $topwindow = $self->GetTopWindow(); $self->{mainframe} = my $frame = Slic3r::GUI::MainFrame->new( - # If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden. - no_controller => $self->{app_config}->get('no_controller'), no_plater => $no_plater, lang_ch_event => $LANGUAGE_CHANGE_EVENT, preferences_event => $PREFERENCES_EVENT, diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 554beba68..3f023c06f 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -57,8 +57,6 @@ sub new { } # store input params - # If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden. - $self->{no_controller} = $params{no_controller}; $self->{no_plater} = $params{no_plater}; $self->{loaded} = 0; $self->{lang_ch_event} = $params{lang_ch_event}; @@ -199,8 +197,6 @@ sub _init_tabpanel { ? 'load_current_preset' : 'update_tab_ui'; $self->{options_tabs}{$tab_name_other}->$update_action; } - # Update the controller printers. - $self->{controller}->update_presets($presets) if $self->{controller}; } $self->{plater}->on_config_change($tab->get_config); } @@ -239,8 +235,7 @@ sub _init_tabpanel { $self->{plater}->update(); }); - - Slic3r::GUI::create_preset_tabs($self->{no_controller}, $VALUE_CHANGE_EVENT, $PRESETS_CHANGED_EVENT); + Slic3r::GUI::create_preset_tabs($VALUE_CHANGE_EVENT, $PRESETS_CHANGED_EVENT); $self->{options_tabs} = {}; for my $tab_name (qw(print filament sla_material printer)) { $self->{options_tabs}{$tab_name} = Slic3r::GUI::get_preset_tab("$tab_name"); diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm deleted file mode 100644 index 79bc41ca3..000000000 --- a/lib/Slic3r/Print.pm +++ /dev/null @@ -1,69 +0,0 @@ -# The slicing work horse. -# Extends C++ class Slic3r::Print -package Slic3r::Print; -use strict; -use warnings; - -use File::Basename qw(basename fileparse); -use File::Spec; -use List::Util qw(min max first sum); -use Slic3r::ExtrusionLoop ':roles'; -use Slic3r::ExtrusionPath ':roles'; -use Slic3r::Flow ':roles'; -use Slic3r::Geometry qw(X Y unscale); -use Slic3r::Geometry::Clipper qw(diff_ex union_ex intersection_ex intersection offset - union JT_ROUND JT_SQUARE); -use Slic3r::Print::State ':steps'; - -sub size { - my $self = shift; - return $self->bounding_box->size; -} - -sub run_post_process_scripts { - my ($self, $output_file) = @_; - # run post-processing scripts - if (@{$self->config->post_process}) { -# $self->set_status(95, "Running post-processing scripts"); - $self->config->setenv; - for my $script (@{$self->config->post_process}) { - # Ignore empty post processing script lines. - next if $script =~ /^\s*$/; - Slic3r::debugf " '%s' '%s'\n", $script, $output_file; - # -x doesn't return true on Windows except for .exe files - if (($^O eq 'MSWin32') ? !(-e $script) : !(-x $script)) { - die "The configured post-processing script is not executable: check permissions. ($script)\n"; - } - if ($^O eq 'MSWin32' && $script =~ /\.[pP][lL]/) { - # The current process (^X) may be slic3r.exe or slic3r-console.exe. - # Replace it with the current perl interpreter. - my($filename, $directories, $suffix) = fileparse($^X); - $filename =~ s/^slic3r.*$/perl5\.24\.0\.exe/; - my $interpreter = $directories . $filename; - system($interpreter, $script, $output_file); - } else { - system($script, $output_file); - } - } - } -} - -sub export_png { - my $self = shift; - my %params = @_; - - my @sobjects = @{$self->objects}; - my $objnum = scalar @sobjects; - for(my $oi = 0; $oi < $objnum; $oi++) - { - $sobjects[$oi]->slice; - $self->set_status(($oi + 1)*100/$objnum - 1, "Slicing..."); - } - - my $fh = $params{output_file}; - $self->set_status(90, "Exporting zipped archive..."); - $self->print_to_png($fh); - $self->set_status(100, "Done."); -} - -1; |