Exemplo n.º 1
0
        public GllStandardGpsMessage(GpsMessage message)
            : base(StandardGpsMessageKind.Gll)
        {
            // Example of data fields:
            // "3110.2908", "N", "12123.2348", "E", "041139.000", "A", "A"

            Latitude        = GpsValueParser.ParseLatitude(message.DataFields[0], message.DataFields[1]);
            Longitude       = GpsValueParser.ParseLongitude(message.DataFields[2], message.DataFields[3]);
            UtcTimeOfDay    = GpsValueParser.ParseUtcTime(message.DataFields[4]);
            DataValid       = message.DataFields[5] == "A";
            PositioningMode = GpsValueParser.ParsePositioningMode(message.DataFields[6]);
        }
        public RmcStandardGpsMessage(GpsMessage message)
            : base(StandardGpsMessageKind.Rmc)
        {
            // Example of data fields:
            // "013732.000", "A", "3150.7238", "N", "11711.7278", "E", "0.00", "0.00", "220413", "", "", "A"

            UtcDateTime      = GpsValueParser.ParseUtcDateTime(message.DataFields[8] + message.DataFields[0]);
            DataValid        = message.DataFields[1] == "A";
            Latitude         = GpsValueParser.ParseLatitude(message.DataFields[2], message.DataFields[3]);
            Longitude        = GpsValueParser.ParseLongitude(message.DataFields[4], message.DataFields[5]);
            Speed            = GpsValueParser.ParseNullableDouble(message.DataFields[6]);
            CourseOverGround = GpsValueParser.ParseNullableDouble(message.DataFields[7]);
            PositioningMode  = GpsValueParser.ParsePositioningMode(message.DataFields[11]);
        }