diff --git a/deps_src/semver/semver.c b/deps_src/semver/semver.c index 8611bd7b7f..b23c110edc 100644 --- a/deps_src/semver/semver.c +++ b/deps_src/semver/semver.c @@ -224,12 +224,14 @@ compare_prerelease (char *x, char *y) { if (x == NULL && y) return 1; // Orca: Special handling for 'dev' + // Nightly builds stay on x.y.z-dev after the alpha and beta are tagged, so 'dev' + // ranks above every other prerelease and below the release. if (strcmp(x, "dev") == 0 && strcmp(y, "dev") == 0) return 0; if (strcmp(x, "dev") == 0 && strcmp(y, "dev") != 0) - return -1; - if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0) return 1; + if (strcmp(x, "dev") != 0 && strcmp(y, "dev") == 0) + return -1; lastx = x; lasty = y; diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 610d6c7147..158e92cf0a 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3092,11 +3092,9 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu // free functions called by GCode::_do_export() namespace DoExport { - static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor, bool& silent_time_estimator_enabled, + static void init_gcode_processor(const PrintConfig& config, GCodeProcessor& processor, const std::shared_ptr& nozzle_group_result = nullptr) { - silent_time_estimator_enabled = (config.gcode_flavor == gcfMarlinLegacy || config.gcode_flavor == gcfMarlinFirmware) - && config.silent_mode; processor.reset(); // Slot-resolution context for the streaming replay (reset() just cleared it). This is NOT // the post-stream result-field handover at the end of do_export, which gates the richer @@ -3105,7 +3103,6 @@ namespace DoExport { processor.initialize_result_moves(); processor.apply_config(config); processor.configure_exclusion_volume_path_check(config); - processor.enable_stealth_time_estimator(silent_time_estimator_enabled); } #if 0 @@ -3397,9 +3394,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato // init as filament map update_layer_related_config(0); - // modifies m_silent_time_estimator_enabled - DoExport::init_gcode_processor(print.config(), m_processor, m_silent_time_estimator_enabled, - print.get_layered_nozzle_group_result()); + DoExport::init_gcode_processor(print.config(), m_processor, print.get_layered_nozzle_group_result()); set_mass_locator(m_processor, print); const bool is_bbl_printers = print.is_BBL_printer(); const bool skip_config_block = print.config().gcode_skip_config_block; diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index e9a346889a..ac646c2a85 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -248,7 +248,6 @@ public: #endif // ENABLE_GCODE_VIEWER_DATA_CHECKING m_brim_done(false), m_second_layer_things_done(false), - m_silent_time_estimator_enabled(false), m_last_obj_copy(nullptr, Point(std::numeric_limits::max(), std::numeric_limits::max())), // BBS m_toolchange_count(0), @@ -911,7 +910,6 @@ protected: int m_timelapse_warning_code = 0; bool m_support_traditional_timelapse = true; - bool m_silent_time_estimator_enabled; Print *m_print{nullptr}; diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index ba22abf4a0..487814a286 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -3652,14 +3652,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) DEFAULT_TRAVEL_ACCELERATION; } - if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) { - const ConfigOptionBool* silent_mode = config.option("silent_mode"); - if (silent_mode != nullptr) { - if (silent_mode->value && m_time_processor.machine_limits.machine_max_acceleration_x.values.size() > 1) - enable_stealth_time_estimator(true); - } - } - const ConfigOptionFloat* initial_layer_print_height = config.option("initial_layer_print_height"); if (initial_layer_print_height != nullptr) m_first_layer_height = std::abs(initial_layer_print_height->value); @@ -3699,11 +3691,6 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) ensure_nozzle_group_result(static_cast(m_result.filaments_count)); } -void GCodeProcessor::enable_stealth_time_estimator(bool enabled) -{ - m_time_processor.machines[static_cast(PrintEstimatedStatistics::ETimeMode::Stealth)].enabled = enabled; -} - void GCodeProcessor::reset() { m_units = EUnits::Millimeters; diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 151faa10cb..a196476e7a 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -1425,7 +1425,6 @@ inline constexpr float DEFAULT_FILAMENT_DENSITY = 1.245f; DynamicConfig export_config_for_render() const; - void enable_stealth_time_estimator(bool enabled); bool is_stealth_time_estimator_enabled() const { return m_time_processor.machines[static_cast(PrintEstimatedStatistics::ETimeMode::Stealth)].enabled; } diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 40a3385371..e643e38b95 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1583,7 +1583,6 @@ static std::vector s_Preset_printer_options { "printable_height", "extruder_printable_height", "extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "extruder_clearance_dist_to_rod", "nozzle_height", "master_extruder_id", "default_print_profile", "inherits", - "silent_mode", "scan_first_layer", "enable_power_loss_recovery", "wrapping_detection_layers", "wrapping_exclude_area", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", "nozzle_type", "nozzle_hrc","auxiliary_fan", "fan_direction", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","support_cooling_filter","cooling_filter_enabled","printer_structure","farthest_point_timelapse", "best_object_pos", "head_wrap_detect_zone", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 164bdece3b..1e6079ff8c 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -5290,12 +5290,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionString("")); - def = this->add("silent_mode", coBool); - def->label = L("Silent Mode"); - def->tooltip = L("Whether the machine supports silent mode in which machine uses lower acceleration to print more quietly"); - def->mode = comDevelop; - def->set_default_value(new ConfigOptionBool(false)); - def = this->add("emit_machine_limits_to_gcode", coBool); def->label = L("Emit limits to G-code"); def->category = L("Machine limits"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index e712c4565f..51b5640593 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1836,7 +1836,6 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionStrings, filament_change_extrusion_role_gcode)) ((ConfigOptionFloatsNullable, travel_speed)) ((ConfigOptionFloatsNullable, travel_speed_z)) - ((ConfigOptionBool, silent_mode)) ((ConfigOptionString, machine_pause_gcode)) ((ConfigOptionString, template_custom_gcode)) //BBS diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 80965cf970..c2f0392d18 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -9283,12 +9283,9 @@ std::vector Plater::priv::load_files(const std::vector& input_ if (config_substitutions.unrecogized_keys.size() > 0) { wxString text = wxString::Format(_L("The 3MF file version %s is newer than %s's version %s, found the following unrecognized keys:"), file_version.to_string_sf(), std::string(SLIC3R_APP_FULL_NAME), app_version.to_string_sf()); - text += "\n"; - wxString context = text; - wxString append = _L("You should update your software.\n"); - context += "\n\n"; - context += append; - log_and_show_3mf_info(context, newer_3mf_title); + text += "\n" + from_u8(boost::algorithm::join(config_substitutions.unrecogized_keys, ", ")) + "\n\n"; + text += _L("You should update your software.\n"); + log_and_show_3mf_info(text, newer_3mf_title); } else { //if the minor version is not matched @@ -9346,9 +9343,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ } else if (load_config) { // Logged, not shown: it is the same for every BambuStudio project and needs no action. - std::string unrecognized; - for (const std::string& key : config_substitutions.unrecogized_keys) - unrecognized += (unrecognized.empty() ? "" : ", ") + key; + const std::string unrecognized = boost::algorithm::join(config_substitutions.unrecogized_keys, ", "); BOOST_LOG_TRIVIAL(info) << "BambuStudio " << file_version.to_string() << " project " << path.string() << ", unrecognized settings: " << (unrecognized.empty() ? "none" : unrecognized); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 31aa897f2e..a29db94827 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -5829,9 +5829,7 @@ void TabPrinter::append_option_line(ConfigOptionsGroupShp optgroup, const std::s auto line = Line{ option.opt.full_label, "" }; line.label_path = label_path; line.append_option(option); - if (m_use_silent_mode - || m_printer_technology == ptSLA // just for first build, if SLA printer preset is selected - ) + if (m_printer_technology == ptSLA) // just for first build, if SLA printer preset is selected line.append_option(optgroup->get_option(opt_key, 1)); optgroup->append_line(line); } @@ -5840,29 +5838,6 @@ PageShp TabPrinter::build_kinematics_page() { auto page = add_options_page(L("Motion ability"), "custom-gcode_motion", true); // ORCA: icon only visible on placeholders - if (m_use_silent_mode) { - // Legend for OptionsGroups - auto optgroup = page->new_optgroup(""); - auto line = Line{ "", "" }; - - ConfigOptionDef def; - def.type = coString; - def.width = Field::def_width(); - def.gui_type = ConfigOptionDef::GUIType::legend; - def.mode = comDevelop; - //def.tooltip = L("Values in this column are for Normal mode"); - def.set_default_value(new ConfigOptionString{ _(L("Normal")).ToUTF8().data() }); - - auto option = Option(def, "full_power_legend"); - line.append_option(option); - - //def.tooltip = L("Values in this column are for Stealth mode"); - def.set_default_value(new ConfigOptionString{ _(L("Silent")).ToUTF8().data() }); - option = Option(def, "silent_legend"); - line.append_option(option); - - optgroup->append_line(line); - } auto optgroup = page->new_optgroup(L("Advanced"), "param_advanced"); optgroup->append_single_option_line("emit_machine_limits_to_gcode", "printer_motion_ability#emit-limits-to-g-code"); @@ -5962,13 +5937,9 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/) size_t existed_page = 0; for (size_t i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already if (m_pages[i]->title().find(L("Motion ability")) != std::string::npos) { - if (m_rebuild_kinematics_page) - m_pages.erase(m_pages.begin() + i); - else - existed_page = i; + existed_page = i; break; } - m_rebuild_kinematics_page = false; if (existed_page < n_before_extruders && (is_marlin_flavor || from_initial_build)) { auto page = build_kinematics_page(); @@ -6957,13 +6928,9 @@ void TabPrinter::toggle_options() const bool gcf_is_klipper = gcf == GCodeFlavor::gcfKlipper; const bool gcf_is_reprap_firmware = gcf == GCodeFlavor::gcfRepRapFirmware; - bool silent_mode = m_config->opt_bool("silent_mode"); - int max_field = silent_mode ? 2 : 1; - for (int i = 0; i < max_field; ++i) - toggle_option("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper, i); + toggle_option("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper, 0); toggle_line("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper); - for (int i = 0; i < max_field; ++i) - toggle_option("machine_max_junction_deviation", gcf_is_marlin_firmware, i); + toggle_option("machine_max_junction_deviation", gcf_is_marlin_firmware, 0); toggle_line("machine_max_junction_deviation", gcf_is_marlin_firmware); // Check if junction deviation value is non-zero and firmware is Marlin @@ -6977,12 +6944,10 @@ void TabPrinter::toggle_options() enable_jerk = true; } } - for (int i = 0; i < max_field; ++i) { - toggle_option("machine_max_jerk_x", enable_jerk, i); - toggle_option("machine_max_jerk_y", enable_jerk, i); - toggle_option("machine_max_jerk_z", enable_jerk, i); - toggle_option("machine_max_jerk_e", enable_jerk, i); - } + toggle_option("machine_max_jerk_x", enable_jerk, 0); + toggle_option("machine_max_jerk_y", enable_jerk, 0); + toggle_option("machine_max_jerk_z", enable_jerk, 0); + toggle_option("machine_max_jerk_e", enable_jerk, 0); bool emittable_limits = gcf_is_marlin_legacy || gcf_is_marlin_firmware || gcf_is_reprap_firmware; toggle_option("emit_machine_limits_to_gcode", emittable_limits); @@ -7087,11 +7052,6 @@ void TabPrinter::update() void TabPrinter::update_fff() { - if (m_use_silent_mode != m_config->opt_bool("silent_mode")) { - m_rebuild_kinematics_page = true; - m_use_silent_mode = m_config->opt_bool("silent_mode"); - } - // Sync IDEX/IQEX tool grid whenever carriage configuration changes. // set_grid_size() is a no-op when dimensions and layout are unchanged. // load_from_config() is gated on matches_config() — without that guard, diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 89e3ce0960..6b4444c962 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -717,9 +717,7 @@ class IMEXModesCtrl; class TabPrinter : public Tab { private: - bool m_use_silent_mode = false; void append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string& label_path = ""); - bool m_rebuild_kinematics_page = false; void update_input_shaper_menu(GCodeFlavor flavor); // R8: track the belt->non-belt transition so update_fff() only clears the belt-derived diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 8a9693f750..43e271cceb 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1623,10 +1623,6 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres wxString label = option.label_local; if (type == Preset::TYPE_PRINTER && variant_index >= 0 && printer_options_with_variant_2.count(get_pure_opt_key(opt_key)) > 0) { - // Orca: silent_mode is obsolete on import, but its option and two-column UI still exist. - // Keep mode labels for configs that explicitly enable it; omit them in the default single-mode UI. - if (new_config.opt_bool("silent_mode")) - label += " (" + (variant_index % 2 == 0 ? _L("Normal") : _L("Silent")) + ")"; variant_index /= 2; } if (variant_index >= 0 && extruder_variant && variant_index < extruder_variant->size()) { diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index a42ead92e4..97fcf2804e 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -68,6 +68,7 @@ add_executable(${_TEST_NAME}_tests test_utils.cpp test_miniz_extension.cpp test_timeutils.cpp + test_semver.cpp test_voronoi.cpp test_wipe_tower_estimate.cpp test_wipe_tower.cpp diff --git a/tests/libslic3r/test_config.cpp b/tests/libslic3r/test_config.cpp index 705da9d36a..fdab25bafb 100644 --- a/tests/libslic3r/test_config.cpp +++ b/tests/libslic3r/test_config.cpp @@ -1535,6 +1535,19 @@ TEST_CASE("handle_legacy migrates the adaptive TPMS keys", "[Config]") { CHECK(ctxt.substitutions.empty()); } +TEST_CASE("silent_mode is no longer saved and is dropped on load", "[Config]") { + DynamicPrintConfig full; + full.apply(FullPrintConfig::defaults()); + CHECK_FALSE(full.has("silent_mode")); + + // Projects saved before its removal still carry it. + ConfigSubstitutionContext ctxt(ForwardCompatibilitySubstitutionRule::Enable); + DynamicPrintConfig config; + config.set_deserialize("silent_mode", "0", ctxt); + CHECK_FALSE(config.has("silent_mode")); + CHECK(ctxt.unrecogized_keys == std::vector{"silent_mode"}); +} + TEST_CASE("handle_legacy migrates every IDEX/IQEX key testers already have", "[Config]") { // Three eras of saved profiles: the feature shipped as iXex (is_ixex + ixex_*), the clearance // pair was renamed to say what it measures, then the whole prefix became imex_. Driven from the diff --git a/tests/libslic3r/test_semver.cpp b/tests/libslic3r/test_semver.cpp new file mode 100644 index 0000000000..81abd967be --- /dev/null +++ b/tests/libslic3r/test_semver.cpp @@ -0,0 +1,32 @@ +#include +#include +#include + +#include "libslic3r/Semver.hpp" + +#include +#include + +using namespace Slic3r; + +TEST_CASE("A dev build ranks above its alpha and beta and below its release", "[Semver]") { + const auto [lower, higher] = GENERATE(table({ + { "2.5.0-alpha", "2.5.0-dev" }, + { "2.5.0-beta", "2.5.0-dev" }, + { "2.5.0-rc", "2.5.0-dev" }, + { "2.5.0-alpha", "2.5.0-beta" }, + { "2.5.0-dev", "2.5.0" }, + { "2.4.2", "2.5.0-dev" }, + { "2.5.0", "2.6.0-dev" }, + })); + INFO(lower << " < " << higher); + const Semver lo(lower); + const Semver hi(higher); + CHECK(lo < hi); + CHECK(hi > lo); + CHECK_FALSE(hi < lo); +} + +TEST_CASE("Two dev builds of the same version are equal", "[Semver]") { + CHECK(Semver("2.5.0-dev") == Semver("2.5.0-dev")); +}