Source code for device_client.client_langmuir_ps
from device_client import DeviceClient
from device.power_supply_langmuir import PowerSupply_Langmuir
description = """
High voltage power supply, use it to generate plasma between the electrodes.
1. Switch the power ON using the toggle button.
2. Look for the current and voltage values in the *Values* section.
3. Use commands **Current +** and **Current -** to regulate the current limit,
and thus the output current itself.
**Manual intervention:** The volatage is set to a reasonable value that is
empirically tested. If you are unable to create a discharge, try adjusting
the "voltage knob" on the power supply (this needs to be done manually).
"""
[docs]
def connect(name, password, server, serial):
client = DeviceClient(name, password,
title="Langmuir: Power supply", description=description)
hw = PowerSupply_Langmuir(
bus=serial,
log_callback=client.emit_log,
)
def set_switch(enabled):
hw.switch_on() if enabled else hw.switch_off()
client.emit_command_state("set_switch", [hw.is_switched_on()])
client.register_command(
set_switch,
"Power ON/OFF",
inputs=[{"type": "toggle"}],
)
client.register_command(hw.increment_max_current, "Current +")
client.register_command(hw.decrement_max_current, "Current -")
client.register_background_task(hw.update_frontend)
client.keep_server_updated(
hw.is_ready, 0.2, server, retry_on_error=True
)