[chronojump] UploadEncoderData checks encoderCaptureCurves.Count > 0



commit d48d6be00b306299cde307af6f188fc3f98181ea
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon May 22 10:50:11 2017 +0200

    UploadEncoderData checks encoderCaptureCurves.Count > 0

 src/gui/encoder.cs |   54 +++++++++++++++++++++++++++++----------------------
 1 files changed, 31 insertions(+), 23 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 26a2ae1..d35797f 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -5953,29 +5953,37 @@ public partial class ChronoJumpWindow
                                                showTriggersAndTab();
 
                                                //2) send the json to server
-                                               UploadEncoderDataObject uo = new 
UploadEncoderDataObject(encoderCaptureCurves);
-
-                                               /*
-                                                * problems on Json by accents like "PressiĆ³ sobre banc"
-                                                * string exerciseName = 
UtilGtk.ComboGetActive(combo_encoder_exercise_capture);
-                                                * right now fixed in json.cs UploadEncoderData()
-                                                */
-                                               Json js = new Json();
-                                               bool success = js.UploadEncoderData(
-                                                               1, //TODO: currentPerson.UniqueID,
-                                                               1,
-                                                               
UtilGtk.ComboGetActive(combo_encoder_exercise_capture),
-                                                               
Util.ConvertToPoint(findMass(Constants.MassType.DISPLACED)), //this is only for gravitatory
-                                                               uo);
-
-                                               if(! success) {
-                                                       LogB.Error(js.ResultMessage);
-                                                       bool showInWindow = false;
-                                                       if(showInWindow)
-                                                               new DialogMessage(
-                                                                               "Chronojump",
-                                                                               
Constants.MessageTypes.WARNING,
-                                                                               js.ResultMessage);
+                                               //check if encoderCaptureCurves > 0
+                                               //(this is the case of a capture without repetitions or can 
have on ending cont mode)
+
+                                               if(configChronojump.Compujump && encoderCaptureCurves.Count > 
0)
+                                               {
+                                                       UploadEncoderDataObject uo = new 
UploadEncoderDataObject(encoderCaptureCurves);
+
+
+                                                       /*
+                                                        * Problems on Json by accents like "PressiĆ³ sobre 
banc"
+                                                        * string exerciseName = 
UtilGtk.ComboGetActive(combo_encoder_exercise_capture);
+                                                        * right now fixed in json.cs UploadEncoderData()
+                                                        */
+
+                                                       Json js = new Json();
+                                                       bool success = js.UploadEncoderData(
+                                                                       1, //TODO: currentPerson.UniqueID,
+                                                                       1,
+                                                                       
UtilGtk.ComboGetActive(combo_encoder_exercise_capture),
+                                                                       
Util.ConvertToPoint(findMass(Constants.MassType.DISPLACED)), //this is only for gravitatory
+                                                                       uo);
+
+                                                       if(! success) {
+                                                               LogB.Error(js.ResultMessage);
+                                                               bool showInWindow = false;
+                                                               if(showInWindow)
+                                                                       new DialogMessage(
+                                                                                       "Chronojump",
+                                                                                       
Constants.MessageTypes.WARNING,
+                                                                                       js.ResultMessage);
+                                                       }
                                                }
                                        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]