Merge branch 'master' into cppgui

This commit is contained in:
Joseph Lenox 2018-04-24 19:05:44 -05:00
commit cc17b2e279
3 changed files with 24 additions and 3 deletions

View File

@ -50,7 +50,6 @@ notifications:
on_success: change
on_failure: always
use_notice: true
sudo: required
dist: trusty
env:
matrix:

View File

@ -153,6 +153,10 @@ sub export {
foreach my $start_gcode (@{ $self->config->start_filament_gcode }) { # process filament gcode in order
$include_start_extruder_temp = $include_start_extruder_temp && ($start_gcode !~ /M(?:109|104)/i);
}
my $include_end_extruder_temp = $self->config->end_gcode !~ /M(?:109|104)/i;
foreach my $end_gcode (@{ $self->config->end_filament_gcode }) { # process filament gcode in order
$include_end_extruder_temp = $include_end_extruder_temp && ($end_gcode !~ /M(?:109|104)/i);
}
$self->_print_first_layer_temperature(0)
if $include_start_extruder_temp;
printf $fh "%s\n", Slic3r::ConditionalGCode::apply_math($gcodegen->placeholder_parser->process($self->config->start_gcode));
@ -301,6 +305,14 @@ sub export {
printf $fh "%s\n", Slic3r::ConditionalGCode::apply_math($gcodegen->placeholder_parser->process($end_gcode));
}
printf $fh "%s\n", Slic3r::ConditionalGCode::apply_math($gcodegen->placeholder_parser->process($self->config->end_gcode));
$self->_print_off_temperature(0)
if $include_end_extruder_temp;
# set bed temperature
if (($self->config->has_heatbed) && $self->config->end_gcode !~ /M(?:190|140)/i) {
printf $fh $gcodegen->writer->set_bed_temperature(0, 0);
}
print $fh $gcodegen->writer->update_progress($gcodegen->layer_count, $gcodegen->layer_count, 1); # 100%
print $fh $gcodegen->writer->postamble;
@ -356,6 +368,16 @@ sub _print_first_layer_temperature {
}
}
sub _print_off_temperature {
my ($self, $wait) = @_;
for my $t (@{$self->print->extruders}) {
printf {$self->fh} $self->_gcodegen->writer->set_temperature(0, $wait, $t)
}
}
# Called per object's layer.
# First a $gcode string is collected,
# then filtered and finally written to a file $fh.

View File

@ -221,7 +221,7 @@ PrintConfigDef::PrintConfigDef()
def = this->add("end_gcode", coString);
def->label = "End G-code";
def->tooltip = "This end procedure is inserted at the end of the output file. Note that you can use placeholder variables for all Slic3r settings.";
def->tooltip = "This end procedure is inserted at the end of the output file. Note that you can use placeholder variables for all Slic3r settings. If Slic3r detects M104, M109, M140 or M190 in your custom codes, such commands will not be prepended automatically so you're free to customize the order of heating commands and other custom actions.";
def->cli = "end-gcode=s";
def->multiline = true;
def->full_width = true;
@ -230,7 +230,7 @@ PrintConfigDef::PrintConfigDef()
def = this->add("end_filament_gcode", coStrings);
def->label = "End G-code";
def->tooltip = "This end procedure is inserted at the end of the output file, before the printer end gcode. Note that you can use placeholder variables for all Slic3r settings. If you have multiple extruders, the gcode is processed in extruder order.";
def->tooltip = "This end procedure is inserted at the end of the output file, before the printer end gcode. Note that you can use placeholder variables for all Slic3r settings. If you have multiple extruders, the gcode is processed in extruder order. If Slic3r detects M104, M109, M140 or M190 in your custom codes, such commands will not be prepended automatically so you're free to customize the order of heating commands and other custom actions.";
def->cli = "end-filament-gcode=s@";
def->multiline = true;
def->full_width = true;