Open carandraug opened 4 years ago
Proposed fix for the "only one floating device listed on config" case on my 153-always-check-floating-device-uid
branch (it effectively removes the len(self._id_to_host) > 1
check mentioned previously.
Not sure how to address the broader issue of not being able to get the device one wants though, this seems to be a limitation of using FloatingDevice
.
After this morning meeting, I pushed the change that checks the UID even for a single floating device. This means that deviceserver now always requires the user to specify the correct UID for floating devices.
Floating devices are devices where we can't specify which device to actually control. After construction and initialization, we get one of those devices and must check via
get_id
to find which one we got. The way this is handled in deviceserver is the following:For this to work we are assuming that all available devices will be served (and that they will be served by the same root deviceserver), which means we require all devices that can be controlled by that class to be init.
For example, if we have three cameras connected but we only want to serve two of them, then deviceserver might get the two cameras we want and everything works. But deviceserver might also get the other camera in which case it will fail with "Host or port not found for device X" error and without a way to select the other camera.
In addition, if we have two floating devices connected and we only list one for the device server, then we don't even check the map and we will serve whatever we got without checking its uid (the code that checks its uid is on this block):