Add get_led_name method

This commit is contained in:
CPD 2025-03-10 13:15:41 +01:00
parent db566a846b
commit ea49062d80
2 changed files with 10 additions and 3 deletions

View File

@ -44,6 +44,9 @@ class LedControlDevice(ABC):
"""
pass
def get_led_name(self) -> None|str:
return None
@abstractmethod
def __str__(self):
pass

View File

@ -16,11 +16,12 @@ class DC2200(LedControlDevice):
def __init__(self, instr: pyvisa.Resource):
super().__init__()
self.instr = instr
# led presence test
self.instr.write('OUTPut:TERMinal2:TEST:INITiate')
presence = self.instr.query('OUTPut:TERMinal2:TEST:STATus?')
# Led name, format:
# "<vendor_name_string>,<led_head_model_name_string >, < led_head_serial_no_string >, < fw_version_major_num >, < fw_version_minor_num >, < fw_version_subminor_num > "
self.name = instr.query('SYSTem:TERMinal2:HTYPe?')
# led presence test
self.instr.write('OUTPut[1]:TERMinal2:TEST:INITiate')
self.led_name = self.instr.query('SYSTem:TERMinal2:HTYPe?')
# constant brightness
self.instr.write('SOURCE1:MODE CB')
# turn off
@ -46,5 +47,8 @@ class DC2200(LedControlDevice):
instr = rm.open_resource(name)
return DC2200(instr)
def get_led_name(self) -> None|str:
return self.led_name
def __str__(self):
return "Thorlabs DC2200"