コード例 #1
0
ファイル: GpsPosition.cs プロジェクト: ntj/GravurGIS
        /// <summary>
        /// Satellites in view
        /// </summary>
        /// <returns>Array of Satellites</returns>
        public Satellite[] GetSatellitesInView()
        {
            Satellite[] satellites = null;
            if (dwSatellitesInView != 0)
            {
                satellites = new Satellite[dwSatellitesInView];
                for (int index = 0; index < satellites.Length; index++)
                {
                    satellites[index]                = new Satellite();
                    satellites[index].Azimuth        = rgdwSatellitesInViewAzimuth[index];
                    satellites[index].Elevation      = rgdwSatellitesInViewElevation[index];
                    satellites[index].Id             = rgdwSatellitesInViewPRNs[index];
                    satellites[index].SignalStrength = rgdwSatellitesInViewSignalToNoiseRatio[index];
                }
            }

            return(satellites);
        }
コード例 #2
0
ファイル: GpsPosition.cs プロジェクト: ntj/GravurGIS
        /// <summary>
        /// Satellites used in the solution
        /// </summary>
        /// <returns>Array of Satellites</returns>
        public Satellite[] GetSatellitesInSolution()
        {
            Satellite[] inViewSatellites = GetSatellitesInView();
            ArrayList   list             = new ArrayList();

            for (int index = 0; index < dwSatelliteCount; index++)
            {
                Satellite found = null;
                for (int viewIndex = 0; viewIndex < inViewSatellites.Length && found == null; viewIndex++)
                {
                    if (rgdwSatellitesUsedPRNs[index] == inViewSatellites[viewIndex].Id)
                    {
                        found = inViewSatellites[viewIndex];
                        list.Add(found);
                    }
                }
            }

            return((Satellite[])list.ToArray(typeof(Satellite)));
        }