public static StationDisplay GetStation(int ccd)
 {
     if (!Stations.ContainsKey(ccd))
     {
         Stations[ccd] = new StationDisplay(ccd);
     }
     return(Stations[ccd]);
 }
 public static StationToolBlockEdit GetStation(int ccd)
 {
     if (!Stations.ContainsKey(ccd))
     {
         Stations[ccd] = new StationToolBlockEdit(ccd);
     }
     return(Stations[ccd]);
 }
示例#3
0
        /// <summary>Gets the name of an Eve location from the location ID</summary>
        /// <param name="locationId">The location id.</param>
        /// <returns>The <see cref="string" />.</returns>
        public static string GetLocationName(int locationId)
        {
            if (locationId >= 66000000)
            {
                if (locationId < 66014933)
                {
                    locationId = locationId - 6000001;
                }
                else
                {
                    locationId = locationId - 6000000;
                }
            }

            if (Convert.ToDouble(locationId) >= 61000000 & Convert.ToDouble(locationId) <= 61999999)
            {
                if (Stations.ContainsKey(locationId))
                {
                    // Known Outpost
                    return(Stations[locationId].StationName);
                }

                // Unknown outpost!
                return("Unknown Outpost");
            }

            if (Convert.ToDouble(locationId) < 60000000)
            {
                if (SolarSystems.ContainsKey(locationId))
                {
                    // Known solar system
                    return(SolarSystems[locationId].Name);
                }

                // Unknown solar system
                return("Unknown System");
            }

            if (Stations.ContainsKey(locationId))
            {
                // Known station
                return(Stations[locationId].StationName);
            }

            // Unknown station
            return("Unknown Station");
        }
示例#4
0
        //Lee todas las paradas del archivo Stops y agrega las estaciones
        public void loadStops()
        {
            try
            {
                StreamReader reader = new StreamReader(RELATIVE_PATH_STOPS);


                string line = reader.ReadLine();
                line = reader.ReadLine();


                while (line != null)
                {
                    string[] datos = line.Split(',');

                    if (!datos[6].Equals("0") || !datos[7].Equals("0"))
                    {
                        //                 Stop Id, Plan Version,   Short Name, Long Name, Gps x,    Gps Y
                        Stop a = new Stop((datos[0]), (datos[1]), datos[2], datos[3], datos[6], datos[7]);
                        if (isStop(a.ShortName) == true)
                        {
                            if (!Stations.ContainsKey(datos[0]))
                            {
                                CreateStation(a);
                            }
                        }
                        else
                        {
                            if (!Stops.ContainsKey(datos[0]))
                            {
                                a.Zona = getZona(a);
                                Stops.Add(datos[0], a);
                            }
                        }
                    }
                    else
                    {
                        line = reader.ReadLine();
                    }

                    line = reader.ReadLine();
                }
                reader.Close();
            }
            catch (DirectoryNotFoundException dnf)
            {
                LoadDate.ErrorStop("No se encuentra el archivo stop");
                if (LoadDate.Estado == false)
                {
                    LoadDate.Hide();
                    LoadDate.DialogError();
                    LoadDate.ShowDialog();
                    LoadDate.Estado = true;
                }
            }


            catch (ArgumentException ae)
            {
                LoadDate.ErrorStop("Archivo equivocado de stop");
                if (LoadDate.Estado == false)
                {
                    LoadDate.DialogError();
                    LoadDate.ShowDialog();
                    LoadDate.Estado = true;
                }
            }
            catch (IndexOutOfRangeException ae)
            {
                LoadDate.ErrorStop("Archivo equivocado de stop");
                if (LoadDate.Estado == false)
                {
                    LoadDate.DialogError();
                    LoadDate.ShowDialog();
                    LoadDate.Estado = true;
                }
            }
        }