virtualpump
¶
This module can be used to simulate the I/O behaviour of a TURBOVAC pump and thus enable testing the program without access to an actual pump.
- class turboctl.virtualpump.virtualpump.VirtualPump¶
This class simulates a TURBOVAC pump and tries to respond to signals the same way a physical pump would. This makes it possible to test the
turboctl
package without connecting to a physical pump.- connection¶
Simulates the serial connection.
- Type:
- parameter_component¶
Handles access to pump parameters.
- Type:
- hardware_component¶
Simulates pump hardware.
- Type:
- __init__()¶
Initialize a new
VirtualPump
.
- __enter__()¶
Called at the beginning of a
with
block; returns self.
- stop()¶
Close parallel threads by calling
connection
.close()
andhardware_component
.stop()
.
- process(bytes_in)¶
Process incoming data.
This function processes the data sent to the virtual pump by interpreting it as a telegram and performing any commands specified by it (such as changing parameter values). A reply telegram is then formed and its contents returned.