9 from magaox.indi.device
import XDevice, BaseConfig
10 from magaox.camera
import XCam
11 from magaox.deformable_mirror
import XDeformableMirror, XFourierMirror, XPokeMirror
12 from magaox.constants
import StateCodes
14 from purepyindi2
import device, properties, constants
15 from purepyindi2.messages
import DefNumber, DefSwitch, DefLight, DefText
23 shmim : str = xconf.field(help=
"Name of the camera device (specifically, the associated shmim, if different)")
24 dark_shmim : str = xconf.field(help=
"Name of the dark frame shmim associated with this camera device")
28 """Automatic coronagraph alignment assistant
30 camera : CameraConfig = xconf.field(help=
"Camera to use")
31 sleep_interval_sec : float = xconf.field(default=0.25, help=
"Sleep interval between loop() calls")
37 config : efcControlConfig
40 self.log.debug(f
"I was configured! See? {self.config=}")
41 fsm = properties.TextVector(name=
'fsm')
42 fsm.add_element(DefText(name=
'state', _value=StateCodes.INITIALIZED.name))
43 self.add_property(fsm)
45 self.log.info(
"Found camera: {:s}".format(self.config.camera.shmim))
46 self.
cameracamera = XCam(self.config.camera.shmim, use_hcipy=
True)
49 self.properties[
'fsm'][
'state'] = StateCodes.READY.name
50 self.update_property(self.properties[
'fsm'])