Source code for device_client.client_paschen_gauge
from device_client import DeviceClient
from device.gauge_controller_tpg36x import GaugeController_TPG362
SERIAL_NO = "44871546"
description = """
#### Log data
Start pressure logging (all channels), returns a datafile when finished.
- *duration* = total time, use format: `5s` or `2m5s` or `1h2m5s`
- *interval* = time between samples in seconds, for example: `11.2`
Note: If stopped using **Stop**, the file will not appear here, but the data
still exists in ~/saved_data directory on one of the RaspberryPi.
"""
[docs]
def connect(name, password, server):
client = DeviceClient(name, password, logger="paschen",
title="Gauge Controller TPG362 (546)", description=description)
hw = GaugeController_TPG362(
serial_number=SERIAL_NO,
log_callback=client.emit_log,
logger="paschen",
)
client.register_command(hw.stop, "Stop")
client.register_command(hw.log_pressure, "Log data", pass_self=True,
inputs=[{"unit": "hms"}, {"unit": "s"}])
client.register_background_task(hw.update_frontend)
client.keep_server_updated(
check_readiness=hw.is_ready,
check_readiness_interval=1,
server_address=server,
retry_on_error=True
)