Skip to content

Fix machine settings not applying until restart#267

Merged
knipknap merged 1 commit into
mainfrom
fix/machine-settings-not-applied
Jun 2, 2026
Merged

Fix machine settings not applying until restart#267
knipknap merged 1 commit into
mainfrom
fix/machine-settings-not-applied

Conversation

@knipknap

@knipknap knipknap commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Closes #266

Several machine settings changes were not propagating to listeners until the app was restarted. This fixes multiple root causes:

Critical Fixes

  • set_driver()/set_driver_args() emit changed synchronously — These were the only setters that didn't emit machine.changed, relying solely on an async rebuild_driver callback. This meant pipeline recalculation, persistence, and UI updates were all delayed or lost if the async chain failed.
  • _hydrated_dialect cache cleared on dialect change — Once hydrated, the dialect property returned a stale cached value even after the user changed the dialect in settings.

UI Fixes

  • JogWidget now listens to machine.changed — Jog button sensitivity, home button visibility, and soft limit warnings now update when machine settings change.
  • WorkSurface incremental update path calls _update_pipeline_view_context() — Non-dimension changes (laser colors, margins) now render on the 2D canvas immediately instead of requiring a zoom/pan.

Memory Leak Fix

  • LaserListEditor signal handler disconnected on dialog destroy — Prevented GC of the editor and all its widgets on every dialog open/close cycle.

API Improvements

  • Added Machine.set_supports_arcs() setter — Replaces direct attribute mutation + manual changed.send() in the advanced preferences page.
  • Added Machine.clear_soft_limits() method — Replaces direct _soft_limits = None access in the hardware page.
  • Added equality guards to 6 settersset_home_on_start, set_max_travel_speed, set_max_cut_speed, set_acceleration, set_origin, and set_soft_limits_enabled now skip unnecessary signals when the value hasn't changed.

Files Changed

  • rayforge/machine/models/machine.py — Core model fixes
  • rayforge/ui_gtk/machine/jog_widget.py — Machine change listener
  • rayforge/ui_gtk/canvas2d/surface.py — Pipeline view context update
  • rayforge/ui_gtk/machine/laser_preferences_page.py — Signal leak fix
  • rayforge/ui_gtk/machine/advanced_preferences_page.py — Use new setter
  • rayforge/ui_gtk/machine/hardware_page.py — Use clear_soft_limits()

@knipknap
knipknap force-pushed the fix/machine-settings-not-applied branch 2 times, most recently from f1e9726 to 20e72ae Compare June 1, 2026 10:08
Closes #266

Several machine settings changes were not propagating to listeners
until the app was restarted. This fixes multiple root causes:

- set_driver()/set_driver_args() now emit changed signal synchronously
  instead of relying solely on the async rebuild_driver callback
- _hydrated_dialect cache is cleared when dialect UID or dialect
  definitions change, preventing stale G-code dialect usage
- JogWidget now listens to machine.changed to update button sensitivity
  and limit status when machine settings change
- WorkSurface incremental update path now calls
  _update_pipeline_view_context() so canvas reflects non-dimension
  changes (e.g. laser colors, margins)
- LaserListEditor signal handler is disconnected on dialog destroy to
  prevent memory leak
- Added Machine.set_supports_arcs() setter replacing direct attribute
  mutation in the advanced preferences page
- Added Machine.clear_soft_limits() replacing direct _soft_limits
  attribute access in hardware page
- Added equality guards to set_home_on_start, set_max_travel_speed,
  set_max_cut_speed, set_acceleration, set_origin, and
  set_soft_limits_enabled to avoid unnecessary signals
@knipknap
knipknap force-pushed the fix/machine-settings-not-applied branch from 20e72ae to c3edcff Compare June 1, 2026 10:45
@thehamstermuffin

Copy link
Copy Markdown

Seems to be working fine 👍

@knipknap

knipknap commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Awesome, thank you for testing!

@knipknap
knipknap merged commit 7bac902 into main Jun 2, 2026
29 checks passed
@knipknap
knipknap deleted the fix/machine-settings-not-applied branch June 4, 2026 20:16
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.

configuration for creality Falcon 10W

2 participants