Example #1
0
 public void changeTimesTcx(string tcxFile)
 {
     try {
         TcxResult res =
             GpsData.changeTimesTcx(tcxFile);
         if (res.TCX == null)
         {
             string msg = "Change times in TCX failed:" + NL
                          + "for " + Path.GetFileName(tcxFile) + NL
                          + res.Message;
             raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.ERR, msg));
             return;
         }
         string saveFileName = getSaveName(tcxFile, ".timechange");
         if (saveFileName != null)
         {
             res.TCX.Save(saveFileName);
             string msg = "Change TCX Times: Changed times in "
                          + tcxFile + NL + "  Output is " + saveFileName
                          + NL + "  " + res.Message;
             raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.MSG, NL + msg));
         }
         else
         {
             return;
         }
     } catch (Exception ex) {
         string msg = "Error changing times in TCX";
         raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.EXC, msg, ex));
         return;
     }
 }
Example #2
0
 public void deleteTcxTrackpoints(string tcxFile)
 {
     try {
         TcxResult res =
             GpsData.deleteTcxTrackpoints(tcxFile);
         if (res.TCX == null)
         {
             string msg = "Delete trackpoints from TCX failed:" + NL
                          + "for " + Path.GetFileName(tcxFile) + NL
                          + res.Message;
             raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.ERR, msg));
             return;
         }
         string saveFileName = getSaveName(tcxFile, ".trimmed");
         if (saveFileName != null)
         {
             res.TCX.Save(saveFileName);
             string msg = "Delete TCX Trackpoints: Trimmed " + tcxFile + NL
                          + "  Output is " + saveFileName
                          + NL + "  " + res.Message;
             raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.MSG, NL + msg));
         }
         else
         {
             return;
         }
     } catch (Exception ex) {
         string msg = "Error deleting trackpoints from TCX";
         raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.EXC, msg, ex));
         return;
     }
 }
Example #3
0
 public static void changeTimesTcx(string tcxFile, MainForm mainForm)
 {
     try {
         TcxResult res =
             GpsData.changeTimesTcx(tcxFile);
         if (res.TCX == null)
         {
             Utils.errMsg("Change times in TCX failed:" + NL
                          + "for " + Path.GetFileName(tcxFile) + NL
                          + res.Message);
             return;
         }
         string saveFileName = getSaveName(tcxFile, ".timechange");
         if (saveFileName != null)
         {
             res.TCX.Save(saveFileName);
             mainForm.gpxTxcCallback(NL + "Changed times in " + tcxFile + NL
                                     + "  Output is " + saveFileName
                                     + NL + "  " + res.Message);
         }
         else
         {
             return;
         }
     } catch (Exception ex) {
         Utils.excMsg("Error change times in TCX", ex);
         return;
     }
 }
Example #4
0
 public static void deleteTcxTrackpoints(string tcxFile, MainForm mainForm)
 {
     try {
         TcxResult res =
             GpsData.deleteTcxTrackpoints(tcxFile);
         if (res.TCX == null)
         {
             Utils.errMsg("Delete trackpoints from TCX failed:" + NL
                          + "for " + Path.GetFileName(tcxFile) + NL
                          + res.Message);
             return;
         }
         string saveFileName = getSaveName(tcxFile, ".trimmed");
         if (saveFileName != null)
         {
             res.TCX.Save(saveFileName);
             mainForm.gpxTxcCallback(NL + "Trimmed " + tcxFile + NL
                                     + "  Output is " + saveFileName
                                     + NL + "  " + res.Message);
         }
         else
         {
             return;
         }
     } catch (Exception ex) {
         Utils.excMsg("Error trackpoints from TCX", ex);
         return;
     }
 }
Example #5
0
        public static void interpolateTcxFromGpx(string tcxFile, string gpxFile,
                                                 MainForm mainForm, GpsData.InterpolateMode mode)
        {
            try {
                TcxResult res =
                    GpsData.interpolateTcxFromGpx(tcxFile, gpxFile, mode);
                if (res.TCX == null)
                {
                    Utils.errMsg("Interpolate Tcx From Gpx failed:" + NL
                                 + "for " + Path.GetFileName(tcxFile) + NL
                                 + " and " + Path.GetFileName(gpxFile) + NL
                                 + res.Message);
                    return;
                }
                TrainingCenterDatabase tcxInterp = res.TCX;

                string saveFileName = getSaveName(tcxFile, ".interpolated");
                if (saveFileName != null)
                {
                    tcxInterp.Save(saveFileName);
                    mainForm.gpxTxcCallback(NL + "Recalculated " + tcxFile + NL
                                            + "  from " + gpxFile + NL
                                            + "  Output is " + saveFileName
                                            + NL + "  " + res.Message);
                }
                else
                {
                    return;
                }
            } catch (Exception ex) {
                Utils.excMsg("Error interpolating TCX from GPX", ex);
                return;
            }
        }
Example #6
0
        public void interpolateTcxFromGpx(string tcxFile, string gpxFile,
                                          GpsData.InterpolateMode mode)
        {
            try {
                TcxResult res =
                    GpsData.interpolateTcxFromGpx(tcxFile, gpxFile, mode);
                if (res.TCX == null)
                {
                    string msg = "Interpolate Tcx From Gpx failed:" + NL
                                 + "for " + Path.GetFileName(tcxFile) + NL
                                 + " and " + Path.GetFileName(gpxFile) + NL
                                 + res.Message;
                    raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.ERR, msg));
                    return;
                }
                TrainingCenterDatabase tcxInterp = res.TCX;

                string saveFileName = getSaveName(tcxFile, ".interpolated");
                if (saveFileName != null)
                {
                    tcxInterp.Save(saveFileName);
                    string msg = "Interpolate TCX from GPX: Recalculated "
                                 + tcxFile + NL + "  from " + gpxFile + NL
                                 + "  Output is " + saveFileName
                                 + NL + "  " + res.Message;
                    raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.MSG, NL + msg));
                }
                else
                {
                    return;
                }
            } catch (Exception ex) {
                string msg = "Error interpolating TCX from GPX";
                raiseGpxTcxEvent(new GpxTcxEventArgs(EventType.EXC, msg, ex));
                return;
            }
        }