コード例 #1
0
        public VtgStandardGpsMessage(GpsMessage message)
            : base(StandardGpsMessageKind.Vtg)
        {
            // Example of data fields:
            // "0.0", "T", "", "M", "0.0", "N", "0.1", "K", "A"

            CourseOverGround = GpsValueParser.ParseNullableDouble(message.DataFields[0]);
            SpeedInKnots     = GpsValueParser.ParseNullableDouble(message.DataFields[4]);
            SpeedInKmPerH    = GpsValueParser.ParseNullableDouble(message.DataFields[6]);
            PositioningMode  = GpsValueParser.ParsePositioningMode(message.DataFields[8]);
        }
コード例 #2
0
        public TxtStandardGpsMessage(GpsMessage message)
            : base(StandardGpsMessageKind.Txt)
        {
            // Example of data fields:
            // "01", "01", "02", "ANTSTATUS=OK"

            NumberOfMessages = GpsValueParser.ParseNullableInt(message.DataFields[0]) ?? 1;
            SequenceNumber   = GpsValueParser.ParseNullableInt(message.DataFields[1]) ?? 1;
            Severity         = GpsValueParser.ParseTextMessageSeverity(message.DataFields[2]);
            TextMessage      = message.DataFields[3];
        }