Commit 68758b470bbf9e3dad1b5bb2eb67bc0b3631f5e3

Authored by Etienne Pallier
1 parent 40d5c20e
Exists in dev

On attaque Gemini avec 2 dcc identiques (dcc1 et dcc2 = mount)

On utilise 2 dcc (distincts) qui pointent sur le même Device
DC_Gemini.Mount :
class Mount(DC)
class MountBis(Mount)
Ca fonctionne en sequentiel

⇒ Yapuka tester ces 2 executions en // !!!
src/core/pyros_django/agent/Agent.py
... ... @@ -1409,8 +1409,8 @@ class Agent:
1409 1409 assert "UnimplementedGenericCmdException" in cmd.get_result()
1410 1410 nb_unimplemented += 1
1411 1411 assert nb_asserted == nb_commands_sent
1412   - print(nb_commands_to_send, "cmds I had to send <==>", nb_asserted, "cmds executed (or killed)", nb_commands_to_send-nb_commands_sent, "cmd ignored")
1413   - print("Among them:")
  1412 + print(nb_commands_to_send, "cmds I had to send <==>", nb_asserted, "cmds executed (or killed), ", nb_commands_to_send-nb_commands_sent, "cmd ignored")
  1413 + print("Among executed commands:")
1414 1414 print(f"- {nb_agent_general} AGENT general command(s)")
1415 1415 print("-", nb_unimplemented, "unimplemented command(s) => UnimplementedGenericCmdException raised then command was skipped")
1416 1416 print("-", nb_unknown, "unknown command(s) => skipped")
... ...
src/core/pyros_django/agent/AgentDeviceGemini.py
... ... @@ -23,6 +23,15 @@ from device_controller.concrete_component.gemini.gemini_controller import DC_Gem
23 23 #class AgentDeviceTelescopeGemini(AgentDevice):
24 24 class AgentDeviceGemini(AgentDevice):
25 25  
  26 + # Agent level specific commands
  27 + # @override superclass Agent
  28 + AGENT_SPECIFIC_COMMANDS = [
  29 + "do_ad_gemini_specific1",
  30 + "set_ad_gemini_specific2",
  31 + # Error case
  32 + "do_ad_gemini_specific3_unimplemented",
  33 + ]
  34 +
26 35 _agent_device_telescope_status = None
27 36  
28 37 # Host and Port of the device
... ... @@ -166,6 +175,15 @@ class AgentDeviceGemini(AgentDevice):
166 175 return { 'date':dev_date, 'time':dev_time, 'radec':dev_radec }
167 176  
168 177  
  178 + '''
  179 + AGENT LEVEL SPECIFIC COMMANDS
  180 + '''
  181 + def do_ad_gemini_specific1(self):
  182 + print("processing ad_specific1... ")
  183 + def set_ad_gemini_specific2(self):
  184 + print("processing set_specific2... ")
  185 +
  186 +
169 187  
170 188  
171 189 """
... ...
src/core/pyros_django/agent/AgentDeviceSBIG.py
... ... @@ -27,6 +27,7 @@ class AgentDeviceSBIG(AgentDevice):
27 27 AGENT_SPECIFIC_COMMANDS = [
28 28 "do_ad_sbig_specific1",
29 29 "set_ad_sbig_specific2",
  30 + # Error case
30 31 "do_ad_sbig_specific3_unimplemented",
31 32 "do_ad_sbig_specific4_unimplemented",
32 33 ]
... ...
src/core/pyros_django/agent/AgentMultiRequester.py
... ... @@ -46,6 +46,10 @@ class AgentMultiRequester(Agent):
46 46 'ad_mount get_ra',
47 47 'ad_mount get_dec',
48 48 'ad_mount get_radec',
  49 + # another alias to the same DC and same DCC (ad_mount2 is the same as ad_mount, both point to AD_Gemini.Mount)
  50 + 'ad_mount2 get_radec',
  51 + # another alias to the same DC but not the same DCC
  52 + 'ad_mount3 get_radec',
49 53 #'ad_mount set_ra 14:20:51'
50 54 #'ad_mount set_dec +86:57:48'
51 55 #'ad_mount set_radec 14:20:51 +86:57:48',
... ... @@ -67,13 +71,13 @@ class AgentMultiRequester(Agent):
67 71 # Unknown AD alias
68 72 'ad_unknown get_dec',
69 73 # Unknown generic command
70   - ##'ad_mount do_unknown',
  74 + 'ad_mount do_unknown',
71 75 # Unimplemented generic command
72   - ##'ad_mount do_unimplemented',
  76 + 'ad_mount do_unimplemented',
73 77 # AD specific command implemented (OK)
74   - ##'ad_mount do_ad_gemini_specific1',
  78 + 'ad_mount do_ad_gemini_specific1',
75 79 # AD specific command UNimplemented (KO)
76   - ##'ad_mount do_ad_sbig_specific3_unimplemented',
  80 + 'ad_mount do_ad_gemini_specific3_unimplemented',
77 81 # AD specific command implemented (OK)
78 82 ##'ad_mount set_ad_gemini_specific2',
79 83  
... ... @@ -227,7 +231,9 @@ class AgentMultiRequester(Agent):
227 231 }
228 232 '''
229 233 self._my_client_agents = {
230   - 'ad_mount': 'AgentDeviceGemini.Mount',
  234 + 'ad_mount': 'AgentDeviceGemini.Mount',
  235 + 'ad_mount2': 'AgentDeviceGemini.Mount',
  236 + 'ad_mount3': 'AgentDeviceGemini.MountBis',
231 237 'ad_filtersel': 'AgentDeviceSBIG.FilterSelector',
232 238 'ad_shutter': 'AgentDeviceSBIG.DetectorShutter',
233 239 'ad_sensor': 'AgentDeviceSBIG.DetectorSensor',
... ...
src/device_controller/concrete_component/gemini/gemini_controller.py
... ... @@ -48,6 +48,10 @@ COMMAND6_SIMPLE = &#39;6&#39;
48 48  
49 49  
50 50  
  51 +class DC_MountBis(DC_Mount):
  52 + pass
  53 +
  54 +
51 55 #class DeviceControllerTelescopeGemini(DC_Mount):
52 56 #class DC_Gemini(DC_Mount):
53 57 class DC_Gemini(DeviceController):
... ... @@ -316,6 +320,7 @@ class DC_Gemini(DeviceController):
316 320 [
317 321 #DC_Mount(device_host, device_port, self._my_channel, 1024, protoc= self.Protocol, gen2nat_cmds= self.MY_GEN2NAT_CMDS['DC_Mount'], device_sim=None, DEBUG=DEBUG),
318 322 DC_Mount(device_host, device_port, self._my_channel, MY_DEVICE_CHANNEL_BUFFER_SIZE, protoc=self.Protocol, gen2nat_cmds=self.MY_GEN2NAT_CMDS_MOUNT, device_sim=None, DEBUG=DEBUG),
  323 + DC_MountBis(device_host, device_port, self._my_channel, MY_DEVICE_CHANNEL_BUFFER_SIZE, protoc=self.Protocol, gen2nat_cmds=self.MY_GEN2NAT_CMDS_MOUNT, device_sim=None, DEBUG=DEBUG),
319 324 ]
320 325 )
321 326  
... ...