示例#1
0
        /// <summary>
        /// GetHeaderFromZip
        /// </summary>
        /// <param name="zipFilePath"></param>
        /// <returns></returns>
        public IgcDocumentHeader GetHeaderFromZip(string zipFilePath)
        {
            IgcDocumentHeader header = null;

            using (var file = File.OpenRead(zipFilePath))
                using (var zip = new ZipArchive(file, ZipArchiveMode.Read))
                {
                    var firstEntry = zip.Entries[0];
                    var stream     = firstEntry.Open();
                    header = IgcDocumentHeader.Load(stream);
                }
            return(header);
        }
示例#2
0
        public void Read_header_from_2bff3xl1_igc_succeeds()
        {
            var path   = @"Data/2bff3xl1.igc";
            var header = IgcDocumentHeader.Load(path);

            Assert.AreEqual(header.Date, new DateTime(2012, 11, 15));
            Assert.AreEqual(header.Accuracy, 100);
            Assert.AreEqual(header.PilotInCharge, "BERND_FABIAN");
            Assert.AreEqual(header.GliderId, "D_KUEL");
            Assert.AreEqual(header.GliderType, "VENTUS2CM18");
            Assert.AreEqual(header.CompetitionId, "D1");
            //Assert.AreEqual(header.CompetitionClass, "18M_FAI*");
            Assert.AreEqual(header.GPS, "FDK/GSU-14");
            Assert.AreEqual(header.FirmwareVersion, "5.1");
            Assert.AreEqual(header.HardwareVersion, "2.1");
            Assert.AreEqual(header.GpsDatum, 100);
            Assert.AreEqual(header.FlightRecorder, "FILSER,LX20");
        }
示例#3
0
        public void Read_header_from_simple_igc_succeeds()
        {
            var path   = @"Data/Simple.igc";
            var header = IgcDocumentHeader.Load(path);

            Assert.AreEqual(header.Date, new DateTime(2001, 7, 16));
            Assert.AreEqual(header.Accuracy, 35);
            Assert.AreEqual(header.PilotInCharge, "Bloggs Bill D");
            Assert.AreEqual(header.CrewMember, "Smith-Barry John A");
            Assert.AreEqual(header.GliderId, "ABCD-1234");
            Assert.AreEqual(header.GliderType, "Schleicher ASH-25");
            Assert.AreEqual(header.CompetitionId, "XYZ-78910");
            Assert.AreEqual(header.CompetitionClass, "15m Motor Glider");
            Assert.AreEqual(header.GPS, "Superstar,12ch, max10000m");
            Assert.AreEqual(header.FirmwareVersion, "6.4");
            Assert.AreEqual(header.HardwareVersion, "3.0");
            Assert.AreEqual(header.GpsDatum, 100);
            Assert.AreEqual(header.PressureAltitudeSensor, "Sensyn, XYZ1111, max11000m");
            Assert.AreEqual(header.FlightRecorder, "Manufacturer, Model");
        }
示例#4
0
        public IgcDocumentHeader GetHeader(string filePath)
        {
            var header = IgcDocumentHeader.Load(filePath);

            return(header);
        }
示例#5
0
        /// <summary>
        /// GetHeaderFromStream
        /// </summary>
        /// <param name="igcStream"></param>
        /// <returns></returns>
        public IgcDocumentHeader GetHeaderFromStream(Stream igcStream)
        {
            var header = IgcDocumentHeader.Load(igcStream);

            return(header);
        }