예제 #1
0
 public void AddRouteTSectionDatFile(string pathNameExt)
 {
     using (STFReader stf = new STFReader(pathNameExt, false))
     {
         if (stf.SimisSignature != "SIMISA@@@@@@@@@@JINX0T0t______")
         {
             Trace.TraceWarning("Skipped invalid TSECTION.DAT in route folder");
             return;
         }
         stf.ParseFile(new STFReader.TokenProcessor[] {
             new STFReader.TokenProcessor("tracksections", () => { TrackSections.AddRouteTrackSections(stf); }),
             new STFReader.TokenProcessor("sectionidx", () => { TSectionIdx = new TSectionIdx(stf); }),
             // todo read in SectionIdx part of RouteTSectionDat
         });
     }
 }
예제 #2
0
 public TrackSectionsFile(string filePath)
 {
     using (STFReader stf = new STFReader(filePath, false))
     {
         stf.ParseFile(new STFReader.TokenProcessor[] {
             new STFReader.TokenProcessor("tracksections", () => { TrackSections = new TrackSections(stf); }),
             new STFReader.TokenProcessor("trackshapes", () => { TrackShapes = new TrackShapes(stf); }),
         });
         //TODO This should be changed to STFException.TraceError() with defaults values created
         if (TrackSections == null)
         {
             throw new STFException(stf, "Missing TrackSections");
         }
         if (TrackShapes == null)
         {
             throw new STFException(stf, "Missing TrackShapes");
         }
     }
 }