Пример #1
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** RMB - Recommended Minimum Navigation Information
            **                                                             14
            **        1 2   3 4    5    6       7 8        9 10  11  12  13|
            **        | |   | |    |    |       | |        | |   |   |   | |
            ** $--RMB,A,x.x,a,c--c,c--c,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,A*hh<CR><LF>
            **
            ** Field Number:
            **  1) Status, V = Navigation receiver warning
            **  2) Cross Track error - nautical miles
            **  3) Direction to Steer, Left or Right
            **  4) TO Waypoint ID
            **  5) FROM Waypoint ID
            **  6) Destination Waypoint Latitude
            **  7) N or S
            **  8) Destination Waypoint Longitude
            **  9) E or W
            ** 10) Range to destination in nautical miles
            ** 11) Bearing to destination in degrees True
            ** 12) Destination closing velocity in knots
            ** 13) Arrival Status, A = Arrival Circle Entered
            ** 14) Checksum
            */

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

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

            IsDataValid      = sentence.Boolean(1);
            CrossTrackError  = sentence.Double(2);
            DirectionToSteer = sentence.LeftOrRight(3);
            From             = sentence.Field(4);
            To = sentence.Field(5);
            DestinationPosition.Parse(6, 7, 8, 9, sentence);
            RangeToDestinationNauticalMiles = sentence.Double(10);
            BearingToDestinationDegreesTrue = sentence.Double(11);
            DestinationClosingVelocityKnots = sentence.Double(12);
            IsArrivalCircleEntered          = sentence.Boolean(13);

            int checksum_field_number = sentence.ChecksumFieldNumber();

            if (checksum_field_number == 15)
            {
                Mode = sentence.FAAMode(14);
            }
            else
            {
                Mode = FAAModeIndicator.Unknown;
            }

            return(true);
        }
Пример #2
0
        public override void Empty()
        {
            base.Empty();

            Velocity = 0.0D;
            To       = string.Empty;
            FAAMode  = FAAModeIndicator.Unknown;
        }
Пример #3
0
        public override void Empty()
        {
            base.Empty();

            UTCTime     = Response.GPSEpoch;
            IsDataValid = NMEA.Boolean.Unknown;
            Position.Empty();
            Mode = FAAModeIndicator.Unknown;
        }
Пример #4
0
        public void FAAModeTest()
        {
            var target       = new Sentence();         // TODO: Initialize to an appropriate value
            int field_number = 0;                      // TODO: Initialize to an appropriate value
            var expected     = new FAAModeIndicator(); // TODO: Initialize to an appropriate value
            var actual       = target.FAAMode(field_number);

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Пример #5
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** RMC - Recommended Minimum Navigation Information
            **                                                            12
            **        1         2 3       4 5        6 7   8   9    10  11|
            **        |         | |       | |        | |   |   |    |   | |
            ** $--RMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,xxxx,x.x,a*hh<CR><LF>
            **
            ** Field Number:
            **  1) UTC Time
            **  2) Status, V = Navigation receiver warning
            **  3) Latitude
            **  4) N or S
            **  5) Longitude
            **  6) E or W
            **  7) Speed over ground, knots
            **  8) Track made good, degrees true
            **  9) Date, ddmmyy
            ** 10) Magnetic Variation, degrees
            ** 11) E or W
            ** 12) Checksum
            */

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

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

            UTCTime     = sentence.DateTime(9, 1);
            IsDataValid = sentence.Boolean(2);
            Position.Parse(3, 4, 5, 6, sentence);
            SpeedOverGroundKnots       = sentence.Double(7);
            TrackMadeGoodDegreesTrue   = sentence.Double(8);
            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);
        }
Пример #6
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** BWC - Bearing and Distance to Waypoint
            ** Latitude, N/S, Longitude, E/W, UTC, Status
            **                                                       11
            **        1         2       3 4        5 6   7 8   9 10  | 12   13
            **        |         |       | |        | |   | |   | |   | |    |
            ** $--BWC,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x.x,T,x.x,M,x.x,N,c--c*hh<CR><LF>
            **
            **  1) UTCTime
            **  2) Waypoint Latitude
            **  3) N = North, S = South
            **  4) Waypoint Longitude
            **  5) E = East, W = West
            **  6) Bearing, True
            **  7) T = True
            **  8) Bearing, Magnetic
            **  9) M = Magnetic
            ** 10) Nautical Miles
            ** 11) N = Nautical Miles
            ** 12) Waypoint ID
            ** 13) Checksum
            */

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

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

            UTCTime = sentence.Time(1);
            Position.Parse(2, 3, 4, 5, sentence);
            BearingTrue           = sentence.Double(6);
            BearingMagnetic       = sentence.Double(8);
            DistanceNauticalMiles = sentence.Double(10);
            To = sentence.Field(12);

            int checksum_field_number = sentence.ChecksumFieldNumber();

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

            return(true);
        }
Пример #7
0
        public override void Empty()
        {
            base.Empty();

            TrackDegreesTrue       = 0.0D;
            TrackDegreesMagnetic   = 0.0D;
            SpeedKnots             = 0.0D;
            SpeedKilometersPerHour = 0.0D;

            Mode = FAAModeIndicator.Unknown;
        }
Пример #8
0
        public override void Empty()
        {
            base.Empty();

            IsLoranBlinkOK           = Boolean.Unknown;
            IsLoranCCycleLockOK      = Boolean.Unknown;
            CrossTrackErrorMagnitude = 0.0D;
            DirectionToSteer         = LeftOrRight.Unknown;
            CrossTrackUnits          = string.Empty;
            FAAMode = FAAModeIndicator.Unknown;
        }
Пример #9
0
        public override void Empty()
        {
            base.Empty();

            UTCTime     = Response.GPSEpoch;
            IsDataValid = NMEA.Boolean.Unknown;
            Position.Empty();
            Mode = FAAModeIndicator.Unknown;
            SpeedOverGroundKnots       = 0.0D;
            TrackMadeGoodDegreesTrue   = 0.0D;
            MagneticVariationDirection = EastOrWest.Unknown;
        }
Пример #10
0
        public override void Empty()
        {
            base.Empty();

            UTCTime = Response.GPSEpoch;
            Position.Empty();
            BearingTrue           = 0.0D;
            BearingMagnetic       = 0.0D;
            DistanceNauticalMiles = 0.0D;
            To      = string.Empty;
            FAAMode = FAAModeIndicator.Unknown;
        }
Пример #11
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** XTE - Cross-Track Error, Measured
            **
            **        1 2 3   4 5  6
            **        | | |   | |  |
            ** $--XTE,A,A,x.x,a,N,*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) Checksum
            */

            /*
            ** 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);

            int checksum_field_number = sentence.ChecksumFieldNumber();

            if (checksum_field_number == 7)
            {
                FAAMode = sentence.FAAMode(6);
            }
            else
            {
                FAAMode = FAAModeIndicator.Unknown;
            }

            return(true);
        }
Пример #12
0
        public override void Empty()
        {
            base.Empty();

            IsDataValid      = Boolean.Unknown;
            CrossTrackError  = 0.0D;
            DirectionToSteer = LeftOrRight.Unknown;
            To   = string.Empty;
            From = string.Empty;
            DestinationPosition.Empty();
            RangeToDestinationNauticalMiles = 0.0D;
            BearingToDestinationDegreesTrue = 0.0D;
            DestinationClosingVelocityKnots = 0.0D;
            IsArrivalCircleEntered          = Boolean.Unknown;
            Mode = NMEA.FAAModeIndicator.Unknown;
        }
Пример #13
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** VTG - Track made good and Ground speed
            **
            **        1   2 3   4 5	  6 7   8 9
            **        |   | |   | |	  | |   | |
            ** $--VTG,x.x,T,x.x,M,x.x,N,x.x,K*hh<CR><LF>
            **
            ** Field Number:
            **  1) Track Degrees
            **  2) T = True
            **  3) Track Degrees
            **  4) M = Magnetic
            **  5) Speed Knots
            **  6) N = Knots
            **  7) Speed Kilometers Per Hour
            **  8) K = Kilometers Per Hour
            **  9) Checksum
            */

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

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

            TrackDegreesTrue       = sentence.Double(1);
            TrackDegreesMagnetic   = sentence.Double(3);
            SpeedKnots             = sentence.Double(5);
            SpeedKilometersPerHour = sentence.Double(7);

            if (sentence.ChecksumFieldNumber() == 9)
            {
                Mode = sentence.FAAMode(8);
            }
            else
            {
                Mode = FAAModeIndicator.Unknown;
            }

            return(true);
        }
Пример #14
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** GLL - Geographic Position - Latitude/Longitude
            ** Latitude, N/S, Longitude, E/W, UTC, Status
            **
            **        1       2 3        4 5         6 7
            **        |       | |        | |         | |
            ** $--GLL,llll.ll,a,yyyyy.yy,a,hhmmss.ss,A*hh<CR><LF>
            **
            ** Field Number:
            **  1) Latitude
            **  2) N or S (North or South)
            **  3) Longitude
            **  4) E or W (East or West)
            **  5) Universal Time Coordinated (UTC)
            **  6) Status A - Data Valid, V - Data Invalid
            **  7) Checksum
            */

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

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

            Position.Parse(1, 2, 3, 4, sentence);
            UTCTime     = sentence.Time(5);
            IsDataValid = sentence.Boolean(6);

            if (sentence.ChecksumFieldNumber() == 8)
            {
                Mode = sentence.FAAMode(7);
            }
            else
            {
                Mode = FAAModeIndicator.Unknown;
            }

            return(true);
        }
Пример #15
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** WCV - Waypoint Closure Velocity
            **
            **        1   2 3    4
            **        |   | |    |
            ** $--WCV,x.x,N,c--c*hh<CR><LF>
            **
            ** Field Number:
            **  1) Velocity
            **  2) N = knots
            **  3) Waypoint ID
            **  4) Checksum
            */

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

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

            Velocity = sentence.Double(1);
            To       = sentence.Field(3);

            int checksum_field_number = sentence.ChecksumFieldNumber();

            if (checksum_field_number == 5)
            {
                FAAMode = sentence.FAAMode(4);
            }
            else
            {
                FAAMode = FAAModeIndicator.Unknown;
            }

            return(true);
        }