Exemple #1
0
        public RampJamRange(RampVDData rampvddata)
            : base(rampvddata.vd)
        {
            this.rampVDData = rampvddata;
            this.m_class = 43; //都會區出口砸到壅塞

            try
            {
                this.m_eventmode = Global.getEventMode(this.m_class);
                this.m_alarm_type = AlarmType.TRAFFIC;
                this.EventId = Global.getEventId();
            }
            catch
            {
                this.m_eventmode = EventMode.DontCare;
            }
        }
Exemple #2
0
        public RampJamRange(RampVDData rampvddata)
            : base(rampvddata.vd)
        {
            this.rampVDData = rampvddata;

            if (rampvddata.InOut == "O")
                this.m_class = 43; //都會區出口砸到壅塞
            else
                this.m_class = 133;

            try
            {
                //this.m_eventmode = Global.getEventMode(this.m_class);
                this.m_eventmode = Global.getEventModeBySectionID(this.getSectionId(), this.m_class, ref this.IsLock, ref this.description);
                this.m_alarm_type = AlarmType.TRAFFIC;
                this.EventId = Global.getEventId();
            }
            catch
            {
                this.m_eventmode = EventMode.DontCare;
            }
        }
Exemple #3
0
        private void loadRampVD(DevcieManager devMg)
        {
            OdbcConnection cn = new OdbcConnection(Global.Db2ConnectionString);
            #if !DEBUG
               OdbcCommand cmd =new OdbcCommand( "select degree_vd,location_r,direction,lineid,divisionid,divisionname,mileage,degree_lane,g_code_id,RGSDeviceName from vwrampDegree where location_r='O'  or location_r='I' ");
            #else
               OdbcCommand cmd = new OdbcCommand("select degree_vd,location_r,direction,lineid,divisionid,divisionname,mileage,degree_lane,g_code_id,RGSDeviceName from vwrampDegree where location_r='O' ");

            #endif

               try
               {
               cn.Open();
               cmd.Connection = cn;
               OdbcDataReader rd = cmd.ExecuteReader();
               while (rd.Read())
               {
                   try
                   {
                       string devname, location_r, lineid, divisionid, divisionname, divisiontype, direction,rgs_devicename;
                       int mile_m,laneid,g_code_id;
                       devname = rd[0].ToString();
                       location_r = rd[1].ToString();
                       direction = rd[2].ToString();
                       lineid = rd[3].ToString();
                       divisionid = rd[4].ToString();
                       divisionname = rd[5].ToString();
                     //  divisiontype = rd[6].ToString();
                       mile_m = System.Convert.ToInt32(rd[6]);
                       laneid = System.Convert.ToInt32(rd[7]);

                       if (!rd.IsDBNull(8))
                           g_code_id = System.Convert.ToInt32(rd[8]);  // for MetroNetwork
                       else
                           g_code_id = -1;

                       if (!rd.IsDBNull(9))
                           rgs_devicename = rd[9].ToString();
                       else
                           rgs_devicename = null;

                       RampVDData rvddata = new RampVDData(devname, lineid, direction, divisionid, divisionname, location_r,devMg[devname] as TC.VDDeviceWrapper,mile_m,laneid,g_code_id,rgs_devicename);

                       this.rampVDDataList.Add(rvddata);

                       rvddata.OnEvent += new EventHandler(rvddata_OnEvent);

                   }
                   catch (Exception ex1)
                   {
                       ConsoleServer.WriteLine(ex1.Message + "," + ex1.StackTrace);
                   }

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