コード例 #1
0
ファイル: Kierunki.cs プロジェクト: Ravensbow/gtfs-mobile
        public Kierunki(Routes rou, Komunikacja kom)
        {
            linia = rou;

            foreach (Trips T in kom.trips)
            {
                if (kierunkiList.Contains(T.trip_headsign) == false && T.route_id == linia.route_id)
                {
                    kierunkiList.Add(T.trip_headsign);
                }
            }
            int wybor = 1;

            //Rozklad.Mege mege = new Rozklad.Mege(kierunkiList);
            //wybor= Convert.ToInt16(mege.Show());
            wybrany_kierunek = kierunkiList[wybor - 1];
        }
コード例 #2
0
        public ListaPrzy(Komunikacja kom)
        {
            route = kom.kier.linia;


            kierunek = kom.kier.wybrany_kierunek;

            foreach (Trips T in kom.trips)
            {
                if (T.trip_headsign != null)
                {
                    if (T.trip_headsign.Replace("/", " ").ToUpper() == kierunek.Replace("/", " ").ToUpper() && T.route_id == route.route_id)
                    {
                        trip = T;
                        break;
                    }
                }
            }

            foreach (Stop_times S in kom.stop_Times)
            {
                if (S.trip_id == trip.trip_id)
                {
                    stop.Add(S);
                }
            }

            stop.Sort();

            foreach (Stop_times S in stop)
            {
                foreach (Stops T in kom.stops)
                {
                    if (T.stop_id == S.stop_id)
                    {
                        przystanki.Add(T);
                    }
                }
            }
            //Rozklad.MPrzystanki mege = new Rozklad.MPrzystanki(przystanki,route);
            //wybrany = mege.Show();
            //MessageBox.Show(wybrany.stop_name);
        }
コード例 #3
0
        public GodzinyOdjazdu(Komunikacja kom)
        {
            Linia = kom.listaPrzystankow.route;
            string kierunek = kom.listaPrzystankow.kierunek;

            Przystanek = kom.listaPrzystankow.wybrany;



            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.monday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            //
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        poniedzialek.Add(Times.departure_time);
                    }
                }
            }

            poniedzialek.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.tuesday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }

            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        wtorek.Add(Times.departure_time);
                    }
                }
            }
            wtorek.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.wednesday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        sroda.Add(Times.departure_time);
                    }
                }
            }
            sroda.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.thursday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        czwartek.Add(Times.departure_time);
                    }
                }
            }
            czwartek.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.friday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        piatek.Add(Times.departure_time);
                    }
                }
            }
            piatek.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.saturday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        sobota.Add(Times.departure_time);
                    }
                }
            }
            sobota.Sort();
            Tripy.Clear();
            //--------------------------------
            foreach (Trips T in kom.trips)
            {
                if (T.route_id == Linia.route_id && T.trip_headsign.Replace("/", " ") == kierunek.Replace("/", " "))
                {
                    foreach (Calendar C in kom.calendar)
                    {
                        if (C.service_id == T.service_id)
                        {
                            if (C.sunday == "1")
                            {
                                Tripy.Add(T);
                            }
                        }
                    }
                }
            }
            foreach (Stop_times Times in kom.stop_Times)
            {
                foreach (Trips T in Tripy)
                {
                    if (Times.stop_id == Przystanek.stop_id && Times.trip_id == T.trip_id)
                    {
                        niedziela.Add(Times.departure_time);
                    }
                }
            }
            niedziela.Sort();
            Tripy.Clear();

            foreach (string S in niedziela)
            {
            }
            //Rozklad.Godziny Mgodziny = new Rozklad.Godziny(poniedzialek, wtorek, sroda, czwartek, piatek, sobota, niedziela,kierunek,Linia.route_id,Przystanek.stop_name);
            //Mgodziny.Show();
        }