[chronojump] ForceSensor mode separating in isometric / elastic (huge commit)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor mode separating in isometric / elastic (huge commit)
- Date: Fri, 27 May 2022 16:53:23 +0000 (UTC)
commit 1cd87af2d54fe73e1fc01e57592f7b07ea96e552
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri May 27 18:52:50 2022 +0200
ForceSensor mode separating in isometric / elastic (huge commit)
glade/app1.glade | 140 ++++++++++++++++++++++++++++-----
src/constants.cs | 11 ++-
src/execute/arduinoCapture.cs | 2 +-
src/exportFiles/fs.cs | 9 ++-
src/forceSensor.cs | 11 +++
src/gui/app1/chronojump.cs | 142 +++++++++++++++++++++-------------
src/gui/app1/contactsExercise.cs | 6 +-
src/gui/app1/forceSensor.cs | 30 ++++---
src/gui/app1/forceSensorAnalyze.cs | 1 +
src/gui/app1/icons.cs | 1 +
src/gui/app1/session/loadAndImport.cs | 2 +-
src/gui/app1/session/main.cs | 2 +-
src/gui/chronopicRegister.cs | 2 +-
src/gui/exhibition.cs | 2 +-
src/gui/preferences.cs | 2 +-
src/gui/sendLogAndPoll.cs | 3 +-
src/gui/webcam.cs | 4 +-
src/sqlite/forceSensor.cs | 34 ++++++--
src/sqlite/main.cs | 2 +-
src/sqlite/personSession.cs | 2 +-
src/sqlite/preferences.cs | 10 ++-
21 files changed, 304 insertions(+), 114 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index bd1eccf7d..9edff5048 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -3758,6 +3758,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">False</property>
+ <property name="padding">12</property>
<property name="position">2</property>
</packing>
</child>
@@ -4121,24 +4122,116 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkRadioButton"
id="radio_change_modes_contacts_force_sensor">
- <property name="width_request">40</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="active">True</property>
- <property name="draw_indicator">False</property>
+ <widget class="GtkHBox"
id="hbox_change_modes_force_sensor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkEventBox"
id="eventbox_change_modes_contacts_force_sensor">
+ <widget class="GtkRadioButton"
id="radio_change_modes_contacts_isometric">
+ <property name="width_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">False</property>
+ <signal name="toggled"
handler="on_radio_change_modes_contacts_isometric_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkEventBox"
id="eventbox_change_modes_contacts_isometric">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
+ <widget class="GtkHBox" id="hbox105">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
<widget class="GtkImage"
id="image_change_modes_contacts_force_sensor">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property
name="stock">gtk-missing-image</property>
</widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">I</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_change_modes_contacts_elastic">
+ <property name="width_request">40</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">False</property>
+ <property
name="group">radio_change_modes_contacts_isometric</property>
+ <signal name="toggled"
handler="on_radio_change_modes_contacts_elastic_toggled" swapped="no"/>
+ <child>
+ <widget class="GtkEventBox"
id="eventbox_change_modes_contacts_elastic">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkHBox" id="hbox82">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkImage"
id="image_change_modes_contacts_force_sensor1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property
name="stock">gtk-missing-image</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label32">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">E</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
</child>
</widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</widget>
<packing>
@@ -25654,6 +25747,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -32062,18 +32158,6 @@ Concentric</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Tests
will be filmed</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkHBox"
id="hbox_video_encoder_capturing">
<property name="can_focus">False</property>
<property name="spacing">4</property>
@@ -32110,6 +32194,18 @@ Concentric</property>
</packing>
</child>
<child>
+ <widget class="GtkLabel"
id="label_video_encoder_tests_will_be_filmed">
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Tests
will be filmed</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox"
id="hbox_video_encoder_no_capturing">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -41477,6 +41573,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -49488,6 +49587,9 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/constants.cs b/src/constants.cs
index 0ae2e7973..52ec4b0e1 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -1047,7 +1047,14 @@ public class Constants
JUMPSSIMPLE, JUMPSREACTIVE,
RUNSSIMPLE, RUNSINTERVALLIC, RUNSENCODER,
POWERGRAVITATORY, POWERINERTIAL,
- FORCESENSOR, RT, OTHER } //OTHER can be: Multichronopic, Pulse
+ FORCESENSORISOMETRIC, FORCESENSORELASTIC,
+ RT, OTHER } //OTHER can be: Multichronopic, Pulse
+
+ //to shorten code on the rest of the software
+ public static bool ModeIsFORCESENSOR (Modes mode)
+ {
+ return (mode == Modes.FORCESENSORISOMETRIC || mode == Modes.FORCESENSORELASTIC);
+ }
public static string ModeFolder (Constants.Modes mode)
{
@@ -1057,7 +1064,7 @@ public class Constants
return "encoder";
else if(mode == Constants.Modes.POWERINERTIAL)
return "encoder";
- else if(mode == Constants.Modes.FORCESENSOR)
+ else if(ModeIsFORCESENSOR (mode))
return "forceSensor";
else
return ""; //should never happen
diff --git a/src/execute/arduinoCapture.cs b/src/execute/arduinoCapture.cs
index 3b9d0d112..fd80b53c1 100644
--- a/src/execute/arduinoCapture.cs
+++ b/src/execute/arduinoCapture.cs
@@ -635,7 +635,7 @@ public class MicroDiscover : MicroComms
}
LogB.Information("success: " + success.ToString());
}
- else if(mode == Constants.Modes.FORCESENSOR)
+ else if(Constants.ModeIsFORCESENSOR (mode))
success = discoverForceSensor ();
else if(mode == Constants.Modes.RUNSENCODER)
success = discoverRaceAnalyzer ();
diff --git a/src/exportFiles/fs.cs b/src/exportFiles/fs.cs
index 411a857da..d5d773fce 100644
--- a/src/exportFiles/fs.cs
+++ b/src/exportFiles/fs.cs
@@ -27,6 +27,7 @@ using Mono.Unix;
public class ForceSensorExport : ExportFiles
{
+ private Constants.Modes mode;
private List<ForceSensorRFD> rfdList;
private ForceSensorImpulse impulse;
private double duration;
@@ -43,6 +44,7 @@ public class ForceSensorExport : ExportFiles
private static int totalRepsToExport;
public ForceSensorExport (
+ Constants.Modes mode,
Gtk.Notebook notebook,
Gtk.ProgressBar progressbar,
Gtk.Label labelResult,
@@ -65,6 +67,7 @@ public class ForceSensorExport : ExportFiles
assignParams(notebook, progressbar, new Gtk.Label(), labelResult, includeImages,
imageWidth, imageHeight, isWindows, personID, sessionID,
exportDecimalSeparator);
+ this.mode = mode;
this.rfdList = rfdList;
this.impulse = impulse;
this.duration = duration;
@@ -101,9 +104,11 @@ public class ForceSensorExport : ExportFiles
protected override bool getData ()
{
- fs_l = SqliteForceSensor.Select(false, -1, personID, sessionID);
+ int elastic = ForceSensor.GetElasticIntFromMode (mode);
+
+ fs_l = SqliteForceSensor.Select(false, -1, personID, sessionID, elastic);
personSession_l = SqlitePersonSession.SelectCurrentSessionPersons(sessionID, true);
- fsEx_l = SqliteForceSensorExercise.Select (false, -1, false);
+ fsEx_l = SqliteForceSensorExercise.Select (false, -1, elastic, false);
totalRepsToExport = 0;
return fs_l.Count > 0;
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index d49e5e4e3..7da78c784 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -353,6 +353,17 @@ public class ForceSensor
}
}
+ //used to do selects on the software
+ public static int GetElasticIntFromMode (Constants.Modes mode)
+ {
+ int elastic = -1;
+ if (mode == Constants.Modes.FORCESENSORISOMETRIC)
+ elastic = 0;
+ else if (mode == Constants.Modes.FORCESENSORELASTIC)
+ elastic = 1;
+
+ return elastic;
+ }
public string Filename
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 14b470529..af635cb01 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -73,12 +73,14 @@ public partial class ChronoJumpWindow
[Widget] Gtk.HBox hbox_change_modes_encoder;
[Widget] Gtk.HBox hbox_change_modes_jumps;
[Widget] Gtk.HBox hbox_change_modes_runs;
+ [Widget] Gtk.HBox hbox_change_modes_force_sensor;
[Widget] Gtk.RadioButton radio_change_modes_contacts_jumps_simple;
[Widget] Gtk.RadioButton radio_change_modes_contacts_jumps_reactive;
[Widget] Gtk.RadioButton radio_change_modes_contacts_runs_simple;
[Widget] Gtk.RadioButton radio_change_modes_contacts_runs_intervallic;
[Widget] Gtk.RadioButton radio_change_modes_contacts_runs_encoder;
- [Widget] Gtk.RadioButton radio_change_modes_contacts_force_sensor;
+ [Widget] Gtk.RadioButton radio_change_modes_contacts_isometric;
+ [Widget] Gtk.RadioButton radio_change_modes_contacts_elastic;
[Widget] Gtk.RadioButton radio_change_modes_encoder_gravitatory;
[Widget] Gtk.RadioButton radio_change_modes_encoder_inertial;
[Widget] Gtk.Image image_change_modes_contacts_jumps_simple;
@@ -87,6 +89,7 @@ public partial class ChronoJumpWindow
//[Widget] Gtk.Image image_change_modes_contacts_runs_reactive;
[Widget] Gtk.Image image_change_modes_contacts_runs_intervallic;
[Widget] Gtk.Image image_change_modes_contacts_force_sensor;
+ [Widget] Gtk.Image image_change_modes_contacts_force_sensor1;
[Widget] Gtk.Image image_change_modes_contacts_runs_encoder;
[Widget] Gtk.Image image_change_modes_encoder_gravitatory;
[Widget] Gtk.Image image_change_modes_encoder_inertial;
@@ -103,7 +106,8 @@ public partial class ChronoJumpWindow
[Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_simple;
[Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_intervallic;
[Widget] Gtk.EventBox eventbox_change_modes_contacts_runs_encoder;
- [Widget] Gtk.EventBox eventbox_change_modes_contacts_force_sensor;
+ [Widget] Gtk.EventBox eventbox_change_modes_contacts_isometric;
+ [Widget] Gtk.EventBox eventbox_change_modes_contacts_elastic;
[Widget] Gtk.EventBox eventbox_change_modes_encoder_gravitatory;
[Widget] Gtk.EventBox eventbox_change_modes_encoder_inertial;
[Widget] Gtk.EventBox eventbox_button_show_modes_encoder;
@@ -651,7 +655,8 @@ public partial class ChronoJumpWindow
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_jumps_reactive,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_simple,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_intervallic,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
- UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_force_sensor,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+ UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_isometric,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
+ UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_elastic,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_contacts_runs_encoder,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_encoder_gravitatory,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_change_modes_encoder_inertial,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
@@ -824,11 +829,13 @@ public partial class ChronoJumpWindow
SqlitePreferences.Update(SqlitePreferences.LoadLastModeAtStart, false, false);
// 2) change mode
- changeModeCheckRadios (preferences.lastMode);
+ changeModeCheckRadios (preferences.lastMode); //this will update current_mode
// 3) put preference to true again
SqlitePreferences.Update(SqlitePreferences.LoadLastModeAtStart, true, false);
}
+ else if (preferences.lastMode != Constants.Modes.UNDEFINED)
+ current_mode = preferences.lastMode; //needed for show_start_page () below
createComboSelectContactsTop (); //need to at least have it not null (to not crash on a
import session)
@@ -857,7 +864,7 @@ public partial class ChronoJumpWindow
if (shouldAskBackupScheduled ())
backupScheduledAsk ();
else if(notebook_sup.CurrentPage == Convert.ToInt32(notebook_sup_pages.START))
- new ChronojumpLogo (notebook_chronojump_logo, drawingarea_chronojump_logo,
preferences.logoAnimatedShow);
+ show_start_page ();
}
//done at the end to ensure main window is shown
@@ -1447,7 +1454,7 @@ public partial class ChronoJumpWindow
else if(current_mode == Constants.Modes.POWERGRAVITATORY ||
current_mode == Constants.Modes.POWERINERTIAL)
encoderPersonChanged();
- else if(current_mode == Constants.Modes.FORCESENSOR)
+ else if(Constants.ModeIsFORCESENSOR (current_mode))
forceSensorPersonChanged();
else if(current_mode == Constants.Modes.RUNSENCODER)
runEncoderPersonChanged();
@@ -2317,7 +2324,7 @@ public partial class ChronoJumpWindow
combo_select_contacts_top.Active = combo_select_runs_interval.Active;
combo_select_contacts_top.Sensitive = true;
}
- else if(current_mode == Constants.Modes.RUNSENCODER || current_mode ==
Constants.Modes.FORCESENSOR)
+ else if(current_mode == Constants.Modes.RUNSENCODER || Constants.ModeIsFORCESENSOR
(current_mode))
{
if(combo_select_contacts_top == null)
combo_select_contacts_top = ComboBox.NewText ();
@@ -2419,7 +2426,7 @@ public partial class ChronoJumpWindow
if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode ==
Constants.Modes.JUMPSREACTIVE ||
current_mode == Constants.Modes.RUNSSIMPLE || current_mode ==
Constants.Modes.RUNSINTERVALLIC ||
- current_mode == Constants.Modes.RUNSENCODER || current_mode ==
Constants.Modes.FORCESENSOR)
+ current_mode == Constants.Modes.RUNSENCODER || Constants.ModeIsFORCESENSOR
(current_mode))
{
button_combo_select_contacts_top_left.Sensitive = (combo.Active > 0);
button_combo_select_contacts_top_right.Sensitive = true;
@@ -2435,7 +2442,7 @@ public partial class ChronoJumpWindow
if(current_mode == Constants.Modes.JUMPSSIMPLE || current_mode ==
Constants.Modes.JUMPSREACTIVE ||
current_mode == Constants.Modes.RUNSSIMPLE || current_mode ==
Constants.Modes.RUNSINTERVALLIC ||
- current_mode == Constants.Modes.RUNSENCODER || current_mode ==
Constants.Modes.FORCESENSOR)
+ current_mode == Constants.Modes.RUNSENCODER || Constants.ModeIsFORCESENSOR
(current_mode))
{
button_combo_select_contacts_top_left.Sensitive = true;
button_combo_select_contacts_top_right.Sensitive = ! isLast;
@@ -2495,7 +2502,7 @@ public partial class ChronoJumpWindow
on_combo_select_runs_interval_changed(o, args);
else if(current_mode == Constants.Modes.RUNSENCODER)
on_combo_run_encoder_exercise_changed(o, args);
- else if(current_mode == Constants.Modes.FORCESENSOR)
+ else if(Constants.ModeIsFORCESENSOR (current_mode))
on_combo_force_sensor_exercise_changed(o, args);
}
@@ -3007,8 +3014,10 @@ public partial class ChronoJumpWindow
return Catalog.GetString("Encoder (gravitatory)");
else if(mode == Constants.Modes.POWERINERTIAL)
return Catalog.GetString("Encoder (inertial)");
- else if(mode == Constants.Modes.FORCESENSOR)
- return Catalog.GetString("Force sensor");
+ else if(mode == Constants.Modes.FORCESENSORISOMETRIC)
+ return Catalog.GetString("Isometric");
+ else if(mode == Constants.Modes.FORCESENSORELASTIC)
+ return Catalog.GetString("Elastic");
else if(mode == Constants.Modes.RT)
return Catalog.GetString("Reaction time");
else if(mode == Constants.Modes.OTHER)
@@ -3215,10 +3224,8 @@ public partial class ChronoJumpWindow
Constants.Modes m = current_mode;
if(m == Constants.Modes.POWERGRAVITATORY || m == Constants.Modes.POWERINERTIAL)
- {
overviewWin = EncoderOverviewWindow.Show (app1, currentEncoderGI,
currentSession.UniqueID, currentPerson.UniqueID);
- }
- else if(m == Constants.Modes.FORCESENSOR)
+ else if(Constants.ModeIsFORCESENSOR (m))
overviewWin = ForceSensorOverviewWindow.Show (app1, currentSession.UniqueID,
currentPerson.UniqueID);
else if(m == Constants.Modes.RUNSENCODER)
overviewWin = RunEncoderOverviewWindow.Show (app1, currentSession.UniqueID,
currentPerson.UniqueID);
@@ -3388,7 +3395,7 @@ public partial class ChronoJumpWindow
setForceSensorAnalyzeMaxAVGInWindow();
// update force_capture_drawingarea
- if(current_mode == Constants.Modes.FORCESENSOR)// &&
radiobutton_force_sensor_analyze_manual.Active)
+ if (Constants.ModeIsFORCESENSOR (current_mode))// &&
radiobutton_force_sensor_analyze_manual.Active)
forceSensorDoGraphAI(false);
// <---------- end of force sensor changes --------------
@@ -3417,11 +3424,16 @@ public partial class ChronoJumpWindow
radio_menu_2_2_2_races.Active = true;
on_button_menu_2_2_2_clicked (radio_menu_2_2_2_races, new EventArgs ());
}
- else if (current_mode == Constants.Modes.FORCESENSOR) //TODO ISOMETRIC, INERTIAL|
+ else if (current_mode == Constants.Modes.FORCESENSORISOMETRIC)
{
radio_menu_2_2_2_isometric.Active = true;
on_button_menu_2_2_2_clicked (radio_menu_2_2_2_isometric, new EventArgs ());
}
+ else if (current_mode == Constants.Modes.FORCESENSORELASTIC)
+ {
+ radio_menu_2_2_2_elastic.Active = true;
+ on_button_menu_2_2_2_clicked (radio_menu_2_2_2_elastic, new EventArgs ());
+ }
else if (current_mode == Constants.Modes.POWERGRAVITATORY)
{
radio_menu_2_2_2_weights.Active = true;
@@ -3500,7 +3512,21 @@ public partial class ChronoJumpWindow
else
radio_change_modes_encoder_inertial.Active = true;
}
- else //for modes that do not have radios like forceSensor, RT, other
+ else if (m == Constants.Modes.FORCESENSORISOMETRIC)
+ {
+ if(radio_change_modes_contacts_isometric.Active)
+ changeMode (Constants.Modes.FORCESENSORISOMETRIC);
+ else
+ radio_change_modes_contacts_isometric.Active = true;
+ }
+ else if (m == Constants.Modes.FORCESENSORELASTIC)
+ {
+ if(radio_change_modes_contacts_elastic.Active)
+ changeMode (Constants.Modes.FORCESENSORELASTIC);
+ else
+ radio_change_modes_contacts_elastic.Active = true;
+ }
+ else //for modes that do not have radios like RT, other
changeMode (m);
}
@@ -3538,7 +3564,7 @@ public partial class ChronoJumpWindow
//show capture graph and/or table
if(m != Constants.Modes.POWERGRAVITATORY && m != Constants.Modes.POWERINERTIAL)
{
- if(m == Constants.Modes.FORCESENSOR || m == Constants.Modes.RUNSENCODER)
+ if(Constants.ModeIsFORCESENSOR (m) || m == Constants.Modes.RUNSENCODER)
{
alignment_contacts_show_graph_table.Visible = false;
//force sensor & race analyzer do not show graph. graphs are on right
notebook: notebook_results
@@ -3565,7 +3591,7 @@ public partial class ChronoJumpWindow
hbox_change_modes_jumps.Visible = false;
hbox_change_modes_runs.Visible = false;
- radio_change_modes_contacts_force_sensor.Visible = false;
+ hbox_change_modes_force_sensor.Visible = false;
button_contacts_bells.Sensitive = false;
@@ -3608,7 +3634,7 @@ public partial class ChronoJumpWindow
if(
( m == Constants.Modes.POWERGRAVITATORY ||
m == Constants.Modes.POWERINERTIAL ||
- m == Constants.Modes.FORCESENSOR ) &&
+ Constants.ModeIsFORCESENSOR (m) ) &&
operatingSystem == UtilAll.OperatingSystems.MACOSX &&
! Util.FileExists(Constants.ROSX) )
{
@@ -3883,7 +3909,7 @@ public partial class ChronoJumpWindow
pixbufModeGrid = new Pixbuf (null, Util.GetImagePath(false) +
"image_modes_encoder.png");
}
- else if(m == Constants.Modes.FORCESENSOR)
+ else if(Constants.ModeIsFORCESENSOR (m))
{
button_contacts_detect.Visible = true;
hbox_contacts_detect_and_execute.Visible = false;
@@ -3912,7 +3938,7 @@ public partial class ChronoJumpWindow
event_graph_label_graph_test.Visible = true;
vbox_contacts_simple_graph_controls.Visible = false;
- radio_change_modes_contacts_force_sensor.Visible = true;
+ hbox_change_modes_force_sensor.Visible = true;
//align_check_vbox_contacts_graph_legend.Visible = false;
//vbox_contacts_graph_legend.Visible = false;
@@ -4035,7 +4061,7 @@ public partial class ChronoJumpWindow
feedbackWin.FeedbackActive(Constants.BellModes.JUMPS)) ||
( (m == Constants.Modes.RUNSSIMPLE || m == Constants.Modes.RUNSINTERVALLIC) &&
feedbackWin.FeedbackActive(Constants.BellModes.RUNS)) ||
- ( m == Constants.Modes.FORCESENSOR &&
+ ( Constants.ModeIsFORCESENSOR (m) &&
feedbackWin.FeedbackActive(Constants.BellModes.FORCESENSOR)) )
image_contacts_bell.Pixbuf = pixbufBellActive;
else
@@ -4170,7 +4196,7 @@ public partial class ChronoJumpWindow
private void showHideCaptureSpecificControls(Constants.Modes m)
{
- hbox_capture_phases_time.Visible = (m != Constants.Modes.FORCESENSOR && m !=
Constants.Modes.RUNSENCODER);
+ hbox_capture_phases_time.Visible = ( ! Constants.ModeIsFORCESENSOR (m) && m !=
Constants.Modes.RUNSENCODER);
if(! configChronojump.Compujump)
showWebcamCaptureContactsControls(true);
@@ -4297,6 +4323,7 @@ public partial class ChronoJumpWindow
+ //jumps
private void on_button_selector_start_jumps_simple_clicked(object o, EventArgs args)
{
changeModeCheckRadios (Constants.Modes.JUMPSSIMPLE);
@@ -4316,6 +4343,7 @@ public partial class ChronoJumpWindow
changeMode (Constants.Modes.JUMPSREACTIVE);
}
+ //runs
private void on_button_selector_start_runs_simple_clicked(object o, EventArgs args)
{
changeModeCheckRadios (Constants.Modes.RUNSSIMPLE);
@@ -4344,6 +4372,27 @@ public partial class ChronoJumpWindow
changeMode (Constants.Modes.RUNSENCODER);
}
+ //forceSensor (isometric, elastic)
+ private void on_button_selector_start_force_sensor_isometric_clicked(object o, EventArgs args)
+ {
+ changeModeCheckRadios (Constants.Modes.FORCESENSORISOMETRIC);
+ }
+ private void on_button_selector_start_force_sensor_elastic_clicked(object o, EventArgs args)
+ {
+ changeModeCheckRadios (Constants.Modes.FORCESENSORELASTIC);
+ }
+ private void on_radio_change_modes_contacts_isometric_toggled (object o, EventArgs args)
+ {
+ if (radio_change_modes_contacts_isometric.Active)
+ changeMode (Constants.Modes.FORCESENSORISOMETRIC);
+ }
+ private void on_radio_change_modes_contacts_elastic_toggled (object o, EventArgs args)
+ {
+ if (radio_change_modes_contacts_elastic.Active)
+ changeMode (Constants.Modes.FORCESENSORELASTIC);
+ }
+
+ //encoder
private void on_button_selector_start_encoder_gravitatory_clicked(object o, EventArgs args)
{
changeModeCheckRadios (Constants.Modes.POWERGRAVITATORY);
@@ -4363,11 +4412,6 @@ public partial class ChronoJumpWindow
changeMode (Constants.Modes.POWERINERTIAL);
}
- private void on_button_selector_start_force_sensor_clicked(object o, EventArgs args)
- {
- changeMode (Constants.Modes.FORCESENSOR);
- }
-
/*
private void on_button_selector_start_rt_clicked(object o, EventArgs args)
{
@@ -4380,16 +4424,6 @@ public partial class ChronoJumpWindow
}
*/
- /*
- private void on_button_view_menu_2_2_2_clicked (object o, EventArgs args)
- {
- //TODO: depending on mode, force click on button_menu_2_2_2_clicked to ensure all widgets are
updated
- //if no current mode, then jumps
- radio_menu_2_2_2_jumps.Active = true;
- on_button_menu_2_2_2_clicked (radio_menu_2_2_2_jumps, args);
- }
- */
-
[Widget] Gtk.RadioButton radio_menu_2_2_2_jumps;
[Widget] Gtk.RadioButton radio_menu_2_2_2_races;
[Widget] Gtk.RadioButton radio_menu_2_2_2_isometric;
@@ -4461,9 +4495,9 @@ public partial class ChronoJumpWindow
{
//jumps, races modes have their own buttons
if (radio_menu_2_2_2_isometric.Active)
- on_button_selector_start_force_sensor_clicked (new object (), new EventArgs ());
+ on_button_selector_start_force_sensor_isometric_clicked (new object (), new EventArgs
());
else if (radio_menu_2_2_2_elastic.Active)
- on_button_selector_start_force_sensor_clicked (new object (), new EventArgs ());
+ on_button_selector_start_force_sensor_elastic_clicked (new object (), new EventArgs
());
else if (radio_menu_2_2_2_weights.Active)
on_button_selector_start_encoder_gravitatory_clicked (new object (), new EventArgs
());
else if (radio_menu_2_2_2_inertial.Active)
@@ -4616,7 +4650,7 @@ public partial class ChronoJumpWindow
current_mode != Constants.Modes.JUMPSREACTIVE &&
current_mode != Constants.Modes.RUNSSIMPLE &&
current_mode != Constants.Modes.RUNSINTERVALLIC &&
- current_mode != Constants.Modes.FORCESENSOR &&
+ ! Constants.ModeIsFORCESENSOR (current_mode) &&
current_mode != Constants.Modes.RUNSENCODER)
return;
@@ -4671,7 +4705,7 @@ public partial class ChronoJumpWindow
private void on_button_execute_test_clicked (object o, EventArgs args)
{
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
{
//LogB.Debug("radio_mode_force_sensor");
/*
@@ -4880,7 +4914,7 @@ public partial class ChronoJumpWindow
if(currentPerson == null || currentSession == null)
return;
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
force_sensor_load();
else if(current_mode == Constants.Modes.RUNSENCODER)
run_encoder_load();
@@ -4888,7 +4922,7 @@ public partial class ChronoJumpWindow
private void on_button_contacts_recalculate_clicked (object o, EventArgs args)
{
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
force_sensor_recalculate();
else if(current_mode == Constants.Modes.RUNSENCODER)
run_encoder_recalculate();
@@ -4901,7 +4935,7 @@ public partial class ChronoJumpWindow
}
void on_button_contacts_signal_save_comment_clicked (object o, EventArgs args)
{
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
{
currentForceSensor.Comments =
UtilGtk.TextViewGetCommentValidSQL(textview_contacts_signal_comment);
currentForceSensor.UpdateSQLJustComments(false);
@@ -4926,7 +4960,7 @@ public partial class ChronoJumpWindow
return Constants.BellModes.ENCODERGRAVITATORY;
else if(m == Constants.Modes.POWERINERTIAL)
return Constants.BellModes.ENCODERINERTIAL;
- else if(m == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (m))
return Constants.BellModes.FORCESENSOR;
else if(m == Constants.Modes.RUNSENCODER)
return Constants.BellModes.RUNSENCODER;
@@ -4940,7 +4974,7 @@ public partial class ChronoJumpWindow
Constants.Modes m = current_mode;
if(m != Constants.Modes.JUMPSREACTIVE &&
m != Constants.Modes.RUNSINTERVALLIC &&
- m != Constants.Modes.FORCESENSOR &&
+ ! Constants.ModeIsFORCESENSOR (m) &&
m != Constants.Modes.RUNSENCODER)
return;
@@ -6717,7 +6751,7 @@ LogB.Debug("mc finished 5");
private void on_delete_last_test_clicked (object o, EventArgs args)
{
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
{
force_sensor_delete_current_test_pre_question();
return;
@@ -7507,7 +7541,7 @@ LogB.Debug("mc finished 5");
notebook_results.CurrentPage = 8;
changeTestImage("", "", "RUNSENCODER");
event_execute_button_finish.Sensitive = false;
- } else if(mode == Constants.Modes.FORCESENSOR)
+ } else if (Constants.ModeIsFORCESENSOR (mode))
{
notebook_execute.CurrentPage = 4;
notebook_options_top.CurrentPage = 4; //but at FORCESENSOR this notebook is not shown
until adjust button is clicked
@@ -7999,7 +8033,7 @@ LogB.Debug("mc finished 5");
//updates preferences object and Sqlite preferences
preferences.UpdateEncoderRhythm(encoderRhythm);
}
- else if(m == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (m))
{
// 1) Update bell
if(feedbackWin.FeedbackActive(bellMode))
@@ -8150,7 +8184,7 @@ LogB.Debug("mc finished 5");
}
}
}
- else if(current_mode == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (current_mode))
notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.FORCESENSOR);
else if(current_mode == Constants.Modes.RUNSENCODER)
notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.RACEENCODER);
@@ -8490,7 +8524,7 @@ LogB.Debug("mc finished 5");
frame_contacts_exercise.Sensitive = true;
//forceSensor and runEncoder does not use currentEventExecute
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if (Constants.ModeIsFORCESENSOR (current_mode))
{
sensitiveLastTestButtons(! forceProcessCancel && ! forceProcessError);
LogB.Information(" sensitiveGuiEventDone end (forceSensor)");
diff --git a/src/gui/app1/contactsExercise.cs b/src/gui/app1/contactsExercise.cs
index a72c1920f..f957aa37f 100644
--- a/src/gui/app1/contactsExercise.cs
+++ b/src/gui/app1/contactsExercise.cs
@@ -140,7 +140,7 @@ public partial class ChronoJumpWindow
name = UtilGtk.ComboGetActive(combo_select_runs);
else if(m == Constants.Modes.RUNSINTERVALLIC)
name = UtilGtk.ComboGetActive(combo_select_runs_interval);
- else if(m == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (m))
name = UtilGtk.ComboGetActive(combo_force_sensor_exercise);
else if(m == Constants.Modes.RUNSENCODER)
name = UtilGtk.ComboGetActive(combo_run_encoder_exercise);
@@ -293,7 +293,7 @@ public partial class ChronoJumpWindow
contacts_exercise_left_button (combo_run_encoder_exercise,
button_combo_run_encoder_exercise_capture_left,
button_combo_run_encoder_exercise_capture_right);
- else if(current_mode == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (current_mode))
contacts_exercise_left_button (combo_force_sensor_exercise,
button_combo_force_sensor_exercise_capture_left,
button_combo_force_sensor_exercise_capture_right);
@@ -320,7 +320,7 @@ public partial class ChronoJumpWindow
contacts_exercise_right_button (combo_run_encoder_exercise,
button_combo_run_encoder_exercise_capture_left,
button_combo_run_encoder_exercise_capture_right);
- else if(current_mode == Constants.Modes.FORCESENSOR)
+ else if (Constants.ModeIsFORCESENSOR (current_mode))
contacts_exercise_right_button (combo_force_sensor_exercise,
button_combo_force_sensor_exercise_capture_left,
button_combo_force_sensor_exercise_capture_right);
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 69af1d9d9..f5f7e89ac 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -1203,7 +1203,7 @@ public partial class ChronoJumpWindow
private void assignCurrentForceSensorExercise()
{
currentForceSensorExercise = (ForceSensorExercise) SqliteForceSensorExercise.Select (
- false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), false)[0];
+ false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), -1, false)[0];
}
private void forceSensorCaptureDo()
@@ -2158,7 +2158,8 @@ LogB.Information(" fs R ");
//very based on: on_encoder_load_signal_clicked () future have some inheritance
private void force_sensor_load ()
{
- List<ForceSensor> data = SqliteForceSensor.Select(false, -1, currentPerson.UniqueID,
currentSession.UniqueID);
+ int elastic = ForceSensor.GetElasticIntFromMode (current_mode);
+ List<ForceSensor> data = SqliteForceSensor.Select(false, -1, currentPerson.UniqueID,
currentSession.UniqueID, elastic);
ArrayList dataPrint = new ArrayList();
int count = 1;
@@ -2241,7 +2242,8 @@ LogB.Information(" fs R ");
genericWin.HideAndNull();
- ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(false, uniqueID,
currentPerson.UniqueID, currentSession.UniqueID)[0];
+ int elastic = ForceSensor.GetElasticIntFromMode (current_mode);
+ ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(false, uniqueID,
currentPerson.UniqueID, currentSession.UniqueID, elastic)[0];
if(fs == null)
{
new DialogMessage(Constants.MessageTypes.WARNING, Constants.FileNotFoundStr());
@@ -2368,7 +2370,8 @@ LogB.Information(" fs R ");
//1) select set
int setID = genericWin.TreeviewSelectedUniqueID;
- ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(true, setID, -1, -1)[0];
+ int elastic = ForceSensor.GetElasticIntFromMode (current_mode);
+ ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(true, setID, -1, -1, elastic)[0];
//2) if changed comment, update SQL, and update treeview
//first remove conflictive characters
@@ -2465,7 +2468,8 @@ LogB.Information(" fs R ");
if(currentForceSensor != null && setID == Convert.ToInt32(currentForceSensor.UniqueID))
force_sensor_delete_current_test_accepted(o, args);
else {
- ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(false, setID, -1, -1)[0];
+ int elastic = ForceSensor.GetElasticIntFromMode (current_mode);
+ ForceSensor fs = (ForceSensor) SqliteForceSensor.Select(false, setID, -1, -1,
elastic)[0];
forceSensorDeleteTestDo(fs);
//genericWin selected row is deleted, unsensitive the "load" button
@@ -3311,7 +3315,7 @@ LogB.Information(" fs R ");
ArrayList array = SqliteForceSensorExercise.Select (
false, getExerciseIDFromAnyCombo(
- combo_force_sensor_exercise, forceSensorComboExercisesString, false),
false );
+ combo_force_sensor_exercise, forceSensorComboExercisesString, false),
-1, false );
if(array.Count == 0)
{
@@ -3321,7 +3325,7 @@ LogB.Information(" fs R ");
frame_force_sensor_elastic.Visible = false;
changeTestImage("", "", "FORCESENSOR_NOT_ELASTIC");
- setLabelContactsExerciseSelected(Constants.Modes.FORCESENSOR);
+ setLabelContactsExerciseSelected(current_mode);
combo_force_sensor_button_sensitive_exercise(false);
return;
}
@@ -3372,9 +3376,11 @@ LogB.Information(" fs R ");
}
}
- private void fillForceSensorExerciseCombo(string name)
+ private void fillForceSensorExerciseCombo (string name)
{
- ArrayList forceSensorExercises = SqliteForceSensorExercise.Select (false, -1, false);
+ int elastic = ForceSensor.GetElasticIntFromMode (current_mode);
+
+ ArrayList forceSensorExercises = SqliteForceSensorExercise.Select (false, -1, elastic, false);
if(forceSensorExercises.Count == 0)
{
forceSensorComboExercisesString = new String [0];
@@ -3401,7 +3407,7 @@ LogB.Information(" fs R ");
//update also combo_select_contacts_top (but check do not crash on start)
//we need the 2nd check because without is, on import if we are on other mode, top combo
could have been updated with this mode exercises
- if(combo_select_contacts_top != null && current_mode == Constants.Modes.FORCESENSOR)
+ if(combo_select_contacts_top != null && Constants.ModeIsFORCESENSOR (current_mode))
{
comboSelectContactsTopNoFollow = true;
UtilGtk.ComboUpdate(combo_select_contacts_top,
@@ -3426,7 +3432,7 @@ LogB.Information(" fs R ");
}
ForceSensorExercise ex = (ForceSensorExercise) SqliteForceSensorExercise.Select (
- false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), false)[0];
+ false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), -1, false)[0];
LogB.Information("selected exercise: " + ex.ToString());
@@ -3478,7 +3484,7 @@ LogB.Information(" fs R ");
}
ForceSensorExercise ex = (ForceSensorExercise) SqliteForceSensorExercise.Select (
- false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), false)[0];
+ false, getExerciseIDFromAnyCombo(combo_force_sensor_exercise,
forceSensorComboExercisesString, false), -1, false)[0];
//1st find if there are sets with this exercise
ArrayList array = SqliteForceSensor.SelectRowsOfAnExercise(false, ex.UniqueID);
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index fa5f622df..9f84cee91 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -797,6 +797,7 @@ public partial class ChronoJumpWindow
forceSensorExport = new ForceSensorExport (
+ current_mode,
notebook_force_sensor_export,
progressbar_force_sensor_export,
label_force_sensor_export_result,
diff --git a/src/gui/app1/icons.cs b/src/gui/app1/icons.cs
index 20a851fbc..f26e34dd6 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -658,6 +658,7 @@ public partial class ChronoJumpWindow
image_mode_runs_intervallic_small2.Pixbuf = pixbuf;
image_change_modes_contacts_runs_intervallic.Pixbuf = pixbuf;
image_change_modes_contacts_force_sensor.Pixbuf = new Pixbuf (null, Util.GetImagePath(false)
+ "force_sensor_icon.png");
+ image_change_modes_contacts_force_sensor1.Pixbuf = new Pixbuf (null, Util.GetImagePath(false)
+ "force_sensor_icon.png");
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "race_encoder_icon.png");
image_mode_race_encoder_small1.Pixbuf = pixbuf;
image_change_modes_contacts_runs_encoder.Pixbuf = pixbuf;
diff --git a/src/gui/app1/session/loadAndImport.cs b/src/gui/app1/session/loadAndImport.cs
index 6ddbec9a3..f8c86001d 100644
--- a/src/gui/app1/session/loadAndImport.cs
+++ b/src/gui/app1/session/loadAndImport.cs
@@ -129,7 +129,7 @@ public partial class ChronoJumpWindow
app1s_checkbutton_show_data_runs.Active = (current_mode == Constants.Modes.RUNSSIMPLE ||
current_mode == Constants.Modes.RUNSINTERVALLIC ||
current_mode == Constants.Modes.RUNSENCODER);
- app1s_checkbutton_show_data_force_sensor.Active = (current_mode ==
Constants.Modes.FORCESENSOR);
+ app1s_checkbutton_show_data_force_sensor.Active = (Constants.ModeIsFORCESENSOR
(current_mode));
app1s_checkbutton_show_data_encoder.Active = (current_mode ==
Constants.Modes.POWERGRAVITATORY ||
current_mode == Constants.Modes.POWERINERTIAL);
diff --git a/src/gui/app1/session/main.cs b/src/gui/app1/session/main.cs
index 66fc75942..8a86fe487 100644
--- a/src/gui/app1/session/main.cs
+++ b/src/gui/app1/session/main.cs
@@ -256,7 +256,7 @@ public partial class ChronoJumpWindow
( current_mode != Constants.Modes.RUNSENCODER && //this 4 modes are the only
one who have a separate dir
current_mode != Constants.Modes.POWERGRAVITATORY &&
current_mode != Constants.Modes.POWERINERTIAL &&
- current_mode != Constants.Modes.FORCESENSOR ) ||
+ ! Constants.ModeIsFORCESENSOR (current_mode)) ||
currentSession == null || currentSession.UniqueID < 0)
{
string dir = app1s_getDataFolderGeneric ();
diff --git a/src/gui/chronopicRegister.cs b/src/gui/chronopicRegister.cs
index 6c32f9c95..b43f13a5b 100644
--- a/src/gui/chronopicRegister.cs
+++ b/src/gui/chronopicRegister.cs
@@ -382,7 +382,7 @@ public class DiscoverWindow
(current_mode == Constants.Modes.RUNSSIMPLE || current_mode ==
Constants.Modes.RUNSINTERVALLIC) &&
(crpt == ChronopicRegisterPort.Types.CONTACTS || crpt ==
ChronopicRegisterPort.Types.RUN_WIRELESS) )
return true;
- else if (current_mode == Constants.Modes.FORCESENSOR && crpt ==
ChronopicRegisterPort.Types.ARDUINO_FORCE)
+ else if (Constants.ModeIsFORCESENSOR (current_mode) && crpt ==
ChronopicRegisterPort.Types.ARDUINO_FORCE)
return true;
else if (current_mode == Constants.Modes.RUNSENCODER && crpt ==
ChronopicRegisterPort.Types.ARDUINO_RUN_ENCODER)
return true;
diff --git a/src/gui/exhibition.cs b/src/gui/exhibition.cs
index 1c3c52607..2c45a54c8 100644
--- a/src/gui/exhibition.cs
+++ b/src/gui/exhibition.cs
@@ -39,7 +39,7 @@ public partial class ChronoJumpWindow
on_button_selector_start_encoder_inertial_clicked (new object (), new EventArgs());
else if(exhibitionStationType == ExhibitionTest.testTypes.FORCE_ROPE ||
exhibitionStationType == ExhibitionTest.testTypes.FORCE_SHOT)
- on_button_selector_start_force_sensor_clicked (new object (), new EventArgs());
+ on_button_selector_start_force_sensor_isometric_clicked (new object (), new
EventArgs());
frame_exhibition.Visible = true;
frame_persons.Sensitive = true;
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index f559e8d03..13f05543f 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -360,7 +360,7 @@ public class PreferencesWindow
PreferencesWindowBox.notebook.GetNthPage(ENCODEROTHERPAGE).Hide();
PreferencesWindowBox.check_view_encoder.Active = false;
}
- if(menu_mode != Constants.Modes.FORCESENSOR) {
+ if(! Constants.ModeIsFORCESENSOR (menu_mode)) {
PreferencesWindowBox.notebook.GetNthPage(FORCESENSORPAGE).Hide();
PreferencesWindowBox.check_view_force_sensor.Active = false;
} if(menu_mode != Constants.Modes.RUNSENCODER) {
diff --git a/src/gui/sendLogAndPoll.cs b/src/gui/sendLogAndPoll.cs
index ca4c6ae91..ae9749cc5 100644
--- a/src/gui/sendLogAndPoll.cs
+++ b/src/gui/sendLogAndPoll.cs
@@ -291,8 +291,7 @@ public partial class ChronoJumpWindow
// 3) put preference to true again
SqlitePreferences.Update(SqlitePreferences.LoadLastModeAtStart, true, false);
} else {
- notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.START);
- new ChronojumpLogo (notebook_chronojump_logo, drawingarea_chronojump_logo,
preferences.logoAnimatedShow);
+ show_start_page ();
}
}
}
diff --git a/src/gui/webcam.cs b/src/gui/webcam.cs
index 099bfb997..8a262f353 100644
--- a/src/gui/webcam.cs
+++ b/src/gui/webcam.cs
@@ -205,7 +205,7 @@ public partial class ChronoJumpWindow
notebook_video_contacts.CurrentPage = 1;
}
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if(Constants.ModeIsFORCESENSOR (current_mode))
forceSensorCapturePre3_GTK_cameraCalled();
else if(current_mode == Constants.Modes.RUNSENCODER)
runEncoderCapturePre3_GTK_cameraCalled();
@@ -747,7 +747,7 @@ public partial class ChronoJumpWindow
private void on_button_video_play_this_test_contacts_clicked (object o, EventArgs args)
{
- if(current_mode == Constants.Modes.FORCESENSOR)
+ if(Constants.ModeIsFORCESENSOR (current_mode))
{
if(currentForceSensor == null || currentForceSensor.UniqueID == -1)
new DialogMessage(Constants.MessageTypes.WARNING, "Sorry, file not found");
diff --git a/src/sqlite/forceSensor.cs b/src/sqlite/forceSensor.cs
index f7536151d..dcd26cd1b 100644
--- a/src/sqlite/forceSensor.cs
+++ b/src/sqlite/forceSensor.cs
@@ -136,8 +136,8 @@ class SqliteForceSensor : Sqlite
Util.FileDelete(fs.FullVideoURL);
}
- //SELECT forceSensor.*, forceSensorExercise.Name FROM forceSensor, forceSensorExercise WHERE
forceSensor.exerciseID = forceSensorExercise.UniqueID ORDER BY forceSensor.uniqueID;
- public static List<ForceSensor> Select (bool dbconOpened, int uniqueID, int personID, int sessionID)
+ //elastic (-1: both; 0: not elastic; 1: elastic)
+ public static List<ForceSensor> Select (bool dbconOpened, int uniqueID, int personID, int sessionID,
int elastic)
{
openIfNeeded(dbconOpened);
@@ -156,7 +156,12 @@ class SqliteForceSensor : Sqlite
if(sessionID != -1)
sessionIDStr = " AND " + table + ".sessionID = " + sessionID;
- dbcmd.CommandText = selectStr + whereStr + uniqueIDStr + personIDStr + sessionIDStr + " Order
BY " + table + ".uniqueID";
+ string elasticStr = "";
+ if(elastic != -1)
+ elasticStr = " AND " + table + ".stiffness >= " + 0;
+
+ dbcmd.CommandText = selectStr + whereStr + uniqueIDStr + personIDStr + sessionIDStr +
elasticStr +
+ " Order BY " + table + ".uniqueID";
LogB.SQL(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -583,19 +588,32 @@ class SqliteForceSensorExercise : Sqlite
}
- public static ArrayList Select (bool dbconOpened, int uniqueID, bool onlyNames)
+ //elastic (-1: both; 0: not elastic; 1: elastic)
+ public static ArrayList Select (bool dbconOpened, int uniqueID, int elastic, bool onlyNames)
{
if(! dbconOpened)
Sqlite.Open();
+ string whereOrAndStr = " WHERE ";
+
string uniqueIDStr = "";
if(uniqueID != -1)
- uniqueIDStr = " WHERE " + table + ".uniqueID = " + uniqueID;
+ {
+ uniqueIDStr = whereOrAndStr + table + ".uniqueID = " + uniqueID;
+ whereOrAndStr = " AND ";
+ }
+
+ string elasticStr = "";
+ if(elastic != -1)
+ {
+ elasticStr = whereOrAndStr + table + ".elastic = " + elastic;
+ whereOrAndStr = " AND ";
+ }
if(onlyNames)
- dbcmd.CommandText = "SELECT name FROM " + table + uniqueIDStr;
+ dbcmd.CommandText = "SELECT name FROM " + table + uniqueIDStr + elasticStr;
else
- dbcmd.CommandText = "SELECT * FROM " + table + uniqueIDStr;
+ dbcmd.CommandText = "SELECT * FROM " + table + uniqueIDStr + elasticStr;
LogB.SQL(dbcmd.CommandText.ToString());
dbcmd.ExecuteNonQuery();
@@ -700,7 +718,7 @@ class SqliteForceSensorExerciseImport : SqliteForceSensorExercise
//database is opened
protected internal static void import_partially_from_1_73_to_1_74_unify_resistance_and_description()
{
- ArrayList exercises = Select(true, -1, false);
+ ArrayList exercises = Select(true, -1, -1, false);
foreach (ForceSensorExercise ex in exercises)
{
LogB.Information(ex.ToString());
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index d1d0614ee..fa6450152 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -3086,7 +3086,7 @@ class Sqlite
{
LogB.SQL("Inserted default exercises of forceSensor and raceAnalyzer if
empty");
- ArrayList exercises = SqliteForceSensorExercise.Select(true, -1, true);
+ ArrayList exercises = SqliteForceSensorExercise.Select(true, -1, -1, true);
if(exercises == null || exercises.Count == 0)
SqliteForceSensorExercise.insertDefault();
diff --git a/src/sqlite/personSession.cs b/src/sqlite/personSession.cs
index 36f088ccc..1a48a6018 100644
--- a/src/sqlite/personSession.cs
+++ b/src/sqlite/personSession.cs
@@ -515,7 +515,7 @@ class SqlitePersonSession : Sqlite
}
// 5) delete forceSensor and related triggers
- List<ForceSensor> fs_l = SqliteForceSensor.Select (true, -1, Convert.ToInt32(personID),
Convert.ToInt32(sessionID));
+ List<ForceSensor> fs_l = SqliteForceSensor.Select (true, -1, Convert.ToInt32(personID),
Convert.ToInt32(sessionID), -1);
foreach(ForceSensor fs in fs_l)
{
SqliteForceSensor.DeleteSQLAndFiles (true, fs); //deletes also the .csv
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 516799eca..abbdd99a6 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -903,8 +903,14 @@ class SqlitePreferences : Sqlite
else if(reader[0].ToString() == LoadLastModeAtStart)
preferences.loadLastModeAtStart = reader[1].ToString() == "True";
else if(reader[0].ToString() == LastMode)
- preferences.lastMode = (Constants.Modes)
- Enum.Parse(typeof(Constants.Modes), reader[1].ToString());
+ {
+ //fix previous to Chronojump 2.2.2 when mode was FORCESENSOR
+ if (reader[1].ToString () == "FORCESENSOR")
+ preferences.lastMode = Constants.Modes.FORCESENSORISOMETRIC;
+ else
+ preferences.lastMode = (Constants.Modes)
+ Enum.Parse(typeof(Constants.Modes), reader[1].ToString());
+ }
else if(reader[0].ToString() == SessionLoadDisplay)
preferences.sessionLoadDisplay = new
SessionLoadDisplay(Convert.ToInt32(reader[1].ToString()));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]