Blame view

src/devices/Telescope.py 834 Bytes
ddf59dd4   haribo   Remaniement :
1
2
from common.models import *
from .Device import DeviceController
ac26ad2b   haribo   Date: 22/07/2016
3

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

    def __init__(self):
bb0fbab1   haribo   Fini de mettre la...
11
        super().__init__("Telescope")
e8e6f017   Jeremy   Reworked devices ...
12
13
14
15
16
17
18
19
20
21
22
23
24

    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))