[chronojump] ForceSensor feedback path: show recommended line size (max-min)/3
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor feedback path: show recommended line size (max-min)/3
- Date: Thu, 27 May 2021 10:50:53 +0000 (UTC)
commit 19e83eb1a1bc49b46ee5c8aa0b1b2b7f139e1b56
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu May 27 12:50:13 2021 +0200
ForceSensor feedback path: show recommended line size (max-min)/3
glade/repetitive_conditions.glade | 160 ++++++++++++++++++++------------------
src/gui/repetitiveConditions.cs | 16 +++-
2 files changed, 98 insertions(+), 78 deletions(-)
---
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index f375af938..fb907e029 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -5140,109 +5140,115 @@
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox54">
+ <widget class="GtkVBox" id="vbox18">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">20</property>
+ <property name="spacing">12</property>
<child>
- <widget class="GtkHBox" id="hbox58">
+ <widget class="GtkHBox" id="hbox54">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkLabel" id="label67">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Line
width</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton"
id="spin_force_sensor_capture_feedback_path_line_width">
- <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">40 1 400 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>
+ <property name="spacing">20</property>
<child>
- <widget class="GtkLabel" id="label73">
+ <widget class="GtkHBox" id="hbox58">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">N</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkLabel" id="label67">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Line
width</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton"
id="spin_force_sensor_capture_feedback_path_line_width">
+ <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">40 1 400 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="label73">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">N</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="position">2</property>
+ <property name="position">0</property>
</packing>
</child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox85">
+ <widget class="GtkAlignment" id="alignment23">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label149">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label"
translatable="yes">Default:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label150">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label">40</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="left_padding">20</property>
<child>
- <widget class="GtkLabel" id="label148">
+ <widget class="GtkHBox" id="hbox85">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label">N</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label149">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label"
translatable="yes">Recommended:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel"
id="label_force_sensor_path_recommended">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ </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">2</property>
- </packing>
</child>
</widget>
<packing>
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index 6f93aac1d..37eb3f02e 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -199,6 +199,7 @@ public class RepetitiveConditionsWindow
[Widget] Gtk.SpinButton spin_force_sensor_capture_feedback_path_masters;
[Widget] Gtk.SpinButton spin_force_sensor_capture_feedback_path_master_seconds;
[Widget] Gtk.SpinButton spin_force_sensor_capture_feedback_path_line_width; //N
+ [Widget] Gtk.Label label_force_sensor_path_recommended;
const int JUMPSRUNSPAGE = 0;
const int ENCODERAUTOPAGE = 1;
@@ -430,10 +431,12 @@ public class RepetitiveConditionsWindow
notebook_force_sensor_feedback.Page = 2;
}
+ //rectangle widgets
spin_force_sensor_capture_feedback_rectangle_at.Value = forceSensorCaptureFeedbackAt;
spin_force_sensor_capture_feedback_rectangle_range.Value =
forceSensorCaptureFeedbackRange;
- //TODO: define values of path widgets
+ //path widgets
+ setForceSensorPathRecommendedLabel();
notebook_main.GetNthPage(FORCESENSORPAGE).Show();
}
@@ -999,15 +1002,26 @@ public class RepetitiveConditionsWindow
//force sensor feedback path
+ private void setForceSensorPathRecommendedLabel ()
+ {
+ label_force_sensor_path_recommended.Text = string.Format("1/3 * ({0} - {1}) = {2} N",
+ Catalog.GetString("Maximum"), Catalog.GetString("Minimum"),
+ Convert.ToInt32((spin_force_sensor_capture_feedback_path_max.Value -
spin_force_sensor_capture_feedback_path_min.Value) /3));
+ }
+
private void on_spin_force_sensor_capture_feedback_path_min_value_changed (object o, EventArgs args)
{
if(spin_force_sensor_capture_feedback_path_min.Value >
spin_force_sensor_capture_feedback_path_max.Value)
spin_force_sensor_capture_feedback_path_max.Value =
spin_force_sensor_capture_feedback_path_min.Value;
+
+ setForceSensorPathRecommendedLabel();
}
private void on_spin_force_sensor_capture_feedback_path_max_value_changed (object o, EventArgs args)
{
if(spin_force_sensor_capture_feedback_path_max.Value <
spin_force_sensor_capture_feedback_path_min.Value)
spin_force_sensor_capture_feedback_path_min.Value =
spin_force_sensor_capture_feedback_path_max.Value;
+
+ setForceSensorPathRecommendedLabel();
}
public bool GetForceSensorFeedbackPathActive {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]