Assign color to filaments

This commit is contained in:
Alessandro Ranellucci 2015-05-26 02:01:43 +02:00
parent ad0a15debe
commit aa8b6afe8b
7 changed files with 94 additions and 19 deletions

View file

@ -232,6 +232,12 @@ PrintConfigDef::build_def() {
Options["fan_below_layer_time"].min = 0;
Options["fan_below_layer_time"].max = 1000;
Options["filament_colour"].type = coStrings;
Options["filament_colour"].label = "Color";
Options["filament_colour"].tooltip = "This is only used in the Slic3r interface as a visual help.";
Options["filament_colour"].cli = "filament-color=s@";
Options["filament_colour"].gui_type = "color";
Options["filament_diameter"].type = coFloats;
Options["filament_diameter"].label = "Diameter";
Options["filament_diameter"].tooltip = "Enter your filament diameter here. Good precision is required, so use a caliper and do multiple measurements along the filament, then compute the average.";

View file

@ -409,6 +409,7 @@ class PrintConfig : public GCodeConfig
ConfigOptionPoints extruder_offset;
ConfigOptionBool fan_always_on;
ConfigOptionInt fan_below_layer_time;
ConfigOptionStrings filament_colour;
ConfigOptionFloat first_layer_acceleration;
ConfigOptionInt first_layer_bed_temperature;
ConfigOptionFloatOrPercent first_layer_extrusion_width;
@ -464,6 +465,8 @@ class PrintConfig : public GCodeConfig
this->extruder_offset.values[0] = Pointf(0,0);
this->fan_always_on.value = false;
this->fan_below_layer_time.value = 60;
this->filament_colour.values.resize(1);
this->filament_colour.values[0] = "#FFFFFF";
this->first_layer_acceleration.value = 0;
this->first_layer_bed_temperature.value = 0;
this->first_layer_extrusion_width.value = 200;
@ -523,6 +526,7 @@ class PrintConfig : public GCodeConfig
if (opt_key == "extruder_offset") return &this->extruder_offset;
if (opt_key == "fan_always_on") return &this->fan_always_on;
if (opt_key == "fan_below_layer_time") return &this->fan_below_layer_time;
if (opt_key == "filament_colour") return &this->filament_colour;
if (opt_key == "first_layer_acceleration") return &this->first_layer_acceleration;
if (opt_key == "first_layer_bed_temperature") return &this->first_layer_bed_temperature;
if (opt_key == "first_layer_extrusion_width") return &this->first_layer_extrusion_width;