[chronojump] encoder feedback historical cannot be ecc or con, have to be both



commit 18f8381204f1863f56f3997dd0804be553e0bb0e
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jun 4 13:59:50 2020 +0200

    encoder feedback historical cannot be ecc or con, have to be both

 src/gui/repetitiveConditions.cs | 34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
---
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index 010538a7..2efcd2c2 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -365,10 +365,24 @@ public class RepetitiveConditionsWindow
                                                encoderMainVariable != 
Constants.EncoderVariablesCapture.MeanSpeed &&
                                                encoderMainVariable != 
Constants.EncoderVariablesCapture.MeanForce
                                          ) )
+                       {
                                radio_encoder_relative_to_set.Active = true;
-                       else
+
+                               if(encoderCaptureFeedbackEccon == Preferences.EncoderPhasesEnum.ECC)
+                                       radio_encoder_eccon_ecc.Active = true;
+                               else if(encoderCaptureFeedbackEccon == Preferences.EncoderPhasesEnum.CON)
+                                       radio_encoder_eccon_con.Active = true;
+                               else
+                                       radio_encoder_eccon_both.Active = true;
+                       } else
+                       {
                                radio_encoder_relative_to_historical.Active = true;
 
+                               radio_encoder_eccon_both.Active = true;
+                               radio_encoder_eccon_ecc.Sensitive = false;
+                               radio_encoder_eccon_con.Sensitive = false;
+                       }
+
                        //the change on spinbuttons here will not have to provoque changes on checkbuttons
                        update_checkbuttons_encoder_automatic = false;
                        checkbutton_encoder_automatic_greater.Active = 
encoderCaptureMainVariableGreaterActive;
@@ -377,13 +391,6 @@ public class RepetitiveConditionsWindow
                        spinbutton_encoder_automatic_lower.Value = encoderCaptureMainVariableLowerValue;
                        update_checkbuttons_encoder_automatic = true;
 
-                       if(encoderCaptureFeedbackEccon == Preferences.EncoderPhasesEnum.ECC)
-                               radio_encoder_eccon_ecc.Active = true;
-                       else if(encoderCaptureFeedbackEccon == Preferences.EncoderPhasesEnum.CON)
-                               radio_encoder_eccon_con.Active = true;
-                       else
-                               radio_encoder_eccon_both.Active = true;
-
                        notebook_main.GetNthPage(ENCODERPAGE).Show();
                        notebook_main.GetNthPage(ENCODERRHYTHMPAGE).Show();
                        notebook_main.GetNthPage(TESTBELLSPAGE).Show();
@@ -635,6 +642,17 @@ public class RepetitiveConditionsWindow
                else
                        comboEncoderAutomaticVariableFillHistorical();
                        */
+
+               //historical does not allow to differentiate between phases
+               if(radio_encoder_relative_to_set.Active)
+               {
+                       radio_encoder_eccon_ecc.Sensitive = true;
+                       radio_encoder_eccon_con.Sensitive = true;
+               } else {
+                       radio_encoder_eccon_both.Active = true;
+                       radio_encoder_eccon_ecc.Sensitive = false;
+                       radio_encoder_eccon_con.Sensitive = false;
+               }
        }
 
 


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