Пример #1
0
        public static void convertTcxToGpx(string fileName)
        {
            TrainingCenterDatabase tcx = TrainingCenterDatabase.Load(fileName);
            gpx gpx = GpsData.convertTcxToGpx(tcx);

            if (gpx != null)
            {
                fileName = Path.ChangeExtension(fileName, ".gpx");
                string saveFilename = getSaveName(fileName, ".converted");
                if (saveFilename != null)
                {
                    gpx.Save(saveFilename);
                }
            }
        }
Пример #2
0
 public GpxFileModel(GpxModel parent, string fileName)
 {
     Parent   = parent;
     FileName = fileName;
     if (Path.GetExtension(fileName).ToLower().Equals(".tcx"))
     {
         IsTcx = true;
         TrainingCenterDatabase tcx = TrainingCenterDatabase.Load(fileName);
         if (tcx != null)
         {
             Gpx = GpsData.convertTcxToGpx(tcx);
         }
         else
         {
             Utils.errMsg("Failed to convert to GPX: " + NL + fileName);
         }
     }
     else
     {
         Gpx = gpx.Load(fileName);
     }
     reset();
 }