25 lines
862 B
Python
25 lines
862 B
Python
from cpdctrl.led_control_device.base import LedControlDevice
|
|
from cpdctrl.led_control_device.impl.test import TestLedControlDevice
|
|
|
|
|
|
def list_devices() -> dict[str,list[str]]:
|
|
devices = {
|
|
"TEST": ["Led Control Dummy Device"],
|
|
}
|
|
try:
|
|
from .impl import thorlabs_ledd1b as th
|
|
devices["ARDUINO"] = ["Thorlabs LEDD1B"] #keithley2700.enumerate_devices()
|
|
except ImportError:
|
|
pass
|
|
return devices
|
|
|
|
def connect_device(typename: str, devicename: str) -> LedControlDevice:
|
|
if typename == "TEST":
|
|
return TestLedControlDevice()
|
|
elif typename == "ARDUINO":
|
|
try:
|
|
from .impl import thorlabs_ledd1b as th
|
|
return th.LEDD1B()
|
|
except ImportError as e:
|
|
raise ValueError(f"Arduino devices not available: {e}")
|
|
raise ValueError(f"Unknown device type {typename}") |