New option to specify G-code to be used at layer change. #279

This commit is contained in:
Alessandro Ranellucci 2012-03-26 12:14:15 +02:00
parent bf964b5273
commit 1a06e35687
6 changed files with 24 additions and 10 deletions

View file

@ -255,7 +255,7 @@ our $Options = {
type => 's',
multiline => 1,
width => 350,
height => 150,
height => 120,
serialize => sub { join '\n', split /\R+/, $_[0] },
deserialize => sub { join "\n", split /\\n/, $_[0] },
},
@ -265,7 +265,17 @@ our $Options = {
type => 's',
multiline => 1,
width => 350,
height => 150,
height => 120,
serialize => sub { join '\n', split /\R+/, $_[0] },
deserialize => sub { join "\n", split /\\n/, $_[0] },
},
'layer_gcode' => {
label => 'Layer Change GCODE',
cli => 'layer-gcode=s',
type => 's',
multiline => 1,
width => 350,
height => 50,
serialize => sub { join '\n', split /\R+/, $_[0] },
deserialize => sub { join "\n", split /\\n/, $_[0] },
},
@ -475,7 +485,7 @@ sub validate_cli {
my $class = shift;
my ($opt) = @_;
for (qw(start end)) {
for (qw(start end layer)) {
if (defined $opt->{$_."_gcode"}) {
if ($opt->{$_."_gcode"} eq "") {
set($_."_gcode", "");

View file

@ -49,6 +49,9 @@ sub change_layer {
$gcode .= $self->G0(undef, $z, 0, 'move to next layer')
if $self->z != $z;
$gcode .= Slic3r::Config->replace_options($Slic3r::layer_gcode) . "\n"
if $Slic3r::layer_gcode;
return $gcode;
}

View file

@ -64,7 +64,7 @@ sub new {
},
gcode => {
title => 'Custom GCODE',
options => [qw(start_gcode end_gcode gcode_comments post_process)],
options => [qw(start_gcode end_gcode layer_gcode gcode_comments post_process)],
},
extrusion => {
title => 'Extrusion',