Hi,
I’m experiencing an issue with the Alarm Manager. When I send an alarm for a custom item that is not a camera, I do not see a camera view in the Alarm Manager, even if I have added a camera to the reference list. How can I resolve this issue?
private void FireSendAlarmClick(object sender, EventArgs e)
{
if (_item == null)
{
MessageBox.Show("Please select an Item first...");
return;
}
EventSource eventSource = new EventSource()
{
FQID = _item.FQID,
Name = _item.Name
};
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Class = "NewEventToRule",
Type = _textBoxEventType.Text,
Timestamp = DateTime.Now,
Message = _textBoxMessage.Text,
Name = _textBoxEventName.Text,
Source = eventSource,
Priority = 2,
PriorityName = "Medium"
};
Item cameraItem = FindAnyCamera(Configuration.Instance.GetItemsByKind(Kind.Camera));
ReferenceList referenceList = new ReferenceList()
{
new Reference()
{
FQID = _item.FQID
}
};
Alarm alarm = new Alarm()
{
EventHeader = eventHeader,
StateName = "In progress",
State = 4,
AssignedTo = "test (\\test)",
ReferenceList = referenceList
// Basic user with the name of test in this example
// the string to use can be seen in the Smart Client dropdown
// Other fields could be filled out, e.g. snapshotlist, objectList
};
// Send the Alarm directly to the EventServer, to store in the Alarm database. No event which could trigger a rule is being activated.
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alarm });
}