indigo-astronomy / indigo

INDIGO is a system of standards and frameworks for multiplatform and distributed astronomy software development designed to scale with your needs.
http://www.indigo-astronomy.org
Other
148 stars 64 forks source link

Device selection in agents needs better policy #373

Closed rumengb closed 4 years ago

rumengb commented 4 years ago

We have a scenario with Imager agent and guider agent. And you have 2 camera setup. You select guider camera setup guiding and start it. Then you go to the imager agent and by accident select the guider camera. Now you are in trouble. When you select another camera in the imager agent the guider camera will be disconnected and the guiding will fail. And you have to set it up and start it again.

To avoid situations like these a better policy is needed. One simple to implement and avoiding the risk of such situations is to connect device on select if not connected and do not disconnect it when another one is selected. This approach will leave all devices connected but there is no chance to break another agents operation accidentally by selecting the camera in use.

Another solution which will avoid breaking another agent operation by accidental selection of the device in use is to make it like this: The agent who connected the device will disconnect it when selects another one. If the device is already connected when selected the agent should not disconnect it when unselected. This approach will not leave open devices and the chance the chances of breaking another agents operation by accident is minimal.

polakovic commented 4 years ago

489c30e4e19bee1572b8969c5970edc4faf840c9