Closed daverolli closed 5 years ago
The MATLAB API used to select the first module, but we changed it after a discussion regarding wild-cards in individual names. If I understand correctly, the behavior you're suggesting is as follows:
Assuming there are 2 modules on the network named HEBI | IO Board
HebiLookup.newGroupFromNames('HEBI', 'IO Board')
should throw an error about a not uniquely identifiable nameHebiLookup.newGroupFromNames('*', 'IO Board')
should throw the same errorHebiLookup.newGroupFromNames('*', 'IO Boar?')
would return a group of two modulesFrom the initial discussion I overheard, Dave encountered an issue with the first example you provided @ennerf (i.e., no wildcard patterns)
I listed my understanding of the desired
behavior. The current behavior would be that it always creates a group with multiple modules.
I assume that a wildcard in the family should be separate from a wildcard in the name?
what should happen if there are two modules on the network called
Family1 | IO Board
Family2 | IO Board
and a group is created using newGroupFromNames('*', 'IO Board')
?
No, what I mean happened that Dave tried to create a group like
newGroupFromNames('HEBI', 'Mobile IO')
(no wildcard)
and he got a group with 2 modules - since we had 2 modules on the network with that name and family. I don't think there was any errors thrown, until he was trying to manipulate feedback received from the group and realized the dimensions weren't what he expected (i.e. 2 elements as opposed to 1)
I understand what happened and why it is an issue. So what should the future behavior be?
Would everyone be happy if I implemented the behavior that I described above?
Yup. Behavior above is exactly right.
Fixed in latest snapshot
When you do
HebiLookup.newGroupFromNames()
, if there are multiple modules with the same family|name, a group is created with all of those modules. I would expect behavior to probably throw and error saying that there were multiple modules found. Behavior of the other APIs is to just use the first module that's found, which also isn't ideal, but is closer to expected behavior, and the debugging process brings you Scope / network debugging earlier. If using a wild-card then multiple modules would be allowed.This comes up a lot with the Mobile IO group creation if multiple people are on the same network with the default family|name. We're partially fixing this by changing all the demos to require the user to change the family of the phone/iPad, so this low-ish priority for now.