Ejemplo n.º 1
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** RMA - Recommended Minimum Navigation Information
            **                                                    12
            **        1 2       3 4        5 6   7   8   9   10  11|
            **        | |       | |        | |   |   |   |   |   | |
            ** $--RMA,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,x.x,x.x,a*hh<CR><LF>
            **
            ** Field Number:
            **  1) Blink Warning
            **  2) Latitude
            **  3) N or S
            **  4) Longitude
            **  5) E or W
            **  6) Time Difference A, uS
            **  7) Time Difference B, uS
            **  8) Speed Over Ground, Knots
            **  9) Track Made Good, degrees true
            ** 10) Magnetic Variation, degrees
            ** 11) E or W
            ** 12) Checksum
            */

            /*
            ** First we check the checksum...
            */

            if (sentence.IsChecksumBad() == Boolean.True)
            {
                Empty();
                return(false);
            }

            IsDataValid = sentence.Boolean(1);
            Position.Parse(2, 3, 4, 5, sentence);
            TimeDifferenceA            = sentence.Double(6);
            TimeDifferenceB            = sentence.Double(7);
            SpeedOverGroundKnots       = sentence.Double(8);
            TrackMadeGoodDegreesTrue   = sentence.Double(9);
            MagneticVariation          = sentence.Double(10);
            MagneticVariationDirection = sentence.EastOrWest(11);

            int checksum_field_number = sentence.ChecksumFieldNumber();

            if (checksum_field_number == 13)
            {
                Mode = sentence.FAAMode(12);
            }
            else
            {
                Mode = FAAModeIndicator.Unknown;
            }

            return(true);
        }
Ejemplo n.º 2
0
        public override void Empty()
        {
            base.Empty();

            IsDataValid = Boolean.Unknown;
            Position.Empty();
            TimeDifferenceA            = 0.0D;
            TimeDifferenceB            = 0.0D;
            SpeedOverGroundKnots       = 0.0D;
            TrackMadeGoodDegreesTrue   = 0.0D;
            MagneticVariation          = 0.0D;
            MagneticVariationDirection = EastOrWest.Unknown;
            Mode = NMEA.FAAModeIndicator.Unknown;
        }
Ejemplo n.º 3
0
        public override void Empty()
        {
            base.Empty();

            IsLoranBlinkOK                  = NMEA.Boolean.Unknown;
            IsLoranCCycleLockOK             = NMEA.Boolean.Unknown;
            CrossTrackErrorMagnitude        = 0.0D;
            DirectionToSteer                = NMEA.LeftOrRight.Unknown;
            CrossTrackUnits                 = string.Empty;
            IsArrivalCircleEntered          = NMEA.Boolean.Unknown;
            IsPerpendicular                 = NMEA.Boolean.Unknown;
            BearingOriginToDestination      = 0.0D;
            BearingOriginToDestinationUnits = string.Empty;
            To = string.Empty;
            BearingPresentPositionToDestination      = 0.0D;
            BearingPresentPositionToDestinationUnits = string.Empty;
            HeadingToSteer      = 0.0D;
            HeadingToSteerUnits = string.Empty;
            FAAMode             = NMEA.FAAModeIndicator.Unknown;
        }
Ejemplo n.º 4
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** APB - Autopilot Sentence "B"
            **                                         13    15
            **        1 2 3   4 5 6 7 8   9 10   11  12|   14|
            **        | | |   | | | | |   | |    |   | |   | |
            ** $--APB,A,A,x.x,a,N,A,A,x.x,a,c--c,x.x,a,x.x,a*hh<CR><LF>
            **
            **  1) Status
            **     V = LORAN-C Blink or SNR warning
            **     V = general warning flag or other navigation systems when a reliable
            **         fix is not available
            **  2) Status
            **     V = Loran-C Cycle Lock warning flag
            **     A = OK or not used
            **  3) Cross Track Error Magnitude
            **  4) Direction to steer, L or R
            **  5) Cross Track Units, N = Nautical Miles
            **  6) Status
            **     A = Arrival Circle Entered
            **  7) Status
            **     A = Perpendicular passed at waypoint
            **  8) Bearing origin to destination
            **  9) M = Magnetic, T = True
            ** 10) Destination Waypoint ID
            ** 11) Bearing, present position to Destination
            ** 12) M = Magnetic, T = True
            ** 13) Heading to steer to destination waypoint
            ** 14) M = Magnetic, T = True
            ** 15) Checksum or FAA Mode Indicator
            ** 16) Checksum if FAA Mode Indicator is present
            */

            // 2005-02-24, according to http://gpsd.berlios.de/NMEA.txt, NMEA added another field to the sentence

            /*
            ** First we check the checksum...
            */

            if (sentence.IsChecksumBad() == Boolean.True)
            {
                Empty();
                return(false);
            }

            IsLoranBlinkOK                  = sentence.Boolean(1);
            IsLoranCCycleLockOK             = sentence.Boolean(2);
            CrossTrackErrorMagnitude        = sentence.Double(3);
            DirectionToSteer                = sentence.LeftOrRight(4);
            CrossTrackUnits                 = sentence.Field(5);
            IsArrivalCircleEntered          = sentence.Boolean(6);
            IsPerpendicular                 = sentence.Boolean(7);
            BearingOriginToDestination      = sentence.Double(8);
            BearingOriginToDestinationUnits = sentence.Field(9);
            To = sentence.Field(10);
            BearingPresentPositionToDestination      = sentence.Double(11);
            BearingPresentPositionToDestinationUnits = sentence.Field(12);
            HeadingToSteer      = sentence.Double(13);
            HeadingToSteerUnits = sentence.Field(14);

            if (sentence.GetNumberOfDataFields() == 16)
            {
                // Parse here...
                FAAMode = sentence.FAAMode(15);
            }
            else
            {
                FAAMode = FAAModeIndicator.Unknown;
            }

            return(true);
        }