/// <summary> /// Event : SatelliteStatusUpdated /// If InViewCount is bigger than 0, SatelliteInformation is available /// </summary> /// <param name="sender">object</param> /// <param name="e">SatelliteStatusChangedEventArgs</param> public static void SatelliteSatelliteStatusUpdated(object sender, SatelliteStatusChangedEventArgs e) { try { /// <param name="ActiveCount">The number of active satellites.</param> /// <param name="InViewCount">The number of satellites in view.</param> /// <param name="Timestamp">The time at which the data has been extracted.</param> if (e.InViewCount > 0) { /// <summary> /// Satellites returns <IList> values /// ElementAt<SatelliteInformation>(0) used to check one of SatelliteInformation /// </summary> /// <param name="Azimuth">The azimuth value of the satellite in degrees.</param> /// <param name="Elevation">The elevation of the satellite in meters.</param> /// <param name="Prn">The PRN value of the satellite.</param> /// <param name="Snr">The SNR value of the satellite in dB.</param> /// <param name="Active">The flag signaling if the satellite is in use.</param> SatelliteInformation s = satellite.Satellites.ElementAt <SatelliteInformation>(0); textMessage.TextColor = Color.YellowGreen; textMessage.Text = "[Satellite] Success\n InViewCount : " + e.InViewCount + "\n Active : " + s.Active; } } catch (Exception ex) { /// Exception handling textMessage.Text = "[Satellite] Exception \n" + ex.Message; } }
/// <summary> /// Event : SatelliteStatusUpdated /// If InViewCount is bigger than 0, SatelliteInformation is available /// </summary> /// <param name="sender">object</param> /// <param name="e">SatelliteStatusChangedEventArgs</param> private void Satellite_SatelliteStatusUpdated(object sender, SatelliteStatusChangedEventArgs e) { try { /// <param name="ActiveCount">The number of active satellites.</param> /// <param name="InViewCount">The number of satellites in view.</param> /// <param name="Timestamp">The time at which the data has been extracted.</param> if (e.InViewCount > 0) { /// <summary> /// Satellites returns <IList> values /// ElementAt<SatelliteInformation>(0) used to check one of SatelliteInformation /// </summary> /// <param name="Azimuth">The azimuth value of the satellite in degrees.</param> /// <param name="Elevation">The elevation of the satellite in meters.</param> /// <param name="Prn">The PRN value of the satellite.</param> /// <param name="Snr">The SNR value of the satellite in dB.</param> /// <param name="Active">The flag signaling if the satellite is in use.</param> SatelliteInformation s = satellite.Satellites.ElementAt <SatelliteInformation>(0); textMessage.Text = "[Satellite]" + "\n Timestamp : " + e.Timestamp + "\n Active : " + e.ActiveCount + " , Inview : " + e.InViewCount + "\n azimuth[" + s.Azimuth + "] elevation[" + s.Elevation + "] prn[" + s.Prn + "]\n snr[" + s.Snr + "] active[" + s.Active + "]"; } else { /// ActiveCount and InViewCount are available when SatelliteSttatusUpdated event invoked. textMessage.Text = "[Satellite]" + "\n Timestamp : " + e.Timestamp + "\n Active : " + e.ActiveCount + " , Inview : " + e.InViewCount; } } catch (Exception ex) { /// Exception when location service is not available textMessage.Text = "[Satellite]\n Exception : " + ex.Message; } }