[chronojump] Removed <1.6.2 cancel and finish code
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Removed <1.6.2 cancel and finish code
- Date: Wed, 4 Jan 2017 07:01:18 +0000 (UTC)
commit 711e985d8c0ae6b456b837c45bb258db0697d969
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Jan 4 07:58:48 2017 +0100
Removed <1.6.2 cancel and finish code
src/execute/event.cs | 37 ------------------
src/execute/jump.cs | 10 -----
src/execute/multiChronopic.cs | 37 +-----------------
src/execute/pulse.cs | 5 --
src/execute/reactionTime.cs | 3 -
src/execute/run.cs | 7 ---
src/gui/chronojump.cs | 82 +----------------------------------------
7 files changed, 4 insertions(+), 177 deletions(-)
---
diff --git a/src/execute/event.cs b/src/execute/event.cs
index 249a2e0..8e65c00 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -127,28 +127,14 @@ public class EventExecute
//for cancelling from chronojump.cs
protected bool cancel;
- //cancel doesn't finish until platform is touched (after pressing cancel button)
- //this variable controls that platform has been touched
- //if not, it will shown a popup from gui/chronojump.cs (on_cancel_clicked)
- protected bool totallyCancelled;
-
//for finishing earlier from chronojump.cs
protected bool finish;
- protected bool totallyFinished;
//if chronopic is disconnected by user, port changes, ...
protected bool chronopicDisconnected;
// multi Chronopic stuff
protected int chronopics;
- protected bool totallyFinishedMulti1;
- protected bool totallyFinishedMulti2;
- protected bool totallyFinishedMulti3;
- protected bool totallyFinishedMulti4;
- protected bool totallyCancelledMulti1;
- protected bool totallyCancelledMulti2;
- protected bool totallyCancelledMulti3;
- protected bool totallyCancelledMulti4;
//for reaction time
@@ -495,7 +481,6 @@ public class EventExecute
protected void cancel_event_before_start(object o, EventArgs args)
{
cancel = true;
- totallyCancelled = true;
//app1.EventEnded();
fakeButtonEventEnded.Click();
@@ -558,18 +543,6 @@ public class EventExecute
set { cancel = value; }
}
- public bool TotallyCancelled
- {
- get { return totallyCancelled; }
- set { totallyCancelled = value; }
- }
-
- public bool TotallyFinished
- {
- get { return totallyFinished; }
- set { totallyFinished = value; }
- }
-
public bool ChronopicDisconnected
{
get { return chronopicDisconnected; }
@@ -582,16 +555,6 @@ public class EventExecute
// multi Chronopic stuff
public int Chronopics { get { return chronopics; } }
- public bool TotallyFinishedMulti1 { get { return totallyFinishedMulti1; } }
- public bool TotallyFinishedMulti2 { get { return totallyFinishedMulti2; } }
- public bool TotallyFinishedMulti3 { get { return totallyFinishedMulti3; } }
- public bool TotallyFinishedMulti4 { get { return totallyFinishedMulti4; } }
-
- public bool TotallyCancelledMulti1 { get { return totallyCancelledMulti1; } }
- public bool TotallyCancelledMulti2 { get { return totallyCancelledMulti2; } }
- public bool TotallyCancelledMulti3 { get { return totallyCancelledMulti3; } }
- public bool TotallyCancelledMulti4 { get { return totallyCancelledMulti4; } }
-
~EventExecute() {}
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index 79db3bd..135f3b1 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -139,7 +139,6 @@ public class JumpExecute : EventExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelled = false;
jumpPhase = jumpPhases.PRE_OR_DOING;
@@ -221,7 +220,6 @@ public class JumpExecute : EventExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelled = false;
jumpPhase = jumpPhases.PRE_OR_DOING;
@@ -433,8 +431,6 @@ public class JumpExecute : EventExecute
{
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
@@ -667,11 +663,9 @@ public class JumpRjExecute : JumpExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelled = false;
//prepare jump for being finished earlier if desired
finish = false;
- totallyFinished = false;
jumpPhase = jumpPhases.PRE_OR_DOING;
@@ -839,8 +833,6 @@ public class JumpRjExecute : JumpExecute
jumpPhase = jumpPhases.PLATFORM_END;
writeRj(false); //tempTable
-
- totallyFinished = true;
} else {
//cancel a jump if clicked finish before any events done
cancel = true;
@@ -850,8 +842,6 @@ public class JumpRjExecute : JumpExecute
if(cancel) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
diff --git a/src/execute/multiChronopic.cs b/src/execute/multiChronopic.cs
index 84351a7..3e0eed4 100644
--- a/src/execute/multiChronopic.cs
+++ b/src/execute/multiChronopic.cs
@@ -237,12 +237,9 @@ public class MultiChronopicExecute : EventExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelledMulti1 = false;
//prepare jump for being finished earlier if desired
finish = false;
- totallyFinishedMulti1 = false;
-
if(chronopics > 1) {
platformState2 = chronopicInitialValue(cp2);
@@ -258,10 +255,6 @@ public class MultiChronopicExecute : EventExecute
return;
}
- totallyCancelledMulti2 = false;
- totallyFinishedMulti2 = false;
-
-
if(chronopics > 2) {
platformState3 = chronopicInitialValue(cp3);
@@ -276,9 +269,6 @@ public class MultiChronopicExecute : EventExecute
return;
}
- totallyCancelledMulti3 = false;
- totallyFinishedMulti3 = false;
-
if(chronopics > 3) {
platformState4 = chronopicInitialValue(cp4);
@@ -292,9 +282,6 @@ public class MultiChronopicExecute : EventExecute
chronopicHasBeenDisconnected();
return;
}
-
- totallyCancelledMulti4 = false;
- totallyFinishedMulti4 = false;
}
}
}
@@ -493,7 +480,7 @@ public class MultiChronopicExecute : EventExecute
} while ( ! success && ! cancel && ! finish );
if (finish) {
- finishThisCp(cpNum);
+ finishThisCp();
//call write on gui/chronojump.cs, because if done in execute/MultiChronopic,
//will be called n times if n chronopics are working
@@ -507,33 +494,13 @@ public class MultiChronopicExecute : EventExecute
if(cancel) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
- cancelThisCp(cpNum);
}
}
- private void finishThisCp (int cp) {
- if (cp==1)
- totallyFinishedMulti1 = true;
- else if (cp==2)
- totallyFinishedMulti2 = true;
- else if (cp==3)
- totallyFinishedMulti3 = true;
- else // if (cp==4)
- totallyFinishedMulti4 = true;
+ private void finishThisCp () {
needEndEvent = true;
}
- private void cancelThisCp (int cp) {
- if (cp==1)
- totallyCancelledMulti1 = true;
- else if (cp==2)
- totallyCancelledMulti2 = true;
- else if (cp==3)
- totallyCancelledMulti3 = true;
- else // if (cp==4)
- totallyCancelledMulti4 = true;
- }
-
protected override bool shouldFinishByTime() {
return false; //this kind of events (simple or Dj jumps) cannot be finished by time
}
diff --git a/src/execute/pulse.cs b/src/execute/pulse.cs
index 54c1e91..4d9745a 100644
--- a/src/execute/pulse.cs
+++ b/src/execute/pulse.cs
@@ -158,11 +158,9 @@ public class PulseExecute : EventExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelled = false;
//prepare jump for being finished earlier if desired
finish = false;
- totallyFinished= false;
//mark we haven't started
pulsePhase = pulsePhases.WAIT_FIRST_EVENT;
@@ -296,13 +294,10 @@ public class PulseExecute : EventExecute
if (finish) {
write();
pulsePhase = pulsePhases.DONE;
- totallyFinished= true;
}
if(cancel || finish) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
diff --git a/src/execute/reactionTime.cs b/src/execute/reactionTime.cs
index d4e0712..bdfae62 100644
--- a/src/execute/reactionTime.cs
+++ b/src/execute/reactionTime.cs
@@ -128,7 +128,6 @@ public class ReactionTimeExecute : EventExecute
//prepare reactionTime for being cancelled if desired
cancel = false;
- totallyCancelled = false;
//in simulated mode, make the jump start just when we arrive to waitEvent at the
first time
//mark now that we have leaved platform:
@@ -256,8 +255,6 @@ public class ReactionTimeExecute : EventExecute
if(cancel) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 2f6bf70..b236434 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -171,7 +171,6 @@ public class RunExecute : EventExecute
//prepare jump for being cancelled if desired
cancel = false;
- totallyCancelled = false;
//start thread
thread = new Thread(new ThreadStart(waitEvent));
@@ -326,8 +325,6 @@ public class RunExecute : EventExecute
if(cancel) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
@@ -748,8 +745,6 @@ public class RunIntervalExecute : RunExecute
//write only if there's a run at minimum
if(Util.GetNumberOfJumps(intervalTimesString, false) >= 1) {
writeRunInterval(false); //tempTable = false
-
- totallyFinished = true;
} else {
//cancel a run if clicked finish before any events done, or ended by time
without events
cancel = true;
@@ -758,8 +753,6 @@ public class RunIntervalExecute : RunExecute
if(cancel || finish) {
//event will be raised, and managed in chronojump.cs
fakeButtonFinished.Click();
-
- totallyCancelled = true;
}
}
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 22d805a..536a8c5 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3585,18 +3585,9 @@ public partial class ChronoJumpWindow
//this will actually cancel Read_cambio and then Read_event in order to really cancel
Chronopic.CancelDo();
- //if(cp2016.StoredCanCaptureContacts)
- // checkCancelTotally(o, args);
-
//let update stats
- //nothing changed, but stats update button cannot be insensitive,
- //because probably some jump type has changed it's jumper
- //the unsensitive of button stats is for showing the user, that he has to update manually
- //because it's not automatically updated
- //because it crashes in some thread problem
- //that will be fixed in other release
- //if(createdStatsWin)
- // showUpdateStatsAndHideData(true);
+ if(createdStatsWin)
+ showUpdateStatsAndHideData(true);
}
private void on_cancel_multi_clicked (object o, EventArgs args)
@@ -3608,77 +3599,8 @@ public partial class ChronoJumpWindow
//this will actually cancel Read_cambio and then Read_event in order to really cancel
Chronopic.CancelDo();
-
- //if(cp2016.StoredCanCaptureContacts)
- // checkCancelMultiTotally(o, args);
}
-
- /*
- //if user doesn't touch the platform after pressing "cancel", sometimes it gets waiting a Read_event
- //now the event cancels ok, and next will be ok, also
- private void checkCancelTotally (object o, EventArgs args)
- {
- if(currentEventExecute.TotallyCancelled)
- LogB.Information("totallyCancelled");
- else {
- LogB.Information("NOT-totallyCancelled ");
- errorWin = ErrorWindow.Show(Catalog.GetString("Please, touch the contact platform for
full cancelling.") + "\n" +
- Catalog.GetString("Then press Accept") + "\n");
- errorWin.Button_accept.Clicked -= new EventHandler(checkCancelTotally);
- errorWin.Button_accept.Clicked += new EventHandler(checkCancelTotally);
-
- //abort test when there are problems with USB disconnected
- errorWin.Show_button_abort();
- errorWin.Button_abort.Clicked += new EventHandler(abortTest);
- }
- }
-
- private void checkCancelMultiTotally (object o, EventArgs args)
- {
- bool needCancel1 = false;
- bool needCancel2 = false;
- bool needCancel3 = false;
- bool needCancel4 = false;
-
- needCancel1 = !currentEventExecute.TotallyCancelledMulti1;
- if(currentEventExecute.Chronopics > 1) {
- needCancel2 = !currentEventExecute.TotallyCancelledMulti2;
- if(currentEventExecute.Chronopics > 2) {
- needCancel3 = !currentEventExecute.TotallyCancelledMulti3;
- if(currentEventExecute.Chronopics > 3)
- needCancel4 = !currentEventExecute.TotallyCancelledMulti4;
- }
- }
-
- if(needCancel1 || needCancel2 || needCancel3 || needCancel4) {
-// LogB.Information("NOT-totallyCancelled ");
- string cancelStr = "";
- string sep = "";
- if(needCancel1) {
- cancelStr += sep + "1";
- sep = ", ";
- }
- if(needCancel2) {
- cancelStr += sep + "2";
- sep = ", ";
- }
- if(needCancel3) {
- cancelStr += sep + "3";
- sep = ", ";
- }
- if(needCancel4) {
- cancelStr += sep + "4";
- sep = ", ";
- }
-
- errorWin = ErrorWindow.Show(string.Format(Catalog.GetString("Please, touch the
contact platform on Chronopic/s [{0}] for full cancelling.\nThen press button\n"), cancelStr));
- errorWin.Button_accept.Clicked += new EventHandler(checkCancelMultiTotally);
- }
- }
- */
-
-
private void on_finish_clicked (object o, EventArgs args)
{
event_execute_ButtonFinish.Clicked -= new EventHandler(on_finish_clicked);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]