Draft: Hla 1113 implement stop and pause buttons#90
Conversation
This speeds up BBA startup against the Virtac by ~10 seconds
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
We now send the stop signal and then send the unpause signal (if paused). This stops an unnecessary algorithm run cycle from happening.
This is to prevent us stopping in a place which leaves a quadrupole away from its original setpoint
If checks the bool'ness of a value automatically so we do not need to do this explicitly
Both names are true, but ticker was deemed more the more immediate action
MJGaughran
left a comment
There was a problem hiding this comment.
I think the general approach is fine, feel free to continue with it.
|
|
||
| def stop_worker(self, manual_stop: bool = False) -> None: |
There was a problem hiding this comment.
This is still called stop_worker
| log.info("Zeroing BCD and Golden Offsets") | ||
| golden_offsets = {} | ||
| pv_names = [] | ||
| bcd_names = [] |
There was a problem hiding this comment.
Did you leave these lines in by mistake?
| """The process is resumed.""" | ||
| log.debug("Resumed") | ||
| Args: | ||
| stop_event: Cothread event which is triggered when the GUI stop button |
| def work(self) -> float: | ||
| """Complete an iteration of the BBA process. | ||
|
|
||
| Args: |
| def stop_ticker(self, manual_stop: bool = False) -> None: | ||
| """Stop the ticker.""" | ||
| self.__action.Signal(("stop", None)) | ||
| if self.__worker is None: |
There was a problem hiding this comment.
Nitpick:
The whitespace is inconsistent. At the top of the method, there's no newline on stop_ticker, __do_tick has a newline, and __ticker has a newline immediately after the docstring.
Keep it consistent, I recommend following __do_tick. Guard clauses (e.g. if val is None: return/raise) are often separated from the main code, as in __do_tick.
TODO: Tests