Skip to content

Commit 7e39c2b

Browse files
changes that would be deleted upon merge were added so that they are not deleted upon merge
1 parent ba2fbb7 commit 7e39c2b

File tree

3 files changed

+50
-33
lines changed

3 files changed

+50
-33
lines changed

src/navigate/model/devices/APIs/asi/asi_tiger_controller.py

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import threading
3434
import time
3535
import logging
36-
from typing import Union
3736

3837
# Third Party Imports
3938
from serial import Serial
@@ -923,7 +922,7 @@ def change_filter_wheel_speed(self, speed: int = 0) -> None:
923922
self.send_filter_wheel_command(f"SV {speed}")
924923
self.read_response()
925924

926-
def halt_filter_wheel(self):
925+
def halt_filter_wheel(self) -> None:
927926
"""Halt filter wheel"""
928927
self.send_filter_wheel_command("HA")
929928
self.read_response()
@@ -947,7 +946,7 @@ def move_dichroic(self, dichroic_id: str, dichroic_position: int = 0) -> None:
947946
def square_wave(self, on_time: int, delay_time: int) -> None:
948947
"""Square wave modulation.
949948
950-
For testing only.
949+
For testing only. Can be used to implement precise laser control.
951950
952951
Parameters
953952
----------
@@ -1013,28 +1012,64 @@ def logic_card_off(self, axis: str):
10131012
self.send_command(f"6 CCA Z=0\r")
10141013
self.read_response()
10151014

1015+
def logic_cell_on(self, axis : str):
1016+
"""Turn on internal logic cell
1017+
1018+
Parameters
1019+
----------
1020+
axis : str
1021+
The axis of the internal logic cell
1022+
"""
1023+
self.send_command(f'6 M E = {axis}\r')
1024+
self.read_response()
1025+
self.send_command(f'6 CCA Z=1\r')
1026+
self.read_response()
1027+
1028+
def logic_cell_off(self, axis :str):
1029+
"""Turn off internal logic cell
1030+
1031+
Parameters
1032+
----------
1033+
axis : str
1034+
The axis of the internal logic cell
1035+
"""
1036+
self.send_command(f'6 M E = {axis}\r')
1037+
self.read_response()
1038+
self.send_command(f'6 CCA Z=0\r')
1039+
self.read_response()
1040+
10161041
def SA_waveform(
1017-
self, axis: str, waveform: int = 0, amplitude: int = 1000, offset: int = 500
1042+
self, axis: str, waveform: int = 0, amplitude: int = 1000, offset: int = 500, period: int = 10
10181043
) -> None:
1019-
"""Programs the analog waveforms using SAA, SAO, and SAP
1020-
Default waveform is a sawtooth waveform with an amplitude of 1V with an offset of 0.5V
1044+
"""Programs the analog waveforms using SAA, SAO, SAP, and SAF
1045+
Default waveform is a sawtooth waveform with an amplitude of 1V, an offset of 0.5V and period of 10 ms
10211046
10221047
Parameters
10231048
----------
10241049
axis: str
1025-
Laser axis
1050+
Tiger Controller axis
10261051
waveform: int
10271052
Type of waveform pattern according to https://asiimaging.com/docs/commands/sap
10281053
amplitude: int
1029-
amplitude of the waveform
1054+
amplitude of the waveform in mV
10301055
offset: int
1031-
sets the center position of the waveform
1056+
sets the center position of the waveform in mV
1057+
period: int
1058+
sets the period of the waveform in ms
10321059
"""
1033-
self.send_command(f"SAP {axis}={waveform}")
1060+
print(f"Period (ms): {period}")
1061+
# takes amplitude and offset from navigate and modifies them to how the TG-1000 takes them
1062+
if (waveform % 128 == 3):
1063+
offset = .5*(offset+amplitude)
1064+
amplitude = amplitude*2
1065+
# TODO: 3 is the address of the GALVO DAC. May need to make this configurable.
1066+
self.send_command(f"3 SAP {axis}={waveform}")
1067+
self.read_response()
1068+
self.send_command(f"3 SAA {axis}={amplitude}")
10341069
self.read_response()
1035-
self.send_command(f"SAA {axis}={amplitude}")
1070+
self.send_command(f"3 SAO {axis}={offset}")
10361071
self.read_response()
1037-
self.send_command(f"SAO {axis}={offset}")
1072+
self.send_command(f"3 SAF {axis}={period}")
10381073
self.read_response()
10391074

10401075
def SAM(self, axis: str, mode: int) -> None:
@@ -1053,7 +1088,7 @@ def SAM(self, axis: str, mode: int) -> None:
10531088
mode: int
10541089
Integer code.
10551090
"""
1056-
self.send_command(f"SAM {axis}={mode}")
1091+
self.send_command(f"3 SAM {axis}={mode}")
10571092
self.read_response()
10581093

10591094
def setup_control_loop(

src/navigate/model/devices/daq/asi.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,14 @@ def __init__(
8080
"""
8181
super().__init__(configuration)
8282

83-
#: dict: Configuration dictionary.
84-
self.configuration = configuration
85-
86-
#: dict: Camera object.
87-
self.camera = {}
88-
8983
#: Lock: Lock for waiting to run.
9084
self.wait_to_run_lock = Lock()
9185

92-
#: dict: Analog output tasks.
93-
self.analog_outputs = {}
94-
9586
#: bool: Flag for updating analog task.
9687
self.is_updating_analog_task = False
9788

98-
#: str: Trigger mode. Self-trigger or external-trigger.
99-
self.trigger_mode = "self-trigger"
89+
#: dict: Analog output tasks.
90+
self.analog_outputs = {}
10091

10192
#: Any: Device connection.
10293
self.daq = device_connection

src/navigate/model/devices/galvo/asi.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ def __init__(
7575
#: Any: Device connection.
7676
self.galvo = device_connection
7777

78-
#: dict: Dictionary of microscope configuration parameters.
79-
self.configuration = configuration
80-
81-
#: str: Name of the microscope.
82-
self.microscope_name = microscope_name
83-
84-
#: int: Galvo ID.
85-
self.galvo_id = device_id
86-
8778
#: str: Galvo Axis
8879
self.axis = self.device_config["hardware"]["axis"] # .get("axis","B")
8980
logger.debug(f"galvo axis: {self.axis}")

0 commit comments

Comments
 (0)