[chronojump] CairoBarplot encoder does not need to check if encoderGraphDoPlot != null



commit 63065b22ccbd6f199a5a6ef9b5fed50b7c60c326
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 1 16:09:55 2022 +0200

    CairoBarplot encoder does not need to check if encoderGraphDoPlot != null

 src/gui/app1/chronojump.cs |  41 ++++++++-------
 src/gui/app1/encoder.cs    | 122 ++++++++++++++++++++++-----------------------
 2 files changed, 79 insertions(+), 84 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 4749836fa..7fbb92cf0 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -7813,28 +7813,27 @@ LogB.Debug("mc finished 5");
                                                                
preferences.encoderCaptureMainVariableThisSetOrHistorical,
                                                                
sendMaxPowerSpeedForceIntersession(mainVariable),
                                                                
sendMaxPowerSpeedForceIntersessionDate(mainVariable));
-
-                                               //Cairo
-                                               //TODO: send also the NewPreferences
-                                               prepareEventGraphBarplotEncoder = new 
PrepareEventGraphBarplotEncoder (
-                                                               mainVariableStr, mainVariableHigher, 
mainVariableLower,
-                                                               secondaryVariableStr, 
preferences.encoderCaptureShowLoss,
-                                                               false, //not capturing
-                                                               findEccon(true),
-                                                               feedback,
-                                                               encoderConfigurationCurrent.has_inertia,
-                                                               configChronojump.PlaySoundsFromFile,
-                                                               captureCurvesBarsData,
-                                                               encoderCaptureListStore,
-                                                               
preferences.encoderCaptureMainVariableThisSetOrHistorical,
-                                                               
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
-                                                               
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
-                                                               
preferences.encoderCaptureInertialDiscardFirstN,
-                                                               preferences.encoderCaptureShowNRepetitions,
-                                                               preferences.volumeOn,
-                                                               preferences.gstreamer);
-                                               prepareEncoderBarplotCairo ();
                                        }
+
+                                       //Cairo
+                                       prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder 
(
+                                                       mainVariableStr, mainVariableHigher, 
mainVariableLower,
+                                                       secondaryVariableStr, 
preferences.encoderCaptureShowLoss,
+                                                       false, //not capturing
+                                                       findEccon(true),
+                                                       feedback,
+                                                       encoderConfigurationCurrent.has_inertia,
+                                                       configChronojump.PlaySoundsFromFile,
+                                                       captureCurvesBarsData,
+                                                       encoderCaptureListStore,
+                                                       
preferences.encoderCaptureMainVariableThisSetOrHistorical,
+                                                       
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
+                                                       
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
+                                                       preferences.encoderCaptureInertialDiscardFirstN,
+                                                       preferences.encoderCaptureShowNRepetitions,
+                                                       preferences.volumeOn,
+                                                       preferences.gstreamer);
+                                       prepareEncoderBarplotCairo ();
                                } else
                                        UtilGtk.ErasePaint(encoder_capture_curves_bars_drawingarea, 
encoder_capture_curves_bars_pixmap);
                        }
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 63df4247d..6d5c70a39 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -5889,7 +5889,6 @@ public partial class ChronoJumpWindow
                        double mainVariableLower = feedbackWin.GetMainVariableLower(mainVariable);
 
                        if(encoderGraphDoPlot != null)
-                       {
                                encoderGraphDoPlot.Start(
                                                mainVariable, mainVariableHigher, mainVariableLower,
                                                secondaryVariable, preferences.encoderCaptureShowLoss,
@@ -5904,26 +5903,25 @@ public partial class ChronoJumpWindow
                                                
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
                                                
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable));
 
-                               //Cairo
-                               prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder (
-                                               mainVariable, mainVariableHigher, mainVariableLower,
-                                               secondaryVariable, preferences.encoderCaptureShowLoss,
-                                               false, //not capturing
-                                               findEccon(true),
-                                               feedback,
-                                               encoderConfigurationCurrent.has_inertia,
-                                               configChronojump.PlaySoundsFromFile,
-                                               captureCurvesBarsData,
-                                               encoderCaptureListStore,
-                                               preferences.encoderCaptureMainVariableThisSetOrHistorical,
-                                               
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
-                                               
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
-                                               preferences.encoderCaptureInertialDiscardFirstN,
-                                               preferences.encoderCaptureShowNRepetitions,
-                                               preferences.volumeOn,
-                                               preferences.gstreamer);
-                               prepareEncoderBarplotCairo ();
-                       }
+                       //Cairo
+                       prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder (
+                                       mainVariable, mainVariableHigher, mainVariableLower,
+                                       secondaryVariable, preferences.encoderCaptureShowLoss,
+                                       false, //not capturing
+                                       findEccon(true),
+                                       feedback,
+                                       encoderConfigurationCurrent.has_inertia,
+                                       configChronojump.PlaySoundsFromFile,
+                                       captureCurvesBarsData,
+                                       encoderCaptureListStore,
+                                       preferences.encoderCaptureMainVariableThisSetOrHistorical,
+                                       
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
+                                       
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
+                                       preferences.encoderCaptureInertialDiscardFirstN,
+                                       preferences.encoderCaptureShowNRepetitions,
+                                       preferences.volumeOn,
+                                       preferences.gstreamer);
+                       prepareEncoderBarplotCairo ();
                }
        }
 
@@ -6799,29 +6797,28 @@ public partial class ChronoJumpWindow
                                                        
preferences.encoderCaptureMainVariableThisSetOrHistorical,
                                                        
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
                                                        
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable));
-
-                                       //Cairo
-                                       //TODO: send also the NewPreferences
-                                       prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder 
(
-                                                       mainVariable, mainVariableHigher, mainVariableLower,
-                                                       secondaryVariable, preferences.encoderCaptureShowLoss,
-                                                       true, //capturing
-                                                       findEccon(true),
-                                                       feedback,
-                                                       encoderConfigurationCurrent.has_inertia,
-                                                       configChronojump.PlaySoundsFromFile,
-                                                       captureCurvesBarsData,
-                                                       encoderCaptureListStore,
-                                                       
preferences.encoderCaptureMainVariableThisSetOrHistorical,
-                                                       
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
-                                                       
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
-                                                       preferences.encoderCaptureInertialDiscardFirstN,
-                                                       preferences.encoderCaptureShowNRepetitions,
-                                                       preferences.volumeOn,
-                                                       preferences.gstreamer);
-                                       prepareEncoderBarplotCairo ();
                                }
 
+                               //Cairo
+                               prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder (
+                                               mainVariable, mainVariableHigher, mainVariableLower,
+                                               secondaryVariable, preferences.encoderCaptureShowLoss,
+                                               true, //capturing
+                                               findEccon(true),
+                                               feedback,
+                                               encoderConfigurationCurrent.has_inertia,
+                                               configChronojump.PlaySoundsFromFile,
+                                               captureCurvesBarsData,
+                                               encoderCaptureListStore,
+                                               preferences.encoderCaptureMainVariableThisSetOrHistorical,
+                                               
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
+                                               
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
+                                               preferences.encoderCaptureInertialDiscardFirstN,
+                                               preferences.encoderCaptureShowNRepetitions,
+                                               preferences.volumeOn,
+                                               preferences.gstreamer);
+                               prepareEncoderBarplotCairo ();
+
                                needToRefreshTreeviewCapture = false;
                        }
 
@@ -7402,29 +7399,28 @@ public partial class ChronoJumpWindow
                                                        
preferences.encoderCaptureMainVariableThisSetOrHistorical,
                                                        
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
                                                        
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable));
-
-                                       //Cairo
-                                       //TODO: send also the NewPreferences
-                                       prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder 
(
-                                                       mainVariable, mainVariableHigher, mainVariableLower,
-                                                       secondaryVariable, preferences.encoderCaptureShowLoss,
-                                                       false, //not capturing
-                                                       findEccon(true),
-                                                       feedback,
-                                                       encoderConfigurationCurrent.has_inertia,
-                                                       configChronojump.PlaySoundsFromFile,
-                                                       captureCurvesBarsData,
-                                                       encoderCaptureListStore,
-                                                       
preferences.encoderCaptureMainVariableThisSetOrHistorical,
-                                                       
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
-                                                       
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
-                                                       preferences.encoderCaptureInertialDiscardFirstN,
-                                                       preferences.encoderCaptureShowNRepetitions,
-                                                       preferences.volumeOn,
-                                                       preferences.gstreamer);
-                                       prepareEncoderBarplotCairo ();
                                }
 
+                               //Cairo
+                               prepareEventGraphBarplotEncoder = new PrepareEventGraphBarplotEncoder (
+                                               mainVariable, mainVariableHigher, mainVariableLower,
+                                               secondaryVariable, preferences.encoderCaptureShowLoss,
+                                               false, //not capturing
+                                               findEccon(true),
+                                               feedback,
+                                               encoderConfigurationCurrent.has_inertia,
+                                               configChronojump.PlaySoundsFromFile,
+                                               captureCurvesBarsData,
+                                               encoderCaptureListStore,
+                                               preferences.encoderCaptureMainVariableThisSetOrHistorical,
+                                               
sendMaxPowerSpeedForceIntersession(preferences.encoderCaptureMainVariable),
+                                               
sendMaxPowerSpeedForceIntersessionDate(preferences.encoderCaptureMainVariable),
+                                               preferences.encoderCaptureInertialDiscardFirstN,
+                                               preferences.encoderCaptureShowNRepetitions,
+                                               preferences.volumeOn,
+                                               preferences.gstreamer);
+                               prepareEncoderBarplotCairo ();
+
                                button_encoder_signal_save_comment.Label = Catalog.GetString("Save comment");
                                button_encoder_signal_save_comment.Sensitive = false;
                


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