From fa2caa8bc83e91e0edf53835ce4cce00ecfdcc86 Mon Sep 17 00:00:00 2001 From: "lane.wei" Date: Thu, 18 Jul 2024 18:12:34 +0800 Subject: [PATCH] ENH: config: add version different check logic jira: STUDIO-7361 Change-Id: I0541d2cdd3bcef059f50ad3accf92bf4bdeaa670 --- src/libslic3r/Format/bbs_3mf.cpp | 2 +- src/libslic3r/Preset.cpp | 4 ++-- src/libslic3r/PresetBundle.cpp | 2 +- src/slic3r/GUI/Plater.cpp | 4 ++-- src/slic3r/Utils/PresetUpdater.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/Format/bbs_3mf.cpp b/src/libslic3r/Format/bbs_3mf.cpp index 8c81ad2f6..5c240cced 100644 --- a/src/libslic3r/Format/bbs_3mf.cpp +++ b/src/libslic3r/Format/bbs_3mf.cpp @@ -1680,7 +1680,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result) if (m_bambuslicer_generator_version) { Semver app_version = *(Semver::parse(SLIC3R_VERSION)); Semver file_version = *m_bambuslicer_generator_version; - if (file_version.maj() != app_version.maj()) + if (file_version.maj() > app_version.maj()) dont_load_config = true; } else { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 2c3900daa..6e9ca5745 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1149,7 +1149,7 @@ void PresetCollection::load_presets( boost::optional version = Semver::parse(version_str); if (!version) continue; Semver app_version = *(Semver::parse(SLIC3R_VERSION)); - if ( version->maj() != app_version.maj()) { + if ( version->maj() > app_version.maj()) { BOOST_LOG_TRIVIAL(warning) << "Preset incompatibla, not loading: " << name; continue; } @@ -1605,7 +1605,7 @@ bool PresetCollection::load_user_preset(std::string name, std::mapmaj() != app_version.maj()) { + if ( cloud_version->maj() > app_version.maj()) { BOOST_LOG_TRIVIAL(warning)<< __FUNCTION__ << boost::format("version %1% mismatch with app version %2%, not loading for user preset %3%")%version_str %SLIC3R_VERSION %name; return false; } diff --git a/src/libslic3r/PresetBundle.cpp b/src/libslic3r/PresetBundle.cpp index b5934f755..0d8f557a6 100644 --- a/src/libslic3r/PresetBundle.cpp +++ b/src/libslic3r/PresetBundle.cpp @@ -747,7 +747,7 @@ bool PresetBundle::import_json_presets(PresetsConfigSubstitutions & s boost::optional version = Semver::parse(version_str); if (!version) return false; Semver app_version = *(Semver::parse(SLIC3R_VERSION)); - if (version->maj() != app_version.maj()) { + if (version->maj() > app_version.maj()) { BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << " Preset incompatibla, not loading: " << name; return false; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index e753a5d8f..974396a2b 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3642,7 +3642,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ if(load_type != LoadType::LoadGeometry) show_info(q, _L("The 3mf is not from Bambu Lab, load geometry data only."), _L("Load 3mf")); } - else if (load_config && (file_version.maj() != app_version.maj())) { + else if (load_config && (file_version.maj() > app_version.maj())) { // version mismatch, only load geometries load_config = false; if (!load_model) { @@ -3658,7 +3658,7 @@ std::vector Plater::priv::load_files(const std::vector& input_ q->select_plate(0); if (load_type != LoadType::LoadGeometry) { if (en_3mf_file_type == En3mfType::From_BBS) - show_info(q, _L("The 3mf is generated by old Bambu Studio, load geometry data only."), _L("Load 3mf")); + show_info(q, _L("Due to the lower version of Bambu Studio, this 3mf file cannot be fully loaded. Please update Bambu Studio to the latest version"), _L("Load 3mf")); else show_info(q, _L("The 3mf is not from Bambu Lab, load geometry data only."), _L("Load 3mf")); } diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 7898b709b..1f41c853b 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1202,7 +1202,7 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const bool version_match = ((resource_ver.maj() == vendor_ver.maj()) && (resource_ver.min() == vendor_ver.min())); if (!version_match || (vendor_ver < resource_ver)) { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:found vendor "<