Exemplo n.º 1
0
        public IIDRange(IID_CAM_Data camdata)
            : base(camdata.devWrapper)
        {
            this.camdata = camdata;
            this.m_alarm_type = AlarmType.TUNNEL;
            /*
            70    IID停等           => 55    停等
             71    IID行人偵測   => 57    行人偵測
             72    IID散落物       => 32    散落物
             73    IID逆行車輛   => 58    逆行車輛
             74    IID煙霧           => 56    煙霧
             75    IID交通壅塞   => 41    一般路段壅塞
             */

            this.m_class = 69 + camdata.eventid;

            //switch (69 + camdata.eventid)
            //{
            //    case 70:
            //        this.m_class = 55;
            //        break;

            //    case 71:
            //        this.m_class = 57;
            //        break;
            //    case 72:
            //        this.m_class = 32;
            //        break;
            //    case 73:
            //        this.m_class = 58;
            //        break;
            //    case 74:
            //        this.m_class = 56;
            //        break;
            //    case 75:
            //        this.m_class = 41;
            //        break;
            //}//一般道路壅塞

              //     this.m_eventmode = Global.getEventMode(this.m_class,out this.IsLock,out this.description);

            try
            {
                this.m_eventmode = Global.getEventModeBySectionID(this.getSectionId(), this.m_class,ref this.IsLock,ref this.description);
                this.EventId = Global.getEventId();
            }
            catch
            {
                this.m_eventmode = EventMode.DontCare;
            }
        }
Exemplo n.º 2
0
        public IIDRange(IID_CAM_Data camdata)
            : base(camdata.devWrapper)
        {
            this.camdata = camdata;
            this.m_alarm_type = AlarmType.TUNNEL;
            this.m_class = 69 + camdata.eventid;  //一般道路壅塞

            this.m_eventmode = Global.getEventMode(this.m_class);
            try
            {
                this.EventId = Global.getEventId();
            }
            catch
            {
                this.m_eventmode = EventMode.DontCare;
            }
        }
Exemplo n.º 3
0
        public void load_IID_Cam_Data()
        {
            hsCams.Clear();
               System.Data.Odbc.OdbcConnection cn = new System.Data.Odbc.OdbcConnection(Global.Db2ConnectionString);
               System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand();
               System.Data.Odbc.OdbcDataReader rd;
               cmd.Connection = cn;
               cmd.CommandText = "select devicename,cam_id,direction,mileage,lane_id from tblIIDCamConfig";
               try
               {
               cn.Open();
               rd = cmd.ExecuteReader();
               while (rd.Read())
               {
                   string devname, direction;
                   int camid,laneid, mileage;
                   devname = rd[0].ToString();
                   camid = System.Convert.ToInt32(rd[1]);
                   direction = rd[2].ToString();
                   mileage = System.Convert.ToInt32(rd[3]);
                   laneid = System.Convert.ToInt32(rd[4]);

                   IID_CAM_Data camdata=new IID_CAM_Data("N6", direction, devname, camid, laneid, mileage);
                   camdata.OnEvent += new EventHandler(camdata_OnEvent);
                   hsCams.Add(camdata.Key,camdata);

               }
               rd.Close();
               }
               catch (Exception ex)
               {
               ConsoleServer.WriteLine(ex.Message + "," + ex.StackTrace);
               }
               finally
               {
               cn.Close();
               }

              // string sql="select camName,
        }