Commit 28a76ed5 authored by Xavier de Blas's avatar Xavier de Blas

Add run type and run interval type (closes task: 282)

Add jump type with unlimited and improved usability

improved usability of combos of jumps and runs adding a alignement,
¡mproved usability in preferences window
minor improving of other gui's

fixed bug in jumping or running from more in "simulated" that calls
more_accepted several incrementing times (this error comes from the
"more" windows change in last cvs commit
parent 1b946f02
......@@ -18,7 +18,7 @@ MCS = mcs
CHRONOJUMP = chronojump
CHRONOJUMP_DEP_GUI = src/gui/confirm.cs src/gui/error.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs
CHRONOJUMP_DEP_GUI = src/gui/confirm.cs src/gui/error.cs src/gui/jump.cs src/gui/jumpType.cs src/gui/run.cs src/gui/runType.cs src/gui/person.cs src/gui/preferences.cs src/gui/session.cs src/gui/stats.cs
CHRONOJUMP_DEP_STATS = src/stats/main.cs src/stats/global.cs src/stats/sjCmjAbk.cs src/stats/sjCmjAbkPlus.cs src/stats/djIndex.cs src/stats/rjIndex.cs src/stats/rjPotencyBosco.cs src/stats/rjEvolution.cs src/stats/ieIub.cs
CHRONOJUMP_DEP_GRAPHS = src/stats/graphs/graphData.cs src/stats/graphs/graphSerie.cs src/stats/graphs/global.cs src/stats/graphs/sjCmjAbk.cs src/stats/graphs/sjCmjAbkPlus.cs src/stats/graphs/djIndex.cs src/stats/graphs/rjIndex.cs src/stats/graphs/rjPotencyBosco.cs src/stats/graphs/rjEvolution.cs src/stats/graphs/ieIub.cs
......
CHANGELOG:
18 aug 2005
Add run type and run interval type (closes task: 282)
Add jump type with unlimited and improved usability
improved usability of combos of jumps and runs adding a alignement,
improved usability in preferences window
minor improving of other gui's
fixed bug in jumping or running from more in "simulated" that calls
more_accepted several incrementing times (this error comes from the
"more" windows change in last cvs commit
17 aug 2005
run interval execute unlimited
run interval execute unlimited (Fixes task 283)
run interval more
run interval cancel
run interval finish
run interval finish (three above fixed task 281)
"more" windows get hided when clic on "accept" (now suitable to clic cancel or finish)
fixed bugs in unlimited RJ jumps and interval runs
......
No preview for this file type
This diff is collapsed.
......@@ -215,7 +215,7 @@ public class ChronoJump
RunExtraWindow runExtraWin; //for normal and intervaled runs
RunsMoreWindow runsMoreWin;
RunsIntervalMoreWindow runsIntervalMoreWin;
//RunTypeAddWindow runTypeAddWin;
RunTypeAddWindow runTypeAddWin;
EditRunWindow editRunWin;
EditRunIntervalWindow editRunIntervalWin;
......@@ -296,7 +296,7 @@ public class ChronoJump
rand = new Random(40);
//init connecting with chronopic
chronopicInit();
//chronopicInit();
program.Run();
}
......@@ -670,9 +670,21 @@ public class ChronoJump
}
private void updateComboJumpsRj() {
combo_jumps_rj.PopdownStrings = SqliteJumpType.SelectJumpRjTypes(allJumpsName, true); //only select name
combo_jumps_rj.PopdownStrings =
SqliteJumpType.SelectJumpRjTypes(allJumpsName, true); //only select name
}
private void updateComboRuns() {
combo_runs.PopdownStrings =
SqliteRunType.SelectRunTypes(allRunsName, true); //only select name
}
private void updateComboRunsInterval() {
combo_runs_interval.PopdownStrings =
SqliteRunType.SelectRunIntervalTypes(allRunsName, true); //only select name
}
private bool updateComboSujetoCurrent() {
string [] jumpers = SqlitePersonSession.SelectCurrentSession(currentSession.UniqueID);
combo_person_current.PopdownStrings = jumpers;
......@@ -1202,10 +1214,7 @@ public class ChronoJump
private void on_cancel_clicked (object o, EventArgs args)
{
Console.WriteLine("Cancel");
//this will cancel jumps or runs
if(currentEventIsJump) {
if (currentJumpType.IsRepetitive) {
currentJumpRj.Cancel = true;
......@@ -1223,8 +1232,6 @@ public class ChronoJump
private void on_finish_clicked (object o, EventArgs args)
{
Console.WriteLine("Finish (not implemented)");
//this will finish jumps or runs
if(currentEventIsJump) {
currentJumpRj.Finish = true;
......@@ -1258,6 +1265,8 @@ public class ChronoJump
//used from the dialogue "jumps more"
private void on_more_jumps_accepted (object o, EventArgs args)
{
jumpsMoreWin.Button_accept.Clicked -= new EventHandler(on_more_jumps_accepted);
currentJumpType = new JumpType(
jumpsMoreWin.SelectedJumpType,
jumpsMoreWin.SelectedStartIn,
......@@ -1391,7 +1400,7 @@ public class ChronoJump
//used from the dialogue "jumps rj more"
private void on_more_jumps_rj_accepted (object o, EventArgs args)
{
Console.WriteLine("--1 jumpsRjMoreWin.SelectedLimited: {0}", jumpsRjMoreWin.SelectedLimited);
jumpsRjMoreWin.Button_accept.Clicked -= new EventHandler(on_more_jumps_rj_accepted);
currentJumpType = new JumpType(
jumpsRjMoreWin.SelectedJumpType,
......@@ -1543,6 +1552,8 @@ public class ChronoJump
//used from the dialogue "runs more"
private void on_more_runs_accepted (object o, EventArgs args)
{
runsMoreWin.Button_accept.Clicked -= new EventHandler(on_more_runs_accepted);
currentRunType = new RunType(
runsMoreWin.SelectedRunType, //name
false, //hasIntervals
......@@ -1661,13 +1672,14 @@ public class ChronoJump
private void on_button_run_interval_more_clicked (object o, EventArgs args)
{
Console.WriteLine("button run interval more");
runsIntervalMoreWin = RunsIntervalMoreWindow.Show(app1);
runsIntervalMoreWin.Button_accept.Clicked += new EventHandler(on_more_runs_interval_accepted);
}
private void on_more_runs_interval_accepted (object o, EventArgs args)
{
runsIntervalMoreWin.Button_accept.Clicked -= new EventHandler(on_more_runs_interval_accepted);
currentRunType = new RunType(
runsIntervalMoreWin.SelectedRunType, //name
true, //hasIntervals
......@@ -2130,14 +2142,14 @@ public class ChronoJump
private void on_run_type_add_activate (object o, EventArgs args) {
Console.WriteLine("Add new run type");
//runTypeAddWin = RunTypeAddWindow.Show(app1);
//runTypeAddWin.Button_accept.Clicked += new EventHandler(on_run_type_add_accepted);
runTypeAddWin = RunTypeAddWindow.Show(app1);
runTypeAddWin.Button_accept.Clicked += new EventHandler(on_run_type_add_accepted);
}
private void on_run_type_add_accepted (object o, EventArgs args) {
Console.WriteLine("ACCEPTED Add new run type");
//updateComboRuns();
//updateComboJumpsRj();
updateComboRuns();
updateComboRunsInterval();
}
......
......@@ -39,7 +39,9 @@ public class JumpTypeAddWindow
[Widget] Gtk.Entry entry_name;
[Widget] Gtk.RadioButton radiobutton_simple;
[Widget] Gtk.RadioButton radiobutton_repetitive;
[Widget] Gtk.RadioButton radiobutton_unlimited;
[Widget] Gtk.VBox vbox_limited;
[Widget] Gtk.HBox hbox_fixed;
[Widget] Gtk.RadioButton radiobutton_limited_jumps;
[Widget] Gtk.CheckButton checkbutton_limited_fixed;
[Widget] Gtk.SpinButton spin_fixed_num;
......@@ -76,8 +78,10 @@ public class JumpTypeAddWindow
private void fillDialog ()
{
vbox_limited.Sensitive = false;
hbox_fixed.Sensitive = false;
button_accept.Sensitive = false;
spin_fixed_num.Sensitive = false;
radiobutton_extra_weight_no.Active = true;
}
void on_button_cancel_clicked (object o, EventArgs args)
......@@ -121,15 +125,23 @@ public class JumpTypeAddWindow
SqliteJumpType.JumpTypeInsert(myJump, false); //false, because dbcon is not opened
} else {
if(radiobutton_limited_jumps.Active) {
myJump = myJump + ":1";
} else {
myJump = myJump + ":0";
}
if(checkbutton_limited_fixed.Active) {
myJump = myJump + ":" + spin_fixed_num.Value;
if(radiobutton_unlimited.Active) {
//unlimited (but in jumps do like if it's limited by jumps
//(explanation in sqlite/jumpType.cs)
myJump = myJump + ":1:-1";
} else {
myJump = myJump + ":0";
if(radiobutton_limited_jumps.Active) {
myJump = myJump + ":1";
} else {
myJump = myJump + ":0";
}
if(checkbutton_limited_fixed.Active) {
myJump = myJump + ":" + spin_fixed_num.Value;
} else {
myJump = myJump + ":0";
}
}
myJump = myJump + ":" +
......@@ -148,11 +160,25 @@ public class JumpTypeAddWindow
void on_radiobutton_simple_toggled (object o, EventArgs args)
{
vbox_limited.Sensitive = false;
hbox_fixed.Sensitive = false;
}
void on_radiobutton_repetitive_toggled (object o, EventArgs args)
{
vbox_limited.Sensitive = true;
if( ! radiobutton_unlimited.Active) {
hbox_fixed.Sensitive = true;
}
}
void on_radiobutton_limited_jumps_or_time_toggled (object o, EventArgs args)
{
hbox_fixed.Sensitive = true;
}
void on_radiobutton_unlimited_toggled (object o, EventArgs args)
{
hbox_fixed.Sensitive = false;
}
void on_checkbutton_limited_fixed_clicked (object o, EventArgs args)
......
......@@ -36,9 +36,8 @@ public class PreferencesWindow {
[Widget] Gtk.CheckButton checkbutton_initial_speed;
[Widget] Gtk.CheckButton checkbutton_ask_deletion;
[Widget] Gtk.CheckButton checkbutton_height_preferred;
[Widget] Gtk.RadioButton radiobutton_weight_stats_percent;
[Widget] Gtk.RadioButton radiobutton_weight_stats_kgs;
[Widget] Gtk.CheckButton checkbutton_meters_seconds_preferred;
[Widget] Gtk.CheckButton checkbutton_percent_kg_preferred;
[Widget] Gtk.Button button_accept;
......@@ -83,10 +82,10 @@ public class PreferencesWindow {
}
if(weightStatsPercent) {
PreferencesWindowBox.radiobutton_weight_stats_percent.Active = true;
PreferencesWindowBox.checkbutton_percent_kg_preferred.Active = true;
}
else {
PreferencesWindowBox.radiobutton_weight_stats_kgs.Active = true;
PreferencesWindowBox.checkbutton_percent_kg_preferred.Active = false;
}
if(heightPreferred) {
......@@ -126,7 +125,7 @@ public class PreferencesWindow {
SqlitePreferences.Update("showHeight", PreferencesWindowBox.checkbutton_height.Active.ToString());
SqlitePreferences.Update("showInitialSpeed", PreferencesWindowBox.checkbutton_initial_speed.Active.ToString());
SqlitePreferences.Update("askDeletion", PreferencesWindowBox.checkbutton_ask_deletion.Active.ToString());
SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.radiobutton_weight_stats_percent.Active.ToString());
SqlitePreferences.Update("weightStatsPercent", PreferencesWindowBox.checkbutton_percent_kg_preferred.Active.ToString());
SqlitePreferences.Update("heightPreferred", PreferencesWindowBox.checkbutton_height_preferred.Active.ToString());
SqlitePreferences.Update("metersSecondsPreferred", PreferencesWindowBox.checkbutton_meters_seconds_preferred.Active.ToString());
......
......@@ -537,7 +537,7 @@ public class JumpRj : Jump
//if it's a unlimited reactive jump and it's simulated, put random value in limitAsDouble (will be jumps)
if(limitAsDouble == -1) {
limitAsDouble = Convert.ToInt32(rand.NextDouble() * 7);
limitAsDouble = Convert.ToInt32(rand.NextDouble() * 7) +10; //+10 for not allowing being 0
jumpsLimited = true;
limited = limitAsDouble.ToString() + "J";
}
......
......@@ -379,7 +379,7 @@ public class RunInterval : Run
//if it's a unlimited intetrvalic run and it's simulated, put random value in limitAsDouble (will be tracks)
if(limitAsDouble == -1) {
limitAsDouble = Convert.ToInt32(rand.NextDouble() * 7);
limitAsDouble = Convert.ToInt32(rand.NextDouble() * 7) +10; //+10 for not allowing being 0
tracksLimited = true;
limited = limitAsDouble.ToString() + "R";
}
......
......@@ -75,10 +75,17 @@ class SqliteJumpType : Sqlite
"name TEXT, " +
"startIn INT, " + //if it starts inside or outside the platform
"weight INT, " +
"jumpsLimited INT, " + //1 imited by jumps; 0 limited by time
"fixedValue FLOAT, " + //0: no fixed value (ask),
//-1: don't ask (jump until "finish" button is clicked;
//3.5: 3.5 jumps or seconds
"jumpsLimited INT, " + //1 limited by jumps; 0 limited by time
"fixedValue FLOAT, " + //0: no fixed value (ask in jump_extra widget),
//3.5: 3.5 jumps or seconds (don't ask in jump_extra)
//-1: unlimited: jump until "finish" button is clicked
// don't ask in jump_extra
// always comes with jumpsLimited value)
// in runs, unlimited goes with seconds, this is because
// unlimited jumps can finish when a certain number is reached,
// and it's easy to stop just when on jump is finished.
// In runs, by the other way, sometimes is not possible to arrive
// to the end of the track, and limitation value is seconds
"description TEXT )";
dbcmd.ExecuteNonQuery();
}
......@@ -143,6 +150,7 @@ class SqliteJumpType : Sqlite
{
//allJumpsName: add and "allJumpsName" value
//filter: "" all jumps, "TC" only with previous fall, "nonTC" only not with previous fall
// used in gui/stats.cs
//onlyName: return only type name
string whereString = "";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment