Esempio n. 1
0
 public void Fake()
 {
     try
     {
         sconnEvent zone = new sconnEvent();
         zone.Fake();
         Events.Add(zone);
     }
     catch (Exception e)
     {
         _logger.Error(e, e.Message);
     }
 }
Esempio n. 2
0
 public sconnEventConfig(ipcSiteConfig cfg)
 {
     try
     {
         Events = new List <sconnEvent>();
         if (cfg.events != null)
         {
             foreach (var ev in cfg.events)
             {
                 sconnEvent nevent = new sconnEvent(ev.Buffer);
                 Events.Add(nevent);
             }
         }
     }
     catch (Exception e)
     {
         _logger.Error(e, e.Message);
     }
 }
Esempio n. 3
0
 public void Deserialize(byte[] buffer)
 {
     try
     {
         int relays = buffer[ipcDefines.EVENT_DB_INFO_EVNO_POS];
         for (int i = 0; i < relays; i++)
         {
             byte[] relayCfg = new byte[ipcDefines.EVENT_DB_RECORD_LEN];
             for (int j = 0; j < ipcDefines.EVENT_DB_RECORD_LEN; j++)
             {
                 relayCfg[j] = buffer[i * ipcDefines.EVENT_DB_RECORD_LEN + j + 1]; //offset for ev no - todo - defines
             }
             sconnEvent relay = new sconnEvent(relayCfg);
             relay.Id = i;
             Events.Add(relay);
         }
     }
     catch (Exception e)
     {
         _logger.Error(e, e.Message);
     }
 }