Skip to content

Fix legacy VSpin grip validation and add centrifuge events - #1212

Merged
rickwierenga merged 3 commits into
PyLabRobot:mainfrom
j0nch:fix/legacy-vspin-grip-steps
Aug 18, 2026
Merged

Fix legacy VSpin grip validation and add centrifuge events#1212
rickwierenga merged 3 commits into
PyLabRobot:mainfrom
j0nch:fix/legacy-vspin-grip-steps

Conversation

@j0nch

@j0nch j0nch commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix the legacy Access2 loader's grip_steps validation and add canonical EventBus coverage to the resource-aware legacy centrifuge and loader frontends.

Legacy Access2 bug fix

Access2Backend.load() currently uses:

if not grip_steps not in (1, 2, 3, 4):

This rejects every valid value, including the default grip_steps=1, before the loader sends any hardware command. The condition was introduced with the configurable grip-step feature in #1140; unload() already uses the intended predicate.

This PR changes load() to the matching validation:

if grip_steps not in (1, 2, 3, 4):

Regression coverage verifies that the default reaches the existing loader command sequence and that an invalid value fails before any command is sent.

Legacy centrifuge EventBus coverage

The modern Agilent VSpin and Access2 frontends already emit:

  • centrifuge.spin
  • centrifuge_loader.load
  • centrifuge_loader.unload

This PR adds the same canonical semantic operations to the resource-aware legacy Centrifuge and Loader frontends. Instrumenting the frontends rather than the FTDI backends allows events to report the actual PLR resources and physical transfer endpoints.

centrifuge.spin reports:

  • the centrifuge resource in device;
  • directly loaded resources in resources;
  • holder/resource associations in bucket_resources;
  • relative_centrifugal_force and duration;
  • the requested or actual backend-default acceleration_fraction and deceleration_fraction when the backend exposes them.

Loader operations report the directly moved plate and actual holders:

  • centrifuge_loader.load: loader to selected bucket;
  • centrifuge_loader.unload: selected bucket to loader.

The context factories exactly match their decorated public method calling semantics, including positional g and duration arguments and forwarded backend keyword arguments. Their fields follow the EventBus contracts formalized in #1210.

Compatibility

  • No VSpin or Access2 command sequence was changed.
  • No public frontend or backend signature was changed.
  • With no active EventBus listener, the decorators remain no-ops.
  • Existing resource assignment behavior is unchanged; assignment events are correlated beneath the semantic loader operation when a listener is active.
  • The EventBus implementation is frontend-generic, so other legacy Centrifuge and Loader backends receive the same semantic operation family using their own resource model and backend defaults.

Verification

  • Modern VSpin/Access2 and legacy centrifuge suites: 23 passed
  • Tests cover successful spin and load lifecycles, unload failure lifecycle, resource/end-point semantics, positional spin arguments, VSpin backend defaults, valid default grip steps, and invalid grip-step rejection.
  • git diff --check: clean

@rickwierenga
rickwierenga merged commit 158a0a9 into PyLabRobot:main Aug 18, 2026
21 checks passed
@rickwierenga

Copy link
Copy Markdown
Member

thanks good find

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.

2 participants