]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/function/charts/Charter.java
Version 18.1, September 2015
[GpsPrune.git] / tim / prune / function / charts / Charter.java
index 0bb377fe2b1c4fe728b1020c1fe6799456ce6a66..5b7ae83c29470ae7fa51306446554c10514405d2 100644 (file)
@@ -284,6 +284,9 @@ public class Charter extends GenericFunction
                                        + getSvgValue(_svgHeightField, DEFAULT_SVG_HEIGHT) + "\n");
                                writer.write("set out '" + svgFile.getAbsolutePath() + "'\n");
                        }
+                       else {
+                               // For screen output, gnuplot should use the default terminal (windows or x11 or wxt or something)
+                       }
                        if (numCharts > 1) {
                                writer.write("set multiplot layout " + numCharts + ",1\n");
                        }
@@ -374,7 +377,7 @@ public class Charter extends GenericFunction
                        break;
                }
                // Make a temporary data file for the output (one per subchart)
-               File tempFile = File.createTempFile("prunedata", null);
+               File tempFile = File.createTempFile("gpsprunedata", null);
                tempFile.deleteOnExit();
                // write out values for x and y to temporary file
                FileWriter tempFileWriter = null;
@@ -482,7 +485,7 @@ public class Charter extends GenericFunction
                        if (currPoint.hasTimestamp())
                        {
                                if (!currPoint.getSegmentStart() && prevTimestamp != null) {
-                                       seconds += (currPoint.getTimestamp().getSecondsSince(prevTimestamp));
+                                       seconds += (currPoint.getTimestamp().getMillisecondsSince(prevTimestamp) / 1000.0);
                                }
                                values.setData(i, seconds / 60.0 / 60.0);
                                prevTimestamp = currPoint.getTimestamp();
@@ -517,6 +520,7 @@ public class Charter extends GenericFunction
        {
                // Calculate speeds using the same formula as the profile chart
                SpeedData speeds = new SpeedData(inTrack);
+               speeds.init(Config.getUnitSet());
 
                final int numPoints = inTrack.getNumPoints();
                ChartSeries values = new ChartSeries(numPoints);
@@ -540,6 +544,7 @@ public class Charter extends GenericFunction
        {
                // Calculate speeds using the same formula as the profile chart
                VerticalSpeedData speeds = new VerticalSpeedData(inTrack);
+               speeds.init(Config.getUnitSet());
 
                final int numPoints = inTrack.getNumPoints();
                ChartSeries values = new ChartSeries(numPoints);