using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AprsSharp.Parsers.Aprs;
using Microsoft.VisualBasic;
using NmeaParser.Messages;

namespace skyscraper5.Aprs.AprsSharp
{
    internal class RawGpsInfoField : InfoField
    {
        public string RawMessage { get; private set; }

        public RawGpsInfoField(string msg)
            : base(msg)
        {
            this.RawMessage = msg;
            try
            {
	            Parsed = NmeaMessage.Parse(msg);
            }
            catch (Exception e)
            {
                Parsed = null;
            }
            
        }

        public NmeaMessage Parsed { get; private set; }

        public override string Encode()
        {
            return RawMessage;
        }
    }
}
