Exemple #1
0
        private void updateSatellitesDetails(string wordSatelliteID, string wordElevation,
                                             string wordAzimuth, string wordSignalToNoiseRatio)
        {
            if (wordSatelliteID != "")
            {
                int SatelliteID        = System.Convert.ToInt32(wordSatelliteID);
                int Elevation          = -1;
                int Azimuth            = -1;
                int SignalToNoiseRatio = -1;

                if (wordElevation != "")
                {
                    Elevation = Convert.ToInt32(wordElevation);
                }
                if (wordAzimuth != "")
                {
                    Azimuth = Convert.ToInt32(wordAzimuth);
                }
                if (wordSignalToNoiseRatio != "")
                {
                    SignalToNoiseRatio = Convert.ToInt32(wordSignalToNoiseRatio);
                }

                if (RecivedData.SatellitesDetails.ContainsKey(SatelliteID))
                {
                    Satellite s = (Satellite)RecivedData.SatellitesDetails[SatelliteID];
                    if (Elevation != -1)
                    {
                        s.Elevation = Elevation;
                    }
                    if (Azimuth != -1)
                    {
                        s.Azimuth = Azimuth;
                    }
                    if (SignalToNoiseRatio != -1)
                    {
                        s.SignalToNoiseRatio = SignalToNoiseRatio;
                    }
                }
                else
                {
                    RecivedData.SatellitesDetails[SatelliteID] = new Satellite(SatelliteID, Elevation, Azimuth, SignalToNoiseRatio);
                }
            }
        }