示例#1
0
        public GPSData Clone()
        {
            GPSData NewInstance = new GPSData();

            NewInstance.Longitude = Longitude;
            NewInstance.Latitude  = Latitude;
            NewInstance.COG       = COG;
            NewInstance.SOG       = SOG;
            return(NewInstance);
        }
示例#2
0
        public GPSManager()
        {
            CurrentState  = new GPSData();
            DataSnapshots = new List <GPSData>();
            FirstRecord   = DateTime.UtcNow;
            NMEAParser.OnLocationUpdated  += new UpdateLocation(CurrentState.UpdateLocation);
            NMEAParser.OnCourseUpdated    += new UpdateCOG(CurrentState.UpdateSpeed);
            NMEAParser.OnSpeedUpdated     += new UpdateSOG(CurrentState.UpdateCourse);
            NMEAParser.OnHeadingUpdated   += new UpdateHDT(CurrentState.UpdateHeading);
            NMEAParser.OnSatelliteUpdated += new UpdateSat(CurrentState.UpdateSateliteCount);

            Tick          = new Timer();
            Tick.Interval = 1000;
            Tick.Tick    += OnTick;
            Tick.Start();
        }