diff --git a/resources/profiles_template/Template/filament/filament_ppa_template.json b/resources/profiles_template/Template/filament/filament_ppa_template.json index bfff947b0..f89e5290c 100644 --- a/resources/profiles_template/Template/filament/filament_ppa_template.json +++ b/resources/profiles_template/Template/filament/filament_ppa_template.json @@ -90,7 +90,7 @@ "PPA-CF" ], "filament_vendor": [ - "Bambu Lab" + "Generic" ], "filament_wipe": [ "nil" diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 604c1014c..e8a6218ae 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -5104,7 +5104,7 @@ void Plater::priv::reload_from_disk() #if ENABLE_RELOAD_FROM_DISK_REWORK // collect selected reloadable ModelVolumes std::vector> selected_volumes = reloadable_volumes(model, get_selection()); - + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " entry, and reloadable volumes number is: " << selected_volumes.size(); // nothing to reload, return if (selected_volumes.empty()) return; @@ -5501,6 +5501,8 @@ void Plater::priv::reload_from_disk() for (size_t i = 0; i < model.objects.size(); ++i) { view3D->get_canvas3d()->update_instance_printable_state_for_object(i); } + + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " finish."; } void Plater::priv::reload_all_from_disk() diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index 67ef99f56..b9d73bf4e 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -43,21 +43,29 @@ static wxString update_custom_filaments() json m_CustomFilaments = json::array(); PresetBundle * preset_bundle = wxGetApp().preset_bundle; std::map> temp_filament_id_to_presets = preset_bundle->filaments.get_filament_presets(); - json temp_j; + + std::vector> need_sort; for (std::pair> filament_id_to_presets : temp_filament_id_to_presets) { std::string filament_id = filament_id_to_presets.first; if (filament_id.empty()) continue; for (const Preset *preset : filament_id_to_presets.second) { if (preset->is_system || filament_id.empty() || "null" == filament_id || filament_id.size() != 8 || filament_id[0] != 'P') break; - temp_j["id"] = preset->filament_id; + auto filament_vendor = dynamic_cast (const_cast(preset)->config.option("filament_vendor",false)); + if(filament_vendor&&filament_vendor->values.size()&&filament_vendor->values[0] == "Generic") break; std::string preset_name = preset->name; - size_t index_at = preset_name.find_last_of('@'); - if (std::string::npos != index_at) { preset_name = preset_name.substr(0, index_at - 1); } - temp_j["name"] = preset_name; - m_CustomFilaments.push_back(temp_j); + size_t index_at = preset_name.find(" @"); + if (std::string::npos != index_at) { preset_name = preset_name.substr(0, index_at); } + need_sort.push_back(std::make_pair(preset_name, preset->filament_id)); break; } } + std::sort(need_sort.begin(), need_sort.end(), [](const std::pair &a, const std::pair &b) { return a.first < b.first; }); + json temp_j; + for (std::pair &filament_name_to_id : need_sort) { + temp_j["name"] = filament_name_to_id.first; + temp_j["id"] = filament_name_to_id.second; + m_CustomFilaments.push_back(temp_j); + } m_Res["data"] = m_CustomFilaments; wxString strJS = wxString::Format("HandleStudio(%s)", wxString::FromUTF8(m_Res.dump(-1, ' ', false, json::error_handler_t::ignore))); return strJS;