Add error handling to Cryomech PTC drivers and agent acq process #767
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.
Description
This PR implements error handling for the Cryomech PTC class and most of the agent, with the main goal of making the
acq()
process robust to network interruptions.In doing this I moved the "drivers" out to their own module. That's perhaps a bit noisy overall in this PR, but the interesting diffs are separated to:
Motivation and Context
This implementation is the one outlined in "Reconnecting in the Drivers" in #538, heavily inspired by #325.
Resolves #766.
How Has This Been Tested?
Tested by running the agent locally with an actual Cryomech compressor. Tested the agent remains online while disconnecting the network cable from the compressor and re-establishes connection when the cable is plugged back in. Example logs:
Also tested shutting down the compressor and bringing it back up, which causes the
reset()
to trigger and produces a slightly different set of errors. It still reconnects once the compressor is back online. Example logs:(There will be a lot of the
AttributeError
logs, as the acq process loops.)Types of changes
Checklist: