[chronojump] Force sensor: laterality and comments. Contacts capture: CTRL + space
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Force sensor: laterality and comments. Contacts capture: CTRL + space
- Date: Mon, 18 Feb 2019 15:38:26 +0000 (UTC)
commit ca4f7b2da91e962f8c8be271962d501f699f5096
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Feb 18 16:37:39 2019 +0100
Force sensor: laterality and comments. Contacts capture: CTRL + space
glade/app1.glade | 233 +++++++++++++++++++++++++++++++++++++++++++--
src/gui/chronojumpIcons.cs | 10 +-
src/gui/forceSensor.cs | 47 ++++++++-
3 files changed, 275 insertions(+), 15 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 968900a9..3836d02f 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1839,6 +1839,9 @@
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkLabel"
id="label_start_selector_jumps">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -7366,8 +7369,220 @@ EncoderInertialCapture</property>
<widget class="GtkHBox" id="hbox301">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="spacing">20</property>
<child>
- <placeholder/>
+ <widget class="GtkHBox"
id="hbox_force_sensor_lat_and_comments">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">20</property>
+ <child>
+ <widget class="GtkHBox"
id="hbox_force_sensor_laterality">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <widget class="GtkLabel" id="label382">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Laterality</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox302">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_force_sensor_laterality_both">
+ <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>
+ <child>
+ <widget class="GtkHBox" id="hbox303">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage"
id="image_force_sensor_laterality_both">
+ <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="label359">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Both</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_force_sensor_laterality_l">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="draw_indicator">False</property>
+ <property
name="group">radio_force_sensor_laterality_both</property>
+ <child>
+ <widget class="GtkHBox" id="hbox304">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage"
id="image_force_sensor_laterality_l">
+ <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="label370">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Left</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_force_sensor_laterality_r">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="draw_indicator">False</property>
+ <property
name="group">radio_force_sensor_laterality_both</property>
+ <child>
+ <widget class="GtkHBox" id="hbox305">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkImage"
id="image_force_sensor_laterality_r">
+ <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="label381">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Right</property>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame"
id="frame_force_sensor_comments">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkTextView"
id="textview_force_sensor_capture_comment">
+ <property name="width_request">200</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label384">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Comments</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
</child>
<child>
<widget class="GtkAlignment"
id="alignment_force_sensor_adjust">
@@ -8774,9 +8989,9 @@ EncoderInertialCapture</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Or
press 'space'</property>
+ <property name="tooltip" translatable="yes">Or
press 'CTRL + space'</property>
<signal name="clicked"
handler="on_button_execute_test_clicked" swapped="no"/>
- <accelerator key="space" signal="clicked"/>
+ <accelerator key="space" signal="clicked"
modifiers="GDK_CONTROL_MASK"/>
<child>
<widget class="GtkImage"
id="image_button_execute">
<property name="visible">True</property>
@@ -19472,12 +19687,6 @@ Concentric</property>
<placeholder/>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<widget class="GtkCheckButton"
id="checkbutton_force_sensor_ai_b">
<property name="width_request">30</property>
<property name="visible">True</property>
@@ -19611,6 +19820,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -27933,6 +28145,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/chronojumpIcons.cs b/src/gui/chronojumpIcons.cs
index 9810e983..20ed18c4 100644
--- a/src/gui/chronojumpIcons.cs
+++ b/src/gui/chronojumpIcons.cs
@@ -141,6 +141,9 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_force_sensor_analyze_options_close;
[Widget] Gtk.Image image_force_sensor_analyze_recalculate;
[Widget] Gtk.Image image_force_sensor_exercise_edit;
+ [Widget] Gtk.Image image_force_sensor_laterality_both;
+ [Widget] Gtk.Image image_force_sensor_laterality_r;
+ [Widget] Gtk.Image image_force_sensor_laterality_l;
//video play icons
[Widget] Gtk.Image image_video_play_this_test;
@@ -204,13 +207,16 @@ public partial class ChronoJumpWindow
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "laterality-both.png");
image_top_laterality.Pixbuf = pixbuf;
-
- pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "laterality-both.png");
image_encoder_laterality_both.Pixbuf = pixbuf;
+ image_force_sensor_laterality_both.Pixbuf = pixbuf;
+
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "laterality-right.png");
image_encoder_laterality_r.Pixbuf = pixbuf;
+ image_force_sensor_laterality_r.Pixbuf = pixbuf;
+
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "laterality-left.png");
image_encoder_laterality_l.Pixbuf = pixbuf;
+ image_force_sensor_laterality_l.Pixbuf = pixbuf;
pixbuf = new Pixbuf (null, Util.GetImagePath(false) + "extra-mass.png");
image_top_extra_mass.Pixbuf = pixbuf;
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index 6ad68c52..cb4cdba2 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -67,8 +67,13 @@ public partial class ChronoJumpWindow
//capture tab
[Widget] Gtk.HBox hbox_force_capture_buttons;
- [Widget] Gtk.Box hbox_combo_force_sensor_exercise;
+ [Widget] Gtk.HBox hbox_combo_force_sensor_exercise;
[Widget] Gtk.ComboBox combo_force_sensor_exercise;
+ [Widget] Gtk.RadioButton radio_force_sensor_laterality_both;
+ [Widget] Gtk.RadioButton radio_force_sensor_laterality_l;
+ [Widget] Gtk.RadioButton radio_force_sensor_laterality_r;
+ [Widget] Gtk.TextView textview_force_sensor_capture_comment;
+ [Widget] Gtk.HBox hbox_force_sensor_lat_and_comments;
[Widget] Gtk.Alignment alignment_force_sensor_adjust;
[Widget] Gtk.Button button_force_sensor_tare;
[Widget] Gtk.Button button_force_sensor_calibrate;
@@ -348,6 +353,7 @@ public partial class ChronoJumpWindow
{
//force related buttons
hbox_force_capture_buttons.Sensitive = sensitive;
+ hbox_force_sensor_lat_and_comments.Sensitive = sensitive;
button_execute_test.Sensitive = sensitive;
button_force_sensor_analyze_load.Sensitive = sensitive;
@@ -664,13 +670,17 @@ public partial class ChronoJumpWindow
Util.CreateForceSensorSessionDirIfNeeded (currentSession.UniqueID);
- string personExDate = currentPerson.Name + "_" +
UtilGtk.ComboGetActive(combo_force_sensor_exercise) + "_" + UtilDate.ToFile(DateTime.Now);
+ string fileNamePre = currentPerson.Name + "_" +
+ UtilGtk.ComboGetActive(combo_force_sensor_exercise) + "_" +
+ getLaterality() + "_" +
+ getCaptureComment() + //includes "_" if it's no empty
+ UtilDate.ToFile(DateTime.Now);
//fileName to save the csv
- string fileName = Util.GetForceSensorSessionDir(currentSession.UniqueID) +
Path.DirectorySeparatorChar + personExDate + ".csv";
+ string fileName = Util.GetForceSensorSessionDir(currentSession.UniqueID) +
Path.DirectorySeparatorChar + fileNamePre + ".csv";
//lastForceSensorFile to save the images
- lastForceSensorFile = personExDate;
+ lastForceSensorFile = fileNamePre;
TextWriter writer = File.CreateText(fileName);
@@ -1460,7 +1470,10 @@ LogB.Information(" re R ");
{
hbox_force_capture_buttons.Sensitive = false;
button_force_sensor_adjust.Sensitive = false;
+
+ hbox_force_sensor_lat_and_comments.Visible = false;
alignment_force_sensor_adjust.Visible = true;
+
notebook_options_at_execute_button.CurrentPage = 2;
forceSensorCaptureAdjustSensitivity(false);
@@ -1470,7 +1483,10 @@ LogB.Information(" re R ");
{
hbox_force_capture_buttons.Sensitive = true;
button_force_sensor_adjust.Sensitive = true;
+
+ hbox_force_sensor_lat_and_comments.Visible = true;
alignment_force_sensor_adjust.Visible = false;
+
notebook_options_at_execute_button.CurrentPage = 0;
forceSensorCaptureAdjustSensitivity(true);
@@ -1728,6 +1744,29 @@ LogB.Information(" re R ");
// -------------------------------- end of exercise stuff --------------------
+ // -------------------------------- laterality and comment stuff -------------
+
+ private string getLaterality()
+ {
+ if(radio_force_sensor_laterality_both.Active)
+ return Catalog.GetString("Both");
+ else if(radio_force_sensor_laterality_l.Active)
+ return Catalog.GetString("Left");
+ else //if(radio_force_sensor_laterality_r.Active)
+ return Catalog.GetString("Right");
+ }
+
+ private string getCaptureComment()
+ {
+ string s = Util.MakeValidSQL(textview_force_sensor_capture_comment.Buffer.Text);
+ if(s != "")
+ s += "_";
+
+ return s;
+ }
+
+ // -------------------------------- end of laterality and comment stuff ------
+
// ------------------------------------------------ slides stuff for presentations
double lastChangedTime; //changeSlideCode
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]