예제 #1
0
        private void HandleVtg(VtgStandardGpsMessage message, DateTime systemReceivedUtcDateTime)
        {
            LatestMovement = new MovementData(
                AdjustSystemUtc(systemReceivedUtcDateTime),
                message.CourseOverGround,
                message.SpeedInKnots,
                message.SpeedInKmPerH,
                message.PositioningMode);

            OnMovementData?.Invoke(this, new MovementDataEventArgs(LatestMovement));
        }
예제 #2
0
        private GpsManager(SerialDevice serialDevice)
        {
            _serialDevice = serialDevice;
            _serialDevice.WriteTimeout = TimeSpan.FromSeconds(1);
            _serialDevice.ReadTimeout  = TimeSpan.FromSeconds(1);
            _serialDevice.BaudRate     = 9600;
            _serialDevice.Parity       = SerialParity.None;
            _serialDevice.StopBits     = SerialStopBitCount.One;
            _serialDevice.DataBits     = 8;

            _gpsMessageHandler = new GpsMessageHandler(_serialDevice);
            _gpsMessageHandler.OnCustomMessage   += HandleCustomMessage;
            _gpsMessageHandler.OnStandardMessage += HandleStandardMessage;

            LatestPosition = new PositionData(AdjustedUtcNow, null, null, GgaFixStatus.Unknown, null, null, null, null, null, null);
            LatestMovement = new MovementData(AdjustedUtcNow, null, null, null, GpsPositioningMode.Unknown);
        }
예제 #3
0
 public MovementDataEventArgs(MovementData movement)
 {
     Movement = movement;
 }