Adds new has_heatbed option to capabilities to disable autogeneration of bed temp settings.

This commit is contained in:
Joseph Lenox 2016-07-12 19:26:17 -05:00
parent eb491056d8
commit c5c1cab4f9
4 changed files with 12 additions and 4 deletions

View File

@ -990,7 +990,7 @@ sub build {
my (%params) = @_;
$self->init_config_options(qw(
bed_shape z_offset
bed_shape z_offset has_heatbed
gcode_flavor use_relative_e_distances
serial_port serial_speed
octoprint_host octoprint_apikey
@ -1057,6 +1057,7 @@ sub build {
);
$optgroup->append_single_option_line($option);
}
$optgroup->append_single_option_line('has_heatbed');
$optgroup->on_change(sub {
my ($opt_id) = @_;
if ($opt_id eq 'extruders_count') {

View File

@ -162,7 +162,7 @@ sub export {
if $self->config->cooling && $self->config->disable_fan_first_layers;
# set bed temperature
if ((my $temp = $self->config->first_layer_bed_temperature) && $self->config->start_gcode !~ /M(?:190|140)/i) {
if ($self->config->has_heatbed && (my $temp = $self->config->first_layer_bed_temperature) && $self->config->start_gcode !~ /M(?:190|140)/i) {
printf $fh $gcodegen->writer->set_bed_temperature($temp, 1);
}
@ -264,7 +264,7 @@ sub export {
# is triggered, so machine has more time to reach such temperatures
if ($layer->id == 0 && $finished_objects > 0) {
printf $fh $gcodegen->writer->set_bed_temperature($self->config->first_layer_bed_temperature),
if $self->config->first_layer_bed_temperature;
if $self->config->first_layer_bed_temperature && $self->config->has_heatbed;
$self->_print_first_layer_temperature(0);
}
$self->process_layer($layer, [$copy]);
@ -375,7 +375,7 @@ sub process_layer {
if $temperature && $temperature != $self->config->get_at('first_layer_temperature', $extruder->id);
}
$gcode .= $self->_gcodegen->writer->set_bed_temperature($self->print->config->bed_temperature)
if $self->print->config->bed_temperature && $self->print->config->bed_temperature != $self->print->config->first_layer_bed_temperature;
if $self->config->has_heatbed && $self->print->config->bed_temperature && $self->print->config->bed_temperature != $self->print->config->first_layer_bed_temperature;
$self->_second_layer_things_done(1);
}

View File

@ -24,6 +24,11 @@ PrintConfigDef::PrintConfigDef()
opt->values.push_back(Pointf(0,200));
def->default_value = opt;
}
def = this->add("has_heatbed", coBool);
def->label = "Has heated bed";
def->tooltip = "Unselecting this will suppress automatic generation of bed heating gcode.";
def->cli = "has_heatbed!";
def->default_value = new ConfigOptionBool(true);
def = this->add("bed_temperature", coInt);
def->label = "Other layers";

View File

@ -318,6 +318,7 @@ class PrintConfig : public GCodeConfig
public:
ConfigOptionBool avoid_crossing_perimeters;
ConfigOptionPoints bed_shape;
ConfigOptionBool has_heatbed;
ConfigOptionInt bed_temperature;
ConfigOptionFloat bridge_acceleration;
ConfigOptionInt bridge_fan_speed;
@ -374,6 +375,7 @@ class PrintConfig : public GCodeConfig
virtual ConfigOption* optptr(const t_config_option_key &opt_key, bool create = false) {
OPT_PTR(avoid_crossing_perimeters);
OPT_PTR(bed_shape);
OPT_PTR(has_heatbed);
OPT_PTR(bed_temperature);
OPT_PTR(bridge_acceleration);
OPT_PTR(bridge_fan_speed);