[chronojump] gui for: RunEncoderExercise angleDefault, RunEncoder angle
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] gui for: RunEncoderExercise angleDefault, RunEncoder angle
- Date: Fri, 6 May 2022 16:19:42 +0000 (UTC)
commit 5d23a9d696185c303a49b8cfe940ba792867c556
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri May 6 18:18:13 2022 +0200
gui for: RunEncoderExercise angleDefault, RunEncoder angle
glade/app1.glade | 266 +++++++++++++++++++++++++++++++++------------
src/gui/app1/icons.cs | 2 +
src/gui/app1/runEncoder.cs | 36 ++++--
3 files changed, 228 insertions(+), 76 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index eeef133b9..84bf1561f 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -15390,6 +15390,64 @@ Resisted race analyzer</property>
</packing>
</child>
<child>
+ <widget class="GtkHBox"
id="hbox_race_analyzer_angle">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkLabel" id="label127">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Angle</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="race_analyzer_spinbutton_angle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property
name="invisible_char_set">True</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">0 -180 180 1 10
0</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel"
id="race_analyzer_angle_units">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">º</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox"
id="hbox_race_analyzer_temperature">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -15444,7 +15502,7 @@ Resisted race analyzer</property>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
@@ -15587,6 +15645,124 @@ Resisted race analyzer</property>
</packing>
</child>
<child>
+ <widget class="GtkHBox" id="hbox202">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">20</property>
+ <child>
+ <widget class="GtkCheckButton"
id="check_run_encoder_exercise_is_sprint">
+ <property name="label" translatable="yes">Is it
an sprint?</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property
name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton"
id="button_run_encoder_exercise_is_sprint_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked"
handler="on_button_run_encoder_exercise_is_sprint_help_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage"
id="image_run_encoder_exercise_is_sprint_help">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-info</property>
+ <property name="icon-size">2</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox221">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">20</property>
+ <child>
+ <widget class="GtkLabel" id="label126">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Default angle</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_run_encoder_exercise_angle_default">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property
name="primary_icon_activatable">False</property>
+ <property
name="secondary_icon_activatable">False</property>
+ <property
name="primary_icon_sensitive">True</property>
+ <property
name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">0 -180 180 1 10
0</property>
+ <property name="climb_rate">1</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton"
id="button_run_encoder_exercise_angle_default_help">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked"
handler="on_button_run_encoder_exercise_angle_default_help_clicked" swapped="no"/>
+ <child>
+ <widget class="GtkImage"
id="image_run_encoder_exercise_angle_default_help">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-info</property>
+ <property name="icon-size">2</property>
+ </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="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkHBox" id="hbox128">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -15717,63 +15893,9 @@ Resisted race analyzer</property>
</child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox202">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">20</property>
- <child>
- <widget class="GtkCheckButton"
id="check_run_encoder_exercise_is_sprint">
- <property name="label" translatable="yes">Is it
an sprint?</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property
name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton"
id="button_run_encoder_exercise_is_sprint_help">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <signal name="clicked"
handler="on_button_run_encoder_exercise_is_sprint_help_clicked" swapped="no"/>
- <child>
- <widget class="GtkImage"
id="image_run_encoder_exercise_is_sprint_help">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-info</property>
- <property name="icon-size">2</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- </widget>
- <packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -16596,7 +16718,7 @@ Resisted race analyzer</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</widget>
@@ -26429,6 +26551,9 @@ Concentric</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -32837,6 +32962,18 @@ 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>
@@ -32873,18 +33010,6 @@ 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>
@@ -42195,6 +42320,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/icons.cs b/src/gui/app1/icons.cs
index 1e7476679..4c3412796 100644
--- a/src/gui/app1/icons.cs
+++ b/src/gui/app1/icons.cs
@@ -235,6 +235,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_run_encoder_analyze_image_save_disk;
[Widget] Gtk.Image image_run_encoder_export_cancel;
[Widget] Gtk.Image image_run_encoder_exercise_is_sprint_help;
+ [Widget] Gtk.Image image_run_encoder_exercise_angle_default_help;
//video play icons
[Widget] Gtk.Image image_video_play_this_test_contacts;
@@ -439,6 +440,7 @@ public partial class ChronoJumpWindow
image_run_simple_with_reaction_time_help.Pixbuf = pixbuf;
image_run_interval_with_reaction_time_help.Pixbuf = pixbuf;
image_run_encoder_exercise_is_sprint_help.Pixbuf = pixbuf;
+ image_run_encoder_exercise_angle_default_help.Pixbuf = pixbuf;
image_info_sessions_info.Pixbuf = pixbuf;
image_encoder_1RM_info.Pixbuf = pixbuf;
image_force_sensor_adjust_help.Pixbuf = pixbuf;
diff --git a/src/gui/app1/runEncoder.cs b/src/gui/app1/runEncoder.cs
index b452453fe..92b93b007 100644
--- a/src/gui/app1/runEncoder.cs
+++ b/src/gui/app1/runEncoder.cs
@@ -44,6 +44,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.HBox hbox_combo_run_encoder_exercise;
[Widget] Gtk.ComboBox combo_run_encoder_exercise;
[Widget] Gtk.SpinButton race_analyzer_spinbutton_distance;
+ [Widget] Gtk.SpinButton race_analyzer_spinbutton_angle;
[Widget] Gtk.SpinButton race_analyzer_spinbutton_temperature;
[Widget] Gtk.ComboBox combo_race_analyzer_device;
[Widget] Gtk.Image image_run_encoder_graph;
@@ -70,6 +71,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Entry entry_run_encoder_exercise_name;
[Widget] Gtk.Entry entry_run_encoder_exercise_description;
[Widget] Gtk.CheckButton check_run_encoder_exercise_is_sprint;
+ [Widget] Gtk.SpinButton spin_run_encoder_exercise_angle_default;
[Widget] Gtk.CheckButton check_run_encoder_exercise_fixed_size;
[Widget] Gtk.HBox hbox_run_encoder_exercise_fixed_segments_size;
[Widget] Gtk.HBox hbox_run_encoder_exercise_notfixed_segment_num;
@@ -118,6 +120,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.SpinButton spin_race_encoder_exercise_v_segment_size_cm_39;
int race_analyzer_distance;
+ //int race_analyzer_angle;
int race_analyzer_temperature;
RunEncoder.Devices race_analyzer_device;
@@ -486,6 +489,7 @@ public partial class ChronoJumpWindow
private void raceEncoderReadWidgets()
{
race_analyzer_distance = Convert.ToInt32(race_analyzer_spinbutton_distance.Value);
+ //race_analyzer_angle = Convert.ToInt32(race_analyzer_spinbutton_angle.Value);
race_analyzer_temperature = Convert.ToInt32(race_analyzer_spinbutton_temperature.Value);
if(UtilGtk.ComboGetActive(combo_race_analyzer_device) == RunEncoder.DevicesStringMANUAL)
@@ -525,9 +529,10 @@ public partial class ChronoJumpWindow
image_test.Pixbuf = pixbuf;
}
- private void raceEncoderSetDistanceAndTemp(int distance, int temp)
+ private void raceEncoderSetDistanceAngleAndTemp (int distance, int angle, int temp)
{
race_analyzer_spinbutton_distance.Value = distance;
+ race_analyzer_spinbutton_angle.Value = angle;
race_analyzer_spinbutton_temperature.Value = temp;
}
@@ -1047,7 +1052,7 @@ public partial class ChronoJumpWindow
assignCurrentRunEncoderExercise();
raceEncoderSetDevice(re.Device);
- raceEncoderSetDistanceAndTemp(re.Distance, re.Temperature);
+ raceEncoderSetDistanceAngleAndTemp(re.Distance, re.Angle, re.Temperature);
/// textview_race_analyzer_comment.Buffer.Text = re.Comments;
textview_contacts_signal_comment.Buffer.Text = re.Comments;
@@ -1312,6 +1317,7 @@ public partial class ChronoJumpWindow
currentRunEncoder.ExerciseName = currentRunEncoderExercise.Name; //just in case
currentRunEncoder.Device = raceEncoderGetDevice();
currentRunEncoder.Distance = Convert.ToInt32(race_analyzer_spinbutton_distance.Value);
+ currentRunEncoder.Angle = Convert.ToInt32(race_analyzer_spinbutton_angle.Value);
currentRunEncoder.Temperature = Convert.ToInt32(race_analyzer_spinbutton_temperature.Value);
//currentRunEncoder.Comments =
UtilGtk.TextViewGetCommentValidSQL(textview_race_analyzer_comment);
currentRunEncoder.Comments =
UtilGtk.TextViewGetCommentValidSQL(textview_contacts_signal_comment);
@@ -1371,6 +1377,7 @@ public partial class ChronoJumpWindow
//create graph
RunEncoderGraph reg = new RunEncoderGraph(
race_analyzer_distance,
+ //race_analyzer_angle, //TODO: unused
currentPersonSession.Weight, //TODO: can be more if extra weight
currentPersonSession.Height,
race_analyzer_temperature,
@@ -1570,6 +1577,7 @@ public partial class ChronoJumpWindow
UtilDate.ToFile(runEncoderTimeStartCapture),
"", //on capture cannot store comment (comment has to
be written after),
"", //videoURL
+ currentRunEncoder.Angle,
currentRunEncoderExercise.Name);
currentRunEncoder.UniqueID = currentRunEncoder.InsertSQL(false);
@@ -1862,6 +1870,10 @@ public partial class ChronoJumpWindow
setLabelContactsExerciseSelected(Constants.Modes.RUNSENCODER);
+ RunEncoderExercise exTemp = SqliteRunEncoderExercise.Select (
+ false, getExerciseIDFromAnyCombo(combo_run_encoder_exercise,
runEncoderComboExercisesString, false))[0];
+ race_analyzer_spinbutton_angle.Value = exTemp.AngleDefault;
+
//sensitivity of left/right buttons
button_combo_run_encoder_exercise_capture_left.Sensitive = (combo_run_encoder_exercise.Active
0);
button_combo_run_encoder_exercise_capture_right.Sensitive = !
UtilGtk.ComboSelectedIsLast(combo_run_encoder_exercise);
@@ -1924,6 +1936,7 @@ public partial class ChronoJumpWindow
entry_run_encoder_exercise_name.Text = ex.Name;
entry_run_encoder_exercise_description.Text = ex.Description;
check_run_encoder_exercise_is_sprint.Active = ex.IsSprint;
+ spin_run_encoder_exercise_angle_default.Value = ex.AngleDefault;
if(v_segments_size_cm_l == null)
spin_race_encoder_exercise_v_segment_size_cm_create_list ();
@@ -1954,6 +1967,7 @@ public partial class ChronoJumpWindow
entry_run_encoder_exercise_name.Text = "";
entry_run_encoder_exercise_description.Text = "";
check_run_encoder_exercise_is_sprint.Active = true;
+ spin_run_encoder_exercise_angle_default.Value = 0;
spin_race_encoder_exercise_f_segment_size_cm.Value = RunEncoderExercise.SegmentCmDefault;
spin_race_encoder_exercise_v_segments_num.Value = 2;
@@ -1974,6 +1988,15 @@ public partial class ChronoJumpWindow
return;
}
+ private void on_button_run_encoder_exercise_angle_default_help_clicked (object o, EventArgs args)
+ {
+ new DialogMessage(Constants.MessageTypes.INFO,
+ Catalog.GetString("Default angle of this exercise.") + "\n" +
+ Catalog.GetString("90 means go vertically up.") + "\n" +
+ Catalog.GetString("-90 means go vertically down.") + "\n" +
+ string.Format(Catalog.GetString("Possible range goes from {0} to {1}."),
-180, 180));
+ return;
+ }
private void on_check_run_encoder_exercise_fixed_size_toggled (object o, EventArgs args)
{
if(check_run_encoder_exercise_fixed_size.Active)
@@ -2114,14 +2137,16 @@ public partial class ChronoJumpWindow
{
RunEncoderExercise ex = new RunEncoderExercise (
-1, name, entry_run_encoder_exercise_description.Text,
- segmentCm, segmentVariableCm,
check_run_encoder_exercise_is_sprint.Active);
+ segmentCm, segmentVariableCm,
check_run_encoder_exercise_is_sprint.Active,
+ Convert.ToInt32(spin_run_encoder_exercise_angle_default.Value));
ex.InsertSQL (false);
currentRunEncoderExercise = ex;
} else {
RunEncoderExercise ex = new RunEncoderExercise(
getExerciseIDFromAnyCombo(combo_run_encoder_exercise,
runEncoderComboExercisesString, false),
name, entry_run_encoder_exercise_description.Text,
- segmentCm, segmentVariableCm,
check_run_encoder_exercise_is_sprint.Active);
+ segmentCm, segmentVariableCm,
check_run_encoder_exercise_is_sprint.Active,
+ Convert.ToInt32(spin_run_encoder_exercise_angle_default.Value));
SqliteRunEncoderExercise.Update(false, ex);
currentRunEncoderExercise = ex;
@@ -2344,8 +2369,6 @@ public partial class ChronoJumpWindow
private int getSmoothFrom_gui_at_race_analyzer_capture_smooth_graphs ()
{
- LogB.Information("hscale value: " +
hscale_race_analyzer_capture_smooth_graphs.Value.ToString());
-
if(! check_race_analyzer_capture_smooth_graphs.Active)
return 0;
@@ -2355,7 +2378,6 @@ public partial class ChronoJumpWindow
private void on_hscale_race_analyzer_capture_smooth_graphs_value_changed (object o, EventArgs args)
{
int smooth = getSmoothFrom_gui_at_race_analyzer_capture_smooth_graphs ();
- LogB.Information("smooth: " + smooth.ToString());
if(smooth == 0)
label_race_analyzer_capture_smooth_graphs.Text = "";
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]