diff --git a/sockets_tele/README.txt b/sockets_tele/README.txt index fc85dfc..5478dc9 100644 --- a/sockets_tele/README.txt +++ b/sockets_tele/README.txt @@ -63,12 +63,16 @@ Pour lancer le client sur le "simulateur" de telescope (localhost, port 11110): ******************************************************************************************** 4) WORK CURRENTLY IN PROGRESS... - - set date&time, set lat&long + - tests updated ******************************************************************************************** 5) DONE + - GOTO + - finalize do_init() + + - set date&time, set lat&long - README file enriched - help => liste cdes possibles @@ -88,16 +92,18 @@ Pour lancer le client sur le "simulateur" de telescope (localhost, port 11110): ******************************************************************************************** 6) TODO LIST + - remplacer utf-8 par unicode ou iso... + - cdes 05 (p100): - cde 05 => return long list of parameters (= GROS GET) - ENQ = 05 - Table d'attributs pour chaque telescope (config) - - set DATE & TIME (p109) + - (X) set DATE & TIME (p109) - Ce que fait AK avec TCL ou C: sprintf(ligne,":SC%02d/%02d/%02d#:SL%02d:%02d:%02.0f#:SG+00#",m,d,y-2000,h,min,s); - (X) 1) :SG+00# + 1) :SG+00# => TU 2) SC%02d/%02d/%02d#: @@ -113,35 +119,17 @@ Pour lancer le client sur le "simulateur" de telescope (localhost, port 11110): - _connect() ou connect() ? - - GOTO(position, blocking=Y/N): - - non bloquant par défaut pour Gemini - - après goto, tester position avec ':Gv#' (p103) : on devrait avoir 'S', puis 'C', puis 'T' - - N (for "no tracking") - - T (for Tracking) - - G (for Guiding) - - C (for Centering) - - S (for Slewing) - - - MOVE(direction, rate, duration): - - move dans une direction (N,S,E,O) à l'infini - - ':Q#' pour arrêter (p 108) - - duration: infinie si pas donnée - - rate (p108): 4 vitesses différentes (prendre la plus lente par défaut), entre 0 et 1: - - [0-0.25] : RC => Rate Center. Subsequent Move commands will move at Centering Speed. - - [0.25-0.50] : RG => Rate Guide. Subsequent Move commands will move at Guiding Speed. - - [0.50-0.75] : RM => Rate Move. Subsequent Move commands will move at Centering Speed. - - [0.75-1.0] : RS => Rate Slew. Subsequent Move commands will move at Slewing Speed. - POSITION (p103): - - set("home", lat, long) - - radec.goto() - - STARTUP position = CWD - - :hC# - - position required for a Cold or Warm Start, pointing to the celestial pole of the given hemisphere (north or south), - with the counterweight pointing downwards (CWD position). From L4, V1.0 up - - HOME position parking => par defaut, c'est CWD, mais ca peut etre different - - :hP# - - defaults to the celestial pole visible at the given hemisphere (north or south) and can be set by the user + - MOVE(direction, rate, duration): + - move dans une direction (N,S,E,O) à l'infini + - ':Q#' pour arrêter (p 108) + - duration: infinie si pas donnée + - rate (p108): 4 vitesses différentes (prendre la plus lente par défaut), entre 0 et 1: + - [0-0.25] : RC => Rate Center. Subsequent Move commands will move at Centering Speed. + - [0.25-0.50] : RG => Rate Guide. Subsequent Move commands will move at Guiding Speed. + - [0.50-0.75] : RM => Rate Move. Subsequent Move commands will move at Centering Speed. + - [0.75-1.0] : RS => Rate Slew. Subsequent Move commands will move at Slewing Speed. - Implémenter les commandes NATIVES (non LX-200) : - < ou >, termine par ':' + checksum + # @@ -149,10 +137,6 @@ Pour lancer le client sur le "simulateur" de telescope (localhost, port 11110): - GOTO: - :Sr18:23:45#:Sd+34:00:00#:MS# - (MS = move start) - = Goto RA=18h23m45s Dec=+34d00m00s J2000 diff --git a/sockets_tele/client_gemini_run.py b/sockets_tele/client_gemini_run.py index da5a628..aa94448 100755 --- a/sockets_tele/client_gemini_run.py +++ b/sockets_tele/client_gemini_run.py @@ -137,6 +137,9 @@ with SocketClientTelescopeGEMINI(HOST, PORT, DEBUG) as tsock: data_received = tsock.receive_data() ''' + tsock.do_GOTO(ra='22:00:00',dec='+30:00:00') + tsock.do_GOTO(ra='21:00:00',dec='+20:00:00') + # Do EXPERT mode execution while True: @@ -162,6 +165,8 @@ with SocketClientTelescopeGEMINI(HOST, PORT, DEBUG) as tsock: #print("Received: {}".format(data_received)) #print("Useful data received: {}".format(data_useful)) ''' + + #tsock.do_PARK() #tsock.close() diff --git a/sockets_tele/src/client/socket_client_telescope_abstract.py b/sockets_tele/src/client/socket_client_telescope_abstract.py index acd4b10..364cc71 100755 --- a/sockets_tele/src/client/socket_client_telescope_abstract.py +++ b/sockets_tele/src/client/socket_client_telescope_abstract.py @@ -87,11 +87,12 @@ class SocketClientTelescopeAbstract(SocketClientAbstract): 'TIME': [], 'LONGITUDE': [], 'LATITUDE': [], + 'VELOCITY': [], } _cmd_do = { - 'INIT': [], + #'INIT': [], 'PARK': [], - 'GOTO': [], + 'MOVE': [], 'WARM_START': [], 'PREC_REFR': [], } @@ -221,8 +222,30 @@ class SocketClientTelescopeAbstract(SocketClientAbstract): # RA/DEC # @abstract + ''' + Sets the object's Right Ascension and the object status to "Not Selected". + The :Sd# command has to follow to complete the selection. + The subsequent use of the :ON...# command is recommended (p106) + :Sr:.# + or + :Sr::# + 0 if invalid + 1 if valid + ''' def get_RA(self): return self._get("RA") def set_RA(self, ra): return self._set("RA", ra) + + ''' + Sets the object's declination. + It is important that the :Sr# command has been send prior. + Internal calculations are done that may take up to 0.5 seconds. + If the coordinate selection is valid the object status is set to "Selected" + :Sd{+-}
{*°}# + or + :Sd{+- }
{*°:}: + 0 if invalid + 1 if valid + ''' def get_DEC(self): return self._get("DEC") def set_DEC(self, dec): return self._set("DEC", dec) # @abstract @@ -243,16 +266,28 @@ class SocketClientTelescopeAbstract(SocketClientAbstract): def get_LATITUDE(self): return self._get('LATITUDE') def set_LATITUDE(self, latitude): return self._set('LATITUDE', latitude) + def get_VELOCITY(self): return self._get('VELOCITY') ''' DO commands ''' # @abstract - def do_INIT(self): return self._do("INIT") + #def do_INIT(self): return self._do("INIT") + + ''' do_PARK() (p103) + - STARTUP position = CWD + - :hC# + - position required for a Cold or Warm Start, pointing to the celestial pole of the given hemisphere (north or south), + with the counterweight pointing downwards (CWD position). From L4, V1.0 up + - HOME position parking => par defaut, c'est CWD, mais ca peut etre different + - :hP# + - defaults to the celestial pole visible at the given hemisphere (north or south) and can be set by the user + ''' # @abstract - def do_park(self): return self._do("PARK") + def do_PARK(self): return self._do("PARK") + def do_MOVE(self): return self._do("MOVE") # @abstract - def do_goto(self, pos:Position): return self._do("GOTO") + #def do_GOTO(self, pos:Position): return self._do("GOTO") def do_WARM_START(self): return self._do("WARM_START") def do_PREC_REFR(self): return self._do("PREC_REFR") diff --git a/sockets_tele/src/client/socket_client_telescope_gemini.py b/sockets_tele/src/client/socket_client_telescope_gemini.py index fb6c136..5b3379a 100755 --- a/sockets_tele/src/client/socket_client_telescope_gemini.py +++ b/sockets_tele/src/client/socket_client_telescope_gemini.py @@ -90,6 +90,9 @@ class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract): 'DATE': ['GC', 'SC'], 'TIME': ['GL', 'SL'], + 'VELOCITY': ['Gv'], + + } ''' Commands dictionary @@ -97,9 +100,9 @@ class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract): ''' # @override _cmd_do = { - 'INIT': [], - 'PARK': [], - 'GOTO': [], + #'INIT': [], + 'PARK': ['hP'], + 'MOVE': ['MS'], 'WARM_START': ['bW'], 'PREC_REFR': ['p3'], } @@ -219,19 +222,10 @@ class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract): elapsed_time += 1 if elapsed_time == TIMEOUT: raise TimeoutException() ACK = self.get_ACK() - - - ''' - 3) Send cde ':p3#' : Precession & Refraction (see page 107) - Ask Gemini to do Precession calculation - Coordinates transferred to the Gemini refer to the standard epoch J2000.0. - Refraction is calculated (From L4, V1.0 up) - ''' - ###self.do_PREC_REFR() - + ''' - 4) Set timezone, date, and time (p109) + 3) Set timezone, date, and time (p109) ''' ''' @@ -293,7 +287,7 @@ class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract): ''' - 5) Set LOCATION (lat,long) (p103,110) + 4) Set LOCATION (lat,long) (p103,110) Pour l'observatoire de Guitalens: Sg = 2.0375 E St = 43.6443 N @@ -352,7 +346,54 @@ class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract): if res != res_dd_mm: raise UnexpectedCommandReturnCode(res) + ''' + 5) Send cde ':p3#' : Precession & Refraction (see page 107) + Ask Gemini to do Precession calculation + Coordinates transferred to the Gemini refer to the standard epoch J2000.0. + Refraction is calculated (From L4, V1.0 up) + ''' + self.do_PREC_REFR() + + + ''' GOTO (p105) + - GOTO(position, blocking=Y/N): + (MS = move start) + = Goto RA=18h23m45s Dec=+34d00m00s J2000 + - radec.goto() + ''' + def do_GOTO(self, ra, dec): + radec = self.get_RADEC() + print("Current position is", radec) + ''' + :Sr18:23:45#:Sd+34:00:00#:MS# + ''' + res = self.set_RA(ra) + if res != '1': raise UnexpectedCommandReturnCode(res) + res = self.set_DEC(dec) + if res != '1': raise UnexpectedCommandReturnCode(res) + # MOVE non bloquant par défaut pour Gemini + self.do_MOVE() + + ''' + After MOVE, test position with ':Gv#' (p103) : on devrait avoir 'S', puis 'C', puis 'T' + - N (for "no tracking") + - T (for Tracking) + - G (for Guiding) + - C (for Centering) + - S (for Slewing) + ''' + v = None + while v != 'T': + v = self.get_VELOCITY() + print("Velocity is", v) + time.sleep(2) + + time.sleep(2) + radec = self.get_RADEC() + print("Current position is", radec) + + -- libgit2 0.21.2