Blame view

src/devices/Telescope.py 918 Bytes
ddf59dd4   haribo   Remaniement :
1
from common.models import *
605b65e5   Jeremy   Update simulators
2
import abc
ddf59dd4   haribo   Remaniement :
3
from .Device import DeviceController
ac26ad2b   haribo   Date: 22/07/2016
4

e8e6f017   Jeremy   Reworked devices ...
5
6
7
8
'''
    Device controller for Telescope.
    This class must implement set, get and do functions (DeviceController is an abstract)
'''
ddf59dd4   haribo   Remaniement :
9
class TelescopeController(DeviceController):
9774228b   haribo   Date: 22/06/2016
10
11

    def __init__(self):
bb0fbab1   haribo   Fini de mettre la...
12
        super().__init__("Telescope")
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"