Commit 9ee212a832362aed37a55a201bde94f305395a57

Authored by Etienne Pallier
1 parent 051e085c
Exists in dev

Renommage des fichiers et classes selon UML (fin)

src/devices_controller/README.md
... ... @@ -4,11 +4,11 @@
4 4 ************************
5 5 VERSION: 0.30.0
6 6  
7   -Date: 14/05/2019
  7 +Date: 19/09/2019
8 8  
9 9 By: epallier@irap.omp.eu
10 10  
11   -Comment : AgentDevice, AgentTelescopeRequester
  11 +
12 12  
13 13  
14 14  
... ... @@ -37,7 +37,7 @@ Là, il faut arrêter avec CTRL-C (car je ne sais pas encore comment arrêter le
37 37 Pour lancer le client sur le telescope Gemini de Alain Klotz:
38 38  
39 39 $ cd devices_controller_concrete/device_controller_Gemini/
40   - $ ./client_telescope_controller_gemini_run.py
  40 + $ ./client_telescope_gemini_controller_run.py
41 41 (Windows: python3 client_telescope_controller_gemini_run.py)
42 42  
43 43 (NB: un log "client.log" est créé et alimenté au fur et à mesure)
... ... @@ -70,11 +70,12 @@ Examples of requests:
70 70 Pour lancer le même client seulement sur le "simulateur" de telescope (localhost, port 11110), ajouter "local" à la fin:
71 71  
72 72 $ cd devices_controller_concrete/device_controller_Gemini/
73   - $ ./client_telescope_controller_gemini_run.py local
  73 + $ ./client_telescope_gemini_controller_run.py local
74 74  
75 75 Dans un autre terminal, lancer le simulateur:
76 76  
77 77 $ ./server_telescope_gemini_simulator_run.py
  78 + (CTRL-C to stop it)
78 79  
79 80  
80 81 ********************************************************************************************
... ...
src/devices_controller/devices_controller_abstract_component/plc_controller_abstract.py renamed to src/devices_controller/devices_controller_abstract_component/device_controller_plc.py
... ... @@ -59,7 +59,7 @@ class c(Enum):
59 59  
60 60  
61 61  
62   -class PLCControllerAbstract(DeviceControllerAbstract):
  62 +class DeviceControllerPLC(DeviceControllerAbstract):
63 63  
64 64 # @abstract (to be overriden)
65 65 _cmd_native = {}
... ...
src/devices_controller/devices_controller_concrete/device_controller_AK/plc_controller_ak.py renamed to src/devices_controller/devices_controller_concrete/device_controller_AK/device_controller_plc_ak.py
... ... @@ -32,7 +32,7 @@ COMMAND6_SIMPLE = '6'
32 32  
33 33  
34 34  
35   -class PLCControllerAK(PLCControllerAbstract):
  35 +class DeviceControllerPLCAK(DeviceControllerPLC):
36 36  
37 37 # STAMP :
38 38 # 00 00 00 00 00 00 00' (8 bytes from '00' to 'FF', 1st one is LOW BYTE)
... ... @@ -226,7 +226,7 @@ if __name__ == "__main__":
226 226 # Classic usage:
227 227 #plc_client = SocketClient_GEMINI(HOST, PORT)
228 228 # More elegant usage, using "with":
229   - with PLCControllerAK("localhost", 11110, DEBUG=False) as plc_client:
  229 + with DeviceControllerPLCAK("localhost", 11110, DEBUG=False) as plc_client:
230 230  
231 231 # 0) CONNECT to server (only for TCP, does nothing for UDP)
232 232 plc_client._connect_to_server()
... ...
src/devices_controller/devices_controller_concrete/device_controller_Gemini/client_telescope_controller_gemini_run.py renamed to src/devices_controller/devices_controller_concrete/device_controller_Gemini/client_telescope_gemini_controller_run.py
... ... @@ -8,13 +8,13 @@ import sys
8 8 '''
9 9 (1)
10 10 sys.path.append("../../..")
11   -from devices_controller.devices_controller_concrete.device_controller_Gemini.telescope_controller_gemini import TelescopeControllerGEMINI
  11 +from devices_controller.devices_controller_concrete.device_controller_Gemini.telescope_controller_gemini import TelescopeControllerGemini
12 12 ou (2)
13 13 #sys.path.append("..")
14   -#from device_controller_Gemini.telescope_controller_gemini import TelescopeControllerGEMINI
  14 +#from device_controller_Gemini.telescope_controller_gemini import TelescopeControllerGemini
15 15 ou (3)
16 16 '''
17   -from telescope_controller_gemini import TelescopeControllerGEMINI
  17 +from device_controller_telescope_gemini import DeviceControllerTelescopeGemini
18 18  
19 19 #DEBUG = False
20 20 DEBUG = True
... ... @@ -80,7 +80,7 @@ def main():
80 80 HOST, PORT = "localhost", 11110
81 81  
82 82 #tele_ctrl = SocketClient_UDP_TCP(HOST, PORT)
83   - with TelescopeControllerGEMINI(HOST, PORT, DEBUG) as tele_ctrl:
  83 + with DeviceControllerTelescopeGemini(HOST, PORT, DEBUG) as tele_ctrl:
84 84  
85 85 # (optional) Only useful for TCP (does nothing for UDP)
86 86 tele_ctrl._connect_to_device()
... ... @@ -140,7 +140,7 @@ def execute_commands_after_init(tele_ctrl):
140 140 tele_ctrl.do_move_dir('east','4', 'slew')
141 141 '''
142 142  
143   - # In order to execute a GEMINI (non generic) command:
  143 + # In order to execute a Gemini (non generic) command:
144 144 res = tele_ctrl.execute_native_cmd(':GR#')
145 145 print("res is", res)
146 146  
... ...
src/devices_controller/devices_controller_concrete/device_controller_Gemini/device_controller_telescope_gemini.py
1 1 #!/usr/bin/env python3
2 2  
3   -"""Socket Client GEMINI Telescope implementation
4   -To be used as a concrete class to system control a GEMINI telescope
  3 +"""Socket Client Gemini Telescope implementation
  4 +To be used as a concrete class to system control a Gemini telescope
5 5 """
6 6  
7 7 # Standard library imports
... ... @@ -34,8 +34,8 @@ COMMAND6_SIMPLE = '6'
34 34  
35 35  
36 36  
37   -##class SocketClientTelescopeGEMINI(SocketClientTelescopeAbstract):
38   -class DeviceControllerTelescopeGEMINI(DeviceControllerTelescope):
  37 +##class SocketClientTelescopeGemini(SocketClientTelescopeAbstract):
  38 +class DeviceControllerTelescopeGemini(DeviceControllerTelescope):
39 39  
40 40 # STAMP :
41 41 # 00 00 00 00 00 00 00' (8 bytes from '00' to 'FF', 1st one is LOW BYTE)
... ... @@ -121,7 +121,7 @@ class DeviceControllerTelescopeGEMINI(DeviceControllerTelescope):
121 121  
122 122  
123 123 # @overwrite
124   - # GEMINI is using UDP
  124 + # Gemini is using UDP
125 125 def __init__(self, device_host:str="localhost", device_port:int=11110, DEBUG=False):
126 126 super().__init__(device_host, device_port, "SOCKET-UDP", 1024, DEBUG)
127 127  
... ... @@ -152,7 +152,7 @@ class DeviceControllerTelescopeGEMINI(DeviceControllerTelescope):
152 152 - TYPE3: 'b?#' (bC# = Cold Start, bW# = selecting Warm Start, bR# = selecting Warm Restart)
153 153  
154 154 :Examples:
155   - >>> tele = TelescopeControllerGEMINI("localhost", 11110, DEBUG=False)
  155 + >>> tele = TelescopeControllerGemini("localhost", 11110, DEBUG=False)
156 156 >>> tele.encapsulate_data_to_send(':GD#')
157 157 '00010000:GD#\x00'
158 158 >>> tele.encapsulate_data_to_send(':GR#')
... ... @@ -202,7 +202,7 @@ class DeviceControllerTelescopeGEMINI(DeviceControllerTelescope):
202 202 r"""
203 203 Extract useful data from received raw data
204 204  
205   - >>> tele = TelescopeControllerGEMINI("localhost", 11110, DEBUG=False)
  205 + >>> tele = TelescopeControllerGemini("localhost", 11110, DEBUG=False)
206 206 >>> tele.last_stamp = '00170000'
207 207 >>> tele.uncap_received_data('001700001#')
208 208 '1'
... ... @@ -248,10 +248,10 @@ if __name__ == "__main__":
248 248 exit()
249 249 """
250 250 # Classic usage:
251   - #tele_ctrl = SocketClient_GEMINI(HOST, PORT)
  251 + #tele_ctrl = SocketClient_Gemini(HOST, PORT)
252 252 # More elegant usage, using "with":
253   - ##with SocketClientTelescopeGEMINI("localhost", 11110, DEBUG=False) as tele_ctrl:
254   - with TelescopeControllerGEMINI("localhost", 11110, DEBUG=False) as tele_ctrl:
  253 + ##with SocketClientTelescopeGemini("localhost", 11110, DEBUG=False) as tele_ctrl:
  254 + with TelescopeControllerGemini("localhost", 11110, DEBUG=False) as tele_ctrl:
255 255  
256 256 # 0) CONNECT to server (only for TCP, does nothing for UDP)
257 257 tele_ctrl._connect_to_server()
... ...
src/devices_controller/devices_controller_concrete/device_controller_Gemini/device_simulator_telescope_gemini.py
... ... @@ -16,8 +16,8 @@ HOST = "localhost"
16 16  
17 17 # Voir https://stackoverflow.com/questions/10085996/shutdown-socketserver-serve-forever-in-one-thread-python-application
18 18  
19   -#class TelescopeGEMINISimulator:
20   -class DeviceSimulatorTelescopeGEMINI:
  19 +#class TelescopeGeminiSimulator:
  20 +class DeviceSimulatorTelescopeGemini:
21 21 #with socketserver_type((HOST, PORT), MyUDPorTCPHandler_classic) as myserver:
22 22  
23 23 myserver = None
... ...
src/devices_controller/test/test_client_gemini.py
... ... @@ -8,8 +8,8 @@ import sys
8 8 sys.path.append('..')
9 9 sys.path.append('../..')
10 10 from devices_controller.devices_controller_concrete.device_simulator_common.server_udp_or_tcp import get_SocketServer_UDP_TCP
11   -#from src_socket.client.socket_client_telescope_gemini import SocketClientTelescopeGEMINI
12   -import devices_controller.devices_controller_concrete.device_controller_Gemini.telescope_controller_gemini as gemini
  11 +#from src_socket.client.socket_client_telescope_gemini import SocketClientTelescopeGemini
  12 +import devices_controller.devices_controller_concrete.device_controller_Gemini.device_controller_telescope_gemini as gemini
13 13  
14 14 #HOST, PORT = "localhost", 9999
15 15 #HOST, PORT = "localhost", 20001
... ... @@ -48,7 +48,7 @@ class TestClient(unittest.TestCase):
48 48  
49 49 # RUN CLIENT to connect to server
50 50 #tele_client = SocketClient_UDP_TCP(HOST, PORT, "UDP")
51   - with gemini.TelescopeControllerGEMINI(HOST, PORT) as tele_client:
  51 + with gemini.DeviceControllerTelescopeGemini(HOST, PORT) as tele_client:
52 52 # Only useful for TCP (does nothing for UDP)
53 53 tele_client._connect_to_device()
54 54  
... ...