Skip to content

sync main branch#409

Merged
SukiSunYuhang merged 16 commits into
Snapmaker:feature_flutter_enginefrom
LuckZAE:develop
Jun 2, 2026
Merged

sync main branch#409
SukiSunYuhang merged 16 commits into
Snapmaker:feature_flutter_enginefrom
LuckZAE:develop

Conversation

@LuckZAE
Copy link
Copy Markdown

@LuckZAE LuckZAE commented Jun 1, 2026

Description

sync main branch

LiuLikeQian and others added 16 commits May 12, 2026 10:07
* fix: wipe tower extruder offset index out of range when filament count exceeds physical extruder count.

* fix: ColorPrint view visibility broken by std::vector<bool> proxy assignment

* fix: the problem where filaments beyond the extruder count fail to load properly in 3MF files.

---------

Co-authored-by: zhouzengping <2719679725@qq.com>
Co-authored-by: zhouzengping <44285325+zhouzengping@users.noreply.github.com>
Fix wipe tower exceed limit
* fix download module file and use incorrect file bug. add check for install.

* fix build fail question.

* fix path error question.

* fix build error question.

* fix build fail question.

* feature remove the logic for check soft work status.

* feature add tips for install win soft.

* feature update the check logic for install nsis.

* fix uninstall path incorrect question.

* fix install nsis question.

* fix uninstall fail question.

* fix uninstall soft error bug.

* fix dir incorrect.

* fix path incorrect.

* feature add update logic for path.
* generate square wipe tower for rib

* fix bug: The calculation for the material required for the wipe tower was incorrect.

* delete wipe tower end tag

* Simplify the code logic

* fix comment
* Change the distance threshold of the Douglas-Peucker algorithm to 1 millimeter and reduce the number of points

* Modify the distance threshold of the Douglas-Peucker algorithm to 0.5mm. Add decimal point optimization, remove the unnecessary digits after the decimal point, and retain only one decimal place.

* Adjust Douglas-Peucker threshold to 0.5 millimeter

---------

Co-authored-by: Joyx <48636909+iesteem@users.noreply.github.com>
…aker#353)

* feat: add interface to get software basic info (Snapmaker#289)

* feat: add interface to get software basic info

* fix: use LOCALHOST_URL macro instead of hardcoded IP

* Update SSWCP.cpp delete try-catch

Remove the try-catch block to streamline exception handling. We'll adopt a new capture mechanism in the future.
…display (Snapmaker#360)

* fix: downloadFileFromOrca fails when HTTP server port changes

When the default port 13619 is occupied, the HTTP server switches to an
alternative port. The C++ side correctly uses the dynamic port for loading
the Flutter UI page, but sw_GetActiveFile() did not include the "url"
field in its JSON response. The Flutter JS downloadFileFromOrca function
falls back to a hardcoded http://127.0.0.1:13619/localfile/... when the
url field is null, causing requests to time out.

Fix:
- Populate the "url" field with the actual port via get_page_http_port()
  in both the zip and non-zip branches of sw_GetActiveFile()
- Normalize Windows backslash path separators to forward slashes
- URL-encode the file path to handle spaces and non-ASCII characters
  consistently across all platforms

* @
1. Add download URL for file transfer, bypassing 512MB postMessage limit
2. Add checksum field for file integrity verification
3. Add origin_size field
4. Use URL-safe base64 for path encoding in /wcp_download/ route
@

* @
Fix: remove in-memory fallback and magic number

- Replace duplicated in-memory response logic with a simple retry
  using utf8_to_filesystem_encoding, then fall through to existing
  streaming path
- Replace char buf[64*1024] with static constexpr + std::string
@

* @
Fix: add missing line breaks for all if/else statements

Ensure consistent code style by adding proper braces and line breaks
to single-line if/else-if/else blocks across HttpServer.cpp and SSWCP.cpp.
@

* @
Fix: add braces to single-line while statement
@

* @
Fix: remove try-catch blocks in sw_GetFileStream and refactor file path encoding in ResponseFile

- SSWCP: Remove try-catch blocks added by PR Snapmaker#310 inside m_work_thread lambdas
  in sw_GetFileStream(), letting exceptions propagate naturally
- HttpServer: Refactor ResponseFile::write_response to use m_native_path flag
  for encoding decision, with fallback to raw path when conversion fails
@

* Fix: bypass 512MB postMessage limit for file transfer and add file integrity checksum (Snapmaker#310)

* @
1. Add download URL for file transfer, bypassing 512MB postMessage limit
2. Add checksum field for file integrity verification
3. Add origin_size field
4. Use URL-safe base64 for path encoding in /wcp_download/ route
@

* @
Fix: remove in-memory fallback and magic number

- Replace duplicated in-memory response logic with a simple retry
  using utf8_to_filesystem_encoding, then fall through to existing
  streaming path
- Replace char buf[64*1024] with static constexpr + std::string
@

* @
Fix: add missing line breaks for all if/else statements

Ensure consistent code style by adding proper braces and line breaks
to single-line if/else-if/else blocks across HttpServer.cpp and SSWCP.cpp.
@

* @
Fix: add braces to single-line while statement
@

* @
Fix: remove try-catch blocks in sw_GetFileStream and refactor file path encoding in ResponseFile

- SSWCP: Remove try-catch blocks added by PR Snapmaker#310 inside m_work_thread lambdas
  in sw_GetFileStream(), letting exceptions propagate naturally
- HttpServer: Refactor ResponseFile::write_response to use m_native_path flag
  for encoding decision, with fallback to raw path when conversion fails
@

* @
@ Add: cross-platform test scripts for port 13619 fallback verification
@

* Fix: update Flutter web resources and SSWCP.cpp refinement

- Replace Flutter web package with latest version from Flutter team
- Update SSWCP.cpp with related adjustments

* delete test case

---------

Co-authored-by: YukiMacMini <yukimacmini@YukiMacMinideMac-mini.local>
* feature add printer info sync entrance.

* feature limit only one nozzle and not allow to choose nozzle.

* fix remove not work code.

* feature select the u1 machine and show the sync btn entrance. fix the machine config not adapt current machine nozzle info.

* feature when on U1 switch the nozzle diameter and show a tips.

* feature add Graphic Effect Steel Plate for U1

* feature add new plate for U1, and U1 default show 3 plates and use support more plate, U1 will show 7 plates.

* feature only U1 has new plate.

* feature merge U1 nozzle to U1 type and handle it the same logic.

* feature upload or print notify web the nozzle info

* feature remove not work code.

* feature rename the graphic effect plate, add dialog for sync nozzle select from machine.

* feature sync nozzle info and set the nozzle combobox data.

* feature add tips for plate use filament.

* feature remove the nozzle modify entrance.

* feature update the Smooth PEI Plate layer temp.

* feature update the plate name for snapmaker u1.

* feature update ui img, guide page merge the nozzle for machine, update nozzle combobox select.

* feature update guide page machine select.

* feature update guide ui, profiles source.

* feature export 3mf include the graphic plate,process soft and load nozzle&filament config, plate&filament config.

* feature add tips for smooth pei plater for filament relations,and graphic plater for filament relations.

* feature add file for filament tips.

* feature revert the profiles change.

* fix revert to old profiles

* feature remove not work code.

* feature add config for tips on filament.

* feature  add nozzle changed and tips filament relations for slice.

* feature add nozzle for filament tips.

* feature remove the not work code.

* feature render panel add graphic hot bed for Custom plater.

* fix the judge logic for sync machine filament info.

* feature load relations json from profiles source,upgrade translations.

* feature update the translation.

* feature update translation,fix sync nozzle bug.

* feature update the translations.

* fix machine sync question .

* feature update the hot bed tmp

* feature update the hot bed tmp

* fix warning rule not work question.

* fix switch machine and the device show incorrect.

* feature update the config for tips hot bed and use the filament to slice module.

* feature fix upgrade lead to resource update fail question.

* feature revert not work code.

* feature update the request type.

* fix build fail bug.

* feature update the web resource.

* fix linux flatpak build fail bug

* feature remove the not work code for thow exception.

* fix request web,profiles resource and thread not sync question.

* feature remove not work code.

* fix invalid version info for update profiles dialog.

* feature only show a dialog tips for bed tips.

* feature update web resource.

* fix the machine filament not sync bug.

* feature get nozzle info data from web.

* fix machine filament not sync bug.

* feature update the web resource.

* fix ota dir not exist and crash bug.

* feature fix profile update and web source update lead to crash question.

* feature update web resource.

---------

Co-authored-by: alves <‘liulikeqian@gmail.com’>
* Add and modify consumable files

* Add custom G-code for model parameters
* Add mixed filament support: Implement MixedFilament and MixedFilamentManager classes for layer-based color mixing. Update CLI to handle downward_check option. Enhance GUI to display mixed filaments and integrate with existing filament management.

* readme

* Update README and implement dithering features: Change download link in README, add mixed filament management enhancements including filament removal and layer height adjustments for dithering in the MixedFilamentManager. Introduce new configuration options for dithering in the PrintConfig and GUI, and ensure proper handling of mixed filament states during filament deletion.

* Dithering settings added to README.md

* Enhance color blending in MixedFilament: Introduce RYB pigment-style blending for improved color mixing accuracy. Add RGB to RYB and RYB to RGB conversion functions, and update blend_color method to utilize the new blending approach. Improve error handling in hex color parsing.

* Implement advanced mixed filament features: Add gradient settings for mixed filaments, including height-weighted cadence and custom filament definitions. Enhance MixedFilamentManager to support custom rows and apply gradient settings during filament generation. Update PrintConfig and GUI to accommodate new configuration options for mixed filament management.

* Add local Z dithering features: Implement local Z height adjustments and clipping for extrusion paths. Introduce new configuration options for local Z dithering in PrintConfig and GUI, enhancing mixed filament management. Update MixedFilamentManager to support height-weighted cadence and integrate local Z settings into the printing process.

* Refactor config comparison logic: Enhance equality checks for ConfigOption instances by including type comparison. Update related methods in ConfigBase, DynamicConfig, and Preset classes to ensure accurate configuration diffs and equality assessments. Improve logging in MixedFilamentManager for better tracking of custom entry loading and processing.

* Enhance mixed filament management: Introduce manual pattern support for mixed filaments, allowing users to define custom layer patterns using '1' and '2' for component selection. Update parsing logic to accommodate new pattern definitions and ensure backward compatibility. Improve GUI to facilitate pattern entry and display, enhancing user experience in mixed filament configurations.

* Enhance mixed filament functionality: Introduce support for gradient component IDs and weights in mixed filaments, allowing for more complex color mixing configurations. Update parsing logic to accommodate new gradient definitions and ensure backward compatibility. Implement pointillism distribution mode for same-layer mixing, enhancing user control over filament blending. Improve GUI elements to facilitate gradient weight adjustments and multi-color previews, enriching the user experience in mixed filament management.

* Add changelog for v0.7-alpha pre-release: Introduce experimental features including Local Z reliability improvements, manual pattern mixed filaments, selective expansion/contraction controls, and a refreshed UI for mixed filaments. Enhance configuration options with surface indentation for mixed filament behavior tuning. Update PrintConfig and GUI components to support new features and improve user experience.

* Replace Mixbox with FilamentMixer integration

* Update README to clarify FilamentMixer integration for color blending

* Update README to include link to FilamentMixer library for color blending

* Refactor color blending in MixedFilament: Replace legacy RYB blending with FilamentMixer for improved accuracy. Update blend_color method to utilize new lerp functionality and enhance display color computation. Retain legacy RYB conversion functions for reference.

* Refactor UI to follow Orca design language

* Pop up settings for mixed filaments instead of inline config

* Add changelog for v0.8 pre-release: Introduce filament mixer color accuracy improvements, and installation instructions. Update README to include support for development. Enhance AboutDialog with updated application name and links.

* Enhance tool change handling in GCode: Introduce support for local-z unplanned tool changes in the WipeTowerIntegration class. Update tool_change method to accommodate an additional parameter for local_z_unplanned, allowing for more flexible tool change management during Local-Z phase-b operations. Adjust related logic in process_layer to ensure proper synchronization with wipe tower planning.

* Implement deleted state for mixed filaments: Add a 'deleted' flag to the MixedFilament structure and update related parsing, serialization, and management functions to handle the visibility of mixed filaments in the UI. Adjust logic in the MixedFilamentManager to ensure proper handling of enabled states based on the deleted flag.

* Refactor color blending logic in MixedFilamentConfigPanel: Improve the blend_from_sequence method to handle empty color and sequence inputs, optimize counting of color occurrences, and enhance the blending process. Introduce new helper functions for building entry preview sequences and computing display colors for mixed filaments, ensuring accurate color representation in the UI.

* Fix summary handling in MixedFilamentConfigPanel: Replace wxEmptyString with wxString() for improved clarity in preview data handling. Update instance_shift type to Vec3d for better type consistency in Selection class during object pasting.

* Add release notes for v0.92 and refactor mixed filament gradient handling

- Introduced a new `RELEASE_NOTES_v0.92.md` file detailing highlights such as gradual gradient behavior, mixed filament indexing fixes, and editable automatic mixed filaments.
- Refactored `compute_gradient_ratios` to remove the cycle layers parameter, implementing a new gradual integer cadence for gradient transitions.
- Updated `MixedFilament` structure to include an `origin_auto` flag for better management of auto-generated entries.
- Adjusted related parsing, serialization, and UI handling to reflect these changes, ensuring improved user experience and color fidelity in mixed filament rendering.

* wxString instead of wxEmptyString

* Refactor custom GCode handling and mixed filament management

- Updated `custom_tool_changes` function to use filament IDs instead of extruder IDs, ensuring better compatibility with mixed filament configurations.
- Enhanced `MixedFilament` structure to include a `stable_id` for persistent identity across mixed filament entries, improving remapping during updates.
- Introduced new methods for stable ID allocation and normalization in `MixedFilamentManager`.
- Updated serialization and loading functions to maintain stable IDs, ensuring consistent behavior when mixed filament entries are modified.
- Added tests to verify the correct handling of tool changes and stable ID remapping in mixed filament scenarios.

* Add mixed filament support and improve filament handling

- Introduced functions to calculate the physical filament count and maximum supported filament ID from project configuration, enhancing mixed filament management.
- Updated GUI components to reflect total filament counts, including mixed filaments, ensuring accurate display and interaction.
- Refactored filament initialization logic to streamline color assignment and naming for both physical and mixed filaments.
- Enhanced the sidebar update mechanism to refresh model canvas colors when mixed filaments are modified, improving visual feedback in the UI.

* Refactor filament ID handling in ObjColorPanel

- Introduced a mapping mechanism for appended filament IDs to ensure correct assignment during color updates.
- Enhanced the update_filament_ids function to streamline filament ID resolution and improve handling of new filament additions.
- Updated the deal_approximate_match_btn and deal_default_strategy methods to accommodate changes in filament management logic, ensuring better integration with the UI.
- Improved overall clarity and maintainability of the filament handling code.

* Refactor tool change handling in GCode and enhance local-Z logic

- Simplified the tool change process for local-Z phases by directly switching extruders, avoiding unnecessary template replays that could degrade wipe tower quality.
- Introduced a new function to determine the starting component for local-Z alternating layers, improving the logic for height adjustments based on pass sequences.
- Updated related GCode processing to ensure consistent behavior during local-Z operations, enhancing overall print quality and efficiency.

Hopefully this fixes the issues with local z dithering and the prime tower becoming mush

* Update tooltip for local Z dithering mode to reflect new variable layer blending feature

- Revised the tooltip description to explain the use of variable layer heights for color blending, enhancing clarity on how blended color zones are managed.
- Emphasized the impact of this setting on color blending smoothness and provided examples for better user understanding.

* Enhance UdpSocket error handling and usability

- Introduced a new `quarantine_socket` function to centralize error handling for socket operations, improving code clarity and maintainability.
- Updated error handling in `UdpSocket` methods to utilize `quarantine_socket`, ensuring consistent logging and socket management across setup, send, and receive operations.
- Added a `cancel` method to `UdpSocket` to safely cancel socket operations when the socket is not usable, enhancing robustness in error scenarios.
- Introduced a `m_socket_usable` flag to track socket state, preventing operations on unusable sockets and improving overall stability.

* build pipeline

* Fix YAML syntax in publish_release workflow

Use printf -v for fallback release notes to keep all lines
properly indented within the YAML run block.

* Add Local-Z wipe tower reserve planning and pass ordering
Add startup profiling for GUI initialization
Drop unusable Bonjour sockets and harden socket cleanup
Add /FS to MSVC parallel compile options

* added support for >16 colors in color picker

* improved mixed filament ui perf

* mixed filament re-ordering

* obj color match "keep color" append missing color simplification

* added support for multi perimeter patterns, issue 34

* Prepare 0.9.4 changelog and release pipeline

* color mixer, depending on the selected color, tries to get the closest mix of 2, 3 or 4 filaments by brute force

* Update build_all.yml

* Refactor GitHub workflows to remove scheduled triggers and streamline build processes. Update MixedFilament to include local Z max sublayers for enhanced filament management. Introduce new functions for color match gradient handling in the GUI.

* Add min_component_percent parameter to color match functions for improved weight validation. Implement new helper functions to check color match weights within specified ranges. Update related functions to utilize the new parameter for enhanced color matching accuracy.

* Add controls for auto-generated mixed filament gradients

Add an app preference for mixed filament gradient auto-generation and
sync the manager state from startup and preferences changes.

Prompt before generating large gradient sets, preserve custom rows
when auto-generation is disabled, and refresh remapping/UI handling
accordingly. Add mixed filament coverage and a dumpinfo helper for
inspecting Windows minidumps.

* Add explicit infill filament override setting with per-layer control

Introduce enable_infill_filament_override toggle to replace the implicit
behavior where sparse_infill_filament != wall_filament implied an override.
Add infill_filament_use_base_first_layers and infill_filament_use_base_last_layers
to keep the base filament on boundary layers before switching to the infill
override filament. Move the sparse infill filament selector into the infill
section of the UI and gate its visibility behind the new toggle.

Also fixes: filament deletion now correctly updates wall/infill/solid filament
assignments, LayerRegion::flow() resolves nozzle diameter from the effective
extruder per role, and mixed filament preview ratio calculation is improved
for edge cases (0% and 100%).

* Fix OpenVDB clang patch application

* settings

* Collapse same-color mixed filament regions across painted areas

Resolve ordinary mixed-filament painted regions to their effective physical
filament on each layer so adjacent same-color zones can merge into one
continuous area instead of being sliced as separate islands.

Add a global "Collapse same-color mixed regions" option, enabled by default,
and automatically turn it off when Local Z dithering is enabled while still
allowing manual re-enable for experimental use.

* bug fix, tests

* .

* .

* logo, release notes, readme update

* forward declaration

* Fix Linux build in mixed filament color map

* temp

* Restore compatible region perimeter merge for MM-painted objects

* Add mixed filament bias controls and bump version to 0.9.51

* update readme, update changelog

* fix version number

* added a unified color helper so that every created colors and cached colors and preview are the same

* fix print filament color matcher

* release notes

* version number

* version number electric boogaloo

* bugfix in progress

* fix manual remap, send nozzle diam

* remove useless features

* local z fixes and extending to whole object

* - Adds optional whole-object Local-Z support for mixed wall regions instead of limiting Local-Z strictly to painted mixed zones.
- Adds an experimental direct multicolor Local-Z solver with carry-over error for 3+ color mixed rows, reducing pair-cadence banding.

* feat(gui): add mixed filament color mix dialog and panel

Introduce AddColorMixDialog with four mixing modes (ratio, cycle, match,
gradient), backed by MixedColorMatchPanel for async color-match recipe
search, MixedGradientSelector for gradient editing, and shared helpers in
MixedColorMatchHelpers. Wire init_color_mix_panel / update_color_mix_panel
into Plater and register all new sources in CMakeLists.

* Correct the web resource

* reworked local z prime tower logic and local z planner, reduced prime tower size and reduced toolchange amount

* feat: restore Snapmaker mainline icons, app name, log path
- Revert all app icons to pre-FullSpectrum version
- Restore app name to "Snapmaker Orca", remove FULLSPECTRUM_VERSION
- Revert Windows log directory from AppData\Local back to g_data_dir (AppData\Roaming)

* fix(gui): split panel headers into .cpp and fix gradient mode bugs

Move MixedFilamentColorMapPanel, MixedGradientSelector, and
MixedColorMatchHelpers implementations from header-only to proper
.cpp/.hpp pairs, and register them in CMakeLists.txt.

Fix duplicate wxEVT_TEXT binding on pattern control, clamp gradient
mode to exactly 2 filament rows, hide add/remove buttons in gradient
mode, replace fixed-pixel strip preview with Bresenham-scheduled
24-segment rendering for consistent cross-DPI behavior, and guard
against division-by-zero when the pattern vector is empty.

* revert: revert name

* revert: remove RELEASE_NOTES_v0.9.7.md (e334b6b)

* revert: remove FS changelog and README compatibility warning (28fd73e, 40f6e02)

* revert: restore gitignore (6022b25)

* revert: restore README to pre-FS state (aad40ef, f7b45fa, f9424e3, 358f81f)

* revert: remove FS_icon.png (0019ad9)

* fixed nominal layer issue in local z prints

* release notes, version bump

* feat: improve mixed filament UI and add merge functionality

- Refactor dialog with better layout and dynamic filament controls
- Add support for merging mixed filaments to physical or other mixed filaments
- Add mixed filaments to \"Merge with\" submenu with colored icons
- Add dependency checks when merging physical filaments used by mixed filaments
- Enhance Color Mix panel styling with cleaner appearance
- Rename AddColorMixDialog to MixedFilamentDialog"

* feat: add 10%-90% ratio constraints for mixed filament blending

* feat: simplify two-color match presets to 50:50 ratio only

* feat:add Gradient

* feat: add material compatibility validation for mixed filament

* feat: filter incompatible filament swatches, improve thread safety, modify api parameter

* feat:Improve gradient swap button to swap filament selections

* feat: use JSON config for filament compatibility

* feat: mixed filament pattern mode support and mixed filament UI redesign

- Manual pattern now supports / delimited multi-digit extruder IDs (e.g. /12/)
  while maintaining backward compatibility with legacy single-char patterns
- Card-based UI redesign for MixedFilamentDialog with segmented mode selector,
  dynamic legend panels, and scrolled content area
- New MixedFilamentBadge widget with solid/gradient fill and adaptive text color
- Sidebar filament and color mix panels capped at 3 visible rows with scroll
- Dependency-aware filament merge/delete with user warning dialogs
- gradient_component_ids now properly updated on physical filament removal

* feat: simplify gradient sublayer to fixed 2-sublayer B-first and decouple from global local-z

* feat: refine mixed filament gradient mode UI

* feat: refine mixed filament gradient UI and add filament count limit

- Add MAXIMUM_FILAMENT_NUMBER (32) as combined physical+mixed filament cap
- Render gradient preview on filament buttons in MMU painting gizmo
- Add create_mixed_filament_menu_bitmap() for gradient icons in dropdown menus
- Rewrite mix ratio calculation with GCD-based simplification
- Redesign tri-picker with vertex dots and updated selection indicator
- Add post_slice_state_change_update() for consistent state invalidation
- Add bounds checks and null guards in GLGizmoMmuSegmentation
- Remove wxRESIZE_BORDER from MixedFilamentDialog, use fixed client size
- Add icon_minus.svg and icon_plus.svg as add/remove filament button icons

* feat: local-Z wipe tower toolchange and fix single-color sublayer splitting

* feat: simplify manual pattern format to bracket notation and harden edge cases

- Replace '/' delimiter and A/B aliases with [N] bracket notation for
  filament IDs >= 10 in normalize_manual_pattern / tokenize_pattern_group
  / split_pattern_group_to_tokens, removing ~80 lines of legacy code
- Add null guards for PresetBundle in Plater (add_filament, delete_filament,
  merge_mixed_filament, add_custom_filament, init_color_mix_panel)
- Add bounds checks before offsetting char in gradient_component_ids
- Add division-by-zero guard (fill_h > 0) in MMU gradient rendering
- Cap layer ratio at 20 in mix_percent calculation to prevent excessively
  long patterns
- Update validate_cycle_pattern allowed chars and tooltip text
- Use SetMinClientSize/SetMaxClientSize for flexible dialog sizing,
  normalize pattern on mode switch to MODE_CYCLE

* feat: hide Mixed Filaments panel, reorganize mixed color settings UI

* feat: enhance mixed filament validation, caching, and compatibility feedback

- Extract is_simple_gradient() and resolve_filament_categories() to
  eliminate duplicated inline checks across multiple files.
- Add find_incompatible_filament_pair() to surface which specific
  filaments conflict in the compatibility warning.
- Add parse_cycle_pattern() for one-shot cycle-pattern tokenization
  and validation.
- Cache color-block bitmaps via a static BitmapCache; return wxBitmap*
  from create_mixed_filament_menu_bitmap() to avoid re-rasterization.
- Validate cycle pattern input: reject illegal characters, leading/
  trailing commas, malformed brackets, and out-of-range filament IDs.
- Show a low-ratio advisory when any filament falls below 25% of the mix.
- Add an error icon to the compatibility warning panel.
- Fix Plater::post_slice_state_change_update() lambda to capture this
  instead of calling wxGetApp().plater() through a global accessor.
- Render gradient icons for mixed filaments in extruder color strips.

* fixup: guard bracket notation overflow, extract is_simple_gradient, bounds check in ratios

* feat: improve cycle pattern display, ratio calculation, and compatibility warnings

- Add summarize_cycle_pattern_text() to show percentage breakdown (e.g. "F1 60%+F2 40%")
- Fix stripe ratio calculation to use GCD-based approach with visual cap
- Add compatibility warnings for same-color filaments and excessive count in cycle mode
- Fire on_filaments_change() after mixed filament updates to keep UI in sync
- Add null guard for preset_bundle in filament action menu factory

* fix: improve mixed filament panel stability and cycle pattern correctness

- Replace raw [this] capture with wxWeakRef<Sidebar> in all
  wxTheApp->CallAfter lambdas to prevent dangling pointer dereference
  when the Sidebar is destroyed before the deferred callback runs.
- Fix cycle mode: component_a/component_b now map token "1"/"2"
  directly to physical filaments 1/2 instead of incorrectly using
  extruder slot indices from get_filament_index().
- Fix virtual_id computation in mixed filament action menu.
- Add validate_cycle_pattern() call when switching to cycle mode.
- Prevent wxScrolledWindow auto-scroll on child focus to avoid
  requiring a second click on partially-visible widgets.
- Fix dialog return value check from wxOK to wxID_OK.
- UI polish: fixed dialog size, icon switching, name ellipsize,
  better minimum sizes for color mix panel name buttons.

* feat: complete match mode UI overhaul and recipe optimization

- Replace recipe-based legend/preview/draw_strip with tri-picker direct weights
- Dynamic gradient/tri picker switching based on filament count
- Remove 4-color match, optimize K-M blending to skip sequence quantization
- Fix hex input Enter propagation via wxEVT_TEXT_ENTER handler
- Fix recommended swatch legend using stale recipe weights
- Fix MixedFilamentBadge focus state overriding custom paint on Windows
- Fix Card 1 badge double-DIP scaling on high-DPI displays
- Fix 2-color match display showing duplicate filament IDs in Plater
- 2-color match: save proper gradient_component_ids for edit detection
- Default entry restores saved data; Add dialog defaults to 50:25:25

* fix: prevent async recipe search from overwriting saved match data on edit

- Remove begin_initial_recipe_load from build_ui to stop auto recipe search
- Use m_match_tri_weights for legend instead of gradient_selector value
- Sync m_match_tri_weights in gradient slider handler

* fix: add hex input validation with red border feedback in match mode

When an invalid hex color is entered in match mode, the input border turns
red and a warning banner is shown, matching the error pattern used in cycle mode.
Error state clears automatically when the user begins typing again.

* fix: add filament compatibility filtering to match mode recipes and entry check

- incompatible filament pairs/triples via pre-computed compatibility matrix
- match mode entry warns and disables confirm when default filaments are
  incompatible, using same error pattern as ratio mode

* fix: clear incompatible warning after clicking recommended swatch

* fix: add wxWeakRef protection for CallAfter

* fix: add border to blend/mix preview panels in all modes

* fix: separate error/warning banners and fix compatibility check in cycle mode

- Split the single compatibility warning panel into error (red, blocks
  confirm) and warning (orange, advisory) panels for clearer semantics.
- Fix is_filament_compatible to skip component_a/component_b in cycle
  mode, where they are hardcoded to 1/2 and would introduce phantom
  filaments into the compatibility check.
- Fix gradient color block rendering artifacts (black edge lines) by
  filling the background with the first gradient stop before painting.
- Clear all banners on mode switch to prevent stale warnings.
- Refactor check_low_ratio_warning() to get_low_ratio_warning_msg(),
  returning a string instead of mutating UI as a side effect.

* fix: clear hex error warning when target color is picked in match mode

* feat: hide local_z_wipe_tower_purge_lines from UI, use default value

* feat: optimize color match search with CIELAB pipeline and layered search

- Fix color_delta_e00 sRGB→Lab normalization (divide by 255)
- Add CIELab struct, BlendLUT for pre-computed pair blends
- Add sRGB_to_CIELab, delta_e_lab, blend_weighted_lab_accurate helpers
- Replace brute-force search with layered progressive search:
  pair coarse(5%)+fine(1%), early termination at ΔE≤0.5,
  adaptive candidate pool(top-8), triple coarse(10%)+fine(1%)
- Add final normalization with color_delta_e00 for consistent ΔE
- Prefer simpler(pair) recipe when triple advantage < 0.5 ΔE
- Extend gradient_component_ids encoding/decoding for filament IDs > 9
- Remove hard-coded filament ID 1-9 limit for triple search
- Optimize BlendLUT memory: only allocate a≤b triangular entries
- Fix is_filament_compatible to use decode_color_match_gradient_ids
- Add assert in BlendLUT::get() to enforce a<b (polynomial is not symmetric)

* feat: add mixed filament tests, dark mode support, and UI refinements

- Expose MixedFilamentManager helpers for unit testing
- Add ~1000 lines of unit tests covering utilities, patterns, and edge cases
- Add dark mode color support across MixedFilamentDialog, Plater, and Badge
- Change MixedFilamentBadge from wxButton to wxPanel with mouse handler
- Fix filament deletion paint transfer when replace_filament_id is specified
- UI refinements: card width, font size, corner radius, spacer management

* feat: modify mix color expresion and add translation

* fix: resolve dithering_local_z_mode state inconsistencies across preset operations

Add dithering_local_z_mode to s_Preset_print_options so it is stored
in the print preset config. This ensures the UI reads the correct
value on 3MF import, and the existing preset->project_config sync in
load_current_presets() handles discard/new-project flows.

Also:
- update_color_mix_panel() no longer creates missing keys in the
  edited print preset
- dithering_local_z_mode on_value_change() no longer force-writes
  sub-option values via change_opt_value()
- UnsavedChangesDialog shows dirty options not found in searcher
  (coString/coStrings types excluded), using ConfigDef label when
  available
- load_current_preset() calls update_changed_ui() to refresh field
  decorations after reload

* fix: correct bool-to-pointer conversion in GLGizmoMmuSegmentation

get_extruder_colors_from_plater_config expects (const GCodeProcessorResult*, bool)
but was called with (false), which GCC/Clang reject as implicit bool→pointer
conversion. Only MSVC allowed it, causing Ubuntu and macOS CI builds to fail.

* Fix slice all result ui flash

* fix: fix filament statistics misalignment across plates in GCode viewer

The filament statistics table rendered incorrect per-extruder data when
different extruders contributed to different volume categories (model,
support, flush, wipe_tower). Four separate maps were iterated
independently to fill parallel vectors, but each map could have a
different set of extruder IDs, causing index misalignment in the
rendering loop.

Fix by collecting all extruder IDs from all four maps into a unified
set, then filling all vectors in lockstep using the same iteration
order. Missing entries default to 0.0 volume.

* fix: skip re-slicing on tab switch when cached result is still valid

* Align Local-Z clipped perimeters with normal seam placement

* fix: resolve text truncation in MixedFilamentDialog across multiple DPIs

- Move "Filament Selection" title to its own row so it no longer competes with buttons for horizontal space at high DPI

- Replace wxStaticText with Label + LB_AUTO_WRAP for error/warning banners, wrapping to actual allocated width instead of hardcoded FromDIP(360) which exceeded available space by 12+ DIP

- Add width > 0 guard in Label::SetLabel to prevent one-char-per-line flicker when SetLabel is called before sizer layout

* refactor: unify update_compatibility_warning flow and fix match mode warnings

- Remove MATCH mode early return that skipped get_low_ratio_warning_msg and
  other warning checks, making low-ratio warnings reachable in match mode.
- Unify filament ID collection and decision cascade into a single if-else
  chain for all four modes, eliminating ~35 lines of duplicated code.
- Use existing set_error() helper for incompatibility errors instead of
  inline label/wrap/show/disable sequences repeated 3 times.
- Fix get_low_ratio_warning_msg() in match mode to read current tri-picker
  and gradient slider state, not stale recipe data that never updates on drag.
- Add update_compatibility_warning() calls after match-mode target color
  selection, hex input, tri-picker drag, and gradient slider drag.
- Match mode valid-recipe incompatibility now reports the specific filament
  pair via find_incompatible_filament_pair instead of a generic message.

* fix: add width guard in Label ctor, restore Fit() in on_dpi_changed, update header types

- Label constructor: add width > 0 guard before Wrap() to match SetLabel fix
- on_dpi_changed: restore Fit() (removed accidentally), dropped only the
  redundant Layout() which DPIAware::rescale() already calls
- MixedFilamentDialog.hpp: declare m_error_text/m_warning_text as Label*
  with forward declaration instead of wxStaticText*

* fix: add SetLabel fallback for zero-width and restore Layout in on_dpi_changed

- Label::SetLabel: when GetSize().x is 0 and LB_AUTO_WRAP is set,
  fall through to wxStaticText::SetLabel instead of silently skipping
  the display update
- MixedFilamentDialog::on_dpi_changed: restore Layout() call removed
  earlier, keeping consistency with all other DPIDialog subclasses

* fix: extend gradient_component_ids encoding to support filament IDs >= 10

* Fix Local-Z seam ordering and gradient wipe tower planning

* fix: remove unreachable dead code in MixedFilamentDialog mode detection

The duplicate LayerCycle→MODE_GRADIENT branch was unreachable because
the same condition was already handled by the preceding if-else block.
Found during santa-loop review round 1.

* fix: persist ui_mode in mixed filament rows to fix mode reversion on reload

Add ui_mode field to MixedFilament struct, serialized as cm<N> token
(cm0=RATIO, cm1=CYCLE, cm2=MATCH, cm3=GRADIENT) in custom entries.
Previously the dialog mode was lost when reloading project/config,
causing 3-color ratio mode to incorrectly revert to match mode.

Also limit recommended swatch filaments to 6 in 3-row ratio mode
to avoid combinatorial explosion of triple combinations.

* Disable mixed-region collapse for Local-Z mixing

* fix: restore single-row layout for filament card title, use prop=1 to prevent truncation

- Revert title/button split; keep "Filament Selection" and buttons on
  same horizontal row, with title at proportion=1 to avoid clipping
- Explicitly set Label::Body_12 for error/warning text instead of
  relying on Label's default Body_14
- Restore original button spacing (wxRIGHT 8 on swap button)

* recover some modify

* restore explicit Wrap in set_error and display_warning

* refactor: reverse ratio warning from low-ratio to high-ratio (dominance) detection

Change the compatibility warning from flagging filaments below 25%
to flagging a single filament exceeding 66.7%, which better reflects
the real concern — mix result dominated by one color.

* fix: rename "Mixed color layer thinner" to "Full domain" and add zh_CN translations

  - PrintConfig: change dithering_local_z_whole_objects label from
    "Mixed color layer thinner" to "Full domain"
  - i18n/zh_CN: add missing translations for cycle pattern validation,
    filament deletion warnings, and quick-append button

* Anchor mixed pattern cadence per painted zone

* fix(i18n): add missing period to zh_CN translations and add filament ratio warning

* remove unable Wrap

* Apply mix layer subdivision to infill by default

* fix: mixed filament dependency resolution priority and delete/merge remap

- manual_pattern now participates in dependency resolution with priority:
  manual_pattern → gradient → pair
- Add errno-based overflow detection for strtoul calls
- Add bounds checking for symbolic tokens "1"/"2" in physical_filament_from_token
- remove_physical_filament now detects and removes entries that depend on
  the deleted physical filament via manual_pattern tokens
- Deleted mixed filament virtual IDs are correctly remapped to 0 (NONE),
  preventing paint from being reassigned to a surviving mixed filament
- build_filament_id_remap accepts deleted_mixed_idx parameter;
  merge path correctly handles dependent mixed entries via remap injection
- UI: properly show/hide delete button and enable/disable add button
  when physical filament count changes
- Add 50+ regression tests covering serialization, resolve, delete,
  merge, gradient, bracket notation, and group boundary scenarios

* Deduplicate painted mixed PrintRegions
Use get_create_region() for painted regions so same-config painted targets
alias existing PrintRegions instead of creating duplicate region objects.
This restores the all_regions config-dedup invariant expected by
verify_update_print_object_regions() and prevents follow-up apply calls from
invalidating/reslicing due to duplicate PrintRegion configs.

* fix: stale m_layers_values causing wrong layer numbers in preview slider

m_layers_values was only repopulated when m_is_wipe_tower was true AND
m_values.size() != m_layers_times.size(). When the sizes happened to match
after a re-slice (e.g., after Subdivide Mix Layer was disabled), the old
data persisted and get_label() returned indices from the stale array,
showing doubled layer numbers (e.g., 263 instead of 132).

Fix by clearing m_layers_values unconditionally before the conditional
block. When the condition is not met, the empty array causes the fallback
path to return the correct slider index directly.

* fix: remove dithering_local_z_mode from 3MF import project option keys

* refactor: extract shared expand_virtual_extruder_ids, add missing expansion calls

* cleanup: remove FullSpectrum branding, personal changelogs, and CI overrides

* fix: force CRLF line endings for build_all.yml workflow

* fix: remove gradient-gated pair weight correction in 3-color localz mixing

* fix square wipe tower for local z

* refactor: improve readability of 3MF config parsing and related code

* chore: remove Chinese text from source comments and UI strings

* fix: disable add-filament button in ratio mode when no spare physical filaments

The add button was only checking against the mode maximum (3 for ratio)
but not against the number of physical filaments. With only 2 physical
filaments and 2 rows already, the button stayed enabled but should be
disabled since there is no third filament to add. Split Show/Enable so
the button remains visible but greyed out when unavailable.

* fix: reword pattern error message and add i18n for Swap filaments

Reword 'Invalid token in pattern' to 'Unrecognized pattern format' for clarity. Add Chinese translation for 'Swap filaments'.

* fix: refine add-filament button Show/Enable logic in ratio mode

* fix: replace fatal exceptions with graceful fallbacks and fix UI lifetime issues

- Convert throw RuntimeError/InvalidArgument to log + safe return in
  WipeTower2::tool_change, LayerRegion::flow, and GUI::change_opt_value
  to avoid crashes on unexpected edge cases
- Fix use-after-free risk in MixedFilamentDialog CallAfter callbacks
  by using wxWeakRef to guard against destroyed windows
- Bind wxEVT_CLOSE_WINDOW to EndModal(wxID_CANCEL) in
  MixedFilamentDialog and Plater anonymous dialogs so the title-bar
  close button works correctly

* fix: MixedFilamentDialog dark mode thumb visibility & gradient title font

- Min Mix Ratio slider thumb now fills with hard-coded #FFFFFF in dark
  mode instead of going through darkModeColorFor which mapped it to
  #2D2D31, making it invisible against the dark track background
- Gradient mode "Mix Effect" card title font changed from Body_12 to
  Body_14 for consistency with all other card titles in the dialog

* fix(MixedFilamentDialog): dark mode thumb fill and gradient title font

* chore: refine UI string wording and sync i18n

- Change "Snapmaker Orca needs an upgrade" to "The Snapmaker Orca needs an upgrade"
- Shorten "Append all" to "Append"
- Clean up orphaned translations in ja.po and zh_TW.po

* refactor: remove socket quarantine pattern from UdpSocket
(Revert to SHA-1: e89263e)

Replace m_socket_usable flag and quarantine/retain helpers with simple
error logging. Sockets are no longer closed and discarded on exception;
they always remain in the socket vector. Simplify destructor with
try-catch instead of error_code handling.

---------

Co-authored-by: Rad <radugheorghiu96@gmail.com>
Co-authored-by: Justin Hayes <justinh@rahb.ca>
Co-authored-by: ratdoux <62392831+ratdoux@users.noreply.github.com>
Co-authored-by: xSil3nt <ahmedshazin21@gmail.com>
Co-authored-by: Calogero Guagenti <calogeroguagenti@gmail.com>
Co-authored-by: xiaoyeliu <xyliu_leo@163.com>
Co-authored-by: zhangzhendong <zzdong0119@foxmail.com>
Co-authored-by: Xiejiajun <413189257@qq.com>
Co-authored-by: Builder Agent <builder@snapmaker.local>
Co-authored-by: fire2wind <1229725087@qq.com>
* feature add printer info sync entrance.

* feature limit only one nozzle and not allow to choose nozzle.

* fix remove not work code.

* feature select the u1 machine and show the sync btn entrance. fix the machine config not adapt current machine nozzle info.

* feature when on U1 switch the nozzle diameter and show a tips.

* feature add Graphic Effect Steel Plate for U1

* feature add new plate for U1, and U1 default show 3 plates and use support more plate, U1 will show 7 plates.

* feature only U1 has new plate.

* feature merge U1 nozzle to U1 type and handle it the same logic.

* feature upload or print notify web the nozzle info

* feature remove not work code.

* feature rename the graphic effect plate, add dialog for sync nozzle select from machine.

* feature sync nozzle info and set the nozzle combobox data.

* feature add tips for plate use filament.

* feature remove the nozzle modify entrance.

* feature update the Smooth PEI Plate layer temp.

* feature update the plate name for snapmaker u1.

* feature update ui img, guide page merge the nozzle for machine, update nozzle combobox select.

* feature update guide page machine select.

* feature update guide ui, profiles source.

* feature export 3mf include the graphic plate,process soft and load nozzle&filament config, plate&filament config.

* feature add tips for smooth pei plater for filament relations,and graphic plater for filament relations.

* feature add file for filament tips.

* feature revert the profiles change.

* fix revert to old profiles

* feature remove not work code.

* feature add config for tips on filament.

* feature  add nozzle changed and tips filament relations for slice.

* feature add nozzle for filament tips.

* feature remove the not work code.

* feature render panel add graphic hot bed for Custom plater.

* fix the judge logic for sync machine filament info.

* feature load relations json from profiles source,upgrade translations.

* feature update the translation.

* feature update translation,fix sync nozzle bug.

* feature update the translations.

* fix machine sync question .

* feature update the hot bed tmp

* feature update the hot bed tmp

* fix warning rule not work question.

* fix switch machine and the device show incorrect.

* feature update the config for tips hot bed and use the filament to slice module.

* feature fix upgrade lead to resource update fail question.

* feature revert not work code.

* feature update the request type.

* fix build fail bug.

* feature update the web resource.

* fix linux flatpak build fail bug

* feature remove the not work code for thow exception.

* fix request web,profiles resource and thread not sync question.

* feature remove not work code.

* fix invalid version info for update profiles dialog.

* feature only show a dialog tips for bed tips.

* feature update web resource.

* fix the machine filament not sync bug.

* feature get nozzle info data from web.

* fix machine filament not sync bug.

* feature update the web resource.

* fix ota dir not exist and crash bug.

* feature fix profile update and web source update lead to crash question.

* feature update web resource.

* feature update the soft version.

---------

Co-authored-by: alves <‘liulikeqian@gmail.com’>
…nel fixes (Snapmaker#401)

* Fix 3MF persistence for Local-Z project settings

Fixes Snapmaker#125.

Add Local-Z Full Domain and related mixed-filament project settings to the project config and import allow-lists so they survive 3MF save/load and model import.

* Load Local-Z settings from imported 3MF geometry

Fix geometry-only 3MF import so saved Local-Z project settings override the current unsaved state even when importing into a non-empty scene. Mirror the print-tab Local-Z booleans as well so the UI does not drift back to the old preset values.

* Keep Local-Z infill option in sync with subdivision mode

Default Apply subdivision to infill to off while Subdivide Mix Layer is disabled, auto-enable it when subdivision is enabled, and clear dependent Local-Z child settings when subdivision is disabled so saved project config does not retain stale active child values.

* bugfix: mix dialog error/warning panel oversized on first display

- Reorder Show+Layout before SetLabel so hidden LB_AUTO_WRAP Label
    gets valid width for wrapping, preventing NSTextField from
    reporting overly wide intrinsicContentSize
- Clean up i18n keys: drop colons (Filaments:/Target Color:),
    fix cycle card title Pattern→Filaments
- Sync zh_CN translations

* Refresh print tab after importing Local-Z settings

After geometry-only 3MF import, reload the print tab when Local-Z settings were imported so the visible Subdivide Mix Layer controls match the project config used for slicing.

* Do not import Local-Z process settings with geometry

File -> Import 3MF should preserve the current project's process parameter state. Stop applying saved Local-Z project/print settings during geometry-only 3MF import; those settings are still loaded when opening a project with config.

* Fix inherited plate bed type dirty state

* i18n: add zh_CN translation for "Apply subdivision to infill"

* docs: add inline comments explaining double-Layout macOS workaround in MixedFilamentDialog

The error/warning labels use LB_AUTO_WRAP, which requires two Layout()
passes on macOS: the first lands the panel's actual width after Show(),
the second re-wraps the label text at the correct width. Without this,
a single Layout can query a stale zero-width from CalcMin and produce
an oversized dialog on first display.

---------

Co-authored-by: ratdoux <radugheorghiu96@gmail.com>
Co-authored-by: ZhangZheng <67276816+LuckZAE@users.noreply.github.com>
* Fix 3MF persistence for Local-Z project settings

Fixes Snapmaker#125.

Add Local-Z Full Domain and related mixed-filament project settings to the project config and import allow-lists so they survive 3MF save/load and model import.

* Load Local-Z settings from imported 3MF geometry

Fix geometry-only 3MF import so saved Local-Z project settings override the current unsaved state even when importing into a non-empty scene. Mirror the print-tab Local-Z booleans as well so the UI does not drift back to the old preset values.

* Keep Local-Z infill option in sync with subdivision mode

Default Apply subdivision to infill to off while Subdivide Mix Layer is disabled, auto-enable it when subdivision is enabled, and clear dependent Local-Z child settings when subdivision is disabled so saved project config does not retain stale active child values.

* bugfix: mix dialog error/warning panel oversized on first display

- Reorder Show+Layout before SetLabel so hidden LB_AUTO_WRAP Label
    gets valid width for wrapping, preventing NSTextField from
    reporting overly wide intrinsicContentSize
- Clean up i18n keys: drop colons (Filaments:/Target Color:),
    fix cycle card title Pattern→Filaments
- Sync zh_CN translations

* Refresh print tab after importing Local-Z settings

After geometry-only 3MF import, reload the print tab when Local-Z settings were imported so the visible Subdivide Mix Layer controls match the project config used for slicing.

* Do not import Local-Z process settings with geometry

File -> Import 3MF should preserve the current project's process parameter state. Stop applying saved Local-Z project/print settings during geometry-only 3MF import; those settings are still loaded when opening a project with config.

* Fix inherited plate bed type dirty state

* i18n: add zh_CN translation for "Apply subdivision to infill"

* docs: add inline comments explaining double-Layout macOS workaround in MixedFilamentDialog

The error/warning labels use LB_AUTO_WRAP, which requires two Layout()
passes on macOS: the first lands the panel's actual width after Show(),
the second re-wraps the label text at the correct width. Without this,
a single Layout can query a stale zero-width from CalcMin and produce
an oversized dialog on first display.

* Fix painted region rebuild after mixed filament edits

* same layer pointillism comment

---------

Co-authored-by: ratdoux <radugheorghiu96@gmail.com>
Co-authored-by: ZhangZheng <67276816+LuckZAE@users.noreply.github.com>
…/OrcaSlicer into develop

# Conflicts:
#	resources/web/flutter_web/flutter_bootstrap.js
#	resources/web/flutter_web/flutter_service_worker.js
#	resources/web/flutter_web/main.dart.js
#	resources/web/flutter_web/version.changelog
#	resources/web/flutter_web/version.json
@LuckZAE LuckZAE force-pushed the develop branch 2 times, most recently from 3beca85 to 1015eb9 Compare June 2, 2026 10:33
@SukiSunYuhang SukiSunYuhang merged commit 3354269 into Snapmaker:feature_flutter_engine Jun 2, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants