Пример #1
0
            public Content4PhysicalFile(string file) : base(file)
            {
                FileInfo fo = new FileInfo(file);

                Filelength   = fo.Length;
                FileDateTime = fo.LastWriteTime;
                BinaryReader = new GarminCore.BinaryReaderWriter(Filename, true, false, false);
                if (Extension.ToUpper() == ".IMG")
                {
                    SimpleFilesystem = new GarminCore.DskImg.SimpleFilesystem();
                    SimpleFilesystem.Read(BinaryReader);
                }
                else
                {
                    SimpleFilesystem = null;
                }
            }
Пример #2
0
        void CloseTabPage()
        {
            if (tabControl1.TabPages.Count > 0)
            {
                if (MessageBox.Show("Would you like to Close this Tab?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    TabPage page = tabControl1.SelectedTab;
                    tabControl1.TabPages.Remove(page);

                    // ev. geöffnete Dateien schließen
                    TabPageData tpd = TabPageData4Page(page);
                    if (tpd != null)
                    {
                        foreach (TreeNode tn in tpd.Tv.Nodes) // alle TreeNodes der 1. Ebene untersuchen
                        {
                            NodeContent nc = Data.NodeContent4TreeNode(tn);
                            GarminCore.BinaryReaderWriter br = null;
                            switch (nc.Type)
                            {
                            case NodeContent.NodeType.PhysicalFile:
                            case NodeContent.NodeType.LogicalFile:
                                br = (nc.Data as NodeContent.Content4File).BinaryReader;
                                break;
                            }
                            if (br != null)
                            {
                                br.Dispose();
                            }
                        }

                        for (int i = RecentUsedPaths.Count - 1; i >= 0; i--)
                        {
                            if (RecentUsedPaths[i] == tpd.Path)
                            {
                                RecentUsedPaths.RemoveAt(i);
                            }
                        }
                        RecentUsedPaths.Insert(0, tpd.Path);
                    }
                }
            }
        }
Пример #3
0
        static void Run(string symbolname, string srcfile, string dstpath, IList <int> zoomlevel, bool overwrite)
        {
            Console.Error.WriteLine("Symbolname: " + symbolname);
            Console.Error.WriteLine("File:       " + srcfile);
            Console.Error.WriteLine("Outputpath: " + dstpath);

            if (!File.Exists(srcfile))
            {
                throw new Exception("File '" + srcfile + "' not exist.");
            }

            string extension = Path.GetExtension(srcfile).ToUpper();

            if (extension == ".DEM")
            {
                using (GarminCore.BinaryReaderWriter dembr = new GarminCore.BinaryReaderWriter(srcfile, true)) {
                    CalculateDem(dembr, dstpath, Path.GetFileNameWithoutExtension(srcfile), overwrite, symbolname, zoomlevel);
                }
            }
            else if (extension == ".IMG")
            {
                GarminCore.DskImg.SimpleFilesystem sf = new GarminCore.DskImg.SimpleFilesystem();
                using (GarminCore.BinaryReaderWriter br = new GarminCore.BinaryReaderWriter(srcfile, true)) {
                    sf.Read(br);

                    for (int i = 0; i < sf.FileCount; i++)
                    {
                        string filename = sf.Filename(i);
                        if (Path.GetExtension(filename).ToUpper() == ".DEM")
                        {
                            using (GarminCore.BinaryReaderWriter dembr = sf.GetBinaryReaderWriter4File(filename)) {
                                CalculateDem(dembr, dstpath, Path.GetFileNameWithoutExtension(filename), overwrite, symbolname, zoomlevel);
                            }
                        }
                    }
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Knoten für eine logische oder physische TRE-Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_TRE tre, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, tre, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, tre, "Garmin TRE-Header"));
            if (tre.MapDescriptionList.Count > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_DescriptionList, tre, "DescriptionBlock"));
            }
            if (tre.MaplevelBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_MaplevelBlock, tre, "MaplevelList"));
            }
            if (tre.SubdivisionBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_SubdivisionBlock, tre, "SubdivisionBlock"));
            }
            if (tre.CopyrightBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_CopyrightBlock, tre, "CopyrightBlock"));
            }
            if (tre.LineOverviewBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_LineOverviewBlock, tre, "LineOverviewBlock"));
            }
            if (tre.AreaOverviewBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_AreaOverviewBlock, tre, "AreaOverviewBlock"));
            }
            if (tre.PointOverviewBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_PointOverviewBlock, tre, "PointOverviewBlock"));
            }
            if (tre.ExtTypeOffsetsBlock != null && tre.ExtTypeOffsetsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_ExtTypeOffsetsBlock, tre, "ExtTypeOffsetsBlock"));
            }
            if (tre.ExtTypeOverviewsBlock != null && tre.ExtTypeOverviewsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_ExtTypeOverviewsBlock, tre, "ExtTypeOverviewsBlock"));
            }
            if (tre.UnknownBlock_xAE != null && tre.UnknownBlock_xAE.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_UnknownBlock_xAE, tre, "UnknownBlock_xAE"));
            }
            if (tre.UnknownBlock_xBC != null && tre.UnknownBlock_xBC.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_UnknownBlock_xBC, tre, "UnknownBlock_xBC"));
            }
            if (tre.UnknownBlock_xE3 != null && tre.UnknownBlock_xE3.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.TRE_UnknownBlock_xE3, tre, "UnknownBlock_xE3"));
            }
        }
Пример #5
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.File_MPS mps, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.MPS_MapEntry, mps, "MapEntrys"));
        }
Пример #6
0
        /// <summary>
        /// Knoten für eine logische oder physische RGN-Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="rgn">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_RGN rgn, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, rgn, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, rgn, "Garmin RGN-Header"));

            if (rgn.PostHeaderDataBlock != null && rgn.PostHeaderDataBlock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.RGN_PostHeaderData, rgn, "PostHeaderDataBlock");
            }
            if (rgn.SubdivContentBlock != null && rgn.SubdivContentBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.RGN_SubdivContentBlock, rgn, "SubdivContentBlock"));
            }
            if (rgn.ExtAreasBlock != null && rgn.ExtAreasBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.RGN_ExtAreasBlock, rgn, "ExtAreasBlock"));
            }
            if (rgn.ExtLinesBlock != null && rgn.ExtLinesBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.RGN_ExtLinesBlock, rgn, "ExtLinesBlock"));
            }
            if (rgn.ExtPointsBlock != null && rgn.ExtPointsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.RGN_ExtPointsBlock, rgn, "ExtPointsBlock"));
            }
            if (rgn.UnknownBlock_0x71 != null && rgn.UnknownBlock_0x71.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.RGN_UnknownBlock_0x71, rgn, "UnknownBlock 0x71");
            }
        }
Пример #7
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.File_TDB tdb, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);
            bool TilemapNodeExist = false;

            for (int i = 0; i < tdb.BlockHeaderTypList.Count; i++)
            {
                switch (tdb.BlockHeaderTypList[i])
                {
                case GarminCore.Files.File_TDB.BlockHeader.Typ.Copyright:
                    AppendNode(AppendNode(tn, NodeContent.NodeType.TDB_Copyright, tdb, "Copyright"));
                    break;

                case GarminCore.Files.File_TDB.BlockHeader.Typ.Crc:
                    AppendNode(tn, NodeContent.NodeType.TDB_Crc, tdb, "Crc");
                    break;

                case GarminCore.Files.File_TDB.BlockHeader.Typ.Description:
                    AppendNode(tn, NodeContent.NodeType.TDB_Description, tdb, "Description");
                    break;

                case GarminCore.Files.File_TDB.BlockHeader.Typ.Header:
                    AppendNode(tn, NodeContent.NodeType.TDB_Header, tdb, "Header");
                    break;

                case GarminCore.Files.File_TDB.BlockHeader.Typ.Overviewmap:
                    AppendNode(tn, NodeContent.NodeType.TDB_Overviewmap, tdb, "Overviewmap");
                    break;

                case GarminCore.Files.File_TDB.BlockHeader.Typ.Tilemap:
                    if (!TilemapNodeExist)
                    {
                        AppendNode(AppendNode(tn, NodeContent.NodeType.TDB_Tilemap, tdb, "Tilemaps"));
                        TilemapNodeExist = true;
                    }
                    break;

                default:
                    AppendNode(tn, NodeContent.NodeType.TDB_Unknown, tdb, "Unknown");
                    break;
                }
            }
        }
Пример #8
0
        public AllSubdivInfo(GarminCore.Files.StdFile_RGN rgn, GarminCore.BinaryReaderWriter binreader, int subdividx)
        {
            this.subdividx = subdividx;
            this.binreader = binreader;
            this.rgn       = rgn;

            SubdivData = rgn.SubdivList[subdividx];

            int offsets = 0; // Anzahl der 2-Byte-Offsets (die erste Objektart benötigt keinen Offset)

            if (rgn.TREFile != null &&
                rgn.TREFile.SubdivInfoList.Count == rgn.SubdivList.Count)
            {
                SubdivfInfo = rgn.TREFile.SubdivInfoList[subdividx];

                // ACHTUNG: Es kann offensichtlich "leere" Listen geben, d.h. es ist ein Objekttyp in SubdivfInfo angegeben, aber in SubdivData ex. keine Daten.
                //          Deshalb kann die Offsetliste Objektlistengrößen ermittelt werden.

                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.poi) != 0)
                {
                    offsets++;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.idxpoi) != 0)
                {
                    offsets++;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.line) != 0)
                {
                    offsets++;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.area) != 0)
                {
                    offsets++;
                }
                OffsetContent = new GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent[offsets];

                int i = 0;
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.poi) != 0)
                {
                    OffsetContent[i++] = GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.poi;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.idxpoi) != 0)
                {
                    OffsetContent[i++] = GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.idxpoi;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.line) != 0)
                {
                    OffsetContent[i++] = GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.line;
                }
                if ((SubdivfInfo.Content & GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.area) != 0)
                {
                    OffsetContent[i++] = GarminCore.Files.StdFile_TRE.SubdivInfoBasic.SubdivContent.area;
                }

                // Offsettabelle füllen
                OffsetTab = new ushort[offsets];
                if (offsets > 0)
                {
                    OffsetTab[0] = (ushort)(2 * (OffsetTab.Length - 1));
                }

                binreader.Seek(rgn.SubdivContentBlock.Offset + SubdivfInfo.Data.Offset);
                for (int j = 1; j < offsets; j++)
                {
                    OffsetTab[j] = binreader.Read2AsUShort();
                }
            }

            int count = 0;

            for (int i = 0; i < rgn.TREFile.MaplevelList.Count; i++)
            {
                count += rgn.TREFile.MaplevelList[i].SubdivInfos;
                if (subdividx < count)
                {
                    MaplevelNo = i;
                    break;
                }
            }
        }
Пример #9
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_TYP typ, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, typ, "Garmin Common Header"));
            AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, typ, "Garmin TYP-Header");

            if (typ.PointTableBlock.Count > 0)
            {
                TreeNode tn2 = AppendNode(tn, NodeContent.NodeType.TYP_PointTableBlock, typ, "PointTableBlock");
                AppendNode(AppendNode(tn2, NodeContent.NodeType.TYP_PointTable, typ, "PointTable"));
            }
            if (typ.PolylineTableBlock.Count > 0)
            {
                TreeNode tn2 = AppendNode(tn, NodeContent.NodeType.TYP_PolylineTableBlock, typ, "PolylineTableBlock");
                AppendNode(AppendNode(tn2, NodeContent.NodeType.TYP_PolylineTable, typ, "PolylineTable"));
            }
            if (typ.PolygoneTableBlock.Count > 0)
            {
                TreeNode tn2 = AppendNode(tn, NodeContent.NodeType.TYP_PolygoneTableBlock, typ, "PolygoneTableBlock");
                AppendNode(AppendNode(tn2, NodeContent.NodeType.TYP_PolygoneTable, typ, "PolygoneTable"));
            }
            AppendNode(AppendNode(tn, NodeContent.NodeType.TYP_PolygoneDraworderTable, typ, "PolygoneDraworderTable"));

            if (typ.NT_PointTableBlock.Count > 0)
            {
                AppendNode(tn, NodeContent.NodeType.TYP_NT_PointDatabtable, typ, "NT PointDatabtable");
            }
            if (typ.NT_PointDatablock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.TYP_NT_PointDatablock, typ, "NT PointDatablock");
            }
            if (typ.NT_PointLabelblock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.TYP_NT_PointLabelblock, typ, "NT PointLabelblock");
            }
            if (typ.NT_LabelblockTable1.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.TYP_NT_LabelblockTable1, typ, "NT LabelblockTable1");
            }
            if (typ.NT_LabelblockTable2.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.TYP_NT_LabelblockTable2, typ, "NT LabelblockTable2");
            }
        }
Пример #10
0
        /// <summary>
        /// liefert einen <see cref="GarminCore.BinaryReaderWriter"/> für die DEM-Datei
        /// </summary>
        /// <param name="dembr"></param>
        /// <param name="outpath">Ausgabepfad</param>
        /// <param name="basefilename"></param>
        /// <param name="overwrite"></param>
        /// <param name="symbolname"></param>
        /// <param name="zoomlevel"></param>
        static void CalculateDem(GarminCore.BinaryReaderWriter dembr, string outpath, string basefilename, bool overwrite, string symbolname, IList <int> zoomlevel)
        {
            GarminCore.Files.StdFile_DEM dem = new GarminCore.Files.StdFile_DEM();
            dem.Read(dembr);
            Console.WriteLine("-> " + basefilename + ".DEM with " + dem.ZoomlevelCount.ToString() + " zoomlevels");

            if (!Directory.Exists(outpath))
            {
                Directory.CreateDirectory(outpath);
            }

            string protfile = Path.Combine(outpath, basefilename + ".txt");

            if (File.Exists(protfile))
            {
                if (!overwrite)
                {
                    throw new Exception("Error: File '" + protfile + "' exists.");
                }
                else
                {
                    File.Delete(protfile);
                }
            }

            using (StreamWriter file = new StreamWriter(protfile)) {
                file.WriteLine(dem.ZoomlevelCount.ToString() + " zoomlevel");

                List <double> lon = new List <double>();
                List <double> lat = new List <double>();

                for (int zl = 0; zl < dem.ZoomlevelCount; zl++)
                {
                    bool used = false;
                    for (int i = 0; i < zoomlevel.Count; i++)
                    {
                        if (zoomlevel[i] == zl)
                        {
                            used = true;
                            break;
                        }
                    }
                    if (used)
                    {
                        GarminCore.Files.DEM.ZoomlevelTableitem record = dem.ZoomLevel[zl].ZoomlevelItem;

                        double west    = record.West;
                        double north   = record.North;
                        double ptdisth = record.PointDistanceHoriz;
                        double ptdistv = record.PointDistanceVert;

                        file.WriteLine("");
                        file.WriteLine("zoomlevel " + zl.ToString());
                        file.WriteLine("{0}x{1} tiles", record.MaxIdxHoriz + 1, record.MaxIdxVert + 1);
                        file.WriteLine("height {0} ... {1}", record.MinHeight, record.MaxHeight);

                        lon.Clear();
                        lat.Clear();
                        int subtileidx = 0;
                        for (int x = 0; x <= record.MaxIdxHoriz; x++)
                        {
                            for (int y = 0; y <= record.MaxIdxVert; y++)
                            {
                                GarminCore.Files.DEM.SubtileTableitem subtile = dem.ZoomLevel[zl].Subtiles[subtileidx].Tableitem;
                                subtileidx++;

                                double tileleft = west + x * (record.PointsHoriz - 1) * ptdisth;
                                double tiletop  = north - y * (record.PointsVert - 1) * ptdistv;

                                file.WriteLine("subtile: x={0}, y={1}, baseheight {2}, heightdiff {3}, west={4}, north={5}",
                                               x,
                                               y,
                                               subtile.Baseheight,
                                               subtile.Diff,
                                               tileleft.ToString(CultureInfo.InvariantCulture),
                                               tiletop.ToString(CultureInfo.InvariantCulture));

                                int maxx = x < record.MaxIdxHoriz ? record.PointsHoriz : record.LastColWidth + 1;
                                int maxy = y < record.MaxIdxVert ? record.PointsVert : record.LastRowHeight + 1;
                                for (int xt = 0; xt < maxx; xt++)
                                {
                                    for (int yt = 0; yt < maxx; yt++)
                                    {
                                        lat.Add(tileleft + xt * ptdisth);
                                        lon.Add(tiletop - yt * ptdistv);
                                    }
                                }

                                WriteGpxFile(outpath, basefilename, zl, x, y, overwrite, symbolname, lon, lat, maxx, maxy);
                            }
                        }
                    }
                }
            }
        }
Пример #11
0
        /// <summary>
        /// Knoten für eine logische oder physische NET-Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="net">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_NET net, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, net, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, net, "Garmin NET-Header"));

            if (net.PostHeaderDataBlock != null && net.PostHeaderDataBlock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.RGN_PostHeaderData, net, "PostHeaderDataBlock");
            }
            if (net.RoadDefinitionsBlock != null && net.RoadDefinitionsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.NET_RoadDefinitionsBlock, net, "RoadDefinitionsBlock"));
            }
            if (net.SegmentedRoadsBlock != null && net.SegmentedRoadsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.NET_SegmentedRoadsBlock, net, "SegmentedRoadsBlock"));
            }
            if (net.SortedRoadsBlock != null && net.SortedRoadsBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.NET_SortedRoadsBlock, net, "SortedRoadsBlock"));
            }
        }
Пример #12
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_MDR mdr, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, mdr, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, mdr, "Garmin MDR-Header"));
            if (mdr.Mdr1.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR1, mdr, "MDR1");
            }
            if (mdr.Mdr2.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR2, mdr, "MDR2");
            }
            if (mdr.Mdr3.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR3, mdr, "MDR3");
            }
            if (mdr.Mdr4.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR4, mdr, "MDR4");
            }
            if (mdr.Mdr5.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR5, mdr, "MDR5");
            }
            if (mdr.Mdr6.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR6, mdr, "MDR6");
            }
            if (mdr.Mdr7.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR7, mdr, "MDR7");
            }
            if (mdr.Mdr8.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR8, mdr, "MDR8");
            }
            if (mdr.Mdr9.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR9, mdr, "MDR9");
            }
            if (mdr.Mdr10.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR10, mdr, "MDR10");
            }
            if (mdr.Mdr11.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR11, mdr, "MDR11");
            }
            if (mdr.Mdr12.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR12, mdr, "MDR12");
            }
            if (mdr.Mdr13.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR13, mdr, "MDR13");
            }
            if (mdr.Mdr14.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR14, mdr, "MDR14");
            }
            if (mdr.Mdr15.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR15, mdr, "MDR15");
            }
            if (mdr.Mdr16.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR16, mdr, "MDR16");
            }
            if (mdr.Mdr17.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR17, mdr, "MDR17");
            }
            if (mdr.Mdr18.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.MDR_MDR18, mdr, "MDR18");
            }
        }
Пример #13
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_DEM dem, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, dem, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, dem, "Garmin DEM-Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.DEM_Zoomlevel, dem, "Zoomlevel"));
        }
Пример #14
0
        /// <summary>
        /// Knoten für eine logische oder physische Datei anhängen
        /// </summary>
        /// <param name="tn"></param>
        /// <param name="tre">wenn null, wird das Objekt erzeugt</param>
        /// <param name="binreader"></param>
        public static void AppendChildNodes(TreeNode tn, GarminCore.Files.StdFile_SRT srt, GarminCore.BinaryReaderWriter binreader)
        {
            DeleteDummyChildNode(tn);

            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminCommonHeader, srt, "Garmin Common Header"));
            AppendNode(AppendNode(tn, NodeContent.NodeType.GarminSpecialHeader, srt, "Garmin SRT-Header"));
            if (srt.ContentsBlock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.SRT_ContentsBlock, srt, "ContentsBlock");
            }
            if (srt.DescriptionBlock.Length > 0)
            {
                AppendNode(tn, NodeContent.NodeType.SRT_DescriptionBlock, srt, "DescriptionBlock");
            }
            if (srt.CharacterLookupTableBlock.Length > 0)
            {
                AppendNode(AppendNode(tn, NodeContent.NodeType.SRT_CharacterLookupTableBlock, srt, "CharacterLookupTableBlock"));
            }
        }