Telescope.py 1.38 KB
from pyrosapp.models import *
from .Device import DeviceObj
from enum import Enum

class RotatorEnum(Enum):
    none = "None"
    synchro = "Synchro"
    tracking = "Tracking"

class ModeModeEnum(Enum):
    goto = "Goto"
    track = "Track"
    goto_track = "GotoTrack"

class CoordsFrameEnum(Enum):
    hadec = "Hadec"
    radec = "Radec"
    altaz = "Altaz"

class TelescopeObj(DeviceObj):

    def __init__(self):
        super().__init__()

        self.set_msgs = [
            ("SPEED", [2, 3], float),
            ("COORDS", [2, 3], float),
            ("TRACKING_SPEED", [2, 3], float),
            ("ACCEL", [2, 3], float),

            ("ROTATOR", [1, ], RotatorEnum),
            ("FOCUS", [1, ], float),
            ("MOVE_MODE", [1, ], ModeModeEnum),
            ("COORDS_FRAME", [1, ], CoordsFrameEnum),
        ]

        self.get_msgs = [
            "POSITION",
            "STATUS",
            "SETUP",
        ]

        self.do_msgs = [
            ("DOORS", [1, ], bool),
            ("START", [0, ],),
            ("ABORT", [0, ],),
            ("STOP", [0, ],),
            ("HOMING", [0, ],),
        ]

    # pour le moment, j'implémente rien ici, les checks des msg sont dans la classe Device

#     def get(self, cmd, *args):
#         super().get(cmd, args)
#
#     def set(self, cmd):
#         super().set(cmd)
#
#     def do(self, cmd, *args):
#         super().do(cmd, args)