feat: top cover detection and related fixes - #521
Merged
Conversation
# Conflicts: # src/libslic3r/Preset.cpp # src/libslic3r/PrintConfig.cpp
…consumable filament, and simultaneously modify the printer's initial gcode.
This reverts commit a3c3e5e.
# Conflicts: # src/libslic3r/Preset.cpp # src/libslic3r/PrintConfig.cpp
…consumable filament, and simultaneously modify the printer's initial gcode.
…eristics of the internal consumables.
Replace the outdated filament_info.json-based classification with per-preset filament_is_high_temperature config. Detect mixing whenever filament assignments change on the current plate (wall, infill, solid infill, support, support interface, wipe tower, and multi-material painting). Detection hooks: - Plater::on_config_change() — config load, extruder count change, import - Sidebar::update_presets() — sidebar filament combo selection Enforcement layers (three-stage guard against notification flicker): 1. check_filament_temp_mixing() shows error notification + marks plate invalid immediately on config change (CallAfter-deferred with serial cancellation to prevent races between the two hooks). 2. Print::validate() runs check_multi_filament_valid() using filament_is_high_temperature (was: filament_info.json + nozzles<2 restriction removed). 3. Plater::priv::update() re-checks after background validate passes, preventing the validate cycle from silently closing the notification. The old Print::validate() check (nozzles<2 && extruders>1) is replaced with a simpler extruders>1 guard that works for multi-nozzle printers too.
Make check_filament_temp_mixing() a pure detection function with no side effects. Notification push/close is now owned exclusively by Plater::priv::update()'s three-layer guard, eliminating races where CallAfter serial cancellation would accidentally drop the error notification. Also scan all plates' configs (not just the active plate) so that filament changes on any plate are detected immediately.
Previously the hooks only marked the plate invalid (greyed out slice button) but relied on priv::update() to push the error notification. Since priv::update() only runs after schedule_background_process(), sidebar filament preset changes that don't trigger a background process cycle would never show the red error bar. Now all three sites push/close notification synchronously: - Sidebar::update_presets() - Plater::on_config_change() - Plater::priv::update() (three-layer guard)
full_config() builds a merged snapshot that may lag when called from Sidebar hooks because the edited preset config hasn't been committed yet. Read filament_is_high_temperature directly from each filament preset's individual config via find_preset(name, true) instead.
…mation when allowed
…tches, and missing Sidebar stubs
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Consolidate duplicated notification logic into sync_filament_temp_mixing_notification() and hook it into model add/remove (object_list_changed), filament assignment changes (set_extruder_for_selected_items, update_filament_in_config), and MMU painting (update_model_object) so the mixing warning updates immediately when plate composition changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Hook sync_filament_temp_mixing_notification() into Selection::notify_instance_update (3D view drag) and ObjectList::reload_all_plates (arrange, file load, plate operations) so the mixing warning updates immediately when objects are moved on/off plates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move the sync call from Selection::notify_instance_update to the end of GLCanvas3D::do_move, so it runs only once after all plate membership updates are complete, avoiding flip-flopping between valid/invalid states. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Limit plate config collection and ModelVolume scanning to objects on the current plate, so removing an object from the plate correctly clears the high/low temperature mixing error notification. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ture_top_cover_yjx # localization/i18n/zh_CN/Snapmaker_Orca_zh_CN.po # src/slic3r/GUI/MainFrame.cpp
…es, C-style cast - Replace hard tabs with 4-space indentation in NotificationManager.hpp and PartPlate.cpp (11 occurrences) - Convert single-line if-block to multi-line Allman style in Preferences.cpp - Replace C-style (int) cast with static_cast<int> in MixedFilamentDialog.cpp - Extract WideCharToMultiByte lambda and remove empty if-body in GUI_Init.cpp - Reformat Ctrl+R shortcut handler to Allman style in MainFrame.cpp - Remove duplicate translation line in zh_CN.po Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…gression The older commit 613f316 inadvertently downgraded the profile version from 02.02.49.02 to 02.02.47.02 and removed filament entries added by upstream. Restore the file to match upstream/feature_top_cover exactly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Feature top cover yjx
extruders_count config option has type coInt, so the underlying boost::any stores an int. Casting it as size_t directly throws boost::bad_any_cast, which wxWidgets reports as "Unhandled unknown exception; terminating the application." Use the safe pattern already established at line 4688: cast to int first, then convert to size_t. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace size_t(...) with static_cast<size_t>(...) to comply with coding standard that prohibits C-style casts. Also fix the same issue in the existing code at line 4688. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ation file Two root causes for "Unhandled unknown exception" at startup: 1. Plater.cpp referenced three config options that were never defined in PrintConfig.cpp: enable_infill_filament_override, infill_filament_use_base_first_layers, infill_filament_use_base_last_layers. This caused "Unknown option exception" during on_init_inner() when the config system looked up these keys. 2. zh_CN .po file had a duplicate block of 5 msgid/msgstr entries inserted during the main merge, plus a malformed line with two msgstr strings concatenated. msgfmt reported 8 fatal errors. Also fixes boost::any_cast<size_t> → static_cast<size_t>(boost::any_cast<int>) in Tab.cpp to match the safe pattern at line 4688 (coInt options store int). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Feature top cover yjx
…eature_top_cover
…n About dialog Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…p_mixing The if (plate) guard was placed after plate had already been passed to model_object_is_on_plate() and dereferenced. Move it to immediately after plate is obtained from get_plate(), with an early return. Also fix model_object_is_on_plate() to return false (not true) when plate is null — no object can be on a null plate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All three switch statements on the FilamentTempMixingState enum now have explicit default cases that log the unknown value via BOOST_LOG_TRIVIAL and fall through to a safe default behavior (allow slicing). - sync_filament_temp_mixing_notification(): default logs warning and sets slicing_allowed = true - confirm_filament_temp_mixing_before_slice(): default logs warning and returns true (allow) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…fication Add null guard for curr_plate immediately after obtaining it from get_curr_plate(), with an early return and warning log. Also replace redundant get_partplate_list().get_curr_plate() calls in the switch branches with the already-fetched curr_plate pointer. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…eature_top_cover
This reverts commit 742834c.
…eature_top_cover
…eature_top_cover
Extends the purifier delay-off time for chamber warming and weak cooling modes to ensure adequate post-print air filtration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Defer the final tab selection in post_init() via CallAfter so that the pending EVT_GLVIEWTOOLBAR_3D event (posted by PAGE_CHANGED handler during GL init) is processed first. Also fix the Home page WebView URL from path=1 (Prepare) to path=0 (Home). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…alog file:// URL - Wrap config_wizard_startup/run_wizard with try-catch to prevent crash from propagating to wxWidgets event loop and terminating the application - Fix UpdateVersionDialog release note URL: use fs::absolute() to ensure file:// URL has full path with drive letter on Windows Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…eature_top_cover
…event I/O overhead Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
LiuLikeQian
approved these changes
Jun 18, 2026
sebsucmor-alt
added a commit
to sebsucmor-alt/OrcaFS-NeotkoCM
that referenced
this pull request
Jun 24, 2026
…r#520, Snapmaker#521, Snapmaker#513, Snapmaker#525, Snapmaker#527/Snapmaker#528, Snapmaker#529, Snapmaker#530, Snapmaker#535, Snapmaker#536, Snapmaker#533, Snapmaker#538, Snapmaker#537 parcial, Snapmaker#539, Snapmaker#540) 2.3.5beta sync
zhouzengping
added a commit
to zhouzengping/OrcaSlicer
that referenced
this pull request
Jul 7, 2026
* fix:修改编译问题 * feat: add configurable option for top cover requirement * feat: add translation # Conflicts: # src/libslic3r/Preset.cpp # src/libslic3r/PrintConfig.cpp * feat: Add the "Is It a High-Temperature Consumable" attribute to the consumable filament, and simultaneously modify the printer's initial gcode. * Fix:Correct the incorrect G-code code * fix:Temporarily enable the ability to export gcode.3mf * Revert "fix:Temporarily enable the ability to export gcode.3mf" This reverts commit a3c3e5e. * feat: add configurable option for top cover requirement * feat: add translation # Conflicts: # src/libslic3r/Preset.cpp # src/libslic3r/PrintConfig.cpp * feat: Add the "Is It a High-Temperature Consumable" attribute to the consumable filament, and simultaneously modify the printer's initial gcode. * Fix:Correct the incorrect G-code code * fix:The top cover mode is determined based on the temperature characteristics of the internal consumables. * feat: add real-time high/low temperature filament mixing detection Replace the outdated filament_info.json-based classification with per-preset filament_is_high_temperature config. Detect mixing whenever filament assignments change on the current plate (wall, infill, solid infill, support, support interface, wipe tower, and multi-material painting). Detection hooks: - Plater::on_config_change() — config load, extruder count change, import - Sidebar::update_presets() — sidebar filament combo selection Enforcement layers (three-stage guard against notification flicker): 1. check_filament_temp_mixing() shows error notification + marks plate invalid immediately on config change (CallAfter-deferred with serial cancellation to prevent races between the two hooks). 2. Print::validate() runs check_multi_filament_valid() using filament_is_high_temperature (was: filament_info.json + nozzles<2 restriction removed). 3. Plater::priv::update() re-checks after background validate passes, preventing the validate cycle from silently closing the notification. The old Print::validate() check (nozzles<2 && extruders>1) is replaced with a simpler extruders>1 guard that works for multi-nozzle printers too. * fix: remove CallAfter races in filament temp mixing detection Make check_filament_temp_mixing() a pure detection function with no side effects. Notification push/close is now owned exclusively by Plater::priv::update()'s three-layer guard, eliminating races where CallAfter serial cancellation would accidentally drop the error notification. Also scan all plates' configs (not just the active plate) so that filament changes on any plate are detected immediately. * fix: push notification immediately in both filament mixing hooks Previously the hooks only marked the plate invalid (greyed out slice button) but relied on priv::update() to push the error notification. Since priv::update() only runs after schedule_background_process(), sidebar filament preset changes that don't trigger a background process cycle would never show the red error bar. Now all three sites push/close notification synchronously: - Sidebar::update_presets() - Plater::on_config_change() - Plater::priv::update() (three-layer guard) * fix: read filament_is_high_temperature directly from preset configs full_config() builds a merged snapshot that may lag when called from Sidebar hooks because the edited preset config hasn't been committed yet. Read filament_is_high_temperature directly from each filament preset's individual config via find_preset(name, true) instead. * Add preference option to allow high/low temperature filament mixing * Add confirmation dialog with guard for allow_filament_temp_mixing preference toggle * Switch filament temp mixing to warning level and add pre-slice confirmation when allowed * Fix:modify machine start gcode * Remove .hermes/ from git tracking * Fix build errors: WipeTower2::generate signature, Plater method mismatches, and missing Sidebar stubs * Replace chamber cooling magic numbers with named constants Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Rename in_handler to reentry_guard for clarity Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add missing trigger points for filament temp mixing detection Consolidate duplicated notification logic into sync_filament_temp_mixing_notification() and hook it into model add/remove (object_list_changed), filament assignment changes (set_extruder_for_selected_items, update_filament_in_config), and MMU painting (update_model_object) so the mixing warning updates immediately when plate composition changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add filament temp mixing check triggers for object move-off-plate Hook sync_filament_temp_mixing_notification() into Selection::notify_instance_update (3D view drag) and ObjectList::reload_all_plates (arrange, file load, plate operations) so the mixing warning updates immediately when objects are moved on/off plates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix sync_filament_temp_mixing_notification placement for object move Move the sync call from Selection::notify_instance_update to the end of GLCanvas3D::do_move, so it runs only once after all plate membership updates are complete, avoiding flip-flopping between valid/invalid states. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Make check_filament_temp_mixing per-plate instead of global Limit plate config collection and ModelVolume scanning to objects on the current plate, so removing an object from the plate correctly clears the high/low temperature mixing error notification. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove full_config collection from per-plate filament mixing check The global config's wall_filament etc. always reference the default filament slot, causing false mixing detection when only high-temp models remain on the plate. Only collect config from current plate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Trim trailing whitespace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Replace custom dialog with Orca-styled MessageDialog for filament mixing warning Use MessageDialog with SetButtonLabel for proper OrcaSlicer button styling instead of manual wxButton with hardcoded green background. Buttons now read "确认"/"取消" with auto-applied Confirm/Regular ButtonStyle. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Localize filament temp mixing UI strings from Chinese to English Replace hardcoded Chinese text with _L()/_u8L() wrapped English strings: - Preferences dialog title, body, and button labels - Error notification (allow=false): includes guidance to enable in Preferences - Warning notification (allow=true): concise message without guidance - Calibration wizard validation error Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add Chinese translations for filament temp mixing UI strings Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove duplicate Cancel msgid from zh_CN translation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Use single-line gettext strings for reliable translation matching Multi-line string literals in _u8L() may not match multi-line msgid entries in .po files during gettext lookup. Consolidate to single-line strings in both C++ source and .po msgid for the filament temp mixing messages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove duplicate Confirm msgid from zh_CN .po file Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add missing Chinese translations for filament mixing checkbox Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: improve filament temp mixing detection coverage - Detect global Process filament assignments (wall_filament, solid_infill_filament, support_filament, support_interface_filament, wipe_tower_filament) in addition to plate-level overrides. Uses p->config which is updated in real-time by on_config_change(). - Remove sparse_infill_filament from checked keys: it is not user-configurable in the UI but has a hardcoded default of 1 in some process presets, causing false positives. - Trigger sync after object-mode config changes in TabPrintModel::on_value_change. - Trigger sync after moving instances between plates (PartPlateList::add_to_plate). - Trigger sync after clearing all objects from the current plate (remove_curr_plate_all). - Update Preferences::create_item_checkbox declaration to match the cherry-picked implementation which adds an optional confirm_cb parameter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: rebuild filament mixing feature on current main base The original cherry-pick fca2f3d used --theirs conflict resolution which overwrote Plater.cpp and Print.cpp with older versions, accidentally dropping 6194 lines of code from main. This commit properly re-applies only the filament mixing additions: Plater.cpp: - Add check_filament_temp_mixing() — detects high/low temp mixing across wall, solid infill, support, support interface, and wipe tower filaments - Add sync_filament_temp_mixing_notification() — updates notification state - Add sync calls in: Sidebar::update_presets, on_config_change, update_background_process, remove_curr_plate_all - Add pre-slice confirmation dialog when allow_filament_temp_mixing is on Print.cpp: - Replace nozzles<2 restriction with simpler extruders>1 guard so the filament mixing check covers multi-nozzle printers too Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix filament temperature mixing notifications * Fix:修改关于页 * Fix filament temperature mixing slice guards * Fix filament temperature mixing slice guards Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: add solid_infill_filament to Plater config for filament temp mixing detection The solid_infill_filament key was missing from p->config's default key list, causing collect_filament_slots_from_config() to never detect solid infill filament usage. This made the high/low temperature mixing guard silently skip solid infill while correctly catching all other auxiliary materials. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab out of sync when switching between Prepare and Preview views Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: per-plate filament temp mixing check using global config check_filament_temp_mixing incorrectly used the Plater's global config (p->config) when checking per-plate filament temperature mixing. This caused false positives on plates that don't use mixing when a 3MF project contains both mixed and non-mixed plates. Remove the global config collection and instead resolve the default extruder for objects with extruder=0 from full_config(), so only the filament slots actually used by each plate's objects are considered. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab view sync and filament temp mixing notification lifecycle - Sync main tab with view panel in select_view_3D via select_tab - Skip redundant GL toolbar event post when view already matches tab - Allow Preview tab switch when plate is blocked by temp mixing - Always re-push filament temp mixing notification to handle external dismiss Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: unify filament temp mixing confirm dialog style and add translations Replace wxMessageDialog with MessageDialog in both mixing confirm functions to match the "High and Low Temperature Material Mixing Risk" dialog style in Preferences. Change dialog title to "Confirm slicing" with custom Confirm/Cancel button labels. Add Chinese translations for "Confirm slicing" and the mixing risk message text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix filament temperature mixing notifications * Fix filament temperature mixing slice guards * Fix filament temperature mixing slice guards Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: add solid_infill_filament to Plater config for filament temp mixing detection The solid_infill_filament key was missing from p->config's default key list, causing collect_filament_slots_from_config() to never detect solid infill filament usage. This made the high/low temperature mixing guard silently skip solid infill while correctly catching all other auxiliary materials. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab out of sync when switching between Prepare and Preview views Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: per-plate filament temp mixing check using global config check_filament_temp_mixing incorrectly used the Plater's global config (p->config) when checking per-plate filament temperature mixing. This caused false positives on plates that don't use mixing when a 3MF project contains both mixed and non-mixed plates. Remove the global config collection and instead resolve the default extruder for objects with extruder=0 from full_config(), so only the filament slots actually used by each plate's objects are considered. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab view sync and filament temp mixing notification lifecycle - Sync main tab with view panel in select_view_3D via select_tab - Skip redundant GL toolbar event post when view already matches tab - Allow Preview tab switch when plate is blocked by temp mixing - Always re-push filament temp mixing notification to handle external dismiss Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: unify filament temp mixing confirm dialog style and add translations Replace wxMessageDialog with MessageDialog in both mixing confirm functions to match the "High and Low Temperature Material Mixing Risk" dialog style in Preferences. Change dialog title to "Confirm slicing" with custom Confirm/Cancel button labels. Add Chinese translations for "Confirm slicing" and the mixing risk message text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: exclude global Process config from per-plate filament temp mixing check The global Plater config's wall_filament/solid_infill_filament etc. were unconditionally collected for every plate, causing false positives when a filament assigned in the global config was not actually used on a given plate (e.g., solid_infill_filament=3(ABS) flagged Plate 2 which only used extruder=0(PLA-AERO)). Remove collect_filament_slots_from_config(*this->config(), ...) so the per-plate check only considers plate-level overrides, object/volume extruder assignments, and global default extruder resolution. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: "Slice All" button stuck disabled after loading multi-plate project After loading a 3MF with plates that have different filament temp mixing states, update_slice_print_status(eEventSliceUpdate, false) from update_background_process hard-disabled the button without consulting get_enable_slice_status(), which correctly checks all plates in eSliceAll mode. Also initialize m_apply_invalid for all plates synchronously after load instead of waiting for the async event on the current plate only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: restore filament temp mixing validation in Print::validate for CLI, fix style issues - Restore check_multi_filament_valid() in Print::validate() so CLI slicing is protected against high/low temperature filament mixing (the GUI layer has its own per-plate check that runs before validate()). This also reactivates the CLI_FILAMENTS_DIFFERENT_TEMP error path. - Fix Allman brace style for all new code in Plater.cpp (18 occurrences). - Wrap two long string literals (206, 211) to fit within 120 characters. - Add const qualifier on immutable local variable in load_files(). - Add Doxygen comments for guard_before_slice_plate/all and confirm_filament_temp_mixing_before_slice in Plater.hpp. - Fix indentation consistency in NotificationManager.hpp. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: conditional global key collection and CLI-only filament temp mixing guard - Plater.cpp: collect wall/sparse/solid_infill_filament from global process config only when objects on the plate use extruder=0 (default). Global feature keys (wipe_tower/support) are always collected. This fixes both missed detection (plate with e=0 objects whose wall_filament differs from wipe_tower) and ensures correctness. - Snapmaker_Orca.cpp: add explicit filament temp mixing check before Print::validate() in CLI slicing path, using the public check_multi_filaments_compatibility(). CLI has no preference concept so mixing always blocks. - Print.cpp: keep validate() clean — the check belongs in the respective entry points (GUI: sync_filament_temp_mixing_notification, CLI: explicit guard) rather than in the shared validate() path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: collect per-object feature keys in filament temp mixing check collect_filament_slots_from_model_config() only checked the extruder key, missing per-object overrides of wall_filament, solid_infill_filament, etc. When a user sets a different filament for solid infill at the object level, the check failed to detect high/low temperature mixing even though the slicer would actually use that filament during printing. Now also collects: wall_filament, sparse_infill_filament, solid_infill_filament, support_filament, support_interface_filament, wipe_tower_filament — matching the actual behavior of apply_to_print_region_config() which applies these per-object keys. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: skip already-sliced plates in slice-all confirmation dialog confirm_filament_temp_mixing_before_slice_all() checked all sliceable plates regardless of whether they already had valid slice results. After slicing one mixed plate and returning to slice-all, the dialog appeared again for that already-sliced plate -- a pointless prompt. Now only unsliced plates with AllowedWarning trigger the dialog. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: wxEntry encoding mismatch when exe path contains non-ASCII characters boost::nowide::narrow() converts argv[0] to UTF-8, but wxEntry expects the system ANSI codepage (CP_ACP). On Windows, rebuild argv[0] from GetModuleFileNameW with proper CP_ACP conversion to avoid "Command line argument 0 couldn't be converted to Unicode" warning from wxWidgets. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: address code review findings — brace style, API return checks, atomic flag - Fix Allman brace style violations in Snapmaker_Orca.cpp and NotificationManager.cpp (opening brace on same line → own line) - Check WideCharToMultiByte return value instead of assuming failure when output buffer is empty; also check short-path fallback result - Replace bool filament_usage_sync_pending with std::atomic<bool> to avoid potential races when notify_filament_usage_changed is called from multiple code paths in quick succession Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: use atomic exchange in notify_filament_usage_changed and remove redundant trigger in select_plate - Replace check-then-set pattern with exchange(true) for correct atomic test-and-set semantics in notify_filament_usage_changed(). - Remove notify_filament_usage_changed() call from select_plate() since sync_filament_temp_mixing_notification() is already called directly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix:修改编译问题 * feat: add configurable option for top cover requirement * feat: add translation # Conflicts: # src/libslic3r/Preset.cpp # src/libslic3r/PrintConfig.cpp * feat: Add the "Is It a High-Temperature Consumable" attribute to the consumable filament, and simultaneously modify the printer's initial gcode. * Fix:Correct the incorrect G-code code * fix:The top cover mode is determined based on the temperature characteristics of the internal consumables. * feat: add real-time high/low temperature filament mixing detection Replace the outdated filament_info.json-based classification with per-preset filament_is_high_temperature config. Detect mixing whenever filament assignments change on the current plate (wall, infill, solid infill, support, support interface, wipe tower, and multi-material painting). Detection hooks: - Plater::on_config_change() — config load, extruder count change, import - Sidebar::update_presets() — sidebar filament combo selection Enforcement layers (three-stage guard against notification flicker): 1. check_filament_temp_mixing() shows error notification + marks plate invalid immediately on config change (CallAfter-deferred with serial cancellation to prevent races between the two hooks). 2. Print::validate() runs check_multi_filament_valid() using filament_is_high_temperature (was: filament_info.json + nozzles<2 restriction removed). 3. Plater::priv::update() re-checks after background validate passes, preventing the validate cycle from silently closing the notification. The old Print::validate() check (nozzles<2 && extruders>1) is replaced with a simpler extruders>1 guard that works for multi-nozzle printers too. * fix: remove CallAfter races in filament temp mixing detection Make check_filament_temp_mixing() a pure detection function with no side effects. Notification push/close is now owned exclusively by Plater::priv::update()'s three-layer guard, eliminating races where CallAfter serial cancellation would accidentally drop the error notification. Also scan all plates' configs (not just the active plate) so that filament changes on any plate are detected immediately. * fix: push notification immediately in both filament mixing hooks Previously the hooks only marked the plate invalid (greyed out slice button) but relied on priv::update() to push the error notification. Since priv::update() only runs after schedule_background_process(), sidebar filament preset changes that don't trigger a background process cycle would never show the red error bar. Now all three sites push/close notification synchronously: - Sidebar::update_presets() - Plater::on_config_change() - Plater::priv::update() (three-layer guard) * fix: read filament_is_high_temperature directly from preset configs full_config() builds a merged snapshot that may lag when called from Sidebar hooks because the edited preset config hasn't been committed yet. Read filament_is_high_temperature directly from each filament preset's individual config via find_preset(name, true) instead. * Add preference option to allow high/low temperature filament mixing * Add confirmation dialog with guard for allow_filament_temp_mixing preference toggle * Switch filament temp mixing to warning level and add pre-slice confirmation when allowed * Fix:modify machine start gcode * Remove .hermes/ from git tracking * Fix build errors: WipeTower2::generate signature, Plater method mismatches, and missing Sidebar stubs * Replace chamber cooling magic numbers with named constants Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Rename in_handler to reentry_guard for clarity Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add missing trigger points for filament temp mixing detection Consolidate duplicated notification logic into sync_filament_temp_mixing_notification() and hook it into model add/remove (object_list_changed), filament assignment changes (set_extruder_for_selected_items, update_filament_in_config), and MMU painting (update_model_object) so the mixing warning updates immediately when plate composition changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add filament temp mixing check triggers for object move-off-plate Hook sync_filament_temp_mixing_notification() into Selection::notify_instance_update (3D view drag) and ObjectList::reload_all_plates (arrange, file load, plate operations) so the mixing warning updates immediately when objects are moved on/off plates. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix sync_filament_temp_mixing_notification placement for object move Move the sync call from Selection::notify_instance_update to the end of GLCanvas3D::do_move, so it runs only once after all plate membership updates are complete, avoiding flip-flopping between valid/invalid states. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Make check_filament_temp_mixing per-plate instead of global Limit plate config collection and ModelVolume scanning to objects on the current plate, so removing an object from the plate correctly clears the high/low temperature mixing error notification. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove full_config collection from per-plate filament mixing check The global config's wall_filament etc. always reference the default filament slot, causing false mixing detection when only high-temp models remain on the plate. Only collect config from current plate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Trim trailing whitespace Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Replace custom dialog with Orca-styled MessageDialog for filament mixing warning Use MessageDialog with SetButtonLabel for proper OrcaSlicer button styling instead of manual wxButton with hardcoded green background. Buttons now read "确认"/"取消" with auto-applied Confirm/Regular ButtonStyle. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Localize filament temp mixing UI strings from Chinese to English Replace hardcoded Chinese text with _L()/_u8L() wrapped English strings: - Preferences dialog title, body, and button labels - Error notification (allow=false): includes guidance to enable in Preferences - Warning notification (allow=true): concise message without guidance - Calibration wizard validation error Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add Chinese translations for filament temp mixing UI strings Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove duplicate Cancel msgid from zh_CN translation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Use single-line gettext strings for reliable translation matching Multi-line string literals in _u8L() may not match multi-line msgid entries in .po files during gettext lookup. Consolidate to single-line strings in both C++ source and .po msgid for the filament temp mixing messages. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Remove duplicate Confirm msgid from zh_CN .po file Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Add missing Chinese translations for filament mixing checkbox Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: improve filament temp mixing detection coverage - Detect global Process filament assignments (wall_filament, solid_infill_filament, support_filament, support_interface_filament, wipe_tower_filament) in addition to plate-level overrides. Uses p->config which is updated in real-time by on_config_change(). - Remove sparse_infill_filament from checked keys: it is not user-configurable in the UI but has a hardcoded default of 1 in some process presets, causing false positives. - Trigger sync after object-mode config changes in TabPrintModel::on_value_change. - Trigger sync after moving instances between plates (PartPlateList::add_to_plate). - Trigger sync after clearing all objects from the current plate (remove_curr_plate_all). - Update Preferences::create_item_checkbox declaration to match the cherry-picked implementation which adds an optional confirm_cb parameter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix:Temporarily enable the ability to export gcode.3mf * Revert "fix:Temporarily enable the ability to export gcode.3mf" This reverts commit a3c3e5e. * fix: rebuild filament mixing feature on current main base The original cherry-pick fca2f3d used --theirs conflict resolution which overwrote Plater.cpp and Print.cpp with older versions, accidentally dropping 6194 lines of code from main. This commit properly re-applies only the filament mixing additions: Plater.cpp: - Add check_filament_temp_mixing() — detects high/low temp mixing across wall, solid infill, support, support interface, and wipe tower filaments - Add sync_filament_temp_mixing_notification() — updates notification state - Add sync calls in: Sidebar::update_presets, on_config_change, update_background_process, remove_curr_plate_all - Add pre-slice confirmation dialog when allow_filament_temp_mixing is on Print.cpp: - Replace nozzles<2 restriction with simpler extruders>1 guard so the filament mixing check covers multi-nozzle printers too Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix filament temperature mixing notifications * Fix filament temperature mixing slice guards * Fix filament temperature mixing slice guards Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: add solid_infill_filament to Plater config for filament temp mixing detection The solid_infill_filament key was missing from p->config's default key list, causing collect_filament_slots_from_config() to never detect solid infill filament usage. This made the high/low temperature mixing guard silently skip solid infill while correctly catching all other auxiliary materials. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab out of sync when switching between Prepare and Preview views Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: per-plate filament temp mixing check using global config check_filament_temp_mixing incorrectly used the Plater's global config (p->config) when checking per-plate filament temperature mixing. This caused false positives on plates that don't use mixing when a 3MF project contains both mixed and non-mixed plates. Remove the global config collection and instead resolve the default extruder for objects with extruder=0 from full_config(), so only the filament slots actually used by each plate's objects are considered. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Fix tab view sync and filament temp mixing notification lifecycle - Sync main tab with view panel in select_view_3D via select_tab - Skip redundant GL toolbar event post when view already matches tab - Allow Preview tab switch when plate is blocked by temp mixing - Always re-push filament temp mixing notification to handle external dismiss Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: unify filament temp mixing confirm dialog style and add translations Replace wxMessageDialog with MessageDialog in both mixing confirm functions to match the "High and Low Temperature Material Mixing Risk" dialog style in Preferences. Change dialog title to "Confirm slicing" with custom Confirm/Cancel button labels. Add Chinese translations for "Confirm slicing" and the mixing risk message text. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: exclude global Process config from per-plate filament temp mixing check The global Plater config's wall_filament/solid_infill_filament etc. were unconditionally collected for every plate, causing false positives when a filament assigned in the global config was not actually used on a given plate (e.g., solid_infill_filament=3(ABS) flagged Plate 2 which only used extruder=0(PLA-AERO)). Remove collect_filament_slots_from_config(*this->config(), ...) so the per-plate check only considers plate-level overrides, object/volume extruder assignments, and global default extruder resolution. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: "Slice All" button stuck disabled after loading multi-plate project After loading a 3MF with plates that have different filament temp mixing states, update_slice_print_status(eEventSliceUpdate, false) from update_background_process hard-disabled the button without consulting get_enable_slice_status(), which correctly checks all plates in eSliceAll mode. Also initialize m_apply_invalid for all plates synchronously after load instead of waiting for the async event on the current plate only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: restore filament temp mixing validation in Print::validate for CLI, fix style issues - Restore check_multi_filament_valid() in Print::validate() so CLI slicing is protected against high/low temperature filament mixing (the GUI layer has its own per-plate check that runs before validate()). This also reactivates the CLI_FILAMENTS_DIFFERENT_TEMP error path. - Fix Allman brace style for all new code in Plater.cpp (18 occurrences). - Wrap two long string literals (206, 211) to fit within 120 characters. - Add const qualifier on immutable local variable in load_files(). - Add Doxygen comments for guard_before_slice_plate/all and confirm_filament_temp_mixing_before_slice in Plater.hpp. - Fix indentation consistency in NotificationManager.hpp. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: conditional global key collection and CLI-only filament temp mixing guard - Plater.cpp: collect wall/sparse/solid_infill_filament from global process config only when objects on the plate use extruder=0 (default). Global feature keys (wipe_tower/support) are always collected. This fixes both missed detection (plate with e=0 objects whose wall_filament differs from wipe_tower) and ensures correctness. - Snapmaker_Orca.cpp: add explicit filament temp mixing check before Print::validate() in CLI slicing path, using the public check_multi_filaments_compatibility(). CLI has no preference concept so mixing always blocks. - Print.cpp: keep validate() clean — the check belongs in the respective entry points (GUI: sync_filament_temp_mixing_notification, CLI: explicit guard) rather than in the shared validate() path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: collect per-object feature keys in filament temp mixing check collect_filament_slots_from_model_config() only checked the extruder key, missing per-object overrides of wall_filament, solid_infill_filament, etc. When a user sets a different filament for solid infill at the object level, the check failed to detect high/low temperature mixing even though the slicer would actually use that filament during printing. Now also collects: wall_filament, sparse_infill_filament, solid_infill_filament, support_filament, support_interface_filament, wipe_tower_filament — matching the actual behavior of apply_to_print_region_config() which applies these per-object keys. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: skip already-sliced plates in slice-all confirmation dialog confirm_filament_temp_mixing_before_slice_all() checked all sliceable plates regardless of whether they already had valid slice results. After slicing one mixed plate and returning to slice-all, the dialog appeared again for that already-sliced plate -- a pointless prompt. Now only unsliced plates with AllowedWarning trigger the dialog. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: wxEntry encoding mismatch when exe path contains non-ASCII characters boost::nowide::narrow() converts argv[0] to UTF-8, but wxEntry expects the system ANSI codepage (CP_ACP). On Windows, rebuild argv[0] from GetModuleFileNameW with proper CP_ACP conversion to avoid "Command line argument 0 couldn't be converted to Unicode" warning from wxWidgets. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: address code review findings — brace style, API return checks, atomic flag - Fix Allman brace style violations in Snapmaker_Orca.cpp and NotificationManager.cpp (opening brace on same line → own line) - Check WideCharToMultiByte return value instead of assuming failure when output buffer is empty; also check short-path fallback result - Replace bool filament_usage_sync_pending with std::atomic<bool> to avoid potential races when notify_filament_usage_changed is called from multiple code paths in quick succession Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: use atomic exchange in notify_filament_usage_changed and remove redundant trigger in select_plate - Replace check-then-set pattern with exchange(true) for correct atomic test-and-set semantics in notify_filament_usage_changed(). - Remove notify_filament_usage_changed() call from select_plate() since sync_filament_temp_mixing_notification() is already called directly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: Selection::clear() takes no arguments, use conditional guard instead The cherry-pick in a9ca118 changed m_selection.clear() to m_selection.clear(mode == ResetVolumesMode::Normal), but Selection::clear() accepts zero parameters. Wrap the call in an explicit if-guard to preserve the intent of skipping clear() during CanvasDestruction. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: extract WideCharToMultiByte lambda and fix brace style in MainFrame Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: resolve coding standard violations — tabs to spaces, Allman braces, C-style cast - Replace hard tabs with 4-space indentation in NotificationManager.hpp and PartPlate.cpp (11 occurrences) - Convert single-line if-block to multi-line Allman style in Preferences.cpp - Replace C-style (int) cast with static_cast<int> in MixedFilamentDialog.cpp - Extract WideCharToMultiByte lambda and remove empty if-body in GUI_Init.cpp - Reformat Ctrl+R shortcut handler to Allman style in MainFrame.cpp - Remove duplicate translation line in zh_CN.po Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: restore Snapmaker.json to upstream version to prevent version regression The older commit 613f316 inadvertently downgraded the profile version from 02.02.49.02 to 02.02.47.02 and removed filament entries added by upstream. Restore the file to match upstream/feature_top_cover exactly. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: boost::any_cast<size_t> → boost::any_cast<int> for extruders_count extruders_count config option has type coInt, so the underlying boost::any stores an int. Casting it as size_t directly throws boost::bad_any_cast, which wxWidgets reports as "Unhandled unknown exception; terminating the application." Use the safe pattern already established at line 4688: cast to int first, then convert to size_t. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: use static_cast instead of functional-style cast Replace size_t(...) with static_cast<size_t>(...) to comply with coding standard that prohibits C-style casts. Also fix the same issue in the existing code at line 4688. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: remove undefined config options and fix corrupted Chinese translation file Two root causes for "Unhandled unknown exception" at startup: 1. Plater.cpp referenced three config options that were never defined in PrintConfig.cpp: enable_infill_filament_override, infill_filament_use_base_first_layers, infill_filament_use_base_last_layers. This caused "Unknown option exception" during on_init_inner() when the config system looked up these keys. 2. zh_CN .po file had a duplicate block of 5 msgid/msgstr entries inserted during the main merge, plus a malformed line with two msgstr strings concatenated. msgfmt reported 8 fatal errors. Also fixes boost::any_cast<size_t> → static_cast<size_t>(boost::any_cast<int>) in Tab.cpp to match the safe pattern at line 4688 (coInt options store int). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: restore attribution text and remove internal dev version label in About dialog Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: move null guard for plate before first use in check_filament_temp_mixing The if (plate) guard was placed after plate had already been passed to model_object_is_on_plate() and dereferenced. Move it to immediately after plate is obtained from get_plate(), with an early return. Also fix model_object_is_on_plate() to return false (not true) when plate is null — no object can be on a null plate. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: add default cases with logging to FilamentTempMixingState switches All three switch statements on the FilamentTempMixingState enum now have explicit default cases that log the unknown value via BOOST_LOG_TRIVIAL and fall through to a safe default behavior (allow slicing). - sync_filament_temp_mixing_notification(): default logs warning and sets slicing_allowed = true - confirm_filament_temp_mixing_before_slice(): default logs warning and returns true (allow) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: validate curr_plate before use in sync_filament_temp_mixing_notification Add null guard for curr_plate immediately after obtaining it from get_curr_plate(), with an early return and warning log. Also replace redundant get_partplate_list().get_curr_plate() calls in the switch branches with the already-fetched curr_plate pointer. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: remove CMAKE_POLICY_VERSION_MINIMUM override from CMakeLists.txt Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: regenerate .pot template from source (xgettext --full) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * Revert "chore: regenerate .pot template from source (xgettext --full)" This reverts commit 742834c. * fix: adjust purifier DELAY_OFF from 180 to 600 in U1 machine start gcode Extends the purifier delay-off time for chamber warming and weak cooling modes to ensure adequate post-print air filtration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: prevent auto-switching to Prepare tab on startup Defer the final tab selection in post_init() via CallAfter so that the pending EVT_GLVIEWTOOLBAR_3D event (posted by PAGE_CHANGED handler during GL init) is processed first. Also fix the Home page WebView URL from path=1 (Prepare) to path=0 (Home). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: add exception handling around config wizard, fix UpdateVersionDialog file:// URL - Wrap config_wizard_startup/run_wizard with try-catch to prevent crash from propagating to wxWidgets event loop and terminating the application - Fix UpdateVersionDialog release note URL: use fs::absolute() to ensure file:// URL has full path with drive letter on Windows Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: remove flush_logs() from webview OnError callbacks to avoid per-event I/O overhead Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: zhouzengping <44285325+zhouzengping@users.noreply.github.com>
NikSativa
added a commit
to NikSativa/OrcaSlicer-FullSpectrum
that referenced
this pull request
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan