Promote next to main: connection redesign#30
Merged
Merged
Conversation
Pairs with openmotion-sdk feature/connection-redesign. motion_connector.py: - on_connected/on_disconnected/on_data_received collapsed into a single _on_handle_state_changed(handle, old, new, reason) wired to each of the three stable handles (console/left/right). Branches on handle.name. - All `motion_interface.console_module` -> `motion_interface.console`. - All `motion_interface.sensors[X]` and `.sensors.get(X)` patterns -> `motion_interface.left` / `motion_interface.right` directly, or `getattr(motion_interface, side, None)` where side is dynamic. - Console-status thread teardown moved into the new state handler's DISCONNECTED branch. motion_singleton.py: - Drop acquire_motion_interface() (removed from SDK). Just construct MotionInterface(); main.py calls .start() once at startup. main.py: - Drop qasync QEventLoop + asyncio glue. Call motion_interface.start() before app.exec() and motion_interface.stop() in handle_exit. The SDK's daemon monitor thread runs alongside the Qt event loop; no bridging needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The SDK now emits "left"/"right"/"console" via signal_state_changed and
expects matching strings as method arguments. The previous "SENSOR_LEFT",
"SENSOR_RIGHT", and "CONSOLE" tags were the old descriptor format.
- pages/{Sensor,Settings,Console,Demo}.qml: every quoted device tag
("SENSOR_LEFT" -> "left", "SENSOR_RIGHT" -> "right", "CONSOLE" ->
"console"), 71 sites total. Comments updated where they reference the
old constants.
- motion_connector.py: same string substitution (75 sites). Removed the
now-redundant `sensor_tag = "left" if target == "SENSOR_LEFT" else
"right"` re-derivation in the DFU enter path; the target IS the tag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Cherry-picks the trigger-frequency precision change from 1e6576f without the JSON camelCase key conversion or the temporary float-coercion shim. The DoubleValidator (1.00-100.00, 2 decimals) and parseFloat now match the firmware's float frequencyHz; PascalCase JSON keys stay consistent with the rest of the trigger config and the firmware's GET response.
Brings feature/connection-redesign current with next: - 7d0ce9a refactor out config to its own handler - 9ceee95 update adc_data scale parameter - 1e6576f more granular control of the trigger - 13ebce5 update workflow to reflect naming convention Resolutions: - motion_connector.py set_laser_power_from_config: collapsed the 144-line inline implementation into the one-line delegation to apply_laser_power_from_config from fpga_laser_config.py. The refactored function preserves the same DRIVE CL safety override logic and EE_THRESH/EE_GAIN/OPT_THRESH/OPT_GAIN handling. - fpga_laser_config.py: ported from the old SDK API (interface.console_module.read_config / .write_i2c_packet) to the new stable-handle API (interface.console.*). Without this the refactored function would have failed on the connection-redesign branch where console_module no longer exists. - pages/Demo.qml: kept PascalCase JSON trigger keys (TriggerFrequencyHz etc.) consistent with the firmware's GET response and the rest of the config; the camelCase variant from 1e6576f is dropped here for the same reasons it was dropped in console-fw 1.5.8-rc.2. Verified: motion_connector.py and fpga_laser_config.py both syntax-check; no remaining console_module references anywhere; no remaining references to the removed _fpga_model / _fpga_scale_overrides / _fpga_scale_cache attributes; the _get_fpga_scale and _get_fpga_entry_by_friendly_name methods stay as 4-line FpgaModel delegators (the auto-merged version from next), preserving the external caller at line 3638. Not yet verified: app actually launches and the trigger panel works end-to-end. Requires GUI + hardware.
feat: migrate test-app to MotionInterface stable-handle API
georgevigelette
approved these changes
May 13, 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
Promotes
nexttomain. Brings in the test-app side of the SDK connection redesign:c2e8283migrate toMotionInterfacestable-handle API — connector subscribes once to per-handlesignal_state_changedinstead of reconnecting on every connect/disconnect cycle; all device calls go throughinterface.console/interface.left/interface.right(the removedconsole_module/sensor_moduleaccessors are gone)85a5978align to the new descriptor naming (lowercasehandle.name)8f9b580workflow naming alignment (release-build.yml)c542329float-precision trigger frequency UI (DoubleValidator +parseFloat); JSON keys stay PascalCase, matching firmware GET response and the rest of the trigger config360d283merge of next: adopts thefpga_laser_config.pyrefactor and ports it from the oldconsole_moduleAPI to the newconsolehandle API in the same change. Without that port the refactored module would have been dead code on the connection-redesign branch.29ad13bPR feat: migrate test-app to MotionInterface stable-handle API #29 merge commitDiff: 8 files, +259 / −283. Most of
motion_connector.py's churn is call-site renames; the 144-lineset_laser_power_from_configbody is now a 3-line delegation toapply_laser_power_from_config(...)— logic preserved, moved tofpga_laser_config.py.SDK pairing
Pairs with
openmotion-sdkPR #48 (alsonext→main). The connection redesign requires the SDK'sMotionInterfacestable-handle API; deploy together.Test plan
python main.pylaunches, app reaches the QML engine, connector subscribes to handle state changesopenmotion-console-fw 1.5.8-rc.2(validated end-to-end via the trigger script in SDK PR #47/#48)set_laser_power_from_config— exercised by app start sequence; reviewer should confirm the DRIVE CL safety override path still fires on hardwaresignal_state_changedflow updates the UI correctly across connect/reconnect🤖 Generated with Claude Code