示例#1
0
        public static List <Track> AllTracksAAA(DataTable dt)
        {
            List <Track> trackList = new List <Track>();

            foreach (DataRow row in dt.Rows)
            {
                Track track = new Track();

                track.Track_No = Convert.ToInt32(row[0]);



                if (int.TryParse(row[1].ToString(), out int Track_ID))
                {
                    track.Track_ID = Track_ID;
                }



                if (int.TryParse(row[2].ToString(), out int Track_Start_Position))
                {
                    track.Track_Start_Position = Track_Start_Position;
                }

                if (int.TryParse(row[3].ToString(), out int Track_End_Position))
                {
                    track.Track_End_Position = Track_End_Position;
                }

                if (int.TryParse(row[4].ToString(), out int Track_Length))
                {
                    track.Track_Length = Track_Length;
                }

                if (int.TryParse(row[5].ToString(), out int Track_Speed_Limit_KMH))
                {
                    track.Track_Speed_Limit_KMH = Track_Speed_Limit_KMH;
                }



                if (int.TryParse(row[6].ToString(), out int Track_Connection_Exit_1))
                {
                    track.Track_Connection_Exit_1 = Track_Connection_Exit_1;
                }



                //track.Track_ID = Convert.ToInt32(row[1]);
                //track.Track_Start_Position = Convert.ToInt32(row[2]);
                //track.Track_End_Position = Convert.ToInt32(row[3]);
                //track.Track_Length = Convert.ToInt32(row[4]);
                //track.Track_Speed_Limit_KMH = Convert.ToInt32(row[5]);
                //track.Track_Connection_Exit_1 = Convert.ToInt32(row[6]);


                //int X1_Point = Convert.ToInt32(row[19]);
                //int X2_Point = Convert.ToInt32(row[20]);
                //int Y1_Point = Convert.ToInt32(row[21]);
                //int Y2_Point = Convert.ToInt32(row[22]);

                track.SpeedChangeVMax = track.Track_Speed_Limit_KMH;

                track.MaxTrackSpeedKMH = track.SpeedChangeVMax;
                track.MaxTrackSpeedCMS = UnitConversion.KilometerHourToCentimeterSecond(track.SpeedChangeVMax);

                //hız limiti hesaplanıyor
                //değiştirilebilir
                //SpeedLimitCommand(track.SpeedChangeVMax);


                trackList.Add(track);
            }



            return(trackList);
        }
示例#2
0
        public static List <Track> AllTracks(DataTable dt)
        {
            List <Track> trackList = new List <Track>();

            foreach (DataRow row in dt.Rows)
            {
                Track track = new Track();

                track.Track_No = Convert.ToInt32(row[0]);


                int station_Start_Position;

                if (int.TryParse(row[1].ToString(), out station_Start_Position))
                {
                    track.Station_Start_Position = station_Start_Position;
                }


                int station_End_Position;

                if (int.TryParse(row[2].ToString(), out station_End_Position))
                {
                    track.Station_Start_Position = station_End_Position;
                }

                track.Station_Name = row[3].ToString();
                track.Track_ID     = Convert.ToInt32(row[4]);
                track.Line_ID      = Convert.ToInt32(row[5]);
                track.Track_Type   = Convert.ToInt32(row[6]);


                track.Track_Start_Position      = Convert.ToInt32(row[7]);
                track.Track_End_Position        = Convert.ToInt32(row[8]);
                track.Track_Length              = Convert.ToInt32(row[9]);
                track.Track_Speed_Limit_KMH     = Convert.ToInt32(row[10]);
                track.Stopping_Point_Position_1 = Convert.ToInt32(row[11]);
                track.Stopping_Point_Type_1     = Convert.ToInt32(row[12]);

                track.Stopping_Point_Positon_2 = Convert.ToInt32(row[13]);
                track.Stopping_Point_Type_2    = Convert.ToInt32(row[14]);
                track.Track_Connection_Entry_1 = Convert.ToInt32(row[15]);
                track.Track_Connection_Entry_2 = Convert.ToInt32(row[16]);
                track.Track_Connection_Exit_1  = Convert.ToInt32(row[17]);
                track.Track_Connection_Exit_2  = Convert.ToInt32(row[18]);


                //int X1_Point = Convert.ToInt32(row[19]);
                //int X2_Point = Convert.ToInt32(row[20]);
                //int Y1_Point = Convert.ToInt32(row[21]);
                //int Y2_Point = Convert.ToInt32(row[22]);

                track.SpeedChangeVMax = track.Track_Speed_Limit_KMH;

                track.MaxTrackSpeedKMH = track.SpeedChangeVMax;
                track.MaxTrackSpeedCMS = UnitConversion.KilometerHourToCentimeterSecond(track.SpeedChangeVMax);

                //hız limiti hesaplanıyor
                //değiştirilebilir
                //SpeedLimitCommand(track.SpeedChangeVMax);



                if (!string.IsNullOrEmpty(track.Station_Name))
                {
                    track.DwellTime = 20;
                }



                trackList.Add(track);
            }



            return(trackList);
        }