diff --git a/src/core/pyros_django/agent/Agent.py b/src/core/pyros_django/agent/Agent.py index ccca291..8e3f35b 100755 --- a/src/core/pyros_django/agent/Agent.py +++ b/src/core/pyros_django/agent/Agent.py @@ -1409,8 +1409,8 @@ class Agent: assert "UnimplementedGenericCmdException" in cmd.get_result() nb_unimplemented += 1 assert nb_asserted == nb_commands_sent - 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") - print("Among them:") + 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") + print("Among executed commands:") print(f"- {nb_agent_general} AGENT general command(s)") print("-", nb_unimplemented, "unimplemented command(s) => UnimplementedGenericCmdException raised then command was skipped") print("-", nb_unknown, "unknown command(s) => skipped") diff --git a/src/core/pyros_django/agent/AgentDeviceGemini.py b/src/core/pyros_django/agent/AgentDeviceGemini.py index 6c389f5..226c03d 100755 --- a/src/core/pyros_django/agent/AgentDeviceGemini.py +++ b/src/core/pyros_django/agent/AgentDeviceGemini.py @@ -23,6 +23,15 @@ from device_controller.concrete_component.gemini.gemini_controller import DC_Gem #class AgentDeviceTelescopeGemini(AgentDevice): class AgentDeviceGemini(AgentDevice): + # Agent level specific commands + # @override superclass Agent + AGENT_SPECIFIC_COMMANDS = [ + "do_ad_gemini_specific1", + "set_ad_gemini_specific2", + # Error case + "do_ad_gemini_specific3_unimplemented", + ] + _agent_device_telescope_status = None # Host and Port of the device @@ -166,6 +175,15 @@ class AgentDeviceGemini(AgentDevice): return { 'date':dev_date, 'time':dev_time, 'radec':dev_radec } + ''' + AGENT LEVEL SPECIFIC COMMANDS + ''' + def do_ad_gemini_specific1(self): + print("processing ad_specific1... ") + def set_ad_gemini_specific2(self): + print("processing set_specific2... ") + + """ diff --git a/src/core/pyros_django/agent/AgentDeviceSBIG.py b/src/core/pyros_django/agent/AgentDeviceSBIG.py index 99d4fee..e7fa6fd 100755 --- a/src/core/pyros_django/agent/AgentDeviceSBIG.py +++ b/src/core/pyros_django/agent/AgentDeviceSBIG.py @@ -27,6 +27,7 @@ class AgentDeviceSBIG(AgentDevice): AGENT_SPECIFIC_COMMANDS = [ "do_ad_sbig_specific1", "set_ad_sbig_specific2", + # Error case "do_ad_sbig_specific3_unimplemented", "do_ad_sbig_specific4_unimplemented", ] diff --git a/src/core/pyros_django/agent/AgentMultiRequester.py b/src/core/pyros_django/agent/AgentMultiRequester.py index 4cf7c85..204538e 100755 --- a/src/core/pyros_django/agent/AgentMultiRequester.py +++ b/src/core/pyros_django/agent/AgentMultiRequester.py @@ -46,6 +46,10 @@ class AgentMultiRequester(Agent): 'ad_mount get_ra', 'ad_mount get_dec', 'ad_mount get_radec', + # another alias to the same DC and same DCC (ad_mount2 is the same as ad_mount, both point to AD_Gemini.Mount) + 'ad_mount2 get_radec', + # another alias to the same DC but not the same DCC + 'ad_mount3 get_radec', #'ad_mount set_ra 14:20:51' #'ad_mount set_dec +86:57:48' #'ad_mount set_radec 14:20:51 +86:57:48', @@ -67,13 +71,13 @@ class AgentMultiRequester(Agent): # Unknown AD alias 'ad_unknown get_dec', # Unknown generic command - ##'ad_mount do_unknown', + 'ad_mount do_unknown', # Unimplemented generic command - ##'ad_mount do_unimplemented', + 'ad_mount do_unimplemented', # AD specific command implemented (OK) - ##'ad_mount do_ad_gemini_specific1', + 'ad_mount do_ad_gemini_specific1', # AD specific command UNimplemented (KO) - ##'ad_mount do_ad_sbig_specific3_unimplemented', + 'ad_mount do_ad_gemini_specific3_unimplemented', # AD specific command implemented (OK) ##'ad_mount set_ad_gemini_specific2', @@ -227,7 +231,9 @@ class AgentMultiRequester(Agent): } ''' self._my_client_agents = { - 'ad_mount': 'AgentDeviceGemini.Mount', + 'ad_mount': 'AgentDeviceGemini.Mount', + 'ad_mount2': 'AgentDeviceGemini.Mount', + 'ad_mount3': 'AgentDeviceGemini.MountBis', 'ad_filtersel': 'AgentDeviceSBIG.FilterSelector', 'ad_shutter': 'AgentDeviceSBIG.DetectorShutter', 'ad_sensor': 'AgentDeviceSBIG.DetectorSensor', diff --git a/src/device_controller/concrete_component/gemini/gemini_controller.py b/src/device_controller/concrete_component/gemini/gemini_controller.py index 080febb..802afd6 100755 --- a/src/device_controller/concrete_component/gemini/gemini_controller.py +++ b/src/device_controller/concrete_component/gemini/gemini_controller.py @@ -48,6 +48,10 @@ COMMAND6_SIMPLE = '6' +class DC_MountBis(DC_Mount): + pass + + #class DeviceControllerTelescopeGemini(DC_Mount): #class DC_Gemini(DC_Mount): class DC_Gemini(DeviceController): @@ -316,6 +320,7 @@ class DC_Gemini(DeviceController): [ #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), 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), + 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), ] ) -- libgit2 0.21.2