[chronojump] ForceSensor feedback rectangle can be negative
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor feedback rectangle can be negative
- Date: Thu, 27 May 2021 09:53:56 +0000 (UTC)
commit 55571caf9116608fa2f977d0f22cd20ca292bdde
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu May 27 11:53:32 2021 +0200
ForceSensor feedback rectangle can be negative
glade/repetitive_conditions.glade | 2 +-
src/gui/app1/forceSensor.cs | 17 ++++++++++++-----
2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index ef774e3b0..f375af938 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -4718,7 +4718,7 @@
<property name="secondary_icon_activatable">False</property>
<property name="primary_icon_sensitive">True</property>
<property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">100 0 9999 1 10 0</property>
+ <property name="adjustment">100 -9999 9999 1 10 0</property>
<property name="climb_rate">1</property>
<property name="numeric">True</property>
</widget>
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index dd584b6b9..ca6cc1e0d 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -1072,12 +1072,14 @@ public partial class ChronoJumpWindow
preferences.forceSensorCaptureWidthSeconds
);
- setForceSensorTopAtOperationStart();
-
pathAccuracy = new PathAccuracy();
- if(fscPoints.RealHeightG < forceSensorTopRectangleAtOperationStart)
+ setForceSensorTopAtOperationStart();
+
+ if(forceSensorTopRectangleAtOperationStart > 0 && fscPoints.RealHeightG <
forceSensorTopRectangleAtOperationStart)
fscPoints.RealHeightG = forceSensorTopRectangleAtOperationStart;
+ else if(forceSensorTopRectangleAtOperationStart < 0 && fscPoints.RealHeightGNeg <
Math.Abs(forceSensorTopRectangleAtOperationStart))
+ fscPoints.RealHeightGNeg = Math.Abs(forceSensorTopRectangleAtOperationStart);
if(repetitiveConditionsWin.GetForceSensorFeedbackPathActive)
{
@@ -2598,11 +2600,16 @@ LogB.Information(" fs R ");
}
}
+ //note can be positive or negative
private void setForceSensorTopAtOperationStart()
{
if(preferences.forceSensorCaptureFeedbackActive ==
Preferences.ForceSensorCaptureFeedbackActiveEnum.RECTANGLE)
- forceSensorTopRectangleAtOperationStart =
Convert.ToInt32(preferences.forceSensorCaptureFeedbackAt + preferences.forceSensorCaptureFeedbackRange /2);
- else
+ {
+ if(preferences.forceSensorCaptureFeedbackAt < 0)
+ forceSensorTopRectangleAtOperationStart =
Convert.ToInt32(preferences.forceSensorCaptureFeedbackAt - preferences.forceSensorCaptureFeedbackRange /2);
+ else
+ forceSensorTopRectangleAtOperationStart =
Convert.ToInt32(preferences.forceSensorCaptureFeedbackAt + preferences.forceSensorCaptureFeedbackRange /2);
+ } else
forceSensorTopRectangleAtOperationStart = 0;
}
//This function calculates the max value between the sent force and the top of the feedback rectangle
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]