[chronojump] Encoder export: Fixed values on Kcal or Joules
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Encoder export: Fixed values on Kcal or Joules
- Date: Fri, 27 Dec 2019 15:37:20 +0000 (UTC)
commit c4c73920e4c8e85608b810c55b5d0ad26aba9e18
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Dec 27 16:37:01 2019 +0100
Encoder export: Fixed values on Kcal or Joules
src/encoder.cs | 10 +++++++---
src/gui/encoder.cs | 2 +-
src/gui/encoderTreeviews.cs | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index 1f0cb634..ce0e5693 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -406,12 +406,16 @@ public class EncoderCurve
}
}
- public string ToCSV(bool captureOrAnalyze, string decimalSeparator) {
-
+ public string ToCSV(bool captureOrAnalyze, string decimalSeparator, bool useWorkKcal)
+ {
//latin: 2,3 ; 2,5
//non-latin: 2.3 , 2.5
string sep = ":::";
+
+ double work = WorkJD;
+ if(useWorkKcal)
+ work = WorkKcalD;
string str = "";
//TODO: if capture not shown because some variables like Inertia are not defined
@@ -425,7 +429,7 @@ public class EncoderCurve
PP_PPT + sep +
MeanForce + sep + MaxForce + sep + MaxForceT + sep +
MaxForce_MaxForceT + sep +
- WorkJ + sep + Impulse;
+ work.ToString() + sep + Impulse;
if(decimalSeparator == "COMMA")
str = Util.ConvertToComma(str);
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 81d363e8..226f2050 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4442,7 +4442,7 @@ public partial class ChronoJumpWindow
//write curves rows
ArrayList array = getTreeViewCurves(encoderAnalyzeListStore);
foreach (EncoderCurve ec in array)
- writer.WriteLine(ec.ToCSV(false,
preferences.CSVExportDecimalSeparator));
+ writer.WriteLine(ec.ToCSV(false,
preferences.CSVExportDecimalSeparator, preferences.encoderWorkKcal));
}
writer.Flush();
diff --git a/src/gui/encoderTreeviews.cs b/src/gui/encoderTreeviews.cs
index a07de1dd..50356c8c 100644
--- a/src/gui/encoderTreeviews.cs
+++ b/src/gui/encoderTreeviews.cs
@@ -989,7 +989,7 @@ public partial class ChronoJumpWindow
//Check if it's number
if(! curve.IsNumberN()) {
(cell as Gtk.CellRendererText).Text = "";
- LogB.Error("Curve is not number at RenderN:" + curve.ToCSV(true, "COMMA"));
+ LogB.Error("Curve is not number at RenderN:" + curve.ToCSV(true, "COMMA",
preferences.encoderWorkKcal));
return;
}
@@ -1026,7 +1026,7 @@ public partial class ChronoJumpWindow
//Check if it's valid
if(! curve.IsValidN()) {
(cell as Gtk.CellRendererText).Text = "";
- LogB.Error("Curve is not valid at RenderNAnalyze:" + curve.ToCSV(false, "COMMA"));
+ LogB.Error("Curve is not valid at RenderNAnalyze:" + curve.ToCSV(false, "COMMA",
preferences.encoderWorkKcal));
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]