[chronojump] Store widget values on LastJumpRjTypeParams



commit a9b4a1967f24a2c544045bf54663882b5fbfd43a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 12 15:39:28 2021 +0200

    Store widget values on LastJumpRjTypeParams

 src/gui/app1/chronojump.cs | 27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 009ca95b..3d4da68e 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -4345,7 +4345,8 @@ public partial class ChronoJumpWindow
                //to store how this test is for future jumps (prepare)
                LastJumpSimpleTypeParams ljstp = new LastJumpSimpleTypeParams(currentJumpType.Name);
 
-               if(currentJumpType.HasWeight) {
+               if(currentJumpType.HasWeight)
+               {
                        double selectedWeight = (double) extra_window_jumps_spinbutton_weight.Value;
                        if(extra_window_jumps_option == "%")
                                jumpWeight = selectedWeight;
@@ -4646,6 +4647,9 @@ public partial class ChronoJumpWindow
        {
                double progressbarLimit = 0;
                
+               //to store how this test is for future jumps (prepare)
+               LastJumpRjTypeParams ljrtp = new LastJumpRjTypeParams(currentJumpRjType.Name);
+
                //if it's a unlimited interval run, put -1 as limit value
                if(currentJumpRjType.Unlimited) {
                        progressbarLimit = -1;
@@ -4654,23 +4658,36 @@ public partial class ChronoJumpWindow
                                progressbarLimit = currentJumpRjType.FixedValue;
                        } else {
                                progressbarLimit = (double) extra_window_jumps_rj_spinbutton_limit.Value;
+                               ljrtp.limitedValue = Convert.ToInt32(progressbarLimit);
                        }
                }
 
                double jumpWeight = 0;
-               if(currentJumpRjType.HasWeight) {
+               if(currentJumpRjType.HasWeight)
+               {
+                       double selectedWeight = (double) extra_window_jumps_rj_spinbutton_weight.Value;
                        if(extra_window_jumps_rj_option == "%") {
-                               jumpWeight = (double) extra_window_jumps_rj_spinbutton_weight.Value;
+                               jumpWeight = selectedWeight;
                        } else {
                                jumpWeight = Util.WeightFromKgToPercent(
-                                               (double) extra_window_jumps_rj_spinbutton_weight.Value,
+                                               selectedWeight,
                                                currentPersonSession.Weight);
+                               ljrtp.weightIsPercent = false;
                        }
+                       ljrtp.weightValue = selectedWeight;
                }
                double myFall = 0;
                if( currentJumpRjType.HasFall || currentJumpRjType.Name == Constants.RunAnalysisName)
+               {
                        myFall = (double) extra_window_jumps_rj_spinbutton_fall.Value;
-                       
+                       ljrtp.fallmm = Convert.ToInt32(myFall * 10);
+               }
+
+               //to store how this test is for future jumps (do)
+               if( (! currentJumpRjType.Unlimited && currentJumpRjType.FixedValue == 0) ||
+                               currentJumpType.HasWeight || currentJumpType.HasFall )
+                       SqliteJumpType.LastJumpRjTypeParamsInsertOrUpdate(ljrtp);
+
                //used by cancel and finish
                //currentEventType = new JumpRjType();
                currentEventType = currentJumpRjType;


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