Blame view

src/devices/CameraNIR.py 1.01 KB
bb0fbab1   haribo   Fini de mettre la...
1
from common.models import *
605b65e5   Jeremy   Update simulators
2
import abc
bb0fbab1   haribo   Fini de mettre la...
3
4
from .Device import DeviceController

e8e6f017   Jeremy   Reworked devices ...
5
6
7
8
'''
    Device controller for NIRCamera.
    This class must implement set, get and do functions (DeviceController is an abstract)
'''
bb0fbab1   haribo   Fini de mettre la...
9
class NIRCameraController(DeviceController):
bb0fbab1   haribo   Fini de mettre la...
10
11
12

    def __init__(self):
        super().__init__("CameraNIR")
e8e6f017   Jeremy   Reworked devices ...
13
14
15
16
17
18
19
20
21
22
23
24
25

    def get(self, command: str, *args):
        message = "GET " + command + " " + " ".join([str(arg) for arg in args])
        self.sendMessage(message)
        return (self.blockAndReadMessage())

    def set(self, command: str, *args):
        message = "SET " + command + " " + " ".join([str(arg) for arg in args])
        return (self.sendMessage(message))

    def do(self, command: str, *args):
        message = "DO " + command + " " + " ".join([str(arg) for arg in args])
        return (self.sendMessage(message))
ce470283   Jeremy   Plc simulator fin...
26
27
28
29

    def getStatus(self):
        self.get("STATUS")
        return "OK"
678838ed   Jeremy   Weather ans insid...
30
31

    def park(self):
c72eb17a   Jeremy   Update celery task
32
33
34
35
36
        return 0

    def open_shutter(self):
        self.do("OPEN SHUTTER")
        return 0