While trying to build a user friendly system of checking out alarm events, I wondered if, given a group of cameras, when an alarm is received from a camera that belongs in a specific group, is there a direct way to know to which group of cameras is it from? I understand that groups are identified in the management client, but I supose there should be an easier way than retrieving this data from there.
There is no way to ask which groups a camera belongs to. It is however possible to get all groups and then for each group see if the camera is a member. (Then you can develop a function that will give you the groups based on the camera as input.)
Note that a camera can be a member in many groups, and you can even have a camera that doesn’t belong in any group.
There is more than one way, but I will describe one. If you do a Configuration.Instance.GetItems(); you will get a tree of the full configuration, all cameras and other items. If you explore the ConfigDump plugin sample you can see how you can use it.