[chronojump] ForceSensor analyze instant, removed B checkbox
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor analyze instant, removed B checkbox
- Date: Tue, 11 Feb 2020 17:15:03 +0000 (UTC)
commit 67cf9afa824e6f2049898faff35f08349a8be243
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Feb 11 15:45:22 2020 +0100
ForceSensor analyze instant, removed B checkbox
glade/app1.glade | 88 ++++++++++++++++++++------------------
src/gui/app1/forceSensor.cs | 1 -
src/gui/app1/forceSensorAnalyze.cs | 86 +++++--------------------------------
3 files changed, 57 insertions(+), 118 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index aa55ec5d..5d7966f6 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -22088,40 +22088,12 @@ Concentric</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <widget class="GtkHBox" id="hbox341">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <widget class="GtkCheckButton"
id="checkbutton_force_sensor_ai_b">
- <property name="width_request">30</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property
name="receives_default">False</property>
- <property name="xalign">1</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled"
handler="on_checkbutton_force_sensor_ai_b_toggled" swapped="no"/>
- </widget>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label361">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">B</property>
</widget>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</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>
@@ -22129,6 +22101,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkHScale"
id="hscale_force_sensor_ai_b">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">1 1 300 1 10
0</property>
<property name="digits">0</property>
@@ -22143,6 +22116,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkHBox"
id="hbox_buttons_scale_force_sensor_ai_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">4</property>
<child>
@@ -22285,6 +22259,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkHScale"
id="hscale_force_sensor_ai_ab">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">1 1 300 1 10
0</property>
<property name="digits">0</property>
@@ -22300,6 +22275,7 @@ Concentric</property>
<child>
<widget class="GtkButton"
id="button_force_sensor_ai_zoom">
<property name="label">Zoom [A-B]</property>
+ <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked"
handler="on_button_force_sensor_ai_zoom_clicked" swapped="no"/>
@@ -22539,6 +22515,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_force_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22553,6 +22530,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_rfd_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22581,6 +22559,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_time_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
@@ -22594,6 +22573,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_force_diff">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22608,6 +22588,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_time_diff">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22622,6 +22603,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_rfd_diff">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22636,6 +22618,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_force_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22650,6 +22633,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_rfd_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22664,6 +22648,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_force_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22678,6 +22663,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_rfd_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -22692,6 +22678,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label">B</property>
</widget>
@@ -22717,6 +22704,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_diff">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label"
translatable="yes">Difference</property>
@@ -22730,6 +22718,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label"
translatable="yes">Average</property>
@@ -22743,6 +22732,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
<property name="label"
translatable="yes">Maximum</property>
@@ -22878,6 +22868,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_position_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
@@ -22905,6 +22896,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_speed_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
@@ -22932,6 +22924,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_accel_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
@@ -22959,6 +22952,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_power_b">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
</widget>
<packing>
@@ -23028,6 +23022,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_speed_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23042,6 +23037,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_accel_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23056,6 +23052,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_power_average">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23070,6 +23067,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_speed_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23084,6 +23082,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_accel_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23098,6 +23097,7 @@ Concentric</property>
</child>
<child>
<widget class="GtkLabel"
id="label_force_sensor_ai_power_max">
+ <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="width_chars">8</property>
</widget>
@@ -23257,6 +23257,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -23267,7 +23270,7 @@ Concentric</property>
<child>
<widget class="GtkVBox"
id="vbox_force_sensor_ai_impulse_variability_and_feedback">
<property name="can_focus">False</property>
- <property name="spacing">12</property>
+ <property name="spacing">10</property>
<child>
<widget class="GtkVBox" id="vbox148">
<property name="visible">True</property>
@@ -25528,18 +25531,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>
@@ -25576,6 +25567,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>
@@ -32922,6 +32925,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/app1/forceSensor.cs b/src/gui/app1/forceSensor.cs
index 8feafee1..f0fc246d 100644
--- a/src/gui/app1/forceSensor.cs
+++ b/src/gui/app1/forceSensor.cs
@@ -1094,7 +1094,6 @@ LogB.Information(" fs C ");
button_force_sensor_analyze_analyze.Sensitive = false;
button_force_sensor_image_save_rfd_auto.Sensitive = false;
button_force_sensor_image_save_rfd_manual.Sensitive = false;
- checkbutton_force_sensor_ai_b.Sensitive = false;
button_contacts_recalculate.Sensitive = false;
button_delete_last_test.Sensitive = false;
}
diff --git a/src/gui/app1/forceSensorAnalyze.cs b/src/gui/app1/forceSensorAnalyze.cs
index 83c0ac83..82bf53d1 100644
--- a/src/gui/app1/forceSensorAnalyze.cs
+++ b/src/gui/app1/forceSensorAnalyze.cs
@@ -535,7 +535,6 @@ public partial class ChronoJumpWindow
[Widget] Gtk.HScale hscale_force_sensor_ai_a;
[Widget] Gtk.HScale hscale_force_sensor_ai_b;
[Widget] Gtk.HScale hscale_force_sensor_ai_ab;
- [Widget] Gtk.CheckButton checkbutton_force_sensor_ai_b;
[Widget] Gtk.Label label_force_sensor_ai_time_a;
[Widget] Gtk.Label label_force_sensor_ai_force_a;
[Widget] Gtk.Label label_force_sensor_ai_rfd_a;
@@ -544,7 +543,6 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Label label_force_sensor_ai_accel_a;
[Widget] Gtk.Label label_force_sensor_ai_power_a;
[Widget] Gtk.HBox hbox_buttons_scale_force_sensor_ai_b;
- [Widget] Gtk.Label label_force_sensor_ai_b;
[Widget] Gtk.Label label_force_sensor_ai_position_b;
[Widget] Gtk.Label label_force_sensor_ai_position_diff;
[Widget] Gtk.Label label_force_sensor_ai_speed_b;
@@ -559,9 +557,6 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Label label_force_sensor_ai_power_diff;
[Widget] Gtk.Label label_force_sensor_ai_power_average;
[Widget] Gtk.Label label_force_sensor_ai_power_max;
- [Widget] Gtk.Label label_force_sensor_ai_diff;
- [Widget] Gtk.Label label_force_sensor_ai_average;
- [Widget] Gtk.Label label_force_sensor_ai_max;
[Widget] Gtk.Label label_force_sensor_ai_time_b;
[Widget] Gtk.Label label_force_sensor_ai_time_diff;
[Widget] Gtk.Label label_force_sensor_ai_force_b;
@@ -602,7 +597,7 @@ public partial class ChronoJumpWindow
double zoomA = -1;
double zoomB = -1;
- if(forceSensorZoomApplied && checkbutton_force_sensor_ai_b.Active &&
+ if(forceSensorZoomApplied &&
Util.IsNumber(label_force_sensor_ai_time_a.Text, true) &&
Util.IsNumber(label_force_sensor_ai_time_b.Text, true))
{
@@ -898,13 +893,9 @@ public partial class ChronoJumpWindow
forceSensorZoomApplied = ! forceSensorZoomApplied;
if(forceSensorZoomApplied)
- {
button_force_sensor_ai_zoom.Label = "Zoom out";
- checkbutton_force_sensor_ai_b.Sensitive = false;
- } else {
+ else
button_force_sensor_ai_zoom.Label = "Zoom [A-B]";
- checkbutton_force_sensor_ai_b.Sensitive = true;
- }
//store hscale a to help return to position on unzoom
if(forceSensorZoomApplied) {
@@ -933,10 +924,6 @@ public partial class ChronoJumpWindow
bool debug = false;
button_force_sensor_image_save_rfd_manual.Sensitive = true;
- if(! forceSensorZoomApplied)
- checkbutton_force_sensor_ai_b.Sensitive = true;
- if(checkbutton_force_sensor_ai_b.Active)
- button_force_sensor_analyze_AB_save.Visible = true;
//draw horizontal rectangle of feedback
if(preferences.forceSensorCaptureFeedbackActive)
@@ -982,7 +969,7 @@ public partial class ChronoJumpWindow
layout_force_ai_text_big);
int xposB = 0;
- if(checkbutton_force_sensor_ai_b.Active && hscaleLower != hscaleHigher)
+ if(hscaleLower != hscaleHigher)
{
xposB = fsAI.GetXFromSampleCount(hscaleHigher);
force_sensor_ai_pixmap.DrawLine(pen_yellow_force_ai,
@@ -1039,12 +1026,8 @@ public partial class ChronoJumpWindow
}
- // 6) if only A calculate exit
- if(! checkbutton_force_sensor_ai_b.Active)
- return;
-
/*
- * 7) Invert AB if needed to paint correctly blue and red lines
+ * 6) Invert AB if needed to paint correctly blue and red lines
* making it work also when B is higher than A
*/
if(hscaleLower > hscaleHigher)
@@ -1127,7 +1110,7 @@ public partial class ChronoJumpWindow
return;
//do not allow A to be higher than B (fix multiple possible problems)
- if(checkbutton_force_sensor_ai_b.Active && hscale_force_sensor_ai_a.Value >
hscale_force_sensor_ai_b.Value)
+ if(hscale_force_sensor_ai_a.Value > hscale_force_sensor_ai_b.Value)
hscale_force_sensor_ai_b.Value = hscale_force_sensor_ai_a.Value;
int count = Convert.ToInt32(hscale_force_sensor_ai_a.Value);
@@ -1152,13 +1135,10 @@ public partial class ChronoJumpWindow
else
label_force_sensor_ai_rfd_a.Text = "";
- if(checkbutton_force_sensor_ai_b.Active)
- {
- force_sensor_analyze_instant_calculate_params();
- updateForceSensorHScales = false;
- hscale_force_sensor_ai_ab.Value = Convert.ToInt32(hscale_force_sensor_ai_a.Value +
hscale_force_sensor_ai_b.Value) / 2;
- updateForceSensorHScales = true;
- }
+ force_sensor_analyze_instant_calculate_params();
+ updateForceSensorHScales = false;
+ hscale_force_sensor_ai_ab.Value = Convert.ToInt32(hscale_force_sensor_ai_a.Value +
hscale_force_sensor_ai_b.Value) / 2;
+ updateForceSensorHScales = true;
forceSensorAnalyzeGeneralButtonHscaleZoomSensitiveness();
forceSensorAIChanged = true;
@@ -1238,8 +1218,6 @@ public partial class ChronoJumpWindow
private void forceSensorAnalyzeGeneralButtonHscaleZoomSensitiveness()
{
- //note ai_a can be working with ai_b or alone (depending on checkbutton_force_sensor_ai_b)
-
button_hscale_force_sensor_ai_a_first.Sensitive = hscale_force_sensor_ai_a.Value > 1;
button_hscale_force_sensor_ai_a_pre.Sensitive = hscale_force_sensor_ai_a.Value > 1;
button_hscale_force_sensor_ai_b_first.Sensitive = hscale_force_sensor_ai_b.Value > 1;
@@ -1287,51 +1265,9 @@ public partial class ChronoJumpWindow
hscale_force_sensor_ai_b.Value = fsAI.GetLength() -2;
}
- private void on_checkbutton_force_sensor_ai_b_toggled (object o, EventArgs args)
- {
- int count = Convert.ToInt32(hscale_force_sensor_ai_b.Value);
- label_force_sensor_ai_time_b.Text = Math.Round(fsAI.GetTimeMS(count), 1).ToString();
- label_force_sensor_ai_force_b.Text = Math.Round(fsAI.GetForceAtCount(count), 1).ToString();
- if(fsAI.CalculedElasticPSAP)
- label_force_sensor_ai_position_b.Text = Math.Round(fsAI.Position_l[count],
3).ToString();
-
- manage_force_sensor_ai_table_visibilities();
-
- if(fsAI != null)
- force_sensor_analyze_instant_calculate_params();
-
- forceSensorAIChanged = true; //to actually plot
-
- //this two help to make the table shrink when B is unchecked
- scrolledwindow_force_sensor_ai.Hide();
- scrolledwindow_force_sensor_ai.Show();
-
- force_sensor_ai_drawingarea.QueueDraw(); // -- refresh
- }
-
private void manage_force_sensor_ai_table_visibilities()
{
- bool visible = checkbutton_force_sensor_ai_b.Active;
- hscale_force_sensor_ai_b.Visible = visible;
- hbox_buttons_scale_force_sensor_ai_b.Visible = visible;
- hscale_force_sensor_ai_ab.Visible = visible;
-
- label_force_sensor_ai_b.Visible = visible;
- label_force_sensor_ai_diff.Visible = visible;
- label_force_sensor_ai_average.Visible = visible;
- label_force_sensor_ai_max.Visible = visible;
- label_force_sensor_ai_time_b.Visible = visible;
- label_force_sensor_ai_time_diff.Visible = visible;
-
- label_force_sensor_ai_force_b.Visible = visible;
- label_force_sensor_ai_force_diff.Visible = visible;
- label_force_sensor_ai_force_average.Visible = visible;
- label_force_sensor_ai_force_max.Visible = visible;
-
- label_force_sensor_ai_rfd_b.Visible = visible;
- label_force_sensor_ai_rfd_diff.Visible = visible;
- label_force_sensor_ai_rfd_average.Visible = visible;
- label_force_sensor_ai_rfd_max.Visible = visible;
+ bool visible = true;//checkbutton_force_sensor_ai_b.Active;
bool visibleElastic = (visible && fsAI.CalculedElasticPSAP);
@@ -1352,8 +1288,6 @@ public partial class ChronoJumpWindow
label_force_sensor_ai_power_average.Visible = visibleElastic;
label_force_sensor_ai_power_max.Visible = visibleElastic;
- button_force_sensor_ai_zoom.Visible = visible;
-
if(visible && canDoForceSensorAnalyzeAB())
button_force_sensor_analyze_AB_save.Visible = true;
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]