Exemple #1
0
        public void AddEvent(Event evt)
        {
            try
               {
               hsEvent.Add(evt.EventId, evt);
               evt.OnStop += new EventHandler(eventobj_OnStop);
               evt.OnRangeChange += new EventHandler(eventobj_OnRangeChange);
               evt.OnDegreeChange += new EventHandler(eventobj_OnDegreeChange);
               evt.OnReNewEvent += new EventHandler(evt_OnReNewEvent);
               evt.OnAbort += new EventHandler(evt_OnAbort);
               if (!evt.IsReload)
               {
                   InsertAlarmTable(evt);
                   evt.setEventStatus((int)EventStatus.Alarm);
               }
               else  //事件還原
               {
                 evt.setEventStatus((int)evt.getEventStatus());
                 evt.IsReload = false;
               }

               if(evt.IsLock)
                 Program.matrix.cctvmgr.setLock(evt);
               Program.notifyServer.NotifyAll(new NotifyEventObject( EventEnumType.NEW_RSP_EVENT,"HOST",evt.EventId));
               }
               catch (Exception ex)
               {
               ConsoleServer.WriteLine(ex.Message + "," + ex.StackTrace);
               }
        }
Exemple #2
0
 public void AddEvent(Event evt)
 {
     try
        {
        hsEvent.Add(evt.EventId, evt);
        evt.OnStop += new EventHandler(eventobj_OnStop);
        evt.OnRangeChange += new EventHandler(eventobj_OnRangeChange);
        evt.OnDegreeChange += new EventHandler(eventobj_OnDegreeChange);
        evt.OnReNewEvent += new EventHandler(evt_OnReNewEvent);
        evt.OnAbort += new EventHandler(evt_OnAbort);
        InsertAlarmTable(evt);
        evt.setEventStatus((int)EventStatus.Alarm);
        Program.notifyServer.NotifyAll(new NotifyEventObject( EventEnumType.NEW_RSP_EVENT,"HOST",evt.EventId));
        }
        catch (Exception ex)
        {
        ConsoleServer.WriteLine(ex.Message + "," + ex.StackTrace);
        }
 }