示例#1
0
文件: WPL.cs 项目: SammyB428/NMEA
        public override bool Parse(Sentence sentence)
        {
            /*
            ** WPL - Waypoint Location
            **
            **        +-------------------------------- 1) Latitude
            **        |       +------------------------ 2) N or S (North or South)
            **        |       | +---------------------- 3) Longitude
            **        |       | |        +------------- 4) E or W (East or West)
            **        |       | |        | +----------- 5) Waypoint name
            **        |       | |        | |    +-------6) Checksum
            **        |       | |        | |    |
            ** $--WPL,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
            */

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

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

            Position.Parse(1, 2, 3, 4, sentence);
            To = sentence.Field(5);

            return(true);
        }
示例#2
0
文件: RMB.cs 项目: SammyB428/NMEA
        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);
        }
示例#3
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** xxx - Waypoint location
            **
            **        1         2       3 4        5 6    7
            **        |         |       | |        | |    |
            ** $--xxx,hhmmss.ss,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
            **
            ** Field Number:
            **  1) UTC Time
            **  2) Latitude
            **  3) N or S (North or South)
            **  4) Longitude
            **  5) E or W (East or West)
            **  6) Waypoint name
            **  7) 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);
            Waypoint = sentence.Field(6);

            return(true);
        }
示例#4
0
文件: BEC.cs 项目: SammyB428/NMEA
        public override bool Parse(Sentence sentence)
        {
            /*
            ** BEC - Bearing & Distance to Waypoint - Dead Reckoning
            **                                                         12
            **        1         2       3 4        5 6   7 8   9 10  11|    13
            **        |         |       | |        | |   | |   | |   | |    |
            ** $--BEC,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x.x,T,x.x,M,x.x,N,c--c*hh<CR><LF>
            */

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

            return(true);
        }
示例#5
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** GGA - Global Positioning System Fix Data
            ** Time, Position and fix related data fora GPS receiver.
            **
            **                                                      11
            **        1         2       3 4        5 6 7  8   9  10 |  12 13  14   15
            **        |         |       | |        | | |  |   |   | |   | |   |    |
            ** $--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh<CR><LF>
            **
            ** Field Number:
            **  1) Universal Time Coordinated (UTC)
            **  2) Latitude
            **  3) N or S (North or South)
            **  4) Longitude
            **  5) E or W (East or West)
            **  6) GPS Quality Indicator,
            **     0 - fix not available,
            **     1 - GPS fix,
            **     2 - Differential GPS fix
            **  7) Number of satellites in view, 00 - 12
            **  8) Horizontal Dilution of precision
            **  9) Antenna Altitude above/below mean-sea-level (geoid)
            ** 10) Units of antenna altitude, meters
            ** 11) Geoidal separation, the difference between the WGS-84 earth
            **     ellipsoid and mean-sea-level (geoid), "-" means mean-sea-level
            **     below ellipsoid
            ** 12) Units of geoidal separation, meters
            ** 13) Age of differential GPS data, time in seconds since last SC104
            **     type 1 or 9 update, null field when DGPS is not used
            ** 14) Differential reference station ID, 0000-1023
            ** 15) 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);
            GPSQuality = sentence.Integer(6);
            NumberOfSatellitesInUse         = sentence.Integer(7);
            HorizontalDilutionOfPrecision   = sentence.Double(8);
            AntennaAltitudeMeters           = sentence.Double(9);
            GeoidalSeparationMeters         = sentence.Double(11);
            AgeOfDifferentialGPSDataSeconds = sentence.Double(13);
            DifferentialReferenceStationID  = sentence.Integer(14);

            return(true);
        }
示例#6
0
文件: RMC.cs 项目: SammyB428/NMEA
        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);
        }
示例#7
0
文件: BWC.cs 项目: SammyB428/NMEA
        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);
        }
示例#8
0
        public void ParseTest()
        {
            var      target = new LatLong();           // TODO: Initialize to an appropriate value
            int      LatitudePostionFieldNumber   = 0; // TODO: Initialize to an appropriate value
            int      NorthingFieldNumber          = 0; // TODO: Initialize to an appropriate value
            int      LongitudePositionFieldNumber = 0; // TODO: Initialize to an appropriate value
            int      EastingFieldNumber           = 0; // TODO: Initialize to an appropriate value
            Sentence LineToParse = null;               // TODO: Initialize to an appropriate value
            bool     expected    = false;              // TODO: Initialize to an appropriate value
            bool     actual      = target.Parse(LatitudePostionFieldNumber, NorthingFieldNumber, LongitudePositionFieldNumber, EastingFieldNumber, LineToParse);

            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
示例#9
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** TRF - TRANSIT Fix Data
            **                                                                    13
            **        1         2      3       4 5        6 7   8   9   10  11  12|
            **        |         |      |       | |        | |   |   |   |   |   | |
            ** $--TRF,hhmmss.ss,xxxxxx,llll.ll,a,yyyyy.yy,a,x.x,x.x,x.x,x.x,xxx,A*hh<CR><LF>
            **
            ** Field Number:
            **  1) UTC Time
            **  2) Date, ddmmyy
            **  3) Latitude
            **  4) N or S
            **  5) Longitude
            **  6) E or W
            **  7) Elevation Angle
            **  8) Number of iterations
            **  9) Number of Doppler intervals
            ** 10) Update distance, nautical miles
            ** 11) Satellite ID
            ** 12) Data Validity
            ** 13) Checksum
            */

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

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

            UTCTime = sentence.DateTime(2, 1);
            Position.Parse(3, 4, 5, 6, sentence);
            ElevationAngle              = sentence.Double(7);
            NumberOfIterations          = sentence.Double(8);
            NumberOfDopplerIntervals    = sentence.Double(9);
            UpdateDistanceNauticalMiles = sentence.Double(10);
            SatelliteID = sentence.Integer(11);
            IsDataValid = sentence.Boolean(12);

            return(true);
        }
示例#10
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);
        }
示例#11
0
        public override bool Parse(Sentence sentence)
        {
            /*
            ** IMA - Vessel Identification
            **                                                              11    13
            **        1            2       3       4 5        6 7   8 9   10|   12|
            **        |            |       |       | |        | |   | |   | |   | |
            ** $--IMA,aaaaaaaaaaaa,aaaxxxx,llll.ll,a,yyyyy.yy,a,x.x,T,x.x,M,x.x,N*hh<CR><LF>
            **
            **  1) Twelve character vessel name
            **  2) Radio Call Sign
            **  3) Latitude
            **  4) North/South
            **  5) Longitude
            **  6) East/West
            **  7) Heading, degrees true
            **  8) T = True
            **  9) Heading, degrees magnetic
            ** 10) M = Magnetic
            ** 11) Speed
            ** 12) N = Knots
            ** 13) Checksum
            */

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

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

            VesselName = sentence.Field(1);
            Callsign   = sentence.Field(2);
            Position.Parse(3, 4, 5, 6, sentence);
            HeadingDegreesTrue     = sentence.Double(7);
            HeadingDegreesMagnetic = sentence.Double(9);
            SpeedKnots             = sentence.Double(11);

            return(true);
        }
示例#12
0
文件: GXA.cs 项目: SammyB428/NMEA
        public override bool Parse(Sentence sentence)
        {
            /*
            ** GXA - TRANSIT Position - Latitude/Longitude
            ** Location and time of TRANSIT fix at waypoint
            **
            **        1         2       3 4        5 6    7 8
            **        |         |       | |        | |    | |
            ** $--GXA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,c--c,X*hh<CR><LF>
            **
            ** 1) UTC of position fix
            ** 2) Latitude
            ** 3) East or West
            ** 4) Longitude
            ** 5) North or South
            ** 6) Waypoint ID
            ** 7) Satelite number
            ** 8) Checksum
            */

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

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

            UTCTime = sentence.Time(1);
            Position.Parse(2, 3, 4, 5, sentence);
            WaypointID      = sentence.Field(6);
            SatelliteNumber = sentence.Integer(7);

            return(true);
        }