if you Stop Pump during Dispense, the timer continues in background. If you wait it out, it catches at the next Timeout signal and ends.
However if you Stop it and Dispense again before it times out, it starts doubling up.
Considerations:
- QTimer.singleShot is apparently impossible to interact with after it's fired, it can't be stopped or caught or modified at all. By design.
- The way it catches the Stop Pump the next time the Timeout emits is with a flag self.stop_flag (bool). If you Dispense again too soon, it resets the stop_flag before it catches it and continues the original Dispense, and at the same time the new Dispense is active.
Plans:
Somehow use a regular QTimer that can be stopped and started. So far in my attempt, with each iteration it gains timeouts, and each time clicking dispense multiplies the number of timeouts.
if you Stop Pump during Dispense, the timer continues in background. If you wait it out, it catches at the next Timeout signal and ends.
However if you Stop it and Dispense again before it times out, it starts doubling up.
Considerations:
Plans:
Somehow use a regular QTimer that can be stopped and started. So far in my attempt, with each iteration it gains timeouts, and each time clicking dispense multiplies the number of timeouts.