[chronojump] Store widget values on LastJumpSimpleTypeParams



commit a944cd2aa90330ad3d5586b210698840b1dc2cda
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 9 17:23:00 2021 +0200

    Store widget values on LastJumpSimpleTypeParams

 src/gui/app1/chronojump.cs | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index df756f90..009ca95b 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -4341,22 +4341,39 @@ public partial class ChronoJumpWindow
                        sensitiveGuiAutoExecuteOrWait (true);
                
                double jumpWeight = 0;
+
+               //to store how this test is for future jumps (prepare)
+               LastJumpSimpleTypeParams ljstp = new LastJumpSimpleTypeParams(currentJumpType.Name);
+
                if(currentJumpType.HasWeight) {
-                       if(extra_window_jumps_option == "%") 
-                               jumpWeight = (double) extra_window_jumps_spinbutton_weight.Value;
-                       else 
+                       double selectedWeight = (double) extra_window_jumps_spinbutton_weight.Value;
+                       if(extra_window_jumps_option == "%")
+                               jumpWeight = selectedWeight;
+                       else {
                                jumpWeight = Util.WeightFromKgToPercent(
-                                               (double) extra_window_jumps_spinbutton_weight.Value, 
+                                               selectedWeight,
                                                currentPersonSession.Weight);
+                               ljstp.weightIsPercent = false;
+                       }
+                       ljstp.weightValue = selectedWeight;
                }
+
                double myFall = 0;
+               ljstp.fallmm = 0;
                if(currentJumpType.HasFall) {
-                       if(extra_window_jumps_check_dj_fall_calculate.Active)
+                       if(extra_window_jumps_check_dj_fall_calculate.Active) {
                                myFall = -1;
-                       else
+                               ljstp.fallmm = -1;
+                       } else {
                                myFall = (double) extra_window_jumps_spinbutton_fall.Value;
+                               ljstp.fallmm = Convert.ToInt32(myFall * 10);
+                       }
                }
 
+               //to store how this test is for future jumps (do)
+               if(currentJumpType.HasWeight || currentJumpType.HasFall)
+                       SqliteJumpType.LastJumpSimpleTypeParamsInsertOrUpdate(ljstp);
+
                string description = "";
                if(currentJumpType.Name == "slCMJleft" || currentJumpType.Name == "slCMJright") {
                        description = slCMJString(); 


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