Example #1
0
        private void HandleGga(GgaStandardGpsMessage message, DateTime systemReceivedUtcDateTime)
        {
            LatestPosition = new PositionData(
                AdjustSystemUtc(systemReceivedUtcDateTime),
                message.Latitude,
                message.Longitude,
                message.FixStatus,
                message.NumberOfSatellites,
                message.HorizontalDilutioOfPrecision,
                message.Altitude,
                message.GeoIdSeparation,
                message.DgpsAge,
                message.DgpsStateId);

            if (LatestPosition.Latitude.HasValue &&
                LatestPosition.Longitude.HasValue &&
                LatestPosition.Altitude.HasValue)
            {
                _currentPosition = new SimplePosition(
                    LatestPosition.Latitude.Value,
                    LatestPosition.Longitude.Value,
                    LatestPosition.Altitude.Value);
            }

            OnPositionData?.Invoke(this, new PositionDataEventArgs(LatestPosition));
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="currentPosition">The fixed position.</param>
 public FixedPositionProvider(SimplePosition currentPosition)
 {
     Position = currentPosition;
 }