Hello,
I am trying to define events for the metadata devices in the XProtect driver. I have multiple devices, each handling an input but all should be able to raise an event if a sign is received.
First I have added the same device event for the metadata devices:
protected override ICollection<DeviceDefinitionBase> BuildDevices()
{
var devices = new List<DeviceDefinitionBase>();
int deviceAmount = 5;
for (int i = 0; i < deviceAmount; i++)
{
devices.Add(new MetadataDeviceDefinition()
{
DisplayName = "Channel " + $"{i:D3}",
DeviceId = Constants.MetadataDeviceIDs[i].ToString(),
Streams = BuildMetadataStreams(i),
Settings = new Dictionary<string, string>()
{
{ Constants.TopicNameSetting, "Topic name" },
{ Constants.UIDNameSetting, i.ToString() }
},
DeviceEvents = new List<EventDefinition>
{
new EventDefinition()
{
DisplayName = "Human Detected Event",
ReferenceId = Constants.HumanDetectedEventId
}
}
});
}
return devices;
}
I have configured the event to the metadata devices on the Event tab, added the device to a camera as related metadata, then created a few rules to trigger a user-defined event when any of my events is raised on the configured camera. Then the user-defined events raised an alarm.
The problem is that in the Smart Client alarm was received from only one camera, regardless of having multiple metadata devices: on the Alarm Manager only one camera was listed, although the other devices also received input signals (and raised an event)
Update: Sorry, this is not an issue. There was a filter defined in the Smart Client Alarm Manager for only one kind of alarm. However the below question is still valid.
So I have tried to distinguish the events related to the metadata devices by adding separate GUIDs to the event definitions, modifying the code as below :
protected override ICollection<DeviceDefinitionBase> BuildDevices()
{
var devices = new List<DeviceDefinitionBase>();
int deviceAmount = 5;
for (int i = 0; i < deviceAmount; i++)
{
devices.Add(new MetadataDeviceDefinition()
{
DisplayName = "Channel " + $"{i:D3}",
DeviceId = Constants.MetadataDeviceIDs[i].ToString(),
Streams = BuildMetadataStreams(i),
Settings = new Dictionary<string, string>()
{
{ Constants.TopicNameSetting, "Topic name" },
{ Constants.UIDNameSetting, i.ToString() }
},
DeviceEvents = new List<EventDefinition>
{
new EventDefinition()
{
DisplayName = "Human Detected Event, " + "Channel " + $"{i:D3}",
ReferenceId = Constants.HumanDetectedEventIds[i],
NameReferenceId = Constants.HumanDetectedEventIds[i]
}
}
});
}
return devices;
}
However I have found that only one event was visible on the system: Human Detected Event, Channel004.
Events named Channel000 - Channel003 were completely missing - either on the event tab, or in the event list of the rules management.
Do you happen to know if this is a bug? Also what is the recommended method for raising device events: one event type (one GUID) added for all of the devices, or separate events for each devices?
I am using XProtect Corporate, 2020R1, version 20.1b
Best Regards,
Andras