Exemple #1
0
        public virtual IList <GlobalsatPacket> SendTrackPackets(GhPacketBase.Train trackFile)
        {
            IList <GlobalsatPacket> sendTrackPackets = new List <GlobalsatPacket>();

            //Console.WriteLine("------ SendTrackStart()");
            GlobalsatPacket startPacket = PacketFactory.SendTrackStart(trackFile);

            sendTrackPackets.Add(startPacket);

            //Some protocols send laps in separate header
            //Use common code instead of overiding this method
            GlobalsatPacket lapPacket = PacketFactory.SendTrackLaps(trackFile);

            if (lapPacket != null)
            {
                sendTrackPackets.Add(lapPacket);
            }

            for (int i = 0; i < trackFile.TrackPoints.Count; i += startPacket.TrackPointsPerSection)
            {
                //Console.WriteLine("------ SendTrackSection()");
                GlobalsatPacket pointsPacket = PacketFactory.SendTrackSection(trackFile, i,
                                                                              Math.Min(i + startPacket.TrackPointsPerSection - 1, trackFile.TrackPoints.Count - 1));
                sendTrackPackets.Add(pointsPacket);
            }

            return(sendTrackPackets);
        }
Exemple #2
0
 //Called in SendTrack(), not really needed to set to exception
 public override IList <GlobalsatPacket> SendTrackPackets(GhPacketBase.Train train)
 {
     throw new FeatureNotSupportedException();
 }