[chronojump] Reaction time discriminative can be simulated
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Reaction time discriminative can be simulated
- Date: Mon, 16 May 2016 17:20:38 +0000 (UTC)
commit f8a8ebb9ebf7c1d07255a1d0079316e72da3b7ea
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon May 16 19:14:26 2016 +0200
Reaction time discriminative can be simulated
src/execute/reactionTime.cs | 20 +++++++++++++-------
src/gui/chronojump.cs | 5 +++--
2 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/src/execute/reactionTime.cs b/src/execute/reactionTime.cs
index 31e3f92..37048e8 100644
--- a/src/execute/reactionTime.cs
+++ b/src/execute/reactionTime.cs
@@ -101,9 +101,12 @@ public class ReactionTimeExecute : EventExecute
LogB.Error("at Manage!");
- if (simulated)
- platformState = Chronopic.Plataforma.ON;
- else {
+ if (simulated) {
+ if(StartIn)
+ platformState = Chronopic.Plataforma.ON;
+ else
+ platformState = Chronopic.Plataforma.OFF;
+ } else {
platformState = chronopicInitialValue(cp);
}
@@ -130,9 +133,12 @@ public class ReactionTimeExecute : EventExecute
//in simulated mode, make the jump start just when we arrive to waitEvent at the
first time
//mark now that we have leaved platform:
- if (simulated) //TODO: check loggedState and StartIn
- platformState = Chronopic.Plataforma.OFF;
-
+ if (simulated) {
+ if(StartIn)
+ platformState = Chronopic.Plataforma.OFF;
+ else
+ platformState = Chronopic.Plataforma.ON;
+ }
//if discriminative, will fire the buttons
FakeButtonReactionTimeStart.Click();
@@ -291,7 +297,7 @@ public class ReactionTimeExecute : EventExecute
time, description, Util.BoolToNegativeInt(simulated));
//define the created object
- eventDone = new ReactionTime(uniqueID, personID, sessionID, time, "",
Util.BoolToNegativeInt(simulated));
+ eventDone = new ReactionTime(uniqueID, personID, sessionID, time, description,
Util.BoolToNegativeInt(simulated));
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index a55e286..b1f4e67 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -4568,8 +4568,9 @@ public partial class ChronoJumpWindow
private void on_event_execute_reaction_time_start (object o, EventArgs args)
{
currentEventExecute.FakeButtonReactionTimeStart.Clicked -= new
EventHandler(on_event_execute_reaction_time_start);
-
- if(extra_window_radio_reaction_time_discriminative.Active) {
+
+ //Fire leds or buzzer on discriminative (if not simulated)
+ if(extra_window_radio_reaction_time_discriminative.Active && chronopicWin.Connected) {
Thread.Sleep(Convert.ToInt32(discriminativeStartTime * 1000)); //in ms
ChronopicAuto cs = new ChronopicStartReactionTimeAnimation();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]