diff --git a/CLAUDE.md b/CLAUDE.md index eb35833082..61d292aee3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,6 +70,25 @@ build_release_vs2022.bat slicer ./build_linux.sh -c # clean build ./build_linux.sh -r # skip RAM/disk checks ./build_linux.sh -l # use Clang instead of GCC +``` +### Build test: + +**Always use this command to build the project when testing build issues on Windows.** +```bash +cmake --build . --config %build_type% --target ALL_BUILD -- -m +``` + +### Building on macOS +**Always use this command to build the project when testing build issues on macOS.** +```bash +cmake --build build/arm64 --config RelWithDebInfo --target all -- +``` + +### Building on Linux + **Always use this command to build the project when testing build issues on Linux.** +```bash +cmake --build build/arm64 --config RelWithDebInfo --target all -- + ``` ### Build System diff --git a/resources/web/guide/22/22.js b/resources/web/guide/22/22.js index abc887653d..0283936ee0 100644 --- a/resources/web/guide/22/22.js +++ b/resources/web/guide/22/22.js @@ -514,14 +514,14 @@ function ResponseFilamentResult() let FilaArray=new Array(); for(let n=0;nsecond.empty(); + bool has_filament_profiles = m_ProfileJson.contains("filament"); + + // Check if any non-default vendor has selected printers + bool has_vendor_printer = false; + for (const auto& [vendor, models] : enabled_vendors) { + if (vendor != PresetBundle::ORCA_DEFAULT_BUNDLE && !models.empty()) { + has_vendor_printer = true; + break; + } + } + + std::map supplemented_filaments; + for (const auto& [name, value] : enabled_filaments) { + if (name.size() > system_suffix.size() && + name.compare(name.size() - system_suffix.size(), system_suffix.size(), system_suffix) == 0) { + std::string short_name = name.substr(0, name.size() - system_suffix.size()); + if (has_vendor_printer && has_filament_profiles && m_ProfileJson["filament"].contains(short_name)) { + supplemented_filaments[short_name] = value; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Replacing @System filament: '" << name << "' -> '" << short_name << "'"; + if (has_default_bundle_printer) { + supplemented_filaments[name] = value; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " Also keeping '" << name << "' for default bundle printers"; + } + continue; + } + } + supplemented_filaments[name] = value; + } + //update the app_config - app_config->set_section(AppConfig::SECTION_FILAMENTS, enabled_filaments); + app_config->set_section(AppConfig::SECTION_FILAMENTS, supplemented_filaments); app_config->set_vendors(m_appconfig_new); if (check_unsaved_preset_changes) preset_bundle->load_presets(*app_config, ForwardCompatibilitySubstitutionRule::Enable, {preferred_model, preferred_variant, first_added_filament, std::string()}); + // If the active filament is not in the wizard-selected filaments, switch to the first + // compatible wizard-selected filament. This handles the first-run case where load_presets + // falls back to "Generic PLA" even though the user selected a different filament. + bool active_filament_selected = supplemented_filaments.empty() + || supplemented_filaments.count(preset_bundle->filament_presets.front()) > 0; + if (!active_filament_selected) { + for (const auto& [filament_name, _] : supplemented_filaments) { + const Preset* preset = preset_bundle->filaments.find_preset(filament_name); + if (preset && preset->is_visible && preset->is_compatible) { + preset_bundle->filaments.select_preset_by_name(filament_name, true); + preset_bundle->filament_presets.front() = preset_bundle->filaments.get_selected_preset_name(); + break; + } + } + } + // Update the selections from the compatibilty. preset_bundle->export_selections(*app_config);