[chronojump] code cleaning
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] code cleaning
- Date: Wed, 20 Apr 2011 11:08:35 +0000 (UTC)
commit 0665646b6bb51c259daf3bff5be35b9f28e41d5c
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Apr 20 13:07:23 2011 +0200
code cleaning
src/execute/event.cs | 77 --------------------
src/gui/chronojump.cs | 182 +----------------------------------------------
src/gui/eventExecute.cs | 111 +++++-----------------------
3 files changed, 21 insertions(+), 349 deletions(-)
---
diff --git a/src/execute/event.cs b/src/execute/event.cs
index d9fd7d6..634d587 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -292,9 +292,7 @@ public class EventExecute
needUpdateEventProgressBar = false;
}
-// Console.WriteLine("pulse update graph");
if(needUpdateGraph) {
-// Console.WriteLine("pulse update graph 2");
//solve problems when runAnalysis ended and tries to paint window
if(needUpdateGraphType == eventType.MULTICHRONOPIC && type == Constants.RunAnalysisName && finish)
Console.WriteLine("is MC, RA, finished!");
@@ -304,10 +302,8 @@ public class EventExecute
} else
updateGraph();
-// Console.WriteLine("pulse update graph 3");
needUpdateGraph = false;
}
-// Console.WriteLine("pulse update graph 4");
if(needSensitiveButtonFinish) {
//ButtonFinishMakeSensitive();
@@ -326,9 +322,6 @@ public class EventExecute
finish = true;
updateProgressBarForFinish();
}
-// Console.WriteLine("pulse done");
- //else
- // updateTimeProgressBar();
}
private void runATouchPlatform() {
@@ -399,7 +392,6 @@ public class EventExecute
//if the time is too much, finish
if(timerCount - simulatedTimeAccumulatedBefore > timeMax) {
-// Log.WriteLine("EXCEEDES MAX!");
simulateChangePlatform();
}
@@ -410,10 +402,8 @@ public class EventExecute
//rand.NextDouble gives a value between 0 and 1
//if we multiply by the (simulatedRange * 10 +1), then we will have 4 options if the range is ,4
//check if the value is less than 1 (it's one change in four options) and if it's 1, then simulated the change platform
- //double dice = 0;
double myRand = rand.NextDouble();
double dice = myRand * (simulatedRange *10 +1);
-// Log.WriteLine(string.Format("rand: {0}, dice: {1}", myRand, dice));
if (dice < 1)
{
simulateChangePlatform();
@@ -444,73 +434,6 @@ public class EventExecute
private void updateGraph() {
fakeButtonUpdateGraph.Click();
}
-
- /*
- * TODO: decide where Prepare methods should be. maybe here?, then need to pass layout, pixmap, drawingarea, ...
- switch(needUpdateGraphType) {
- case eventType.JUMP:
- Log.Write("update graph: JUMP");
- app1.PrepareJumpSimpleGraph(
- PrepareEventGraphJumpSimpleObject.tv,
- PrepareEventGraphJumpSimpleObject.tc);
- break;
- case eventType.JUMPREACTIVE:
- Log.Write("update graph: JUMPREACTIVE");
- app1.PrepareJumpReactiveGraph(
- PrepareEventGraphJumpReactiveObject.lastTv,
- PrepareEventGraphJumpReactiveObject.lastTc,
- PrepareEventGraphJumpReactiveObject.tvString,
- PrepareEventGraphJumpReactiveObject.tcString,
- volumeOn, repetitiveConditionsWin);
- break;
- case eventType.RUN:
- Log.Write("update graph: RUN");
- app1.PrepareRunSimpleGraph(
- PrepareEventGraphRunSimpleObject.time,
- PrepareEventGraphRunSimpleObject.speed);
- break;
- case eventType.RUNINTERVAL:
- Log.Write("update graph: RUNINTERVAL");
- app1.PrepareRunIntervalGraph(
- PrepareEventGraphRunIntervalObject.distance,
- PrepareEventGraphRunIntervalObject.lastTime,
- PrepareEventGraphRunIntervalObject.timesString,
- PrepareEventGraphRunIntervalObject.distanceTotal,
- PrepareEventGraphRunIntervalObject.distancesString,
- volumeOn, repetitiveConditionsWin);
- break;
- case eventType.PULSE:
- Log.Write("update graph: PULSE");
- app1.PreparePulseGraph(
- PrepareEventGraphPulse.lastTime,
- PrepareEventGraphPulse.timesString);
- break;
- case eventType.REACTIONTIME:
- Log.Write("update graph: REACTIONTIME");
- app1.PrepareReactionTimeGraph(
- PrepareEventGraphReactionTimeObject.time);
- break;
- case eventType.MULTICHRONOPIC:
- Log.Write("update graph: MULTICHRONOPIC");
- app1.PrepareMultiChronopicGraph(
- //PrepareEventGraphMultiChronopicObject.timestamp,
- PrepareEventGraphMultiChronopicObject.cp1StartedIn,
- PrepareEventGraphMultiChronopicObject.cp2StartedIn,
- PrepareEventGraphMultiChronopicObject.cp3StartedIn,
- PrepareEventGraphMultiChronopicObject.cp4StartedIn,
- PrepareEventGraphMultiChronopicObject.cp1InStr,
- PrepareEventGraphMultiChronopicObject.cp1OutStr,
- PrepareEventGraphMultiChronopicObject.cp2InStr,
- PrepareEventGraphMultiChronopicObject.cp2OutStr,
- PrepareEventGraphMultiChronopicObject.cp3InStr,
- PrepareEventGraphMultiChronopicObject.cp3OutStr,
- PrepareEventGraphMultiChronopicObject.cp4InStr,
- PrepareEventGraphMultiChronopicObject.cp4OutStr
- );
- break;
- }
- */
-// }
protected virtual bool shouldFinishByTime() {
return true;
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 71c02e0..6f8db5c 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -327,7 +327,6 @@ public partial class ChronoJumpWindow
RepairJumpRjWindow repairJumpRjWin;
JumpTypeAddWindow jumpTypeAddWin;
- //RunExtraWindow runExtraWin; //for normal and intervaled runs
RunsMoreWindow runsMoreWin;
RunsIntervalMoreWindow runsIntervalMoreWin;
RunTypeAddWindow runTypeAddWin;
@@ -338,14 +337,12 @@ public partial class ChronoJumpWindow
EditReactionTimeWindow editReactionTimeWin;
EditPulseWindow editPulseWin;
-// PulseExtraWindow pulseExtraWin;
RepairPulseWindow repairPulseWin;
EditMultiChronopicWindow editMultiChronopicWin;
ConfirmWindowJumpRun confirmWinJumpRun; //for deleting jumps and RJ jumps (and runs)
ErrorWindow errorWin;
-// StatsWindow statsWin;
ReportWindow reportWin;
RepetitiveConditionsWindow repetitiveConditionsWin;
GenericWindow genericWin;
@@ -355,8 +352,6 @@ public partial class ChronoJumpWindow
ChronopicWindow chronopicWin;
- //static EventExecuteWindow eventExecuteWin;
-
private bool firstRjValue;
private double rjTcCount;
private double rjTvCount;
@@ -374,7 +369,6 @@ public partial class ChronoJumpWindow
//int chronopicCancelledTimes = 0;
- //const int statusbarID = 1;
//only called the first time the software runs
@@ -423,24 +417,6 @@ public partial class ChronoJumpWindow
createTreeView_persons (treeview_persons);
- /*
- fakeButtonPersonUp = new Gtk.Button();
- fakeButtonPersonDown = new Gtk.Button();
-
-
- AccelGroup accelGroup = new AccelGroup();
- app1.AddAccelGroup(accelGroup);
-
- fakeButtonPersonUp.Clicked += new EventHandler(upClicked);
-
- AccelKey accelKey = new AccelKey(Gdk.Key.Up, Gdk.ModifierType.ControlMask, AccelFlags.Visible);
-
- fakeButtonPersonUp.AddAccelerator("clicked", accelGroup, accelKey);
-
-// Gtk.AccelGroup accelGroup = Accel.GroupsFromObject(app1);
-// fakeButtonPersonUp.AddAccelerator("Clicked", accelGroup, "<CTRL>Up");
- */
-
createTreeView_jumps (treeview_jumps);
createTreeView_jumps_rj (treeview_jumps_rj);
createTreeView_runs (treeview_runs);
@@ -2900,13 +2876,6 @@ Console.WriteLine("X");
}
}
-/*
- private void on_show_report_activate (object o, EventArgs args) {
- Log.WriteLine("open report window");
- reportWin = ReportWindow.Show(app1, report);
- }
- */
-
void on_button_execute_test_clicked (object o, EventArgs args) {
if(radio_mode_jumps_small.Active) {
@@ -3063,23 +3032,14 @@ Console.WriteLine("X");
if(createdStatsWin)
showUpdateStatsAndHideData(false);
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Jump"), //windowTitle
Catalog.GetString("Phases"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.JumpTable, //tableName
currentJumpType.Name
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3088,7 +3048,6 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked -= new EventHandler(on_update_clicked); //if we don't do this, on_update_clicked it's called 'n' times when 'n' events are done
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new JumpExecute(eventExecuteWin, currentPerson.UniqueID, currentPerson.Name,
currentEventExecute = new JumpExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentJumpType.Name, myFall, jumpWeight,
chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
@@ -3195,23 +3154,14 @@ Console.WriteLine("X");
showUpdateStatsAndHideData(false);
//show the event doing window
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Reactive Jump"), //windowTitle
Catalog.GetString("Jumps"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.JumpRjTable, //tableName
currentJumpRjType.Name
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3220,7 +3170,6 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked -= new EventHandler(on_update_clicked); //if we don't do this, on_update_clicked it's called 'n' times when 'n' events are done
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new JumpRjExecute(eventExecuteWin, currentPerson.UniqueID, currentPerson.Name,
currentEventExecute = new JumpRjExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentJumpRjType.Name, myFall, jumpWeight,
progressbarLimit, currentJumpRjType.JumpsLimited,
@@ -3310,28 +3259,6 @@ Console.WriteLine("X");
* --------------------------------------------------------
*/
- /*
- //here comes the unlimited runs (and every run with distance = 0 (undefined)
- private void on_run_extra_activate (object o, EventArgs args)
- {
- Log.WriteLine("run extra");
-
- if(o == (object) button_run_custom || o == (object) menuitem_run_custom) {
- currentRunType = new RunType("Custom");
- } else if (o == (object) button_run_margaria || o == (object) menuitem_run_margaria) {
- currentRunType = new RunType("Margaria");
- }
- // add others...
-
- runExtraWin = RunExtraWindow.Show(app1, currentRunType);
- if( currentRunType.HasIntervals ) {
- runExtraWin.Button_accept.Clicked += new EventHandler(on_run_interval_accepted);
- } else {
- runExtraWin.Button_accept.Clicked += new EventHandler(on_normal_run_activate);
- }
- }
- */
-
//suitable for all runs not repetitive
private void on_normal_run_activate (object o, EventArgs args)
{
@@ -3359,23 +3286,14 @@ Console.WriteLine("X");
if(createdStatsWin)
showUpdateStatsAndHideData(false);
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Run"), //windowTitle
Catalog.GetString("Phases"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.RunTable, //tableName
currentRunType.Name
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3386,7 +3304,6 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new RunExecute(eventExecuteWin, currentPerson.UniqueID, currentSession.UniqueID,
currentEventExecute = new RunExecute(currentPerson.UniqueID, currentSession.UniqueID,
currentRunType.Name, myDistance,
chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, metersSecondsPreferred, volumeOn,
@@ -3448,34 +3365,6 @@ Console.WriteLine("X");
*/
- //interval runs clicked from user interface
- //(not suitable for the other runs we found in "more")
- private void old_on_run_interval_activate (object o, EventArgs args)
- {/*
- if(o == (object) button_run_interval_by_laps || o == (object) menuitem_run_interval_by_laps)
- {
- currentRunType = new RunType("byLaps");
- } else if(o == (object) button_run_interval_by_time || o == (object) menuitem_run_interval_by_time)
- {
- currentRunType = new RunType("byTime");
- } else if(o == (object) button_run_interval_unlimited || o == (object) menuitem_run_interval_unlimited)
- {
- currentRunType = new RunType("unlimited");
- } else if(o == (object) button_run_interval_mtgug || o == (object) menuitem_run_interval_mtgug)
- {
- currentRunType = new RunType("MTGUG");
- }
-
- if( currentRunType.Distance == 0 ||
- (currentRunType.FixedValue == 0 && ! currentRunType.Unlimited) ) {
- runExtraWin = RunExtraWindow.Show(app1, currentRunType);
- runExtraWin.Button_accept.Clicked += new EventHandler(on_run_interval_accepted);
- } else {
- on_run_interval_accepted(o, args);
- }
- */
- }
-
private void on_run_interval_activate (object o, EventArgs args)
{
Log.WriteLine("run interval accepted");
@@ -3491,7 +3380,6 @@ Console.WriteLine("X");
double progressbarLimit = 0;
//if it's a unlimited interval run, put -1 as limit value
- //if(o == (object) button_rj_unlimited || o == (object) rj_unlimited) {
if(currentRunIntervalType.Unlimited) {
progressbarLimit = -1;
} else {
@@ -3515,23 +3403,14 @@ Console.WriteLine("X");
showUpdateStatsAndHideData(false);
//show the event doing window
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
- // Catalog.GetString("Execute Intervallic Run"), //windowTitle
Catalog.GetString("Tracks"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.RunIntervalTable, //tableName
currentRunIntervalType.Name
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3540,7 +3419,6 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked -= new EventHandler(on_update_clicked); //if we don't do this, on_update_clicked it's called 'n' times when 'n' events are done
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new RunIntervalExecute(eventExecuteWin, currentPerson.UniqueID, currentSession.UniqueID, currentRunIntervalType.Name,
currentEventExecute = new RunIntervalExecute(currentPerson.UniqueID, currentSession.UniqueID, currentRunIntervalType.Name,
distanceInterval, progressbarLimit, currentRunIntervalType.TracksLimited,
chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, metersSecondsPreferred, volumeOn, repetitiveConditionsWin,
@@ -3637,25 +3515,14 @@ Console.WriteLine("X");
if(createdStatsWin)
showUpdateStatsAndHideData(false);
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Jump"), //windowTitle
-// Catalog.GetString("Execute Reaction Time"), //windowTitle
Catalog.GetString("Phases"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.ReactionTimeTable, //tableName
- //currentJumpType.Name,
""
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
- );
+ );
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3664,10 +3531,8 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked -= new EventHandler(on_update_clicked); //if we don't do this, on_update_clicked it's called 'n' times when 'n' events are done
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new ReactionTimeExecute(eventExecuteWin, currentPerson.UniqueID, currentPerson.Name,
currentEventExecute = new ReactionTimeExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID,
- //currentJumpType.Name,
chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
progressbarLimit, egd);
@@ -3723,22 +3588,6 @@ Console.WriteLine("X");
* --------------------------------------------------------
*/
- /*
- private void on_button_pulse_free_activate (object o, EventArgs args)
- {
- currentPulseType = new PulseType("Free");
- on_pulse_accepted(o, args);
- }
-
- private void on_button_pulse_custom_activate (object o, EventArgs args)
- {
- currentPulseType = new PulseType("Custom");
-
- pulseExtraWin = PulseExtraWindow.Show(app1, currentPulseType);
- pulseExtraWin.Button_accept.Clicked += new EventHandler(on_pulse_accepted);
- }
- */
-
private void on_pulse_activate (object o, EventArgs args)
{
Log.WriteLine("pulse accepted");
@@ -3770,23 +3619,14 @@ Console.WriteLine("X");
showUpdateStatsAndHideData(false);
//show the event doing window
-// eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Pulse"), //windowTitle
Catalog.GetString("Pulses"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.PulseTable, //tableName
currentPulseType.Name
-// prefsDigitsNumber,
-// progressbarLimit
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_clicked);
@@ -3795,11 +3635,9 @@ Console.WriteLine("X");
event_execute_ButtonUpdate.Clicked -= new EventHandler(on_update_clicked); //if we don't do this, on_update_clicked it's called 'n' times when 'n' events are done
event_execute_ButtonUpdate.Clicked += new EventHandler(on_update_clicked);
- //currentEventExecute = new PulseExecute(eventExecuteWin, currentPerson.UniqueID, currentPerson.Name,
currentEventExecute = new PulseExecute(currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentPulseType.Name, pulseStep, totalPulses,
chronopicWin.CP, event_execute_textview_message, app1, prefsDigitsNumber, volumeOn,
- //progressbarLimit,
egd);
if(!chronopicWin.Connected)
@@ -3965,25 +3803,15 @@ Console.WriteLine("X");
showUpdateStatsAndHideData(false);
//show the event doing window
- //eventExecuteWin = EventExecuteWindow.Show(
ExecutingGraphData egd = event_execute_initializeVariables(
currentPerson.UniqueID,
currentPerson.Name,
-// Catalog.GetString("Execute Multi Chronopic"), //windowTitle
Catalog.GetString("Changes"), //name of the different moments
-// currentPerson.UniqueID, currentPerson.Name,
-// currentSession.UniqueID,
Constants.MultiChronopicTable, //tableName
currentMultiChronopicType.Name
-// prefsDigitsNumber,
-// -1 //-1: unlimited pulses (or changes)
-// chronopicWin.Connected
);
- //eventExecuteWin.ButtonCancel.Clicked += new EventHandler(on_cancel_multi_clicked);
event_execute_ButtonCancel.Clicked += new EventHandler(on_cancel_multi_clicked);
- //multiFinishingByClickFinish = false;
- //eventExecuteWin.ButtonFinish.Clicked += new EventHandler(on_finish_multi_clicked);
event_execute_ButtonFinish.Clicked += new EventHandler(on_finish_multi_clicked);
//when user clicks on update the eventExecute window
@@ -4002,47 +3830,39 @@ Console.WriteLine("X");
if(numConnected == 1)
currentEventExecute = new MultiChronopicExecute(
- //eventExecuteWin,
currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentMultiChronopicType.Name,
chronopicWin.CP,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
app1,
- //progressbarlimit,
egd);
else if(numConnected == 2)
currentEventExecute = new MultiChronopicExecute(
- //eventExecuteWin,
currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentMultiChronopicType.Name,
chronopicWin.CP, chronopicWin.CP2,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
app1,
- //progressbarlimit,
egd);
else if(numConnected == 3)
currentEventExecute = new MultiChronopicExecute(
- //eventExecuteWin,
currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentMultiChronopicType.Name,
chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
app1,
- //progressbarlimit,
egd);
else if(numConnected == 4)
currentEventExecute = new MultiChronopicExecute(
- //eventExecuteWin,
currentPerson.UniqueID, currentPerson.Name,
currentSession.UniqueID, currentMultiChronopicType.Name,
chronopicWin.CP, chronopicWin.CP2, chronopicWin.CP3, chronopicWin.CP4,
syncAvailable, extra_window_check_multichronopic_delete_first.Active,
extra_window_spin_run_analysis_distance.Value.ToString(),
app1,
- //progressbarlimit,
egd);
//if(!chronopicWin.Connected)
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index cbefb1b..0e17aaf 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -197,7 +197,6 @@ public partial class ChronoJumpWindow
string phasesName,
string tableName,
string event_execute_eventType
-// double event_execute_limit
)
{
eventExecuteHideAllTables();
@@ -215,7 +214,6 @@ public partial class ChronoJumpWindow
event_execute_textview_message.Buffer = UtilGtk.TextViewPrint("");
-// event_execute.Title = windowTitle;
//this.event_execute_personName.Text = event_execute_personName; //"Jumps" (rjInterval), "Runs" (runInterval), "Ticks" (pulses),
this.event_execute_label_phases_name.Text = phasesName; //"Jumps" (rjInterval), "Runs" (runInterval), "Ticks" (pulses),
//"Phases" (simple jumps, dj, simple runs)
@@ -586,18 +584,23 @@ public partial class ChronoJumpWindow
//obtain data
- string []jumps = SqliteJump.SelectJumps(currentSession.UniqueID, event_execute_personID, "", event_execute_eventType);
+ string []jumps = SqliteJump.SelectJumps(
+ currentSession.UniqueID, event_execute_personID, "", event_execute_eventType);
-Log.WriteLine("Preparing simple A");
- double tvPersonAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, event_execute_personID, event_execute_tableName, event_execute_eventType, "TV");
- double tvSessionAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "TV");
-Log.WriteLine("Preparing simple B");
+ double tvPersonAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, event_execute_personID,
+ event_execute_tableName, event_execute_eventType, "TV");
+ double tvSessionAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "TV");
double tcPersonAVG = 0;
double tcSessionAVG = 0;
if(tc > 0) {
- tcPersonAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, event_execute_personID, event_execute_tableName, event_execute_eventType, "TC");
- tcSessionAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "TC");
+ tcPersonAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, event_execute_personID,
+ event_execute_tableName, event_execute_eventType, "TC");
+ tcSessionAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "TC");
}
double maxValue = 0;
@@ -641,7 +644,8 @@ Log.WriteLine("Preparing simple B");
}
//paint graph
- paintJumpSimple (event_execute_drawingarea, jumps, tv, tvPersonAVG, tvSessionAVG, tc, tcPersonAVG, tcSessionAVG, maxValue, minValue, topMargin, bottomMargin);
+ paintJumpSimple (event_execute_drawingarea, jumps, tv, tvPersonAVG, tvSessionAVG,
+ tc, tcPersonAVG, tcSessionAVG, maxValue, minValue, topMargin, bottomMargin);
//printLabels
printLabelsJumpSimple (tv, tvPersonAVG, tvSessionAVG, tc, tcPersonAVG, tcSessionAVG);
@@ -922,7 +926,8 @@ Log.WriteLine("Preparing reactive A");
int pulses = Util.GetNumberOfJumps(timesString, true);
//paint graph
- paintPulse (event_execute_drawingarea, lastTime, timesString, Util.GetAverage(timesString), pulses, maxValue, minValue, topMargin, bottomMargin);
+ paintPulse (event_execute_drawingarea, lastTime, timesString,
+ Util.GetAverage(timesString), pulses, maxValue, minValue, topMargin, bottomMargin);
// -- refresh
event_execute_drawingarea.QueueDraw();
@@ -939,8 +944,10 @@ Log.WriteLine("Preparing reactive A");
//obtain data
string [] rts = SqliteReactionTime.SelectReactionTimes(currentSession.UniqueID, event_execute_personID);
- double timePersonAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, event_execute_personID, event_execute_tableName, event_execute_eventType, "time");
- double timeSessionAVG = SqliteSession.SelectAVGEventsOfAType(currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "time");
+ double timePersonAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, event_execute_personID, event_execute_tableName, event_execute_eventType, "time");
+ double timeSessionAVG = SqliteSession.SelectAVGEventsOfAType(
+ currentSession.UniqueID, -1, event_execute_tableName, event_execute_eventType, "time");
double maxValue = 0;
double minValue = 0;
@@ -966,8 +973,6 @@ Log.WriteLine("Preparing reactive A");
}
//paint graph (use simple jump method)
- //TODO: fix this, paintJumpSimple changed
- //paintJumpSimple (event_execute_drawingarea, time, timePersonAVG, timeSessionAVG, 0, 0, 0, maxValue, minValue, topMargin, bottomMargin);
paintJumpSimple (event_execute_drawingarea, rts, time, timePersonAVG, timeSessionAVG, 0, 0, 0, maxValue, minValue, topMargin, bottomMargin);
printLabelsReactionTime (time, timePersonAVG, timeSessionAVG);
@@ -1872,55 +1877,8 @@ Log.WriteLine("Preparing reactive A");
void on_event_execute_button_help_clicked (object o, EventArgs args)
{
-/*
- new DialogMessage(Constants.MessageTypes.HELP, Catalog.GetString("This window shows the execution of a test. In the graph, you may see:\n\nSIMPLE TESTS:\n-\"Now\": shows the data of the current test.\n-\"Person AVG\": shows the average of the current person executing this type of test on this session.\n-\"Session AVG\": shows the Average of all persons executing this type of test on this session.\n\nREPETITIVE TESTS:\n-\"Now\": shows the data of the current test.\n-\"AVG\": shows the average of the current test.\n\n(For more statistics data, you may use the statistics window).\n\nYou may change the graph options using buttons on the left.\n\nAt the bottom you may see the evolution of the test, and you may finish it (depending on the type of test), or even cancel it."));
-*/
- }
-
-/*
- public void ProgressBarEventOrTimePreExecution (bool isEvent, bool percentageMode, double events)
- {
- if (isEvent)
- progressbarEventOrTimeExecution (event_execute_progressbar_event, percentageMode, event_execute_label_event_value, events);
- else
- progressbarEventOrTimeExecution (event_execute_progressbar_time, percentageMode, event_execute_label_time_value, events);
}
- private void progressbarEventOrTimeExecution (Gtk.ProgressBar progressbar, bool percentageMode, Gtk.Label label_value, double events)
- {
- if(event_execute_limit == -1) { //unlimited event (until 'finish' is clicked)
- progressbar.Pulse();
- //label_value.Text = events.ToString();
- if(events != -1)
- label_value.Text = Math.Round(events,3).ToString();
- } else {
- if(percentageMode) {
- double myFraction = events / event_execute_limit;
-
- if(myFraction > 1)
- myFraction = 1;
- else if(myFraction < 0)
- myFraction = 0;
-
- progressbar.Fraction = myFraction;
- //progressbar.Text = Util.TrimDecimals(events.ToString(), 1) + " / " + event_execute_limit.ToString();
- if(events == -1) //we don't want to display nothing
- //progressbar.Text = "";
- label_value.Text = "";
- else
- label_value.Text = Math.Round(events,3).ToString();
- } else {
- //activity mode
- progressbar.Pulse();
-
- //pass -1 in events in activity mode if don't want to use this label
- if(events != -1)
- //label_value.Text = Util.TrimDecimals(events.ToString(), 1);
- label_value.Text = Math.Round(events,3).ToString();
- }
- }
- }
- */
//projecte cubevirtual de juan gonzalez
@@ -2002,35 +1960,6 @@ Log.WriteLine("Preparing reactive A");
{
hideButtons();
}
-
- void on_event_execute_button_close_clicked (object o, EventArgs args)
- {
- /*
- //capturerWindow.Hide();
-
- EventExecuteWindowBox.event_execute.Hide();
- EventExecuteWindowBox.event_execute.Destroy();
- EventExecuteWindowBox = null;
- */
- }
-
- void on_event_execute_delete_event (object o, DeleteEventArgs args)
- {
- /*
- //if there's an event doing, simulate a cancel
- //see eventHasEnded comments at beginning of this file
- if(!eventHasEnded)
- event_execute_button_cancel.Click();
-
- capturer.Close();
- capturer.Dispose();
- //capturerWindow.Hide();
-
- EventExecuteWindowBox.event_execute.Hide();
- EventExecuteWindowBox.event_execute.Destroy();
- EventExecuteWindowBox = null;
- */
- }
//when event finishes, we should put in the label_time, the correct totalTime, that comes from chronopic
//label_time shows a updating value from a software chrono: onTimer, this is not exact and is now
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]