From 088c8f5a8bee8218c138f4eda481db313c1967fb Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Thu, 20 Feb 2025 17:22:25 +0800 Subject: [PATCH 1/2] Fix crash when selected bed type is not supported by current version. This could happen if you downgrade Orca to old version that does not have that bed type --- src/slic3r/GUI/Plater.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index f14175568..5a68b1a45 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1298,8 +1298,10 @@ void Sidebar::update_all_preset_comboboxes() "curr_bed_type"); if (!str_bed_type.empty()) { int bed_type_value = atoi(str_bed_type.c_str()); - if (bed_type_value == 0) - bed_type_value = 1; + if (bed_type_value <= 0 || bed_type_value >= btCount) { + bed_type_value = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle); + } + m_bed_type_list->SelectAndNotify(bed_type_value - 1); } else { BedType bed_type = preset_bundle.printers.get_edited_preset().get_default_bed_type(&preset_bundle); From 831743997dc9267f25fddbb4c55564ae82be5c53 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Thu, 20 Feb 2025 17:41:41 +0800 Subject: [PATCH 2/2] Fix issue that current bed type is changed after upgrading from 2.2 --- src/libslic3r/PrintConfig.cpp | 4 ++-- src/libslic3r/PrintConfig.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index b25a7d417..070152c7a 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -804,18 +804,18 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->enum_keys_map = &s_keys_map_BedType; // Orca: make sure the order of the values is the same as the BedType enum - def->enum_values.emplace_back("Supertack Plate"); def->enum_values.emplace_back("Cool Plate"); def->enum_values.emplace_back("Engineering Plate"); def->enum_values.emplace_back("High Temp Plate"); def->enum_values.emplace_back("Textured PEI Plate"); def->enum_values.emplace_back("Textured Cool Plate"); - def->enum_labels.emplace_back(L("Cool Plate (SuperTack)")); + def->enum_values.emplace_back("Supertack Plate"); def->enum_labels.emplace_back(L("Smooth Cool Plate")); def->enum_labels.emplace_back(L("Engineering Plate")); def->enum_labels.emplace_back(L("Smooth High Temp Plate")); def->enum_labels.emplace_back(L("Textured PEI Plate")); def->enum_labels.emplace_back(L("Textured Cool Plate")); + def->enum_labels.emplace_back(L("Cool Plate (SuperTack)")); def->set_default_value(new ConfigOptionEnum(btPC)); // BBS diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 02db0c061..b11225ea6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -268,12 +268,12 @@ enum OverhangFanThreshold { // BBS enum BedType { btDefault = 0, - btSuperTack, btPC, btEP, btPEI, btPTE, btPCT, + btSuperTack, btCount };