remove retired_filament_ids.json

This commit is contained in:
SoftFever
2026-09-03 21:03:42 +08:00
parent fdc0ee18f1
commit 7c9b38ba04
16 changed files with 119 additions and 8309 deletions
+1 -7
View File
@@ -69,7 +69,7 @@ static wxString nozzle_id_code_to_string(int code)
}
}
static wxString get_preset_name_by_filament_id(std::string filament_id, bool follow_succession = true)
static wxString get_preset_name_by_filament_id(std::string filament_id)
{
auto preset_bundle = wxGetApp().preset_bundle;
auto collection = &preset_bundle->filaments;
@@ -103,12 +103,6 @@ static wxString get_preset_name_by_filament_id(std::string filament_id, bool fol
}
}
}
if (preset_name.empty() && follow_succession) {
// Retired/renamed ids forward to a live successor through the shipped succession ledger.
const std::string successor = resolve_filament_id_succession(filament_id);
if (!successor.empty())
preset_name = get_preset_name_by_filament_id(successor, false);
}
return preset_name;
}
+7 -15
View File
@@ -2764,22 +2764,14 @@ std::string MachineObject::setting_id_to_type(std::string setting_id, std::strin
std::string type;
PresetBundle* preset_bundle = GUI::wxGetApp().preset_bundle;
if (preset_bundle) {
auto lookup_system_type = [preset_bundle](const std::string &id) {
std::string display_filament_type;
for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
if (it->filament_id.compare(id) == 0 && it->is_system) {
it->config.get_filament_type(display_filament_type);
break;
}
for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
if (it->filament_id.compare(setting_id) == 0 && it->is_system) {
std::string display_filament_type;
it->config.get_filament_type(display_filament_type);
type = display_filament_type;
break;
}
return display_filament_type;
};
type = lookup_system_type(setting_id);
if (type.empty()) {
// Retired/renamed ids forward to a live successor through the shipped succession ledger.
const std::string successor = resolve_filament_id_succession(setting_id);
if (!successor.empty())
type = lookup_system_type(successor);
}
}
-7
View File
@@ -556,13 +556,6 @@ bool PresetComboBox::add_ams_filaments(std::string selected, bool alias_name)
}
auto iter = std::find_if(filaments.begin(), filaments.end(),
[&filament_id, this](auto &f) { return f.is_compatible && m_collection->get_preset_base(f) == &f && f.filament_id == filament_id; });
if (iter == filaments.end()) {
// Retired/renamed ids forward to a live successor through the shipped succession ledger.
const std::string successor = resolve_filament_id_succession(filament_id);
if (!successor.empty())
iter = std::find_if(filaments.begin(), filaments.end(),
[&successor, this](auto &f) { return f.is_compatible && m_collection->get_preset_base(f) == &f && f.filament_id == successor; });
}
if (iter == filaments.end()) {
auto filament_type = tray.opt_string("filament_type", 0u);
if (!filament_type.empty()) {