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 | 95 | /' Components (only 1) '/ |
96 | 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 | 98 | /'DC_Mount o-left- DS_Mount'/ |
102 | 99 | |
103 | 100 | AgentDeviceTelescopeGemini --> DC_Gemini :use |
104 | 101 | /'DC_Gemini o-left- DS_Gemini'/ |
105 | 102 | |
106 | 103 | /' Controllers '/ |
104 | +class DC_Gemini <<Singleton>> #lightblue | |
105 | +class DC_MountGemini #lightblue | |
107 | 106 | DC_Gemini <.l> gemini_device : channel/\nsocket |
108 | 107 | DC_Gemini ---|> DeviceControllerAbstract |
109 | 108 | DC_Gemini o-- DC_MountGemini |
... | ... | @@ -111,6 +110,8 @@ DC_MountGemini --d|> DC_Mount |
111 | 110 | DC_Mount --|> DeviceControllerAbstract |
112 | 111 | |
113 | 112 | /' Simulators '/ |
113 | +class DS_Gemini #lightblue | |
114 | +class DS_MountGemini #lightblue | |
114 | 115 | DS_Gemini ---|> DeviceSimulator |
115 | 116 | DS_Gemini o-down-> DS_MountGemini |
116 | 117 | DS_MountGemini -d-|> DS_Mount |
... | ... | @@ -128,16 +129,16 @@ AD_FilterSelector1 --> AgentDeviceSBIG :alias of |
128 | 129 | AD_Shutter1 --> AgentDeviceSBIG :alias of |
129 | 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 | 137 | class DC_SBIG <<Singleton>> #lightgreen |
132 | 138 | class DC_DetectorSensorSBIG #lightgreen |
133 | 139 | class DC_DetectorShutterSBIG #lightgreen |
134 | 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 | 142 | DC_SBIG <.r> sbig_device : channel/\nsocket |
142 | 143 | DC_SBIG ---|> DeviceControllerAbstract |
143 | 144 | DC_SBIG o-down- DC_DetectorSensorSBIG |
... | ... | @@ -153,6 +154,10 @@ DC_DetectorShutter --|> DeviceControllerAbstract |
153 | 154 | DC_FilterSelector --|> DeviceControllerAbstract |
154 | 155 | |
155 | 156 | /' Simulators '/ |
157 | +class DS_SBIG #lightgreen | |
158 | +class DS_DetectorSensorSBIG #lightgreen | |
159 | +class DS_DetectorShutterSBIG #lightgreen | |
160 | +class DS_FilterSelectorSBIG #lightgreen | |
156 | 161 | DS_SBIG ---|> DeviceSimulator |
157 | 162 | DS_SBIG o-down- DS_DetectorShutterSBIG |
158 | 163 | DS_SBIG o-down- DS_DetectorSensorSBIG | ... | ... |
src/device_controller/abstract_component/device_controller.py
... | ... | @@ -233,10 +233,12 @@ class DeviceControllerAbstract(): |
233 | 233 | set_logger(DEBUG) |
234 | 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 | 239 | # If LOCALHOST, launch the device SIMULATOR |
239 | 240 | if device_host=="localhost": |
241 | + if not device_sim: raise Exception("No simulator class available") | |
240 | 242 | self._device_simulator = device_sim |
241 | 243 | print("SIMU IS", device_sim, self._device_simulator) |
242 | 244 | self._thread_device_simulator = threading.Thread(target=self.device_simulator_run) |
... | ... | @@ -247,9 +249,6 @@ class DeviceControllerAbstract(): |
247 | 249 | elif PROTOCOL == "USB": self.my_channel:ClientChannel = ClientChannelUSB(device_host, device_port, buffer_size, DEBUG) |
248 | 250 | else: raise Exception("Unknown Channel", PROTOCOL) |
249 | 251 | |
250 | - else: | |
251 | - | |
252 | - self.my_channel = PROTOCOL | |
253 | 252 | |
254 | 253 | # overwrite abstract _cmd dictionary with subclass native _cmd_native dictionary: |
255 | 254 | #self._cmd = {**self._cmd, **self._cmd_native} | ... | ... |