I need to know the total count of alarms in milestone database
Here is the code:
IAlarmClient _alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);
_alarms = _alarmClient.GetAlarmLines(0, maxExport, new VideoOS.Platform.Proxy.Alarm.AlarmFilter()
{
Orders = new OrderBy[]
{
new OrderBy() { Order = Order.Descending, Target = Target.Timestamp }
},
Conditions = new VideoOS.Platform.Proxy.Alarm.Condition[]
{
new VideoOS.Platform.Proxy.Alarm.Condition() { Operator = Operator.GreaterThan, Target = Target.Timestamp, Value = dtStart },
new VideoOS.Platform.Proxy.Alarm.Condition() { Operator = Operator.LessThan, Target = Target.Timestamp, Value = dtEnd }
}
});
You need to provide Start and End DateTime and Max number of alarms returned.
Ciao,
Frediano
I need only count of alarms
You can omit specifying the time range commenting the 2 rows of Condition and use a big value for MaxCount then count how many rows you get
Frediano