Blame view

src/devices/TelescopeRemoteControlAbstract.py 1013 Bytes
c78dc38b   Quentin Durand   Classe abstraite ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.conf import settings
from common.models import Log
from devices.Telescope import TelescopeController


'''
    Class managing the input from the remote commands sent by the dashboard
    the command is parsed and sent to the Telescope via an instance of TelescopeController

'''

class TelescopeRemoteControlAbstract():
    _command = []
    _command_matcher_set = {}
    _command_matcher_get = {}
    _command_matcher_do = {}
d3faf327   Quentin Durand   Command control D...
17
    _current_matcher = None
c78dc38b   Quentin Durand   Classe abstraite ...
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    _telescope = None

    def __init__(self, command, expert_mode):
        self._command = command
        if expert_mode:
            self._command = str(command).split()
        self._telescope = TelescopeController()

    def exec_command(self):
        raise NotImplementedError("You must implement %s method" % type(self).__name__)
        # if self._command[0] in self._command_matcher:
        #     response = self._command_matcher[self._command[0]]()
        # else:
        #     return "KO: Unknown command"
d3faf327   Quentin Durand   Command control D...
32
        # return response