From d039fc95edc42324ea3bbffa9784198e22d0e72d Mon Sep 17 00:00:00 2001 From: Yifan Wu <110661856+YifanWuBambu@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:53:51 +0800 Subject: [PATCH 01/13] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 31 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..e21ee45935 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**3mf File for This Bug** +If it is related to slicing, please append the 3mf file. It could be extremely helpful to solve the issue. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS, Windows] + - Version [e.g. 22] diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..4fe86d5ec8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: feature +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 9d85a7f21621b13502bb3001d22eda129240ae4e Mon Sep 17 00:00:00 2001 From: Yifan Wu <110661856+YifanWuBambu@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:58:48 +0800 Subject: [PATCH 02/13] Update issue templates --- .github/ISSUE_TEMPLATE/custom.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/custom.md diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000000..50b6debdab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: For generic ideas such as enhancement of a feature, some questions, and etc. +title: '' +labels: '' +assignees: '' + +--- + + From fcf490028adfcfb47d4fa75e8e66bc147d592622 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Sat, 19 Nov 2022 14:17:04 +0800 Subject: [PATCH 03/13] ENH: Updater: always update plugin to the newest compatible version Change-Id: Icec343ba4913b9738add9564c78934553a33336c --- src/slic3r/GUI/GUI_App.cpp | 57 +++++++++++++++++++++++- src/slic3r/GUI/GUI_App.hpp | 1 + src/slic3r/Utils/PresetUpdater.cpp | 69 ++++++++++++++++++++++++------ src/slic3r/Utils/PresetUpdater.hpp | 2 +- 4 files changed, 115 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index a89d4188e2..ab07b42f21 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1096,7 +1096,8 @@ void GUI_App::post_init() std::string http_url = get_http_url(app_config->get_country_code()); std::string language = GUI::into_u8(current_language_code()); - this->preset_updater->sync(http_url, language, preset_bundle); + std::string network_ver = Slic3r::NetworkAgent::get_version(); + this->preset_updater->sync(http_url, language, network_ver, preset_bundle); //BBS: check new version this->check_new_version(); @@ -2224,6 +2225,7 @@ bool GUI_App::on_init_inner() Bind(EVT_USER_LOGIN, &GUI_App::on_user_login, this); + copy_network_if_available(); on_init_network(); //BBS if load user preset failed @@ -2385,6 +2387,59 @@ bool GUI_App::on_init_inner() return true; } +void GUI_App::copy_network_if_available() +{ + std::string network_library, player_library, network_library_dst, player_library_dst; + std::string data_dir_str = data_dir(); + boost::filesystem::path data_dir_path(data_dir_str); + auto plugin_folder = data_dir_path / "plugins"; + auto cache_folder = data_dir_path / "ota"; +#if defined(_MSC_VER) || defined(_WIN32) + network_library = cache_folder.string() + "/bambu_networking.dll"; + player_library = cache_folder.string() + "/BambuSource.dll"; + network_library_dst = plugin_folder.string() + "/bambu_networking.dll"; + player_library_dst = plugin_folder.string() + "/BambuSource.dll"; +#elif defined(__WXMAC__) + network_library = cache_folder.string() + "/libbambu_networking.dylib"; + player_library = cache_folder.string() + "/libBambuSource.dylib"; + network_library_dst = plugin_folder.string() + "/libbambu_networking.dylib"; + player_library_dst = plugin_folder.string() + "/libBambuSource.dylib"; +#else + network_library = cache_folder.string() + "/libbambu_networking.so"; + player_library = cache_folder.string() + "/libBambuSource.so"; + network_library_dst = plugin_folder.string() + "/libbambu_networking.so"; + player_library_dst = plugin_folder.string() + "/libBambuSource.so"; +#endif + + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": checking network_library " << network_library << ", player_library " << player_library; + std::string error_message; + if (boost::filesystem::exists(network_library)) { + CopyFileResult cfr = copy_file(network_library, network_library_dst, error_message, false); + if (cfr != CopyFileResult::SUCCESS) { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": Copying failed(" << cfr << "): " << error_message; + return; + } + + static constexpr const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read; + fs::permissions(network_library_dst, perms); + fs::remove(network_library); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": Copying network library from" << network_library << " to " << network_library_dst<<" successfully."; + } + + if (boost::filesystem::exists(player_library)) { + CopyFileResult cfr = copy_file(player_library, player_library_dst, error_message, false); + if (cfr != CopyFileResult::SUCCESS) { + BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": Copying failed(" << cfr << "): " << error_message; + return; + } + + static constexpr const auto perms = fs::owner_read | fs::owner_write | fs::group_read | fs::others_read; + fs::permissions(player_library_dst, perms); + fs::remove(player_library); + BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< ": Copying player library from" << player_library << " to " << player_library_dst<<" successfully."; + } +} + bool GUI_App::on_init_network(bool try_backup) { int load_agent_dll = Slic3r::NetworkAgent::initialize_network_module(); diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index e5fcba012a..b77d3ec9e5 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -536,6 +536,7 @@ public: private: int updating_bambu_networking(); bool on_init_inner(); + void copy_network_if_available(); bool on_init_network(bool try_backup = false); void init_networking_callbacks(); void init_app_config(); diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index d4eafae624..8399fb2936 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -230,9 +230,10 @@ struct PresetUpdater::priv void prune_tmps() const; void sync_version() const; void parse_version_string(const std::string& body) const; - void sync_resources(std::string http_url, std::map &resources); + void sync_resources(std::string http_url, std::map &resources, bool check_patch = false, std::string current_version=""); void sync_config(std::string http_url, const VendorMap vendors); void sync_tooltip(std::string http_url, std::string language); + void sync_plugins(std::string http_url, std::string plugin_version); //BBS: refine preset update logic bool install_bundles_rsrc(std::vector bundles, bool snapshot) const; @@ -349,6 +350,7 @@ bool PresetUpdater::priv::extract_file(const fs::path &source_path, const fs::pa close_zip_reader(&archive); return res; } + BOOST_LOG_TRIVIAL(info) << "[BBL Updater]successfully extract file " << stat.m_file_index << " to "< &resources) +void PresetUpdater::priv::sync_resources(std::string http_url, std::map &resources, bool check_patch, std::string current_version_str) { std::map resource_list; - BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%")%SLIC3R_APP_NAME%http_url; + BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%, current_version_str %3%, check_patch %4%")%SLIC3R_APP_NAME%http_url%current_version_str%check_patch; std::string query_params = "?"; bool first = true; @@ -545,7 +547,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::mapsecond; } + else { + BOOST_LOG_TRIVIAL(warning) << boost::format("[BBL Updater]: online version=%1%, current_version=%2%, no need to download") % online_version.to_string() % current_version.to_string(); + } } } @@ -830,6 +849,28 @@ void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string languag } } +void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_version) +{ + if (plugin_version == "00.00.00.00") { + BOOST_LOG_TRIVIAL(info) << "non need to sync plugins for there is no plugins currently."; + return; + } + std::string curr_version = SLIC3R_VERSION; + std::string using_version = curr_version.substr(0, 9) + "00"; + + try { + std::map resources + { + {"slicer/plugins/cloud", { using_version, "", "", cache_path.string(), {"plugins"}}} + }; + sync_resources(http_url, resources, true, plugin_version); + } + catch (std::exception& e) { + BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater] sync_plugins: %1%", e.what()); + } +} + + bool PresetUpdater::priv::install_bundles_rsrc(std::vector bundles, bool snapshot) const { Updates updates; @@ -1092,7 +1133,7 @@ PresetUpdater::~PresetUpdater() //BBS: change directories by design //BBS: refine the preset updater logic -void PresetUpdater::sync(std::string http_url, std::string language, PresetBundle *preset_bundle) +void PresetUpdater::sync(std::string http_url, std::string language, std::string plugin_version, PresetBundle *preset_bundle) { //p->set_download_prefs(GUI::wxGetApp().app_config); if (!p->enabled_version_check && !p->enabled_config_update) { return; } @@ -1102,7 +1143,7 @@ void PresetUpdater::sync(std::string http_url, std::string language, PresetBundl // into the closure (but perhaps the compiler can elide this). VendorMap vendors = preset_bundle->vendors; - p->thread = std::thread([this, vendors, http_url, language]() { + p->thread = std::thread([this, vendors, http_url, language, plugin_version]() { this->p->prune_tmps(); if (p->cancel) return; @@ -1112,8 +1153,12 @@ void PresetUpdater::sync(std::string http_url, std::string language, PresetBundl this->p->sync_config(http_url, std::move(vendors)); if (p->cancel) return; - this->p->sync_tooltip(http_url, language); - }); + this->p->sync_plugins(http_url, plugin_version); + //if (p->cancel) + // return; + //remove the tooltip currently + //this->p->sync_tooltip(http_url, language); + }); } void PresetUpdater::slic3r_update_notify() diff --git a/src/slic3r/Utils/PresetUpdater.hpp b/src/slic3r/Utils/PresetUpdater.hpp index 4db6772849..306c0549fa 100644 --- a/src/slic3r/Utils/PresetUpdater.hpp +++ b/src/slic3r/Utils/PresetUpdater.hpp @@ -26,7 +26,7 @@ public: ~PresetUpdater(); // If either version check or config updating is enabled, get the appropriate data in the background and cache it. - void sync(std::string http_url, std::string language, PresetBundle *preset_bundle); + void sync(std::string http_url, std::string language, std::string plugin_version, PresetBundle *preset_bundle); // If version check is enabled, check if chaced online slic3r version is newer, notify if so. void slic3r_update_notify(); From 44c2c235c0d39e8ff08207c975efa671302f9b3a Mon Sep 17 00:00:00 2001 From: "yifan.wu" Date: Sat, 26 Nov 2022 01:02:15 +0800 Subject: [PATCH 04/13] ENH: update version to v1.3.1.0 Signed-off-by: yifan.wu Change-Id: I0df092f831ea9f77b8e4cce1fe29781f95b7b795 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 0452194ef2..e5e4a599d2 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.00.25") +set(SLIC3R_VERSION "01.03.01.00") From f18550bd9dbf1d0ff4317bb9097a05e919c58201 Mon Sep 17 00:00:00 2001 From: gerrit Date: Sat, 26 Nov 2022 11:24:03 +0800 Subject: [PATCH 05/13] ci: update build version to 01.03.01.01 Change-Id: Ibee60aed5abb7e6b23f0c28322ca7ff03e930ce4 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index e5e4a599d2..5c39756471 100644 --- a/version.inc +++ b/version.inc @@ -10,4 +10,4 @@ endif() if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() -set(SLIC3R_VERSION "01.03.01.00") +set(SLIC3R_VERSION "01.03.01.01") From bcff4f81c2619b415e9937888141d4ac33a44e47 Mon Sep 17 00:00:00 2001 From: gerrit Date: Sat, 26 Nov 2022 12:05:30 +0800 Subject: [PATCH 06/13] ci: update network module based on commit 175cde3 Change-Id: I7a803608dfc894644d1c074856a35a84fa231d84 --- src/slic3r/Utils/bambu_networking.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/Utils/bambu_networking.hpp b/src/slic3r/Utils/bambu_networking.hpp index 90abd50800..57bd86320f 100644 --- a/src/slic3r/Utils/bambu_networking.hpp +++ b/src/slic3r/Utils/bambu_networking.hpp @@ -36,7 +36,7 @@ namespace BBL { #define BAMBU_NETWORK_LIBRARY "bambu_networking" #define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent" -#define BAMBU_NETWORK_AGENT_VERSION "01.03.00.02" +#define BAMBU_NETWORK_AGENT_VERSION "01.03.01.01" //iot preset type strings From b77682c13f065a2171ada8a7891eec40af19cbc8 Mon Sep 17 00:00:00 2001 From: gerrit Date: Sat, 26 Nov 2022 13:52:23 +0800 Subject: [PATCH 07/13] ci: update network module based on commit b27bf8e Change-Id: I31fd12de0b7f9b457f925a834fdc273bd944f966 --- src/slic3r/Utils/bambu_networking.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/Utils/bambu_networking.hpp b/src/slic3r/Utils/bambu_networking.hpp index 57bd86320f..8d5be9c52b 100644 --- a/src/slic3r/Utils/bambu_networking.hpp +++ b/src/slic3r/Utils/bambu_networking.hpp @@ -36,7 +36,7 @@ namespace BBL { #define BAMBU_NETWORK_LIBRARY "bambu_networking" #define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent" -#define BAMBU_NETWORK_AGENT_VERSION "01.03.01.01" +#define BAMBU_NETWORK_AGENT_VERSION "01.03.01.02" //iot preset type strings From 57755c766c558ad84a04b2e92ba4b8d602750b83 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Mon, 28 Nov 2022 20:41:20 +0800 Subject: [PATCH 08/13] Skip version check on App startup --- src/slic3r/GUI/GUI_App.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 94c6621b46..eddda8fa31 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1088,21 +1088,21 @@ void GUI_App::post_init() // to popup a modal dialog on start without screwing combo boxes. // This is ugly but I honestly found no better way to do it. // Neither wxShowEvent nor wxWindowCreateEvent work reliably. - if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. - BOOST_LOG_TRIVIAL(info) << "before check_updates"; - this->check_updates(false); - BOOST_LOG_TRIVIAL(info) << "after check_updates"; - CallAfter([this] { - bool cw_showed = this->config_wizard_startup(); + //if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. + // BOOST_LOG_TRIVIAL(info) << "before check_updates"; + // this->check_updates(false); + // BOOST_LOG_TRIVIAL(info) << "after check_updates"; + // CallAfter([this] { + // bool cw_showed = this->config_wizard_startup(); - std::string http_url = get_http_url(app_config->get_country_code()); - std::string language = GUI::into_u8(current_language_code()); - this->preset_updater->sync(http_url, language, preset_bundle); + // std::string http_url = get_http_url(app_config->get_country_code()); + // std::string language = GUI::into_u8(current_language_code()); + // this->preset_updater->sync(http_url, language, preset_bundle); - //BBS: check new version - this->check_new_version(); - }); - } + // //BBS: check new version + // this->check_new_version(); + // }); + //} if(!m_networking_need_update && m_agent) { m_agent->set_on_ssdp_msg_fn( From 4a20f7c22abe1afb02471806ff536e83d12531af Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 29 Nov 2022 23:06:09 +0800 Subject: [PATCH 09/13] uncheck `send data` by default --- resources/web/guide/3/index.html | 2 +- resources/web/guide/31/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/web/guide/3/index.html b/resources/web/guide/3/index.html index 62ae67cafc..4ddcc3101b 100644 --- a/resources/web/guide/3/index.html +++ b/resources/web/guide/3/index.html @@ -26,7 +26,7 @@
- + Allow sending anonymous data
diff --git a/resources/web/guide/31/index.html b/resources/web/guide/31/index.html index c5a386d176..b76a445b85 100644 --- a/resources/web/guide/31/index.html +++ b/resources/web/guide/31/index.html @@ -26,7 +26,7 @@
- + Allow sending anonymous data
From 264b0ee891da5c0695aa639de074f35b26ceec03 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Tue, 29 Nov 2022 23:06:37 +0800 Subject: [PATCH 10/13] support RRF firmware(experiment) --- src/libslic3r/GCode.cpp | 45 ++++++++++++++------------ src/libslic3r/GCode/GCodeProcessor.cpp | 7 +++- src/libslic3r/GCode/WipeTower.cpp | 9 ++++-- src/libslic3r/GCodeWriter.cpp | 9 ++++-- src/libslic3r/PrintConfig.cpp | 6 ++-- src/libslic3r/PrintConfig.hpp | 2 +- 6 files changed, 48 insertions(+), 30 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 26cfc5f108..86a28420e7 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2092,40 +2092,45 @@ static bool custom_gcode_sets_temperature(const std::string &gcode, const int mc // Do not process this piece of G-code by the time estimator, it already knows the values through another sources. void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print) { - if (print.config().gcode_flavor.value == gcfMarlinLegacy || print.config().gcode_flavor.value == gcfMarlinFirmware) { + const auto flavor = print.config().gcode_flavor.value; + if (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware) { + int factor = flavor == gcfRepRapFirmware ? 60 : 1; // RRF M203 and M566 are in mm/min file.write_format("M201 X%d Y%d Z%d E%d\n", int(print.config().machine_max_acceleration_x.values.front() + 0.5), int(print.config().machine_max_acceleration_y.values.front() + 0.5), int(print.config().machine_max_acceleration_z.values.front() + 0.5), int(print.config().machine_max_acceleration_e.values.front() + 0.5)); file.write_format("M203 X%d Y%d Z%d E%d\n", - int(print.config().machine_max_speed_x.values.front() + 0.5), - int(print.config().machine_max_speed_y.values.front() + 0.5), - int(print.config().machine_max_speed_z.values.front() + 0.5), - int(print.config().machine_max_speed_e.values.front() + 0.5)); + int(print.config().machine_max_speed_x.values.front() * factor + 0.5), + int(print.config().machine_max_speed_y.values.front() * factor + 0.5), + int(print.config().machine_max_speed_z.values.front() * factor + 0.5), + int(print.config().machine_max_speed_e.values.front() * factor + 0.5)); // Now M204 - acceleration. This one is quite hairy thanks to how Marlin guys care about // Legacy Marlin should export travel acceleration the same as printing acceleration. // MarlinFirmware has the two separated. - int travel_acc = print.config().gcode_flavor == gcfMarlinLegacy + int travel_acc = flavor == gcfMarlinLegacy ? int(print.config().machine_max_acceleration_extruding.values.front() + 0.5) : int(print.config().machine_max_acceleration_travel.values.front() + 0.5); - file.write_format("M204 P%d R%d T%d\n", - int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), - int(print.config().machine_max_acceleration_retracting.values.front() + 0.5), - travel_acc); - + if (flavor == gcfRepRapFirmware) + file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n", + int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), + travel_acc); + else + file.write_format("M204 P%d R%d T%d\n", + int(print.config().machine_max_acceleration_extruding.values.front() + 0.5), + int(print.config().machine_max_acceleration_retracting.values.front() + 0.5), + travel_acc); assert(is_decimal_separator_point()); - file.write_format("M205 X%.2lf Y%.2lf Z%.2lf E%.2lf\n", - print.config().machine_max_jerk_x.values.front(), - print.config().machine_max_jerk_y.values.front(), - print.config().machine_max_jerk_z.values.front(), - print.config().machine_max_jerk_e.values.front()); - //BBS: don't support M205 Sx Tx - //file.write_format("M205 S%d T%d\n", - // int(print.config().machine_min_extruding_rate.values.front() + 0.5), - // int(print.config().machine_min_travel_rate.values.front() + 0.5)); + file.write_format(flavor == gcfRepRapFirmware + ? "M566 X%.2lf Y%.2lf Z%.2lf E%.2lf ; sets the jerk limits, mm/min\n" + : "M205 X%.2lf Y%.2lf Z%.2lf E%.2lf ; sets the jerk limits, mm/sec\n", + print.config().machine_max_jerk_x.values.front() * factor, + print.config().machine_max_jerk_y.values.front() * factor, + print.config().machine_max_jerk_z.values.front() * factor, + print.config().machine_max_jerk_e.values.front() * factor); + } } diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 06931a27c0..a1bd906b6d 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -911,12 +911,17 @@ void GCodeProcessor::apply_config(const PrintConfig& config) m_result.filament_vitrification_temperature[i] = static_cast(config.temperature_vitrification.get_at(i)); } - if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) { + if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) { m_time_processor.machine_limits = reinterpret_cast(config); if (m_flavor == gcfMarlinLegacy) { // Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead. m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding; } + if (m_flavor == gcfRepRapFirmware) { + // RRF does not support setting min feedrates. Set them to zero. + m_time_processor.machine_limits.machine_min_travel_rate.values.assign(m_time_processor.machine_limits.machine_min_travel_rate.size(), 0.); + m_time_processor.machine_limits.machine_min_extruding_rate.values.assign(m_time_processor.machine_limits.machine_min_extruding_rate.size(), 0.); + } } // Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful. diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index b87b6af672..cbdca7e928 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -99,8 +99,13 @@ public: } WipeTowerWriter& disable_linear_advance() { - m_gcode += (m_gcode_flavor == gcfKlipper ? (std::string("SET_PRESSURE_ADVANCE ADVANCE=0\n")) - : std::string("M900 K0\n")); + if(m_gcode_flavor == gcfKlipper) + m_gcode += "SET_PRESSURE_ADVANCE ADVANCE=0\n"; + else if(m_gcode_flavor == gcfRepRapFirmware) + m_gcode += std::string("M572 D") + std::to_string(m_current_tool) + " S0\n"; + else + m_gcode += "M900 K0\n"; + return *this; } diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index 5876f9fdd0..fe5ddbecfd 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -22,9 +22,12 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) { this->config.apply(print_config, true); m_single_extruder_multi_material = print_config.single_extruder_multi_material.value; - bool is_marlin = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware || print_config.gcode_flavor.value == gcfKlipper; - m_max_acceleration = std::lrint(is_marlin ? print_config.machine_max_acceleration_extruding.values.front() : 0); - m_max_jerk = std::lrint(is_marlin ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0); + bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy || + print_config.gcode_flavor.value == gcfMarlinFirmware || + print_config.gcode_flavor.value == gcfKlipper || + print_config.gcode_flavor.value == gcfRepRapFirmware; + m_max_acceleration = std::lrint(use_mach_limits ? print_config.machine_max_acceleration_extruding.values.front() : 0); + m_max_jerk = std::lrint(use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0); } void GCodeWriter::set_extruders(std::vector extruder_ids) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 89d9ff106b..3cc08e681b 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1567,7 +1567,7 @@ void PrintConfigDef::init_fff_params() def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); def->enum_values.push_back("marlin"); def->enum_values.push_back("klipper"); - //def->enum_values.push_back("reprapfirmware"); + def->enum_values.push_back("reprapfirmware"); //def->enum_values.push_back("repetier"); //def->enum_values.push_back("teacup"); //def->enum_values.push_back("makerware"); @@ -1578,8 +1578,9 @@ void PrintConfigDef::init_fff_params() //def->enum_values.push_back("smoothie"); //def->enum_values.push_back("no-extrusion"); def->enum_labels.push_back("Marlin(legacy)"); + def->enum_labels.push_back(L("Klipper")); + def->enum_labels.push_back("RepRapFirmware"); //def->enum_labels.push_back("RepRap/Sprinter"); - //def->enum_labels.push_back("RepRapFirmware"); //def->enum_labels.push_back("Repetier"); //def->enum_labels.push_back("Teacup"); //def->enum_labels.push_back("MakerWare (MakerBot)"); @@ -1589,7 +1590,6 @@ void PrintConfigDef::init_fff_params() //def->enum_labels.push_back("Machinekit"); //def->enum_labels.push_back("Smoothie"); //def->enum_labels.push_back(L("No extrusion")); - def->enum_labels.push_back(L("Klipper")); def->mode = comAdvanced; def->readonly = false; def->set_default_value(new ConfigOptionEnum(gcfMarlinLegacy)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index dfc0888d66..1329231b95 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -32,7 +32,7 @@ namespace Slic3r { enum GCodeFlavor : unsigned char { - gcfMarlinLegacy, gcfKlipper, gcfRepRapSprinter, gcfRepRapFirmware, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit, + gcfMarlinLegacy, gcfKlipper, gcfRepRapFirmware, gcfRepRapSprinter, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlinFirmware, gcfSailfish, gcfMach3, gcfMachinekit, gcfSmoothie, gcfNoExtrusion }; From eeb8b6eb374981f481a70baa1b74bbfe17a33cd1 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 30 Nov 2022 00:04:25 +0800 Subject: [PATCH 11/13] Skip version check on App startup --- src/slic3r/GUI/GUI_App.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 44450ed448..d195402015 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1088,22 +1088,22 @@ void GUI_App::post_init() // to popup a modal dialog on start without screwing combo boxes. // This is ugly but I honestly found no better way to do it. // Neither wxShowEvent nor wxWindowCreateEvent work reliably. - //if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. - // BOOST_LOG_TRIVIAL(info) << "before check_updates"; - // this->check_updates(false); - // BOOST_LOG_TRIVIAL(info) << "after check_updates"; - // CallAfter([this] { - // bool cw_showed = this->config_wizard_startup(); + if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. + BOOST_LOG_TRIVIAL(info) << "before check_updates"; + this->check_updates(false); + BOOST_LOG_TRIVIAL(info) << "after check_updates"; + CallAfter([this] { + bool cw_showed = this->config_wizard_startup(); - // std::string http_url = get_http_url(app_config->get_country_code()); - // std::string language = GUI::into_u8(current_language_code()); - // std::string network_ver = Slic3r::NetworkAgent::get_version(); - // this->preset_updater->sync(http_url, language, network_ver, preset_bundle); + std::string http_url = get_http_url(app_config->get_country_code()); + std::string language = GUI::into_u8(current_language_code()); + std::string network_ver = Slic3r::NetworkAgent::get_version(); + this->preset_updater->sync(http_url, language, network_ver, preset_bundle); - // //BBS: check new version - // this->check_new_version(); - // }); - //} + //BBS: check new version + //this->check_new_version(); + }); + } if(!m_networking_need_update && m_agent) { m_agent->set_on_ssdp_msg_fn( From 4f53ef9316acacaeac39f00820c515db6a099590 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 30 Nov 2022 00:16:00 +0800 Subject: [PATCH 12/13] bump version to 1.3.3.2 --- version.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.inc b/version.inc index 19725b2281..747143168c 100644 --- a/version.inc +++ b/version.inc @@ -11,4 +11,4 @@ if(NOT DEFINED BBL_INTERNAL_TESTING) set(BBL_INTERNAL_TESTING "1") endif() set(SLIC3R_VERSION "01.03.01.01") -set(SoftFever_VERSION "1.3.3") +set(SoftFever_VERSION "1.3.3.2") From f06171f5517bcab6638854bfba97c2f1d5e58213 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Wed, 30 Nov 2022 21:31:33 +0800 Subject: [PATCH 13/13] make extruder clearance settings editable --- src/slic3r/GUI/Tab.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 6094c2119e..68099d351a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1889,6 +1889,7 @@ void TabPrint::build() optgroup->append_single_option_line("tree_support_wall_count"); optgroup->append_single_option_line("tree_support_with_infill"); optgroup->append_single_option_line("support_top_z_distance", "support#top-z-distance"); + optgroup->append_single_option_line("support_bottom_z_distance", "support#bottom-z-distance"); optgroup->append_single_option_line("support_base_pattern", "support#base-pattern"); optgroup->append_single_option_line("support_base_pattern_spacing", "support#base-pattern"); //optgroup->append_single_option_line("support_angle"); @@ -3449,8 +3450,8 @@ void TabPrinter::toggle_options() // Disable silent mode for non-marlin firmwares. toggle_option("silent_mode", is_marlin_flavor); //BBS: extruder clearance of BBL printer can't be edited. - for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" }) - toggle_option(el, !is_BBL_printer); + //for (auto el : { "extruder_clearance_radius", "extruder_clearance_height_to_rod", "extruder_clearance_height_to_lid" }) + // toggle_option(el, !is_BBL_printer); // SoftFever: hide BBL specific settings for (auto el :