TelescopeRemoteControlAbstract.py
1013 Bytes
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 = {}
_current_matcher = None
_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"
# return response