[chronojump] Jumps HasFall works different on Networks
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Jumps HasFall works different on Networks
- Date: Tue, 23 Aug 2022 15:31:07 +0000 (UTC)
commit 9f0d3db6597f36ae8551b64330f7123231a29f6b
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Aug 23 17:30:33 2022 +0200
Jumps HasFall works different on Networks
src/gui/app1/chronojump.cs | 11 ++++++-----
src/gui/app1/contactsExercise.cs | 4 ++--
src/gui/app1/jump.cs | 10 +++++-----
src/jumpType.cs | 24 +++++++++++-------------
4 files changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 92ec1a39a..39b653a24 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -5138,7 +5138,8 @@ public partial class ChronoJumpWindow
double myFall = 0;
ljstp.fallmm = 0;
- if(currentJumpType.HasFall) {
+ if (currentJumpType.HasFall (configChronojump.Compujump))
+ {
if(extra_window_jumps_check_dj_fall_calculate.Active) {
myFall = -1;
ljstp.fallmm = -1;
@@ -5149,8 +5150,8 @@ public partial class ChronoJumpWindow
}
//to store how this test is for future jumps (do)
- if(currentJumpType.HasWeight || currentJumpType.HasFall)
- SqliteJumpType.LastJumpSimpleTypeParamsInsertOrUpdate(ljstp);
+ if(currentJumpType.HasWeight || currentJumpType.HasFall (configChronojump.Compujump))
+ SqliteJumpType.LastJumpSimpleTypeParamsInsertOrUpdate (ljstp);
string description = "";
if(currentJumpType.Name == "slCMJleft" || currentJumpType.Name == "slCMJright") {
@@ -5451,7 +5452,7 @@ public partial class ChronoJumpWindow
ljrtp.weightValue = selectedWeight;
}
double myFall = 0;
- if( currentJumpRjType.HasFall || currentJumpRjType.Name == Constants.RunAnalysisName)
+ if( currentJumpRjType.HasFall (configChronojump.Compujump) || currentJumpRjType.Name ==
Constants.RunAnalysisName)
{
myFall = (double) extra_window_jumps_rj_spinbutton_fall.Value;
ljrtp.fallmm = Convert.ToInt32(myFall * 10);
@@ -5459,7 +5460,7 @@ public partial class ChronoJumpWindow
//to store how this test is for future jumps (do)
if( (! currentJumpRjType.Unlimited && currentJumpRjType.FixedValue == 0) ||
- currentJumpType.HasWeight || currentJumpType.HasFall )
+ currentJumpType.HasWeight || currentJumpType.HasFall
(configChronojump.Compujump) )
SqliteJumpType.LastJumpRjTypeParamsInsertOrUpdate(ljrtp);
//used by cancel and finish
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index 5d197c000..7252e4d48 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -189,7 +189,7 @@ public partial class ChronoJumpWindow
name += sep + extra_window_jumps_spinbutton_weight.Value.ToString() + " kg";
sep = "; ";
}
- if(((JumpType) currentEventType).HasFall)
+ if(((JumpType) currentEventType).HasFall (configChronojump.Compujump))
{
if(! extra_window_jumps_check_dj_fall_calculate.Active)
{
@@ -229,7 +229,7 @@ public partial class ChronoJumpWindow
name += sep + extra_window_jumps_rj_spinbutton_weight.Value.ToString() + "
kg";
sep = "; ";
}
- if(((JumpType) currentEventType).HasFall)
+ if(((JumpType) currentEventType).HasFall (configChronojump.Compujump))
{
name += sep + extra_window_jumps_rj_spinbutton_fall.Value.ToString() + " cm";
sep = "; ";
diff --git a/src/gui/app1/jump.cs b/src/gui/app1/jump.cs
index 98e697a92..c25d9b79a 100644
--- a/src/gui/app1/jump.cs
+++ b/src/gui/app1/jump.cs
@@ -235,7 +235,7 @@ public partial class ChronoJumpWindow
setLabelContactsExerciseSelected(Constants.Modes.JUMPSSIMPLE);
LastJumpSimpleTypeParams ljstp = new LastJumpSimpleTypeParams(myJumpType.Name);
- if(myJumpType.HasWeight || myJumpType.HasFall)
+ if(myJumpType.HasWeight || myJumpType.HasFall (configChronojump.Compujump))
ljstp = SqliteJumpType.LastJumpSimpleTypeParamsSelect(myJumpType.Name); //search it
on DB
if(myJumpType.HasWeight)
@@ -243,7 +243,7 @@ public partial class ChronoJumpWindow
else
extra_window_showWeightData(myJumpType, false);
- if(myJumpType.HasFall) {
+ if(myJumpType.HasFall (configChronojump.Compujump)) {
extra_window_showFallData(myJumpType, true);
if(ljstp.uniqueID != -1)
extra_window_jumps_check_dj_fall_calculate.Active = (ljstp.fallmm == -1);
@@ -276,7 +276,7 @@ public partial class ChronoJumpWindow
button_jump_type_delete_simple.Sensitive = ! myJumpType.IsPredefined;
- if( (myJumpType.HasWeight || myJumpType.HasFall) && ljstp.uniqueID != -1) {
+ if( (myJumpType.HasWeight || myJumpType.HasFall (configChronojump.Compujump)) &&
ljstp.uniqueID != -1) {
extra_window_jumps_spinbutton_weight.Value = ljstp.weightValue;
extra_window_jumps_spinbutton_fall.Value = ljstp.fallmm/10.0;
} else {
@@ -439,14 +439,14 @@ public partial class ChronoJumpWindow
} else
extra_window_showWeightData(myJumpType, false);
- if(myJumpType.HasFall || myJumpType.Name == Constants.RunAnalysisName) {
+ if(myJumpType.HasFall (configChronojump.Compujump) || myJumpType.Name ==
Constants.RunAnalysisName) {
extra_window_showFallData(myJumpType, true);
} else
extra_window_showFallData(myJumpType, false);
button_jump_type_delete_reactive.Sensitive = ! myJumpType.IsPredefined;
- if( (myJumpType.HasWeight || myJumpType.HasFall) && ljrtp.uniqueID != -1) {
+ if( (myJumpType.HasWeight || myJumpType.HasFall (configChronojump.Compujump)) &&
ljrtp.uniqueID != -1) {
extra_window_jumps_rj_spinbutton_weight.Value = ljrtp.weightValue;
extra_window_jumps_rj_spinbutton_fall.Value = ljrtp.fallmm/10.0;
} else {
diff --git a/src/jumpType.cs b/src/jumpType.cs
index 2828fbef2..90819263a 100644
--- a/src/jumpType.cs
+++ b/src/jumpType.cs
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * Copyright (C) 2004-2020 Xavier de Blas <xaviblas gmail com>
+ * Copyright (C) 2004-2022 Xavier de Blas <xaviblas gmail com>
*/
using System;
@@ -261,20 +261,18 @@ public class JumpType : EventType
set { hasWeight = value; }
}
- public bool HasFall
+ public bool HasFall (bool compujump)
{
- get {
- if(name == Constants.TakeOffName || name == Constants.TakeOffWeightName)
- return false;
+ if(name == Constants.TakeOffName || name == Constants.TakeOffWeightName)
+ return false;
- if(isPredefined) {
- return ! startIn;
- } else {
- if(isRepetitive)
- return SqliteJumpType.HasFall("jumpRjType", name);
- else
- return SqliteJumpType.HasFall("jumpType", name);
- }
+ if(isPredefined && ! compujump) {
+ return ! startIn;
+ } else {
+ if(isRepetitive)
+ return SqliteJumpType.HasFall("jumpRjType", name);
+ else
+ return SqliteJumpType.HasFall("jumpType", name);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]