Source code for device_client.client_langmuir_hotprobe
from device_client import DeviceClient
from device.langmuir_hotprobe import LangmuirHotProbe
description = """
*No description.*
"""
[docs]
def connect(name, password, server):
client = DeviceClient(name, password,
title="Langmuir: Heated probe", description=description)
hw = LangmuirHotProbe(
bus="/dev/ttyUSB123", # TODO Change
log_callback=client.emit_log,
)
client.register_command(hw.stop, "Stop")
def set_heating(enabled):
hw.switch_heating_on() if enabled else hw.switch_heating_off()
client.emit_command_state("set_heating", [enabled])
client.register_command(set_heating, "Heating on/off", inputs=[{"type": "toggle"}])
client.register_command(hw.heating_power, "Check heating power", pass_self=True)
client.register_command(hw.measure_sweep, "Sweep I-V", inputs=[
{"type": "select", "options": [1, 2, 5, 10, 20, 50, 100], "unit": "kHz"},
{"type": "select", "options": [25, 50, 60, 70, 80, 90, 100], "unit": "%"},
], pass_self=True)
client.register_background_task(hw.update_frontend)
client.keep_server_updated(
check_readiness=hw.is_ready,
check_readiness_interval=0.2,
server_address=server,
retry_on_error=True
)