From 3433e8e3743f8aebea940ae92e3f26fec03c7a22 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 17 Aug 2018 15:42:46 +0200 Subject: Fixed a few tooltips, changed default value for minimal purge on wipe tower --- xs/src/libslic3r/PrintConfig.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'xs/src/libslic3r') diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index d8f2d85a6..a78e73fb5 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -518,7 +518,7 @@ PrintConfigDef::PrintConfigDef() def->cli = "filament-minimal-purge-on-wipe-tower=f@"; def->sidetext = L("mm³"); def->min = 0; - def->default_value = new ConfigOptionFloats { 5.f }; + def->default_value = new ConfigOptionFloats { 15.f }; def = this->add("filament_cooling_final_speed", coFloats); def->label = L("Speed of the last cooling move"); @@ -572,10 +572,7 @@ PrintConfigDef::PrintConfigDef() def = this->add("filament_type", coStrings); def->label = L("Filament type"); - def->tooltip = L("If you want to process the output G-code through custom scripts, just list their " - "absolute paths here. Separate multiple scripts with a semicolon. Scripts will be passed " - "the absolute path to the G-code file as the first argument, and they can access " - "the Slic3r config settings by reading environment variables."); + def->tooltip = L("The filament material type for use in custom G-codes."); def->cli = "filament_type=s@"; def->gui_type = "f_enum_open"; def->gui_flags = "show_value"; @@ -921,7 +918,7 @@ PrintConfigDef::PrintConfigDef() def = this->add("remaining_times", coBool); def->label = L("Supports remaining times"); - def->tooltip = L("Emit M73 P[percent printed] R[remaining time in seconds] at 1 minute" + def->tooltip = L("Emit M73 P[percent printed] R[remaining time in minutes] at 1 minute" " intervals into the G-code to let the firmware show accurate remaining time." " As of now only the Prusa i3 MK3 firmware recognizes M73." " Also the i3 MK3 firmware supports M73 Qxx Sxx for the silent mode."); -- cgit v1.2.3 From dd1fd66a47f64ca8bfba736728787d2781a983e1 Mon Sep 17 00:00:00 2001 From: Martin Loidl Date: Sun, 8 Jul 2018 14:32:48 +0200 Subject: Added possibility for upload to Duet Further changes: - Added new configuration option Host Type - Added abstract base class for future printer hosts - Moved location of upload dialog (also made it a little bit more configureable) - added possibility to send file via postfield instead a new frame --- xs/src/libslic3r/PrintConfig.cpp | 32 ++++++++++++++++++++------------ xs/src/libslic3r/PrintConfig.hpp | 27 +++++++++++++++++++++------ 2 files changed, 41 insertions(+), 18 deletions(-) (limited to 'xs/src/libslic3r') diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index a78e73fb5..794c27608 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1137,24 +1137,36 @@ PrintConfigDef::PrintConfigDef() def->cli = "nozzle-diameter=f@"; def->default_value = new ConfigOptionFloats { 0.5 }; - def = this->add("octoprint_apikey", coString); - def->label = L("API Key"); - def->tooltip = L("Slic3r can upload G-code files to OctoPrint. This field should contain " - "the API Key required for authentication."); + def = this->add("host_type", coEnum); + def->label = L("Host Type"); + def->tooltip = L("Slic3r can upload G-code files to a printer host. This field must contain " + "the kind of the host."); + def->cli = "host-type=s"; + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values.push_back("octoprint"); + def->enum_values.push_back("duet"); + def->enum_labels.push_back("OctoPrint"); + def->enum_labels.push_back("Duet"); + def->default_value = new ConfigOptionEnum(htOctoPrint); + + def = this->add("printhost_apikey", coString); + def->label = L("API Key / Password"); + def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " + "the API Key or the password required for authentication."); def->cli = "octoprint-apikey=s"; def->default_value = new ConfigOptionString(""); - def = this->add("octoprint_cafile", coString); + def = this->add("printhost_cafile", coString); def->label = "HTTPS CA file"; def->tooltip = "Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. " "If left blank, the default OS CA certificate repository is used."; def->cli = "octoprint-cafile=s"; def->default_value = new ConfigOptionString(""); - def = this->add("octoprint_host", coString); + def = this->add("print_host", coString); def->label = L("Hostname, IP or URL"); - def->tooltip = L("Slic3r can upload G-code files to OctoPrint. This field should contain " - "the hostname, IP address or URL of the OctoPrint instance."); + def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " + "the hostname, IP address or URL of the printer host instance."); def->cli = "octoprint-host=s"; def->default_value = new ConfigOptionString(""); @@ -2107,10 +2119,6 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va std::ostringstream oss; oss << "0x0," << p.value.x << "x0," << p.value.x << "x" << p.value.y << ",0x" << p.value.y; value = oss.str(); -// Maybe one day we will rename octoprint_host to print_host as it has been done in the upstream Slic3r. -// Commenting this out fixes github issue #869 for now. -// } else if (opt_key == "octoprint_host" && !value.empty()) { -// opt_key = "print_host"; } else if ((opt_key == "perimeter_acceleration" && value == "25") || (opt_key == "infill_acceleration" && value == "50")) { /* For historical reasons, the world's full of configs having these very low values; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index b18603d87..438e90681 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -27,6 +27,10 @@ enum GCodeFlavor { gcfSmoothie, gcfNoExtrusion, }; +enum PrintHostType { + htOctoPrint, htDuet, +}; + enum InfillPattern { ipRectilinear, ipGrid, ipTriangles, ipStars, ipCubic, ipLine, ipConcentric, ipHoneycomb, ip3DHoneycomb, ipGyroid, ipHilbertCurve, ipArchimedeanChords, ipOctagramSpiral, @@ -61,6 +65,15 @@ template<> inline t_config_enum_values& ConfigOptionEnum::get_enum_ return keys_map; } +template<> inline t_config_enum_values& ConfigOptionEnum::get_enum_values() { + static t_config_enum_values keys_map; + if (keys_map.empty()) { + keys_map["octoprint"] = htOctoPrint; + keys_map["duet"] = htDuet; + } + return keys_map; +} + template<> inline t_config_enum_values& ConfigOptionEnum::get_enum_values() { static t_config_enum_values keys_map; if (keys_map.empty()) { @@ -789,18 +802,20 @@ class HostConfig : public StaticPrintConfig { STATIC_PRINT_CONFIG_CACHE(HostConfig) public: - ConfigOptionString octoprint_host; - ConfigOptionString octoprint_apikey; - ConfigOptionString octoprint_cafile; + ConfigOptionEnum host_type; + ConfigOptionString print_host; + ConfigOptionString printhost_apikey; + ConfigOptionString printhost_cafile; ConfigOptionString serial_port; ConfigOptionInt serial_speed; protected: void initialize(StaticCacheBase &cache, const char *base_ptr) { - OPT_PTR(octoprint_host); - OPT_PTR(octoprint_apikey); - OPT_PTR(octoprint_cafile); + OPT_PTR(host_type); + OPT_PTR(print_host); + OPT_PTR(printhost_apikey); + OPT_PTR(printhost_cafile); OPT_PTR(serial_port); OPT_PTR(serial_speed); } -- cgit v1.2.3 From ee9f7eaef69cbb84e3f5b54e6b624e317d16f7a3 Mon Sep 17 00:00:00 2001 From: Martin Loidl Date: Mon, 20 Aug 2018 20:19:22 +0200 Subject: Host upload backwards compatibility * Added legacy code to preserve backwards compatibility * renamed some cli option names to better match option names --- xs/src/libslic3r/PrintConfig.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xs/src/libslic3r') diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 794c27608..943db2a30 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1153,21 +1153,21 @@ PrintConfigDef::PrintConfigDef() def->label = L("API Key / Password"); def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " "the API Key or the password required for authentication."); - def->cli = "octoprint-apikey=s"; + def->cli = "printhost-apikey=s"; def->default_value = new ConfigOptionString(""); def = this->add("printhost_cafile", coString); def->label = "HTTPS CA file"; def->tooltip = "Custom CA certificate file can be specified for HTTPS OctoPrint connections, in crt/pem format. " "If left blank, the default OS CA certificate repository is used."; - def->cli = "octoprint-cafile=s"; + def->cli = "printhost-cafile=s"; def->default_value = new ConfigOptionString(""); def = this->add("print_host", coString); def->label = L("Hostname, IP or URL"); def->tooltip = L("Slic3r can upload G-code files to a printer host. This field should contain " "the hostname, IP address or URL of the printer host instance."); - def->cli = "octoprint-host=s"; + def->cli = "print-host=s"; def->default_value = new ConfigOptionString(""); def = this->add("only_retract_when_crossing_perimeters", coBool); @@ -2129,6 +2129,12 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } else if (opt_key == "support_material_pattern" && value == "pillars") { // Slic3r PE does not support the pillars. They never worked well. value = "rectilinear"; + } else if (opt_key == "octoprint_host") { + opt_key = "print_host"; + } else if (opt_key == "octoprint_cafile") { + opt_key = "printhost_cafile"; + } else if (opt_key == "octoprint_apikey") { + opt_key = "printhost_apikey"; } // Ignore the following obsolete configuration keys: -- cgit v1.2.3 From 0c984c75841f2f691af5a73c070ba9d2378bb634 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Tue, 21 Aug 2018 11:10:32 +0200 Subject: Print host bugfixes / refactoring --- xs/src/libslic3r/PrintConfig.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'xs/src/libslic3r') diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 943db2a30..bf5f734ac 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -2144,9 +2144,6 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va "standby_temperature", "scale", "rotate", "duplicate", "duplicate_grid", "start_perimeters_at_concave_points", "start_perimeters_at_non_overhang", "randomize_start", "seal_position", "vibration_limit", "bed_size", - // Maybe one day we will rename octoprint_host to print_host as it has been done in the upstream Slic3r. - // Commenting this out fixes github issue #869 for now. - // "octoprint_host", "print_center", "g0", "threads", "pressure_advance", "wipe_tower_per_color_wipe" }; @@ -2156,7 +2153,6 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va } if (! print_config_def.has(opt_key)) { - //printf("Unknown option %s\n", opt_key.c_str()); opt_key = ""; return; } -- cgit v1.2.3