Commit eee1cdb424648aba28f14120838f320cfd5901a9
1 parent
88bc01ab
Exists in
dev
bugfix diagramme majordome...
Showing
2 changed files
with
17 additions
and
13 deletions
Show diff stats
src/core/pyros_django/majordome/doc/AgentMajordome_object_diag.pu
@@ -95,15 +95,14 @@ AgentDeviceTelescopeGemini -u--|> AgentDevice | @@ -95,15 +95,14 @@ AgentDeviceTelescopeGemini -u--|> AgentDevice | ||
95 | /' Components (only 1) '/ | 95 | /' Components (only 1) '/ |
96 | AD_Telescope1 -d-> AgentDeviceTelescopeGemini :alias of | 96 | AD_Telescope1 -d-> AgentDeviceTelescopeGemini :alias of |
97 | 97 | ||
98 | -class DC_Gemini <<Singleton>> #lightblue | ||
99 | -class DC_MountGemini #lightblue | ||
100 | -class DS_Gemini #lightblue | ||
101 | /'DC_Mount o-left- DS_Mount'/ | 98 | /'DC_Mount o-left- DS_Mount'/ |
102 | 99 | ||
103 | AgentDeviceTelescopeGemini --> DC_Gemini :use | 100 | AgentDeviceTelescopeGemini --> DC_Gemini :use |
104 | /'DC_Gemini o-left- DS_Gemini'/ | 101 | /'DC_Gemini o-left- DS_Gemini'/ |
105 | 102 | ||
106 | /' Controllers '/ | 103 | /' Controllers '/ |
104 | +class DC_Gemini <<Singleton>> #lightblue | ||
105 | +class DC_MountGemini #lightblue | ||
107 | DC_Gemini <.l> gemini_device : channel/\nsocket | 106 | DC_Gemini <.l> gemini_device : channel/\nsocket |
108 | DC_Gemini ---|> DeviceControllerAbstract | 107 | DC_Gemini ---|> DeviceControllerAbstract |
109 | DC_Gemini o-- DC_MountGemini | 108 | DC_Gemini o-- DC_MountGemini |
@@ -111,6 +110,8 @@ DC_MountGemini --d|> DC_Mount | @@ -111,6 +110,8 @@ DC_MountGemini --d|> DC_Mount | ||
111 | DC_Mount --|> DeviceControllerAbstract | 110 | DC_Mount --|> DeviceControllerAbstract |
112 | 111 | ||
113 | /' Simulators '/ | 112 | /' Simulators '/ |
113 | +class DS_Gemini #lightblue | ||
114 | +class DS_MountGemini #lightblue | ||
114 | DS_Gemini ---|> DeviceSimulator | 115 | DS_Gemini ---|> DeviceSimulator |
115 | DS_Gemini o-down-> DS_MountGemini | 116 | DS_Gemini o-down-> DS_MountGemini |
116 | DS_MountGemini -d-|> DS_Mount | 117 | DS_MountGemini -d-|> DS_Mount |
@@ -128,16 +129,16 @@ AD_FilterSelector1 --> AgentDeviceSBIG :alias of | @@ -128,16 +129,16 @@ AD_FilterSelector1 --> AgentDeviceSBIG :alias of | ||
128 | AD_Shutter1 --> AgentDeviceSBIG :alias of | 129 | AD_Shutter1 --> AgentDeviceSBIG :alias of |
129 | AD_Sensor1 --> AgentDeviceSBIG :alias of | 130 | AD_Sensor1 --> AgentDeviceSBIG :alias of |
130 | 131 | ||
132 | +AgentDeviceSBIG -d-> DC_SBIG :use | ||
133 | +/'DC_SBIG o- DS_SBIG'/ | ||
134 | + | ||
135 | +/' Controllers '/ | ||
136 | + | ||
131 | class DC_SBIG <<Singleton>> #lightgreen | 137 | class DC_SBIG <<Singleton>> #lightgreen |
132 | class DC_DetectorSensorSBIG #lightgreen | 138 | class DC_DetectorSensorSBIG #lightgreen |
133 | class DC_DetectorShutterSBIG #lightgreen | 139 | class DC_DetectorShutterSBIG #lightgreen |
134 | class DC_FilterSelectorSBIG #lightgreen | 140 | class DC_FilterSelectorSBIG #lightgreen |
135 | -class DS_SBIG #lightgreen | ||
136 | - | ||
137 | -AgentDeviceSBIG -d-> DC_SBIG :use | ||
138 | -/'DC_SBIG o- DS_SBIG'/ | ||
139 | 141 | ||
140 | -/' Controllers '/ | ||
141 | DC_SBIG <.r> sbig_device : channel/\nsocket | 142 | DC_SBIG <.r> sbig_device : channel/\nsocket |
142 | DC_SBIG ---|> DeviceControllerAbstract | 143 | DC_SBIG ---|> DeviceControllerAbstract |
143 | DC_SBIG o-down- DC_DetectorSensorSBIG | 144 | DC_SBIG o-down- DC_DetectorSensorSBIG |
@@ -153,6 +154,10 @@ DC_DetectorShutter --|> DeviceControllerAbstract | @@ -153,6 +154,10 @@ DC_DetectorShutter --|> DeviceControllerAbstract | ||
153 | DC_FilterSelector --|> DeviceControllerAbstract | 154 | DC_FilterSelector --|> DeviceControllerAbstract |
154 | 155 | ||
155 | /' Simulators '/ | 156 | /' Simulators '/ |
157 | +class DS_SBIG #lightgreen | ||
158 | +class DS_DetectorSensorSBIG #lightgreen | ||
159 | +class DS_DetectorShutterSBIG #lightgreen | ||
160 | +class DS_FilterSelectorSBIG #lightgreen | ||
156 | DS_SBIG ---|> DeviceSimulator | 161 | DS_SBIG ---|> DeviceSimulator |
157 | DS_SBIG o-down- DS_DetectorShutterSBIG | 162 | DS_SBIG o-down- DS_DetectorShutterSBIG |
158 | DS_SBIG o-down- DS_DetectorSensorSBIG | 163 | DS_SBIG o-down- DS_DetectorSensorSBIG |
src/device_controller/abstract_component/device_controller.py
@@ -233,10 +233,12 @@ class DeviceControllerAbstract(): | @@ -233,10 +233,12 @@ class DeviceControllerAbstract(): | ||
233 | set_logger(DEBUG) | 233 | set_logger(DEBUG) |
234 | log_d("Logger configured") | 234 | log_d("Logger configured") |
235 | 235 | ||
236 | - if isinstance(PROTOCOL, str): | ||
237 | - | 236 | + if not isinstance(PROTOCOL, str): |
237 | + self.my_channel = PROTOCOL | ||
238 | + else: | ||
238 | # If LOCALHOST, launch the device SIMULATOR | 239 | # If LOCALHOST, launch the device SIMULATOR |
239 | if device_host=="localhost": | 240 | if device_host=="localhost": |
241 | + if not device_sim: raise Exception("No simulator class available") | ||
240 | self._device_simulator = device_sim | 242 | self._device_simulator = device_sim |
241 | print("SIMU IS", device_sim, self._device_simulator) | 243 | print("SIMU IS", device_sim, self._device_simulator) |
242 | self._thread_device_simulator = threading.Thread(target=self.device_simulator_run) | 244 | self._thread_device_simulator = threading.Thread(target=self.device_simulator_run) |
@@ -247,9 +249,6 @@ class DeviceControllerAbstract(): | @@ -247,9 +249,6 @@ class DeviceControllerAbstract(): | ||
247 | elif PROTOCOL == "USB": self.my_channel:ClientChannel = ClientChannelUSB(device_host, device_port, buffer_size, DEBUG) | 249 | elif PROTOCOL == "USB": self.my_channel:ClientChannel = ClientChannelUSB(device_host, device_port, buffer_size, DEBUG) |
248 | else: raise Exception("Unknown Channel", PROTOCOL) | 250 | else: raise Exception("Unknown Channel", PROTOCOL) |
249 | 251 | ||
250 | - else: | ||
251 | - | ||
252 | - self.my_channel = PROTOCOL | ||
253 | 252 | ||
254 | # overwrite abstract _cmd dictionary with subclass native _cmd_native dictionary: | 253 | # overwrite abstract _cmd dictionary with subclass native _cmd_native dictionary: |
255 | #self._cmd = {**self._cmd, **self._cmd_native} | 254 | #self._cmd = {**self._cmd, **self._cmd_native} |