[chronojump] RaceAnalyzer can show simple view or complete view on capture tab
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RaceAnalyzer can show simple view or complete view on capture tab
- Date: Fri, 6 Aug 2021 12:05:31 +0000 (UTC)
commit 6d2215b78148e9c757059705743360da87fbce48
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Aug 6 14:05:09 2021 +0200
RaceAnalyzer can show simple view or complete view on capture tab
glade/app1.glade | 97 ++++++++++++++++++++++++++++++++++++++++++++--
src/gui/app1/chronojump.cs | 2 +
src/gui/app1/runEncoder.cs | 63 +++++++++++++++++++++++++++---
3 files changed, 153 insertions(+), 9 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 90b06de22..c8e02f5f9 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -11391,21 +11391,53 @@ EncoderInertialCapture</property>
<widget class="GtkVBox" id="vbox231">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <child>
+ <widget class="GtkHPaned"
id="hpaned_race_analyzer_capture_velocimeter_speed_time">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkAlignment"
id="alignment_drawingarea_race_analyzer_capture_velocimeter_topleft">
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="right_padding">6</property>
+ <child>
+ <widget class="GtkDrawingArea"
id="drawingarea_race_analyzer_capture_velocimeter_topleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <signal name="expose_event"
handler="on_drawingarea_race_analyzer_capture_velocimeter_expose_event" swapped="no"/>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">False</property>
+ </packing>
+ </child>
<child>
<widget class="GtkDrawingArea"
id="drawingarea_race_analyzer_capture_speed_time">
+ <property name="width_request">150</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="expose_event"
handler="on_drawingarea_race_analyzer_capture_speed_time_expose_event" swapped="no"/>
</widget>
<packing>
+ <property name="resize">True</property>
+ <property name="shrink">False</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="GtkHBox" id="hbox502">
+ <widget class="GtkAlignment"
id="alignment_hbox_race_analyzer_capture_bottom">
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkHBox"
id="hbox_race_analyzer_capture_bottom">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -11423,10 +11455,10 @@ EncoderInertialCapture</property>
</packing>
</child>
<child>
- <widget class="GtkDrawingArea"
id="drawingarea_race_analyzer_capture">
+ <widget class="GtkDrawingArea"
id="drawingarea_race_analyzer_capture_velocimeter_bottom">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <signal name="expose_event"
handler="on_drawingarea_race_analyzer_capture_expose_event" swapped="no"/>
+ <signal name="expose_event"
handler="on_drawingarea_race_analyzer_capture_velocimeter_expose_event" swapped="no"/>
</widget>
<packing>
<property name="expand">True</property>
@@ -11447,6 +11479,8 @@ EncoderInertialCapture</property>
</packing>
</child>
</widget>
+ </child>
+ </widget>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
@@ -11493,6 +11527,11 @@ EncoderInertialCapture</property>
</widget>
</child>
<child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">24</property>
+ <child>
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -11500,6 +11539,56 @@ EncoderInertialCapture</property>
<property name="use_markup">True</property>
</widget>
<packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox"
id="hbox_race_analyzer_capture_tab_result_views">
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkRadioButton"
id="radio_race_analyzer_capture_view_simple">
+ <property name="label">Simple view</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="clicked"
handler="on_radio_race_analyzer_capture_view_clicked" swapped="no"/>
+ </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_race_analyzer_capture_view_complete">
+ <property name="label">Complete view</property>
+ <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_race_analyzer_capture_view_simple</property>
+ <signal name="clicked"
handler="on_radio_race_analyzer_capture_view_clicked" swapped="no"/>
+ </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">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
<property name="type">label_item</property>
</packing>
</child>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 56646f8b7..c08499775 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -3436,6 +3436,7 @@ public partial class ChronoJumpWindow
radio_mode_contacts_jumps_rj_fatigue.Visible = false;
radio_mode_contacts_runs_evolution.Visible = false;
radio_mode_contacts_sprint.Visible = false;
+ hbox_race_analyzer_capture_tab_result_views.Visible = false;
notebook_analyze.CurrentPage = Convert.ToInt32(notebook_analyze_pages.STATISTICS);
button_inspect_last_test_run_intervallic.Visible = false;
alignment_button_force_sensor_adjust.Visible = false;
@@ -3767,6 +3768,7 @@ public partial class ChronoJumpWindow
alignment_button_threshold.Visible = false;
//notebook_capture_analyze.GetNthPage(2).Hide(); //hide jumpsProfile on other tests
+ hbox_race_analyzer_capture_tab_result_views.Visible = true;
hbox_change_modes_runs.Visible = true;
align_check_vbox_contacts_graph_legend.Visible = false;
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index d244f16de..a8a5b9349 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -51,7 +51,12 @@ public partial class ChronoJumpWindow
[Widget] Gtk.TreeView treeview_raceAnalyzer;
[Widget] Gtk.Button button_raceAnalyzer_table_save;
//[Widget] Gtk.Label label_race_analyzer_capture_speed;
- [Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture;
+ [Widget] Gtk.HBox hbox_race_analyzer_capture_tab_result_views;
+ [Widget] Gtk.RadioButton radio_race_analyzer_capture_view_simple;
+ [Widget] Gtk.Alignment alignment_drawingarea_race_analyzer_capture_velocimeter_topleft;
+ [Widget] Gtk.Alignment alignment_hbox_race_analyzer_capture_bottom;
+ [Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_velocimeter_topleft;
+ [Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_velocimeter_bottom;
[Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_position_time;
[Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_speed_time;
[Widget] Gtk.DrawingArea drawingarea_race_analyzer_capture_accel_time;
@@ -100,6 +105,8 @@ public partial class ChronoJumpWindow
private void initRunEncoder ()
{
+ manageRunEncoderCaptureViews();
+
createRunEncoderExerciseCombo();
createRunEncoderAnalyzeCombos();
setRunEncoderAnalyzeWidgets();
@@ -108,6 +115,27 @@ public partial class ChronoJumpWindow
spinbutton_run_encoder_export_image_height.Value = preferences.exportGraphHeight;
}
+ private void manageRunEncoderCaptureViews()
+ {
+ if(radio_race_analyzer_capture_view_simple.Active)
+ {
+ alignment_drawingarea_race_analyzer_capture_velocimeter_topleft.Visible = true;
+ alignment_hbox_race_analyzer_capture_bottom.Visible = false;
+ cairoRadial = null;
+ drawingarea_race_analyzer_capture_velocimeter_topleft.QueueDraw(); //will fire
ExposeEvent
+ } else {
+ alignment_drawingarea_race_analyzer_capture_velocimeter_topleft.Visible = false;
+ alignment_hbox_race_analyzer_capture_bottom.Visible = true;
+ cairoRadial = null;
+ drawingarea_race_analyzer_capture_velocimeter_bottom.QueueDraw(); //will fire
ExposeEvent
+ }
+ }
+
+ private void on_radio_race_analyzer_capture_view_clicked (object o, EventArgs args)
+ {
+ manageRunEncoderCaptureViews();
+ }
+
//no GTK here
private bool runEncoderConnect()
{
@@ -329,7 +357,12 @@ public partial class ChronoJumpWindow
//draw the capture graphs empty:
//a) radial
runEncoderShouldShowCaptureGraphsWithData = false;
- drawingarea_race_analyzer_capture.QueueDraw(); //will fire ExposeEvent
+
+ if(radio_race_analyzer_capture_view_simple.Active)
+ drawingarea_race_analyzer_capture_velocimeter_topleft.QueueDraw(); //will fire
ExposeEvent
+ else
+ drawingarea_race_analyzer_capture_velocimeter_bottom.QueueDraw(); //will fire
ExposeEvent
+
//b) scatterplots
cairoGraphRaceAnalyzerPoints_dt_l = new List<PointF>();
cairoGraphRaceAnalyzerPoints_st_l = new List<PointF>();
@@ -996,7 +1029,13 @@ public partial class ChronoJumpWindow
if(reCGSD.RunEncoderCaptureSpeedMax > 0)
{
if(cairoRadial == null)
- cairoRadial = new CairoRadial(drawingarea_race_analyzer_capture,
preferences.fontType.ToString());
+ {
+ if(radio_race_analyzer_capture_view_simple.Active)
+ cairoRadial = new
CairoRadial(drawingarea_race_analyzer_capture_velocimeter_topleft, preferences.fontType.ToString());
+ else
+ cairoRadial = new
CairoRadial(drawingarea_race_analyzer_capture_velocimeter_bottom, preferences.fontType.ToString());
+ }
+
cairoRadial.GraphSpeedMaxAndDistance(reCGSD.RunEncoderCaptureSpeedMax,
reCGSD.RunEncoderCaptureDistance);
updateRaceAnalyzerCapturePositionTime(true);
@@ -1965,10 +2004,18 @@ public partial class ChronoJumpWindow
// -------------------------------- end of exercise stuff --------------------
CairoRadial cairoRadial;
- private void on_drawingarea_race_analyzer_capture_expose_event (object o, ExposeEventArgs args)
+ private void on_drawingarea_race_analyzer_capture_velocimeter_expose_event (object o, ExposeEventArgs
args)
{
+ Gtk.DrawingArea da;
+ if (o == (object) drawingarea_race_analyzer_capture_velocimeter_topleft)
+ da = drawingarea_race_analyzer_capture_velocimeter_topleft;
+ else if (o == (object) drawingarea_race_analyzer_capture_velocimeter_bottom)
+ da = drawingarea_race_analyzer_capture_velocimeter_bottom;
+ else
+ return;
+
if(cairoRadial == null)
- cairoRadial = new CairoRadial(drawingarea_race_analyzer_capture,
preferences.fontType.ToString());
+ cairoRadial = new CairoRadial(da, preferences.fontType.ToString());
//when person or session changes
if(! runEncoderShouldShowCaptureGraphsWithData)
@@ -2012,6 +2059,9 @@ public partial class ChronoJumpWindow
private void updateRaceAnalyzerCapturePositionTime(bool forceRedraw)
{
+ if(radio_race_analyzer_capture_view_simple.Active)
+ return;
+
if(cairoGraphRaceAnalyzer_dt == null)
cairoGraphRaceAnalyzer_dt = new CairoGraphRaceAnalyzer(
drawingarea_race_analyzer_capture_position_time, "title",
@@ -2032,6 +2082,9 @@ public partial class ChronoJumpWindow
}
private void updateRaceAnalyzerCaptureAccelTime(bool forceRedraw)
{
+ if(radio_race_analyzer_capture_view_simple.Active)
+ return;
+
if(cairoGraphRaceAnalyzer_at == null)
cairoGraphRaceAnalyzer_at = new CairoGraphRaceAnalyzer(
drawingarea_race_analyzer_capture_accel_time, "title",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]