Commit e2e66949 authored by Xavier de Blas's avatar Xavier de Blas

DB 1.24 runs options on SQL and preferences win

parent 009970a5
This diff is collapsed.
...@@ -825,7 +825,7 @@ public class Constants ...@@ -825,7 +825,7 @@ public class Constants
public enum EncoderAutoSaveCurve { ALL, NONE, BESTMEANPOWER } public enum EncoderAutoSaveCurve { ALL, NONE, BESTMEANPOWER }
public enum DoubleContact { public enum DoubleContact {
FIRST, AVERAGE, LAST NONE, FIRST, AVERAGE, LAST
} }
//DISPLACED means: total //DISPLACED means: total
......
...@@ -43,9 +43,8 @@ public class RunExecute : EventExecute ...@@ -43,9 +43,8 @@ public class RunExecute : EventExecute
} }
protected static runPhases runPhase; protected static runPhases runPhase;
protected bool checkDoubleContact;
protected int checkDoubleContactTime;
protected Constants.DoubleContact checkDoubleContactMode; protected Constants.DoubleContact checkDoubleContactMode;
protected int checkDoubleContactTime;
protected bool speedStartArrival; protected bool speedStartArrival;
...@@ -57,8 +56,7 @@ public class RunExecute : EventExecute ...@@ -57,8 +56,7 @@ public class RunExecute : EventExecute
Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app,
int pDN, bool metersSecondsPreferred, bool volumeOn, int pDN, bool metersSecondsPreferred, bool volumeOn,
double progressbarLimit, ExecutingGraphData egd, double progressbarLimit, ExecutingGraphData egd,
bool checkDoubleContact, int checkDoubleContactTime, Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime,
Constants.DoubleContact checkDoubleContactMode,
bool speedStartArrival bool speedStartArrival
) )
{ {
...@@ -76,9 +74,8 @@ public class RunExecute : EventExecute ...@@ -76,9 +74,8 @@ public class RunExecute : EventExecute
this.volumeOn = volumeOn; this.volumeOn = volumeOn;
this.progressbarLimit = progressbarLimit; this.progressbarLimit = progressbarLimit;
this.egd = egd; this.egd = egd;
this.checkDoubleContact = checkDoubleContact;
this.checkDoubleContactTime = checkDoubleContactTime;
this.checkDoubleContactMode = checkDoubleContactMode; this.checkDoubleContactMode = checkDoubleContactMode;
this.checkDoubleContactTime = checkDoubleContactTime;
this.speedStartArrival = speedStartArrival; this.speedStartArrival = speedStartArrival;
fakeButtonUpdateGraph = new Gtk.Button(); fakeButtonUpdateGraph = new Gtk.Button();
...@@ -231,7 +228,7 @@ public class RunExecute : EventExecute ...@@ -231,7 +228,7 @@ public class RunExecute : EventExecute
timestamp = simulatedTimeLast * 1000; //conversion to milliseconds timestamp = simulatedTimeLast * 1000; //conversion to milliseconds
//prevent double contact stuff //prevent double contact stuff
if(checkDoubleContact) { if(checkDoubleContactMode != Constants.DoubleContact.NONE) {
if(timestamp <= checkDoubleContactTime) { if(timestamp <= checkDoubleContactTime) {
/* /*
when checking double contact when checking double contact
...@@ -268,7 +265,7 @@ public class RunExecute : EventExecute ...@@ -268,7 +265,7 @@ public class RunExecute : EventExecute
} }
} }
if(! checkDoubleContact) if(checkDoubleContactMode == Constants.DoubleContact.NONE)
success = true; success = true;
if(success) { if(success) {
...@@ -300,7 +297,7 @@ public class RunExecute : EventExecute ...@@ -300,7 +297,7 @@ public class RunExecute : EventExecute
//change the automata state //change the automata state
loggedState = States.OFF; loggedState = States.OFF;
if(checkDoubleContact && timestampDCn > 0) if(checkDoubleContactMode != Constants.DoubleContact.NONE && timestampDCn > 0)
timestampDCContactTimes += timestamp; timestampDCContactTimes += timestamp;
else { else {
if(runPhase == runPhases.PLATFORM_INI_YES_TIME) if(runPhase == runPhases.PLATFORM_INI_YES_TIME)
...@@ -473,8 +470,7 @@ public class RunIntervalExecute : RunExecute ...@@ -473,8 +470,7 @@ public class RunIntervalExecute : RunExecute
Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool metersSecondsPreferred, Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool metersSecondsPreferred,
bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin, bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
double progressbarLimit, ExecutingGraphData egd , double progressbarLimit, ExecutingGraphData egd ,
bool checkDoubleContact, int checkDoubleContactTime, Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime,
Constants.DoubleContact checkDoubleContactMode,
bool speedStartArrival bool speedStartArrival
) )
{ {
...@@ -511,9 +507,8 @@ public class RunIntervalExecute : RunExecute ...@@ -511,9 +507,8 @@ public class RunIntervalExecute : RunExecute
this.repetitiveConditionsWin = repetitiveConditionsWin; this.repetitiveConditionsWin = repetitiveConditionsWin;
this.progressbarLimit = progressbarLimit; this.progressbarLimit = progressbarLimit;
this.egd = egd; this.egd = egd;
this.checkDoubleContact = checkDoubleContact;
this.checkDoubleContactTime = checkDoubleContactTime;
this.checkDoubleContactMode = checkDoubleContactMode; this.checkDoubleContactMode = checkDoubleContactMode;
this.checkDoubleContactTime = checkDoubleContactTime;
this.speedStartArrival = speedStartArrival; this.speedStartArrival = speedStartArrival;
fakeButtonUpdateGraph = new Gtk.Button(); fakeButtonUpdateGraph = new Gtk.Button();
...@@ -594,7 +589,7 @@ public class RunIntervalExecute : RunExecute ...@@ -594,7 +589,7 @@ public class RunIntervalExecute : RunExecute
if(simulated) if(simulated)
timestamp = simulatedTimeLast * 1000; //conversion to milliseconds timestamp = simulatedTimeLast * 1000; //conversion to milliseconds
if(checkDoubleContact) { if(checkDoubleContactMode != Constants.DoubleContact.NONE) {
if(timestamp <= checkDoubleContactTime) { if(timestamp <= checkDoubleContactTime) {
/* /*
when checking double contact when checking double contact
...@@ -715,7 +710,7 @@ public class RunIntervalExecute : RunExecute ...@@ -715,7 +710,7 @@ public class RunIntervalExecute : RunExecute
feedbackMessage = ""; feedbackMessage = "";
needShowFeedbackMessage = true; needShowFeedbackMessage = true;
} else { } else {
if(checkDoubleContact && timestampDCn > 0) if(checkDoubleContactMode != Constants.DoubleContact.NONE && timestampDCn > 0)
timestampDCContactTimes += timestamp; timestampDCContactTimes += timestamp;
else else
lastTc = timestamp/1000.0; lastTc = timestamp/1000.0;
......
...@@ -572,14 +572,6 @@ public partial class ChronoJumpWindow ...@@ -572,14 +572,6 @@ public partial class ChronoJumpWindow
on_extra_window_jumps_test_changed(new object(), new EventArgs()); on_extra_window_jumps_test_changed(new object(), new EventArgs());
//changeTestImage("", "", "LOGO"); //changeTestImage("", "", "LOGO");
//don't know why Glade is not doing this
spinbutton_runs_prevent_double_contact.Value=1000;
spinbutton_runs_i_prevent_double_contact.Value=1000;
radio_runs_prevent_double_contact_last.Active = true;
radio_runs_i_prevent_double_contact_average.Active = true;
//We have no session, mark some widgets as ".Sensitive = false" //We have no session, mark some widgets as ".Sensitive = false"
sensitiveGuiNoSession(); sensitiveGuiNoSession();
definedSession = false; definedSession = false;
...@@ -873,22 +865,6 @@ public partial class ChronoJumpWindow ...@@ -873,22 +865,6 @@ public partial class ChronoJumpWindow
changeVideoButtons(preferences.videoOn); changeVideoButtons(preferences.videoOn);
//load preferences, update radios, but not update database
update_sqlite_at_runs_speed_radios = false;
if (preferences.runSpeedStartArrival)
radio_runs_speed_start_arrival.Active = true;
else
radio_runs_speed_start_leaving.Active = true;
if (preferences.runISpeedStartArrival)
radio_runs_i_speed_start_arrival.Active = true;
else
radio_runs_i_speed_start_leaving.Active = true;
update_sqlite_at_runs_speed_radios = true;
//change language works on windows. On Linux let's change the locale //change language works on windows. On Linux let's change the locale
//if(UtilAll.IsWindows()) //if(UtilAll.IsWindows())
// languageChange(); // languageChange();
...@@ -4139,24 +4115,6 @@ public partial class ChronoJumpWindow ...@@ -4139,24 +4115,6 @@ public partial class ChronoJumpWindow
* -------------------------------------------------------- * --------------------------------------------------------
*/ */
private Constants.DoubleContact getDoubleContactModes(bool runSimple) {
if(runSimple) {
if(radio_runs_prevent_double_contact_first.Active)
return Constants.DoubleContact.FIRST;
else if(radio_runs_prevent_double_contact_average.Active)
return Constants.DoubleContact.AVERAGE;
else
return Constants.DoubleContact.LAST;
} else { //runInterval
if(radio_runs_i_prevent_double_contact_first.Active)
return Constants.DoubleContact.FIRST;
else if(radio_runs_i_prevent_double_contact_average.Active)
return Constants.DoubleContact.AVERAGE;
else
return Constants.DoubleContact.LAST;
}
}
//suitable for all runs not repetitive //suitable for all runs not repetitive
private void on_normal_run_activate (object o, EventArgs args) private void on_normal_run_activate (object o, EventArgs args)
{ {
...@@ -4209,10 +4167,9 @@ public partial class ChronoJumpWindow ...@@ -4209,10 +4167,9 @@ public partial class ChronoJumpWindow
chronopicWin.CP, event_execute_label_message, app1, chronopicWin.CP, event_execute_label_message, app1,
preferences.digitsNumber, preferences.metersSecondsPreferred, preferences.volumeOn, preferences.digitsNumber, preferences.metersSecondsPreferred, preferences.volumeOn,
progressbarLimit, egd, progressbarLimit, egd,
checkbutton_runs_prevent_double_contact.Active, preferences.runDoubleContactsMode,
(int) spinbutton_runs_prevent_double_contact.Value, preferences.runDoubleContactsMS,
getDoubleContactModes(true), //true: runSimple preferences.runSpeedStartArrival
radio_runs_speed_start_arrival.Active
); );
if (!chronopicWin.Connected) if (!chronopicWin.Connected)
...@@ -4333,10 +4290,9 @@ public partial class ChronoJumpWindow ...@@ -4333,10 +4290,9 @@ public partial class ChronoJumpWindow
chronopicWin.CP, event_execute_label_message, app1, chronopicWin.CP, event_execute_label_message, app1,
preferences.digitsNumber, preferences.metersSecondsPreferred, preferences.volumeOn, repetitiveConditionsWin, preferences.digitsNumber, preferences.metersSecondsPreferred, preferences.volumeOn, repetitiveConditionsWin,
progressbarLimit, egd, progressbarLimit, egd,
checkbutton_runs_i_prevent_double_contact.Active, preferences.runIDoubleContactsMode,
(int) spinbutton_runs_i_prevent_double_contact.Value, preferences.runIDoubleContactsMS,
getDoubleContactModes(false), //false: not runSimple preferences.runSpeedStartArrival
radio_runs_i_speed_start_arrival.Active
); );
......
...@@ -34,6 +34,8 @@ public class PreferencesWindow { ...@@ -34,6 +34,8 @@ public class PreferencesWindow {
[Widget] Gtk.Window preferences_win; [Widget] Gtk.Window preferences_win;
//database tab
[Widget] Gtk.Label label_database; [Widget] Gtk.Label label_database;
[Widget] Gtk.Label label_database_temp; [Widget] Gtk.Label label_database_temp;
...@@ -50,55 +52,72 @@ public class PreferencesWindow { ...@@ -50,55 +52,72 @@ public class PreferencesWindow {
[Widget] Gtk.Box hbox_backup_doing; [Widget] Gtk.Box hbox_backup_doing;
[Widget] Gtk.ProgressBar pulsebar; [Widget] Gtk.ProgressBar pulsebar;
[Widget] Gtk.ComboBox combo_decimals;
//jumps tab
[Widget] Gtk.CheckButton checkbutton_power; [Widget] Gtk.CheckButton checkbutton_power;
[Widget] Gtk.CheckButton checkbutton_stiffness; [Widget] Gtk.CheckButton checkbutton_stiffness;
[Widget] Gtk.CheckButton checkbutton_initial_speed; [Widget] Gtk.CheckButton checkbutton_initial_speed;
[Widget] Gtk.CheckButton checkbutton_angle; [Widget] Gtk.CheckButton checkbutton_angle;
[Widget] Gtk.CheckButton checkbutton_show_tv_tc_index; [Widget] Gtk.CheckButton checkbutton_show_tv_tc_index;
[Widget] Gtk.Box hbox_indexes; [Widget] Gtk.Box hbox_indexes;
[Widget] Gtk.RadioButton radiobutton_show_q_index; [Widget] Gtk.RadioButton radiobutton_show_q_index;
[Widget] Gtk.RadioButton radiobutton_show_dj_index; [Widget] Gtk.RadioButton radiobutton_show_dj_index;
[Widget] Gtk.CheckButton checkbutton_ask_deletion;
[Widget] Gtk.RadioButton radio_elevation_height; [Widget] Gtk.RadioButton radio_elevation_height;
[Widget] Gtk.RadioButton radio_elevation_tf; [Widget] Gtk.RadioButton radio_elevation_tf;
[Widget] Gtk.RadioButton radio_speed_ms;
[Widget] Gtk.RadioButton radio_speed_km;
[Widget] Gtk.RadioButton radio_weight_percent; [Widget] Gtk.RadioButton radio_weight_percent;
[Widget] Gtk.RadioButton radio_weight_kg; [Widget] Gtk.RadioButton radio_weight_kg;
[Widget] Gtk.RadioButton radio_use_heights_on_jump_indexes;
[Widget] Gtk.RadioButton radio_do_not_use_heights_on_jump_indexes;
//runs tab
[Widget] Gtk.RadioButton radio_speed_ms;
[Widget] Gtk.RadioButton radio_speed_km;
[Widget] Gtk.RadioButton radio_runs_speed_start_arrival;
[Widget] Gtk.RadioButton radio_runs_speed_start_leaving;
[Widget] Gtk.Box vbox_runs_prevent_double_contact;
[Widget] Gtk.CheckButton checkbutton_runs_prevent_double_contact;
[Widget] Gtk.SpinButton spinbutton_runs_prevent_double_contact;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_first;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_average;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_last;
[Widget] Gtk.Box vbox_runs_i_prevent_double_contact;
[Widget] Gtk.CheckButton checkbutton_runs_i_prevent_double_contact;
[Widget] Gtk.SpinButton spinbutton_runs_i_prevent_double_contact;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_first;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_average;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_last;
//encoder tab
[Widget] Gtk.CheckButton checkbutton_encoder_propulsive; [Widget] Gtk.CheckButton checkbutton_encoder_propulsive;
[Widget] Gtk.SpinButton spin_encoder_smooth_con; [Widget] Gtk.SpinButton spin_encoder_smooth_con;
[Widget] Gtk.Label label_encoder_con; [Widget] Gtk.Label label_encoder_con;
[Widget] Gtk.RadioButton radio_encoder_1RM_nonweighted; [Widget] Gtk.RadioButton radio_encoder_1RM_nonweighted;
[Widget] Gtk.RadioButton radio_encoder_1RM_weighted; [Widget] Gtk.RadioButton radio_encoder_1RM_weighted;
[Widget] Gtk.RadioButton radio_encoder_1RM_weighted2; [Widget] Gtk.RadioButton radio_encoder_1RM_weighted2;
[Widget] Gtk.RadioButton radio_encoder_1RM_weighted3; [Widget] Gtk.RadioButton radio_encoder_1RM_weighted3;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_bestmeanpower;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_all;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_none;
//camera tab
[Widget] Gtk.Box hbox_combo_camera;
[Widget] Gtk.ComboBox combo_camera;
//other tab
[Widget] Gtk.ComboBox combo_decimals;
[Widget] Gtk.CheckButton checkbutton_ask_deletion;
[Widget] Gtk.RadioButton radio_export_latin; [Widget] Gtk.RadioButton radio_export_latin;
[Widget] Gtk.RadioButton radio_export_non_latin; [Widget] Gtk.RadioButton radio_export_non_latin;
[Widget] Gtk.RadioButton radio_graphs_translate; [Widget] Gtk.RadioButton radio_graphs_translate;
[Widget] Gtk.RadioButton radio_graphs_no_translate; [Widget] Gtk.RadioButton radio_graphs_no_translate;
[Widget] Gtk.RadioButton radio_use_heights_on_jump_indexes;
[Widget] Gtk.RadioButton radio_do_not_use_heights_on_jump_indexes;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_bestmeanpower;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_all;
[Widget] Gtk.RadioButton radio_encoder_auto_save_curve_none;
// [Widget] Gtk.Box hbox_language_row; // [Widget] Gtk.Box hbox_language_row;
// [Widget] Gtk.Box hbox_combo_language; // [Widget] Gtk.Box hbox_combo_language;
// [Widget] Gtk.ComboBox combo_language; // [Widget] Gtk.ComboBox combo_language;
[Widget] Gtk.Box hbox_combo_camera;
[Widget] Gtk.ComboBox combo_camera;
[Widget] Gtk.Button button_accept; [Widget] Gtk.Button button_accept;
[Widget] Gtk.Button button_cancel; [Widget] Gtk.Button button_cancel;
...@@ -209,6 +228,42 @@ public class PreferencesWindow { ...@@ -209,6 +228,42 @@ public class PreferencesWindow {
PreferencesWindowBox.radio_speed_km.Active = true; PreferencesWindowBox.radio_speed_km.Active = true;
if(preferences.runSpeedStartArrival)
PreferencesWindowBox.radio_runs_speed_start_arrival.Active = true;
else
PreferencesWindowBox.radio_runs_speed_start_leaving.Active = true;
//start of double contacts stuff ----
PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active =
(preferences.runDoubleContactsMode != Constants.DoubleContact.NONE);
PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active =
(preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE);
PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value =
preferences.runDoubleContactsMS;
PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value =
preferences.runIDoubleContactsMS;
if(preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) {
if(preferences.runDoubleContactsMode == Constants.DoubleContact.FIRST)
PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active = true;
else if(preferences.runDoubleContactsMode == Constants.DoubleContact.AVERAGE)
PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active = true;
else // Constants.DoubleContact.LAST DEFAULT
PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active = true;
}
if(preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) {
if(preferences.runIDoubleContactsMode == Constants.DoubleContact.FIRST)
PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active = true;
else if(preferences.runIDoubleContactsMode == Constants.DoubleContact.LAST)
PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active = true;
else //Constants.DoubleContact.AVERAGE DEFAULT
PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active = true;
}
//---- end of double contacts stuff
if(preferences.CSVExportDecimalSeparator == "COMMA") if(preferences.CSVExportDecimalSeparator == "COMMA")
PreferencesWindowBox.radio_export_latin.Active = true; PreferencesWindowBox.radio_export_latin.Active = true;
else else
...@@ -307,6 +362,14 @@ public class PreferencesWindow { ...@@ -307,6 +362,14 @@ public class PreferencesWindow {
hbox_indexes.Hide(); hbox_indexes.Hide();
} }
private void on_checkbutton_runs_prevent_double_contact_toggled (object o, EventArgs args) {
vbox_runs_prevent_double_contact.Visible = checkbutton_runs_prevent_double_contact.Active;
}
private void on_checkbutton_runs_i_prevent_double_contact_toggled (object o, EventArgs args) {
vbox_runs_i_prevent_double_contact.Visible = checkbutton_runs_i_prevent_double_contact.Active;
}
void on_button_cancel_clicked (object o, EventArgs args) void on_button_cancel_clicked (object o, EventArgs args)
{ {
PreferencesWindowBox.preferences_win.Hide(); PreferencesWindowBox.preferences_win.Hide();
...@@ -595,6 +658,84 @@ public class PreferencesWindow { ...@@ -595,6 +658,84 @@ public class PreferencesWindow {
preferences.metersSecondsPreferred = PreferencesWindowBox.radio_speed_ms.Active; preferences.metersSecondsPreferred = PreferencesWindowBox.radio_speed_ms.Active;
} }
if( preferences.runSpeedStartArrival != PreferencesWindowBox.radio_runs_speed_start_arrival.Active ) {
SqlitePreferences.Update("runSpeedStartArrival", PreferencesWindowBox.radio_runs_speed_start_arrival.Active.ToString(), true);
preferences.runSpeedStartArrival = PreferencesWindowBox.radio_runs_speed_start_arrival.Active;
}
//start of double contacts stuff ----
//1 simple runs ----
//1.1 was FIRST or AVERAGE or LAST and now will be NONE
if( (preferences.runDoubleContactsMode != Constants.DoubleContact.NONE) &&
! PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active)
{
SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.NONE.ToString(), true);
preferences.runDoubleContactsMode = Constants.DoubleContact.NONE;
}
else if(PreferencesWindowBox.checkbutton_runs_prevent_double_contact.Active)
{
//1.2 mode has changed between FIRST, AVERAGE or LAST
if( PreferencesWindowBox.radio_runs_prevent_double_contact_first.Active &&
(preferences.runDoubleContactsMode != Constants.DoubleContact.FIRST) ) {
SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.FIRST.ToString(), true);
preferences.runDoubleContactsMode = Constants.DoubleContact.FIRST;
}
else if( PreferencesWindowBox.radio_runs_prevent_double_contact_average.Active &&
(preferences.runDoubleContactsMode != Constants.DoubleContact.AVERAGE) ) {
SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.AVERAGE.ToString(), true);
preferences.runDoubleContactsMode = Constants.DoubleContact.AVERAGE;
}
else if( PreferencesWindowBox.radio_runs_prevent_double_contact_last.Active &&
(preferences.runDoubleContactsMode != Constants.DoubleContact.LAST) ) {
SqlitePreferences.Update("runDoubleContactsMode", Constants.DoubleContact.LAST.ToString(), true);
preferences.runDoubleContactsMode = Constants.DoubleContact.LAST;
}
if(preferences.runDoubleContactsMS != (int) PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value) {
SqlitePreferences.Update("runDoubleContactsMS",
PreferencesWindowBox.spinbutton_runs_prevent_double_contact.Value.ToString(), true); //saved as string
preferences.runDoubleContactsMS = (int) spinbutton_runs_prevent_double_contact.Value;
}
}
//2 intervallic runs ----
//2.1 was FIRST or AVERAGE or LAST and now will be NONE
if( (preferences.runIDoubleContactsMode != Constants.DoubleContact.NONE) &&
! PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active)
{
SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.NONE.ToString(), true);
preferences.runIDoubleContactsMode = Constants.DoubleContact.NONE;
}
else if(PreferencesWindowBox.checkbutton_runs_i_prevent_double_contact.Active)
{
//2.2 mode has changed between FIRST, AVERAGE or LAST
if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_first.Active &&
(preferences.runIDoubleContactsMode != Constants.DoubleContact.FIRST) ) {
SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.FIRST.ToString(), true);
preferences.runIDoubleContactsMode = Constants.DoubleContact.FIRST;
}
else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_average.Active &&
(preferences.runIDoubleContactsMode != Constants.DoubleContact.AVERAGE) ) {
SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.AVERAGE.ToString(), true);
preferences.runIDoubleContactsMode = Constants.DoubleContact.AVERAGE;
}
else if( PreferencesWindowBox.radio_runs_i_prevent_double_contact_last.Active &&
(preferences.runIDoubleContactsMode != Constants.DoubleContact.LAST) ) {
SqlitePreferences.Update("runIDoubleContactsMode", Constants.DoubleContact.LAST.ToString(), true);
preferences.runIDoubleContactsMode = Constants.DoubleContact.LAST;
}
if(preferences.runIDoubleContactsMS != (int) PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value) {
SqlitePreferences.Update("runIDoubleContactsMS",
PreferencesWindowBox.spinbutton_runs_i_prevent_double_contact.Value.ToString(), true); //saved as string
preferences.runIDoubleContactsMS = (int) spinbutton_runs_i_prevent_double_contact.Value;
}
}
//---- end of double contacts stuff
if( preferences.encoderPropulsive != PreferencesWindowBox.checkbutton_encoder_propulsive.Active ) { if( preferences.encoderPropulsive != PreferencesWindowBox.checkbutton_encoder_propulsive.Active ) {
......
...@@ -894,15 +894,6 @@ partial class ChronoJumpWindow ...@@ -894,15 +894,6 @@ partial class ChronoJumpWindow
[Widget] Gtk.Label extra_window_runs_label_distance_units; [Widget] Gtk.Label extra_window_runs_label_distance_units;
[Widget] Gtk.Label extra_window_label_runs_no_options; [Widget] Gtk.Label extra_window_label_runs_no_options;
[Widget] Gtk.Box vbox_runs_prevent_double_contact;
[Widget] Gtk.CheckButton checkbutton_runs_prevent_double_contact;
[Widget] Gtk.SpinButton spinbutton_runs_prevent_double_contact;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_first;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_average;
[Widget] Gtk.RadioButton radio_runs_prevent_double_contact_last;
[Widget] Gtk.RadioButton radio_runs_speed_start_arrival;
[Widget] Gtk.RadioButton radio_runs_speed_start_leaving;
//options runs interval //options runs interval
[Widget] Gtk.Label extra_window_runs_interval_label_distance; [Widget] Gtk.Label extra_window_runs_interval_label_distance;
[Widget] Gtk.SpinButton extra_window_runs_interval_spinbutton_distance; [Widget] Gtk.SpinButton extra_window_runs_interval_spinbutton_distance;
...@@ -912,15 +903,6 @@ partial class ChronoJumpWindow ...@@ -912,15 +903,6 @@ partial class ChronoJumpWindow
[Widget] Gtk.Label extra_window_runs_interval_label_limit_units; [Widget] Gtk.Label extra_window_runs_interval_label_limit_units;
[Widget] Gtk.Label extra_window_label_runs_interval_no_options; [Widget] Gtk.Label extra_window_label_runs_interval_no_options;
[Widget] Gtk.Box vbox_runs_i_prevent_double_contact;
[Widget] Gtk.CheckButton checkbutton_runs_i_prevent_double_contact;
[Widget] Gtk.SpinButton spinbutton_runs_i_prevent_double_contact;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_first;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_average;
[Widget] Gtk.RadioButton radio_runs_i_prevent_double_contact_last;
[Widget] Gtk.RadioButton radio_runs_i_speed_start_arrival;
[Widget] Gtk.RadioButton radio_runs_i_speed_start_leaving;
double extra_window_runs_distance = 100; double extra_window_runs_distance = 100;
double extra_window_runs_interval_distance = 100; double extra_window_runs_interval_distance = 100;
...@@ -1143,31 +1125,6 @@ partial class ChronoJumpWindow ...@@ -1143,31 +1125,6 @@ partial class ChronoJumpWindow
extra_window_label_runs_no_options.Visible = ! hasOptions; extra_window_label_runs_no_options.Visible = ! hasOptions;
} }
protected void on_checkbutton_runs_prevent_double_contact_toggled (object o, EventArgs args) {
vbox_runs_prevent_double_contact.Visible = checkbutton_runs_prevent_double_contact.Active;
}
protected void on_checkbutton_runs_i_prevent_double_contact_toggled (object o, EventArgs args) {
vbox_runs_i_prevent_double_contact.Visible = checkbutton_runs_i_prevent_double_contact.Active;
}
bool update_sqlite_at_runs_speed_radios = false;
private void on_radio_runs_speed_start_toggled (object o, EventArgs args) {
if(update_sqlite_at_runs_speed_radios) {
if(radio_runs_speed_start_arrival.Active)
SqlitePreferences.Update("runSpeedStartArrival", "True", false);
else
SqlitePreferences.Update("runSpeedStartArrival", "False", false);
}
}
private void on_radio_runs_i_speed_start_toggled (object o, EventArgs args) {
if(update_sqlite_at_runs_speed_radios) {
if(radio_runs_i_speed_start_arrival.Active)
SqlitePreferences.Update("runISpeedStartArrival", "True", false);
else
SqlitePreferences.Update("runISpeedStartArrival", "False", false);
}
}
} }
......