Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding ENC_INT device code #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/tigerasi/device_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class ErrorCodes(Enum):
class FirmwareModules(Enum):
SCAN_MODULE = "SCAN MODULE"
ARRAY_MODULE = "ARRAY MODULE"
ENC_INT = "ENC INT"
IN0_INT = "IN0 INT"


class JoystickInput(Enum):
Expand Down Expand Up @@ -144,6 +146,7 @@ class RingBufferMode(Enum):
class TTLIn0Mode(Enum):
OFF = 0
MOVE_TO_NEXT_ABS_POSITION = 1
ENC_INT = 1 # ENC_INT module https://asiimaging.com/docs/scan_module.
REPEAT_LAST_REL_MOVE = 2
AUTOFOCUS = 3
ZSTACK_ENABLE = 4
Expand Down
6 changes: 6 additions & 0 deletions src/tigerasi/tiger_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,12 @@ def set_ttl_pin_modes(self, in0_mode: TTLIn0Mode = None,
# Aggregate specified params.
param_str = f"{in0_str}{out0_str}{auxstate_str}{polarity_str}" \
f"{auxmask_str}{auxmode_str}".rstrip()
# Check that SCAN_MODULE, ENC_INT, or IN0_INT firmware exists.
if in0_mode == TTLIn0Mode.ENC_INT:
self._has_firmware(self._scan_card_addr,
[FirmwareModules.SCAN_MODULE,
FirmwareModules.ENC_INT,
FirmwareModules.IN0_INT])
# Infer address of card or cards for a repeated move.
if in0_mode == TTLIn0Mode.REPEAT_LAST_REL_MOVE and card_address is None:
cards = {self.axis_to_card[x][0] for x in self._last_rel_move_axes}
Expand Down