[chronojump] Done help dialog for threshold



commit 621e7917869496005dbe02b64e9d8ecc052d0199
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Dec 22 13:08:07 2016 +0100

    Done help dialog for threshold

 chronojump.csproj            |    1 +
 glade/app1.glade             |   24 ++--
 glade/dialog_threshold.glade |  343 ++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in               |    1 +
 src/Makefile.am              |    2 +
 src/gui/chronojump.cs        |    5 +
 src/gui/dialogThreshold.cs   |   55 +++++++
 7 files changed, 421 insertions(+), 10 deletions(-)
---
diff --git a/chronojump.csproj b/chronojump.csproj
index a2d60c6..92526ce 100644
--- a/chronojump.csproj
+++ b/chronojump.csproj
@@ -1005,6 +1005,7 @@
     <Compile Include="src\restTime.cs" />
     <Compile Include="src\gui\encoderOverview.cs" />
     <Compile Include="src\threshold.cs" />
+    <Compile Include="src\gui\dialogThreshold.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="src\" />
diff --git a/glade/app1.glade b/glade/app1.glade
index 2475fec..b51aaad 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1564,12 +1564,12 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkButton" id="button_crash">
-                                    <property name="label">CRASH_ME
-(debug purposes)</property>
+                                  <widget class="GtkButton" id="button_carles">
+                                    <property name="label">Button
+Carles</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <signal name="clicked" handler="on_debug_crash_activate" swapped="no"/>
+                                    <signal name="clicked" handler="on_button_carles_clicked" swapped="no"/>
                                   </widget>
                                   <packing>
                                     <property name="expand">False</property>
@@ -1578,12 +1578,12 @@
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="GtkButton" id="button_carles">
-                                    <property name="label">Button
-Carles</property>
+                                  <widget class="GtkButton" id="button_crash">
+                                    <property name="label">CRASH_ME
+(debug purposes)</property>
                                     <property name="can_focus">True</property>
                                     <property name="receives_default">True</property>
-                                    <signal name="clicked" handler="on_button_carles_clicked" swapped="no"/>
+                                    <signal name="clicked" handler="on_debug_crash_activate" swapped="no"/>
                                   </widget>
                                   <packing>
                                     <property name="expand">False</property>
@@ -4262,7 +4262,7 @@ Carles</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">4</property>
                                                             <child>
-                                                            <widget class="GtkTable" 
id="table_chronopic_sensibility">
+                                                            <widget class="GtkTable" 
id="table_chronopic_threshold">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="n_rows">2</property>
@@ -4277,10 +4277,11 @@ Carles</property>
                                                             </widget>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkButton" 
id="chronopic_sensibility_help">
+                                                            <widget class="GtkButton" 
id="chronopic_threshold_help">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
                                                             <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_chronopic_threshold_help_clicked" swapped="no"/>
                                                             <child>
                                                             <widget class="GtkImage" id="image10">
                                                             <property name="visible">True</property>
@@ -18620,6 +18621,9 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/glade/dialog_threshold.glade b/glade/dialog_threshold.glade
new file mode 100644
index 0000000..f35511a
--- /dev/null
+++ b/glade/dialog_threshold.glade
@@ -0,0 +1,343 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkDialog" id="dialog_threshold">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="border_width">10</property>
+    <property name="title" translatable="yes">Chronojump threshold</property>
+    <property name="modal">True</property>
+    <property name="type_hint">dialog</property>
+    <signal name="delete_event" handler="on_delete_event" swapped="no"/>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="vbox151">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">20</property>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="hbuttonbox44">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">center</property>
+            <child>
+              <widget class="GtkButton" id="button24">
+                <property name="label">gtk-close</property>
+                <property name="response_id">-7</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_button_close_clicked" swapped="no"/>
+                <accelerator key="Escape" signal="clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVBox" id="vbox152">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">20</property>
+            <child>
+              <widget class="GtkFrame" id="frame1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label_xalign">0</property>
+                <property name="label_yalign">0.69999998807907104</property>
+                <property name="shadow_type">out</property>
+                <child>
+                  <widget class="GtkAlignment" id="alignment1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">10</property>
+                    <property name="bottom_padding">10</property>
+                    <property name="left_padding">10</property>
+                    <property name="right_padding">10</property>
+                    <child>
+                      <widget class="GtkVBox" id="vbox1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <widget class="GtkLabel" id="label2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Spurius signals are common on 
electronics.</property>
+                            <property name="width_chars">100</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="label3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Threshold refers to the minimum value 
measurable and is the common way to clean this spurius signals. Threshold should be a value lower than 
expected values.</property>
+                            <property name="wrap">True</property>
+                            <property name="width_chars">100</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="label4">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">On database three different thresholds 
are stored: jumps, races and other tests.
+If you change this values they will be stored once test is executed.</property>
+                            <property name="wrap">True</property>
+                            <property name="ellipsize">middle</property>
+                            <property name="width_chars">100</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Usually threshold values should not be 
changed but this option is useful for special cases.</property>
+                            <property name="wrap">True</property>
+                            <property name="width_chars">100</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">3</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">&lt;b&gt;About threshold&lt;/b&gt;</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">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkNotebook" id="notebook">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="border_width">10</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label9">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Default value: 50 ms</property>
+                        <property name="width_chars">100</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="label10">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On jumps with contact platforms a value of 
50 ms (3 cm jump approximately) is enough to solve electronical problems.</property>
+                        <property name="width_chars">100</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="label11">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">You may change this value if you have a 
jumper that looses pressure with the platform
+while going down on the eccentric phase previous to a CMJ or ABK jump.
+This jumper should change his technique, but if it's difficult, a solution is to increase 
threshold.</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label6">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Jumps</property>
+                  </widget>
+                  <packing>
+                    <property name="tab_fill">False</property>
+                    <property name="type">tab</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="border_width">10</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label12">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Default value: 10 ms</property>
+                        <property name="width_chars">100</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="label13">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On races with photocells a value of 10 ms 
is the default value.
+As Chronojump manages double contacts on photocells, changing threshold value is not very common.</property>
+                        <property name="width_chars">100</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label7">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Races</property>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                    <property name="tab_fill">False</property>
+                    <property name="type">tab</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox4">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="border_width">10</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkLabel" id="label14">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Default value: 50 ms</property>
+                        <property name="width_chars">100</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="label15">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Depending on the test, user could change 
values.</property>
+                        <property name="width_chars">100</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label8">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Other tests</property>
+                  </widget>
+                  <packing>
+                    <property name="position">2</property>
+                    <property name="tab_fill">False</property>
+                    <property name="type">tab</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">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 14f4b68..f1764c2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -17,6 +17,7 @@ glade/dialog_help_ports.glade
 glade/dialog_image_test.glade
 glade/dialog_message.glade
 glade/dialog_server_stats.glade
+glade/dialog_threshold.glade
 glade/edit_event.glade
 glade/encoder_configuration.glade
 glade/encoder_overview.glade
diff --git a/src/Makefile.am b/src/Makefile.am
index 4538d14..d76bddb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -42,6 +42,7 @@ SOURCES = \
        gui/dialogMessage.cs\
        gui/dialogCalendar.cs\
        gui/dialogImageTest.cs\
+       gui/dialogThreshold.cs\
        gui/repetitiveConditions.cs\
        gui/convertWeight.cs\
        gui/genericWindow.cs\
@@ -206,6 +207,7 @@ RESOURCES = \
        ../glade/dialog_image_test.glade \
        ../glade/dialog_message.glade \
        ../glade/dialog_server_stats.glade \
+       ../glade/dialog_threshold.glade \
        ../glade/edit_event.glade \
        ../glade/encoder_configuration.glade \
        ../glade/encoder_overview.glade \
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 9045a4b..b6037e1 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -3824,6 +3824,11 @@ public partial class ChronoJumpWindow
                }
        }
 
+       private void on_chronopic_threshold_help_clicked (object o, EventArgs args)
+       {
+               new DialogThreshold(getMenuItemMode());
+       }
+
        //hscale does not manage correctly the +10 increments.
        //we solve it with a label
        private void on_hscale_threshold_value_changed(object o, EventArgs arg)
diff --git a/src/gui/dialogThreshold.cs b/src/gui/dialogThreshold.cs
new file mode 100644
index 0000000..bd76fc3
--- /dev/null
+++ b/src/gui/dialogThreshold.cs
@@ -0,0 +1,55 @@
+/*
+ * This file is part of ChronoJump
+ *
+ * ChronoJump is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or   
+ *    (at your option) any later version.
+ *    
+ * ChronoJump is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
+ *    GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Copyright (C) 2016   Xavier de Blas <xaviblas gmail com> 
+ */
+
+using System;
+using Gtk;
+using Gdk;
+using Glade;
+
+public class DialogThreshold
+{
+       [Widget] Gtk.Dialog dialog_threshold;
+       [Widget] Gtk.Notebook notebook;
+
+       public DialogThreshold (Constants.Menuitem_modes m)
+       {
+               Glade.XML gladeXML;
+               gladeXML = Glade.XML.FromAssembly (Util.GetGladePath() + "dialog_threshold.glade", 
"dialog_threshold", null);
+               gladeXML.Autoconnect(this);
+               
+               //put an icon to window
+               UtilGtk.IconWindow(dialog_threshold);
+
+               if(m == Constants.Menuitem_modes.JUMPSSIMPLE || m == Constants.Menuitem_modes.JUMPSREACTIVE)
+                       notebook.CurrentPage = 0;
+                else if(m == Constants.Menuitem_modes.RUNSSIMPLE || m == 
Constants.Menuitem_modes.RUNSINTERVALLIC)
+                       notebook.CurrentPage = 1;
+               else    //other
+                       notebook.CurrentPage = 2;
+       }
+
+       public void on_button_close_clicked (object obj, EventArgs args) {
+               dialog_threshold.Destroy ();
+       }
+
+       private void on_delete_event (object o, DeleteEventArgs args) {
+               dialog_threshold.Destroy ();
+       }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]