-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shutter support to camera and update schema
- Loading branch information
1 parent
0593f90
commit d015463
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pystages import Tic, TicDirection, Vector | ||
from .instrument import Instrument | ||
|
||
|
||
class ShutterInstrument(Instrument): | ||
def __init__(self, config: dict): | ||
super().__init__(config=config) | ||
self.tic = Tic() | ||
self.tic.exit_safe_start() | ||
self.tic.go_home(TicDirection.FORWARD) | ||
self.__open = True # Open after homing | ||
|
||
@property | ||
def open(self) -> bool: | ||
return self.__open | ||
|
||
@open.setter | ||
def open(self, value: bool): | ||
if type(value) is not bool: | ||
raise ValueError("Expected bool") | ||
if value != self.__open: | ||
self.tic.position = Vector({False: -106, True: 0}[value]) | ||
self.__open = value |