[chronojump] Selected device on discover is usable in any compatible mode
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Selected device on discover is usable in any compatible mode
- Date: Sat, 25 Jun 2022 16:03:33 +0000 (UTC)
commit 2e0dab96146f63180b789fcfc4e53232afeb420d
Author: Xavier de Blas <xaviblas gmail com>
Date: Sat Jun 25 18:02:42 2022 +0200
Selected device on discover is usable in any compatible mode
src/chronopicRegister.cs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
---
diff --git a/src/chronopicRegister.cs b/src/chronopicRegister.cs
index 733fc7faf..f9c9536b5 100644
--- a/src/chronopicRegister.cs
+++ b/src/chronopicRegister.cs
@@ -343,10 +343,27 @@ public abstract class ChronopicRegister
if (selectedForMode_l == null)
return new ChronopicRegisterPort ("");
+ //first search strict to that mode, so if there is a chronopic for jumps and another for
races, will select the appropriate
foreach (selectedForMode sfm in selectedForMode_l)
if (sfm.mode == mode)
return sfm.crp;
+ //if not found for that mode, find for equivalent mode, so a chronopic for jumps can be
suitable for races
+ foreach (selectedForMode sfm in selectedForMode_l)
+ {
+ if (
+ (mode == Constants.Modes.JUMPSSIMPLE || mode ==
Constants.Modes.JUMPSREACTIVE ||
+ mode == Constants.Modes.RUNSSIMPLE || mode ==
Constants.Modes.RUNSINTERVALLIC)
+ &&
+ (sfm.mode == Constants.Modes.JUMPSSIMPLE || sfm.mode ==
Constants.Modes.JUMPSREACTIVE ||
+ sfm.mode == Constants.Modes.RUNSSIMPLE || sfm.mode ==
Constants.Modes.RUNSINTERVALLIC) )
+ return sfm.crp;
+ else if (Constants.ModeIsFORCESENSOR (mode) && Constants.ModeIsFORCESENSOR (sfm.mode))
+ return sfm.crp;
+ else if (Constants.ModeIsENCODER (mode) && Constants.ModeIsENCODER (sfm.mode))
+ return sfm.crp;
+ }
+
return new ChronopicRegisterPort ("");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]