Skip to content

Commit 4ee03fd

Browse files
Adding the lights argument adds lights to the controller
1 parent cd02f43 commit 4ee03fd

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

microscope/controllers/asi.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def __init__(self, port: str, baudrate: int, timeout: float) -> None:
232232
print("Unable to read configuration. Is ASI controller connected?")
233233
return
234234

235-
self._led_mapper = {"1": b"X", "2": b"Y"}
235+
# As for this version, some MS2000 controllers have integrated control for 2 LEDs
236+
self._led_mapper = [b"X", b"Y"]
236237

237238
# parse config response which tells us what devices are present
238239
# on this controller.
@@ -608,7 +609,7 @@ class _ASILED(microscope._utils.OnlyTriggersBulbOnSoftwareMixin, microscope.abc.
608609
# we set this class as oly triggerable by software
609610
# TODO: Look into implementation of triggers
610611

611-
def __init__(self, dev_conn: _ASIController, channel: str) -> None:
612+
def __init__(self, dev_conn: _ASIController, channel: int) -> None:
612613
super().__init__()
613614
self._dev_conn = dev_conn
614615
self._channel = channel
@@ -687,20 +688,23 @@ class ASIMS2000(microscope.abc.Controller):
687688
688689
.. note::
689690
690-
The ASI MS2000 can control a stage, and other items
691-
but only the stage is currently implemented.
691+
The ASI MS2000 can control a stage, and other items.
692+
This version implements:
693+
stage: X, Y, Z axes
694+
lights: up to 2 lights are supported by some MS2000 controllers. Use the lights argument to send a list of
695+
one or two lights defined as strings.
692696
693697
"""
694698

695699
def __init__(
696700
self, port: str, baudrate: int = 9600, timeout: float = 0.5, **kwargs
697701
) -> None:
698-
super().__init__(**kwargs)
702+
super().__init__()
699703
self._conn = _ASIController(port, baudrate, timeout)
700704
self._devices: typing.Mapping[str, microscope.abc.Device] = {}
701705
self._devices["stage"] = _ASIStage(self._conn)
702-
self._devices["ligth_465"] = _ASILED(self._conn, "1")
703-
self._devices["ligth_560"] = _ASILED(self._conn, "2")
706+
for light_ch, light in enumerate(kwargs["lights"]):
707+
self._devices[light] = _ASILED(self._conn, light_ch)
704708

705709

706710
@property

0 commit comments

Comments
 (0)