Beispiel #1
0
        private void loadClientEvent()
        {
            try
            {
                IAlarmClient alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

                EventLine[] events = alarmClient.GetEventLines(0, 10,
                                                               new VideoOS.Platform.Proxy.Alarm.EventFilter()
                {
                });


                foreach (EventLine line in events)
                {
                    BaseEvent       baseevent = alarmClient.GetEvent(line.Id);
                    DataGridViewRow row       = new DataGridViewRow();
                    row.Tag = baseevent;
                    row.CreateCells(dataGridViewAlarm, baseevent.EventHeader.Type, baseevent.EventHeader.Message, line.Timestamp.ToLocalTime(), line.SourceName);
                    dataGridViewAlarm.Rows.Add(row);
                }
            }
            catch (Exception ex)
            {
                EnvironmentManager.Instance.ExceptionDialog("loading Event", ex);
            }
        }
Beispiel #2
0
        private void loadClientAccess()
        {
            try
            {
                IAlarmClient alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

                EventLine[] events = alarmClient.GetEventLines(0, 10,
                                                               new VideoOS.Platform.Proxy.Alarm.EventFilter()
                {
                    Conditions = new Condition[] { new Condition()
                                                   {
                                                       Operator = Operator.Equals, Target = Target.Type, Value = "Access Control System Event"
                                                   } }
                });


                foreach (EventLine line in events)
                {
                    BaseEvent          baseevent          = alarmClient.GetEvent(line.Id);
                    AccessControlEvent accessControlEvent = baseevent as AccessControlEvent;
                    if (accessControlEvent != null)
                    {
                        DataGridViewRow row = new DataGridViewRow();
                        row.Tag = baseevent;
                        string credentialHolderId = "";
                        string systemId           = "";
                        if (accessControlEvent.RelatedAccessControlCredentialHolderIds != null)
                        {
                            if (accessControlEvent.RelatedAccessControlCredentialHolderIds.Length > 0)
                            {
                                credentialHolderId = accessControlEvent.RelatedAccessControlCredentialHolderIds[0];
                            }
                        }
                        if (accessControlEvent.AccessControlSystemId != null)
                        {
                            systemId = accessControlEvent.AccessControlSystemId.ToString();
                        }
                        row.CreateCells(
                            dataGridViewAlarm,
                            baseevent.EventHeader.Type,
                            baseevent.EventHeader.Message,
                            line.Timestamp.ToLocalTime(),
                            line.SourceName,
                            credentialHolderId,
                            systemId);
                        dataGridViewAlarm.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                EnvironmentManager.Instance.ExceptionDialog("loading Acces Control System Event", ex);
            }
        }
Beispiel #3
0
        private void loadClientAnalytics()
        {
            try
            {
                IAlarmClient alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

                EventLine[] events = alarmClient.GetEventLines(0, 10,
                                                               new VideoOS.Platform.Proxy.Alarm.EventFilter()
                {
                    Conditions = new Condition[] { new Condition()
                                                   {
                                                       Operator = Operator.NotEquals, Target = Target.Type, Value = "System Event"
                                                   } }
                });


                foreach (EventLine line in events)
                {
                    BaseEvent       baseevent = alarmClient.GetEvent(line.Id);
                    DataGridViewRow row       = new DataGridViewRow();
                    row.Tag = baseevent;

                    AnalyticsEvent aEvent = baseevent as AnalyticsEvent;
                    if (aEvent != null)
                    {
                        row.CreateCells(
                            dataGridViewAlarm,
                            baseevent.EventHeader.Type,
                            line.ObjectValue,
                            baseevent.EventHeader.Message,
                            line.CustomTag,
                            line.Timestamp.ToLocalTime(),
                            line.SourceName);
                        dataGridViewAlarm.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                EnvironmentManager.Instance.ExceptionDialog("loading Analytics", ex);
            }
        }
Beispiel #4
0
        private void loadClientLPR()
        {
            try
            {
                IAlarmClient alarmClient = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

                EventLine[] events = alarmClient.GetEventLines(0, 10,
                                                               new VideoOS.Platform.Proxy.Alarm.EventFilter()
                {
                    Conditions = new Condition[] { new Condition()
                                                   {
                                                       Operator = Operator.Equals, Target = Target.Type, Value = "LPR Event"
                                                   } }
                });


                foreach (EventLine line in events)
                {
                    BaseEvent       baseevent = alarmClient.GetEvent(line.Id);
                    DataGridViewRow row       = new DataGridViewRow();
                    row.Tag = baseevent;
                    AnalyticsEvent aEvent = baseevent as AnalyticsEvent;
                    if (aEvent != null)
                    {
                        string oValue      = "";
                        string oConfidence = "";
                        if (aEvent.ObjectList != null && aEvent.ObjectList.Count > 0)
                        {
                            oValue      = aEvent.ObjectList[0].Value ?? "";
                            oConfidence = aEvent.ObjectList[0].Confidence.ToString("F5");
                        }
                        row.CreateCells(dataGridViewAlarm, aEvent.EventHeader.Type, oValue, oConfidence, aEvent.EventHeader.CustomTag, aEvent.EventHeader.Timestamp.ToLocalTime(), aEvent.EventHeader.Source.Name);
                        dataGridViewAlarm.Rows.Add(row);
                    }
                }
            }
            catch (Exception ex)
            {
                EnvironmentManager.Instance.ExceptionDialog("loading LPR Analytics", ex);
            }
        }
Beispiel #5
0
        private void CreatePlaybackDictionary(ImageViewerAddOn imageViewerAddOn, DateTime videoTime)
        {
            CachedOverlayObjects coo;

            if (!_dicAddOnOverlayObjectsPlayback.TryGetValue(imageViewerAddOn, out coo) || coo.StartTime > videoTime || coo.EndTime < videoTime)
            {
                DateTime startDatetime = videoTime.AddMilliseconds(-_startCache);
                DateTime endDatetime   = videoTime.AddMilliseconds(_endCache);
                if (endDatetime > DateTime.Now)
                {
                    endDatetime = DateTime.Now;
                }

                EventLine[] analyticsEventLines = GetAnalyticsEventList(startDatetime, endDatetime);
                if (analyticsEventLines.Length == 0)
                {
                    return;
                }

                CachedOverlayObjects overlayObjectList = new CachedOverlayObjects();
                overlayObjectList.OverlayObjectList = new List <OverlayObject>();
                overlayObjectList.StartTime         = startDatetime;
                overlayObjectList.EndTime           = endDatetime;

                AlarmClientManager _alarmClientManager = new AlarmClientManager();
                IAlarmClient       alarmClient         = _alarmClientManager.GetAlarmClient(EnvironmentManager.Instance.MasterSite.ServerId);

                foreach (EventLine ev in analyticsEventLines)
                {
                    BaseEvent baseevent = alarmClient.GetEvent(ev.Id);
                    overlayObjectList.OverlayObjectList.Add(new OverlayObject(baseevent, ev.Timestamp));
                }
                if (_dicAddOnOverlayObjectsPlayback.ContainsKey(imageViewerAddOn))
                {
                    _dicAddOnOverlayObjectsPlayback.Remove(imageViewerAddOn);
                }
                _dicAddOnOverlayObjectsPlayback.Add(imageViewerAddOn, overlayObjectList);
            }
        }