device.mockup module¶
- class device.mockup.Discharge(duration, peak_power, t_rise=5, t_tail=3)[source]¶
Bases:
object- commentary()[source]¶
Fancy messages that are triggered during the discharge. Returns None when no new message is availible
- measure_power()[source]¶
Fancy time evolution of “power output” during a discharge. Returns a tuple (time, power).
- property phase¶
- property time¶
- class device.mockup.MockupDevice(constants=None, **kwargs)[source]¶
Bases:
HardwareBaseA mockup class to demonstrate HardwareBase functionalities and the integration with DeviceClient.
- HardwareBase features:
Manual connect, disconnect or automatic via calling is_ready
Manual command interrupt
Automatic safety kill-switch called in the case of interrupt or error
- Thread-safety = only one command at a time (via @base_command, …)
=> this is required for calls made by DeviceClient
Info, warning, error logging (to console and file)
- DeviceClient features:
Autoconnect and check connection via calls to is_ready
Run user commands with parameters
Run custom periodic commands in background
Display info messages
Display a graph
- initiate_discharge(device_client, duration)[source]¶
Simulated: Discharge with a specified time duration. It just reads power output from device and emits some meassages (‘commands’).