Cooling tubes parameters added into GUI and configuration layer (not yet into wipe tower generator)

This commit is contained in:
Lukas Matena 2018-03-01 16:15:00 +01:00
parent 1d787a15a0
commit d2006c8d8e
6 changed files with 48 additions and 4 deletions

View file

@ -188,7 +188,9 @@ public:
// y -- y coordinates of wipe tower in mm ( left bottom corner ) // y -- y coordinates of wipe tower in mm ( left bottom corner )
// width -- width of wipe tower in mm ( default 60 mm - leave as it is ) // width -- width of wipe tower in mm ( default 60 mm - leave as it is )
// wipe_area -- space available for one toolchange in mm // wipe_area -- space available for one toolchange in mm
WipeTowerPrusaMM(float x, float y, float width, float wipe_area, float rotation_angle, unsigned int initial_tool,std::string& parameters) : WipeTowerPrusaMM(float x, float y, float width, float wipe_area, float rotation_angle, float cooling_tube_retraction,
float cooling_tube_length, float parking_pos_retraction, std::string& parameters,
unsigned int initial_tool) :
m_wipe_tower_pos(x, y), m_wipe_tower_pos(x, y),
m_wipe_tower_width(width), m_wipe_tower_width(width),
m_wipe_tower_rotation_angle(rotation_angle), m_wipe_tower_rotation_angle(rotation_angle),
@ -199,6 +201,7 @@ public:
m_current_tool(initial_tool), m_current_tool(initial_tool),
m_par(parameters) m_par(parameters)
{ {
printf("Jsem konstruktor WT a vidim cisla %f,%f,%f\n",cooling_tube_retraction,cooling_tube_length,parking_pos_retraction);
for (size_t i = 0; i < 4; ++ i) { for (size_t i = 0; i < 4; ++ i) {
// Extruder specific parameters. // Extruder specific parameters.
m_material[i] = PLA; m_material[i] = PLA;
@ -325,6 +328,9 @@ private:
// G-code generator parameters. // G-code generator parameters.
float m_zhop = 0.5f; float m_zhop = 0.5f;
float m_retract = 4.f; float m_retract = 4.f;
float m_cooling_tube_retraction = 0.f;
float m_cooling_tube_length = 0.f;
float m_parking_pos_retraction = 0.f;
float m_line_width = Nozzle_Diameter * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill. float m_line_width = Nozzle_Diameter * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
float m_extrusion_flow = 0.038; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter. float m_extrusion_flow = 0.038; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.

View file

@ -90,6 +90,8 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"bridge_acceleration", "bridge_acceleration",
"bridge_fan_speed", "bridge_fan_speed",
"cooling", "cooling",
"cooling_tube_retraction",
"cooling_tube_length",
"default_acceleration", "default_acceleration",
"deretract_speed", "deretract_speed",
"disable_fan_first_layers", "disable_fan_first_layers",
@ -128,6 +130,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"notes", "notes",
"only_retract_when_crossing_perimeters", "only_retract_when_crossing_perimeters",
"output_filename_format", "output_filename_format",
"parking_pos_retraction",
"perimeter_acceleration", "perimeter_acceleration",
"post_process", "post_process",
"printer_notes", "printer_notes",
@ -1022,8 +1025,9 @@ void Print::_make_wipe_tower()
WipeTowerPrusaMM wipe_tower( WipeTowerPrusaMM wipe_tower(
float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value), float(this->config.wipe_tower_x.value), float(this->config.wipe_tower_y.value),
float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value), float(this->config.wipe_tower_width.value), float(this->config.wipe_tower_per_color_wipe.value),
float(this->config.wipe_tower_rotation_angle.value), m_tool_ordering.first_extruder(), float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
this->config.wipe_tower_advanced.value); float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
this->config.wipe_tower_advanced.value,m_tool_ordering.first_extruder());
//wipe_tower.set_retract(); //wipe_tower.set_retract();
//wipe_tower.set_zhop(); //wipe_tower.set_zhop();

View file

@ -171,6 +171,22 @@ PrintConfigDef::PrintConfigDef()
def->cli = "cooling!"; def->cli = "cooling!";
def->default_value = new ConfigOptionBools { true }; def->default_value = new ConfigOptionBools { true };
def = this->add("cooling_tube_retraction", coFloat);
def->label = _L("Cooling tube position");
def->tooltip = _L("Distance of the center-point of the cooling tube from the extruder tip ");
def->sidetext = _L("mm");
def->cli = "cooling_tube_retraction=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(0);
def = this->add("cooling_tube_length", coFloat);
def->label = _L("Cooling tube length");
def->tooltip = _L("Length of the cooling tube to limit space for cooling moves inside it ");
def->sidetext = _L("mm");
def->cli = "cooling_tube_length=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(0);
def = this->add("default_acceleration", coFloat); def = this->add("default_acceleration", coFloat);
def->label = _L("Default"); def->label = _L("Default");
def->tooltip = _L("This is the acceleration your printer will be reset to after " def->tooltip = _L("This is the acceleration your printer will be reset to after "
@ -947,6 +963,15 @@ PrintConfigDef::PrintConfigDef()
def->cli = "overhangs!"; def->cli = "overhangs!";
def->default_value = new ConfigOptionBool(true); def->default_value = new ConfigOptionBool(true);
def = this->add("parking_pos_retraction", coFloat);
def->label = _L("Filament parking position");
def->tooltip = _L("Distance of the extruder tip from the position where the filament is parked"
"when unloaded. This should match the value in printer firmware. ");
def->sidetext = _L("mm");
def->cli = "parking_pos_retraction=f";
def->min = 0;
def->default_value = new ConfigOptionFloat(0);
def = this->add("perimeter_acceleration", coFloat); def = this->add("perimeter_acceleration", coFloat);
def->label = _L("Perimeters"); def->label = _L("Perimeters");
def->tooltip = _L("This is the acceleration your printer will use for perimeters. " def->tooltip = _L("This is the acceleration your printer will use for perimeters. "

View file

@ -491,6 +491,9 @@ public:
ConfigOptionBool use_relative_e_distances; ConfigOptionBool use_relative_e_distances;
ConfigOptionBool use_volumetric_e; ConfigOptionBool use_volumetric_e;
ConfigOptionBool variable_layer_height; ConfigOptionBool variable_layer_height;
ConfigOptionFloat cooling_tube_retraction;
ConfigOptionFloat cooling_tube_length;
ConfigOptionFloat parking_pos_retraction;
std::string get_extrusion_axis() const std::string get_extrusion_axis() const
{ {
@ -540,6 +543,9 @@ protected:
OPT_PTR(use_relative_e_distances); OPT_PTR(use_relative_e_distances);
OPT_PTR(use_volumetric_e); OPT_PTR(use_volumetric_e);
OPT_PTR(variable_layer_height); OPT_PTR(variable_layer_height);
OPT_PTR(cooling_tube_retraction);
OPT_PTR(cooling_tube_length);
OPT_PTR(parking_pos_retraction);
} }
}; };

View file

@ -227,7 +227,7 @@ const std::vector<std::string>& Preset::printer_options()
"bed_shape", "z_offset", "gcode_flavor", "use_relative_e_distances", "serial_port", "serial_speed", "bed_shape", "z_offset", "gcode_flavor", "use_relative_e_distances", "serial_port", "serial_speed",
"octoprint_host", "octoprint_apikey", "use_firmware_retraction", "use_volumetric_e", "variable_layer_height", "octoprint_host", "octoprint_apikey", "use_firmware_retraction", "use_volumetric_e", "variable_layer_height",
"single_extruder_multi_material", "start_gcode", "end_gcode", "before_layer_gcode", "layer_gcode", "toolchange_gcode", "single_extruder_multi_material", "start_gcode", "end_gcode", "before_layer_gcode", "layer_gcode", "toolchange_gcode",
"between_objects_gcode", "printer_notes" "between_objects_gcode", "printer_notes", "cooling_tube_retraction", "cooling_tube_length", "parking_pos_retraction"
}; };
s_opts.insert(s_opts.end(), Preset::nozzle_options().begin(), Preset::nozzle_options().end()); s_opts.insert(s_opts.end(), Preset::nozzle_options().begin(), Preset::nozzle_options().end());
} }

View file

@ -1139,6 +1139,9 @@ void TabPrinter::build()
optgroup->append_single_option_line("use_firmware_retraction"); optgroup->append_single_option_line("use_firmware_retraction");
optgroup->append_single_option_line("use_volumetric_e"); optgroup->append_single_option_line("use_volumetric_e");
optgroup->append_single_option_line("variable_layer_height"); optgroup->append_single_option_line("variable_layer_height");
optgroup->append_single_option_line("cooling_tube_retraction");
optgroup->append_single_option_line("cooling_tube_length");
optgroup->append_single_option_line("parking_pos_retraction");
page = add_options_page(_L("Custom G-code"), "cog.png"); page = add_options_page(_L("Custom G-code"), "cog.png");
optgroup = page->new_optgroup(_L("Start G-code"), 0); optgroup = page->new_optgroup(_L("Start G-code"), 0);