[chronojump] Lots of changes on encoder threading



commit ec3cfa3bc11f287a976fd79f412ac85fb1021089
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 19 12:07:23 2014 +0100

    Lots of changes on encoder threading

 diagrams/classes/encoder-threads.dia |  Bin 4986 -> 5213 bytes
 glade/chronojump.glade               | 2533 +++++++++++++++++-----------------
 src/gui/encoder.cs                   |  276 ++--
 src/utilEncoder.cs                   |    8 +-
 4 files changed, 1453 insertions(+), 1364 deletions(-)
---
diff --git a/diagrams/classes/encoder-threads.dia b/diagrams/classes/encoder-threads.dia
index 72b3c1c..24b7037 100644
Binary files a/diagrams/classes/encoder-threads.dia and b/diagrams/classes/encoder-threads.dia differ
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index ae2b36f..2470297 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6297,6 +6297,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -6911,6 +6914,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -7661,6 +7667,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8170,6 +8179,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -14901,6 +14913,834 @@ Evaluator can use real name or nickname.</property>
       </widget>
     </child>
   </widget>
+  <widget class="GtkWindow" id="chronopic_window">
+    <property name="can_focus">False</property>
+    <property name="border_width">10</property>
+    <property name="title" translatable="yes">Chronopic window</property>
+    <property name="resizable">False</property>
+    <property name="window_position">center-always</property>
+    <signal name="delete_event" handler="on_delete_event" swapped="no"/>
+    <child>
+      <widget class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">12</property>
+        <child>
+          <widget class="GtkAlignment" id="alignment5">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="top_padding">8</property>
+            <property name="left_padding">12</property>
+            <property name="right_padding">12</property>
+            <child>
+              <widget class="GtkFrame" id="frame3">
+                <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="alignment7">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="top_padding">8</property>
+                    <property name="bottom_padding">8</property>
+                    <property name="left_padding">12</property>
+                    <property name="right_padding">12</property>
+                    <child>
+                      <widget class="GtkTable" id="table1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="n_columns">2</property>
+                        <property name="column_spacing">2</property>
+                        <property name="row_spacing">2</property>
+                        <child>
+                          <widget class="GtkRadioButton" id="radio_contacts">
+                            <property name="label" translatable="yes">Contacts
+(platform or photocell)</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">True</property>
+                            <signal name="toggled" handler="on_radio_contacts_toggled" swapped="no"/>
+                          </widget>
+                        </child>
+                        <child>
+                          <widget class="GtkRadioButton" id="radio_encoder">
+                            <property name="label" translatable="yes">Encoder</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">radio_contacts</property>
+                            <signal name="toggled" handler="on_radio_encoder_toggled" swapped="no"/>
+                          </widget>
+                          <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label4">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Select your connection</property>
+                    <property name="use_markup">True</property>
+                  </widget>
+                  <packing>
+                    <property name="type">label_item</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkNotebook" id="notebook_main">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="show_tabs">False</property>
+            <property name="show_border">False</property>
+            <property name="tab_border">4</property>
+            <property name="tab_hborder">8</property>
+            <property name="tab_vborder">0</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">12</property>
+                <property name="bottom_padding">12</property>
+                <property name="left_padding">12</property>
+                <property name="right_padding">12</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox8">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">12</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="alignment2">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="top_padding">8</property>
+                            <property name="bottom_padding">8</property>
+                            <property name="left_padding">12</property>
+                            <property name="right_padding">12</property>
+                            <child>
+                              <widget class="GtkTable" id="table2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="n_columns">4</property>
+                                <property name="column_spacing">8</property>
+                                <property name="row_spacing">8</property>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox2">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkComboBox" id="combo_linux1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="items">/dev/ttyUSB?
+</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkComboBox" id="combo_windows1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="items">COM?</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkVBox" id="vbox5">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkImage" id="image_cp1_no">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="stock">gtk-no</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkImage" id="image_cp1_yes">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="stock">gtk-yes</property>
+                                        <property name="icon-size">5</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label7">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">Chronopic 1</property>
+                                  </widget>
+                                </child>
+                                <child>
+                                  <widget class="GtkButton" id="button_connect_cp1">
+                                    <property name="label" translatable="yes">Connect</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">True</property>
+                                    <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
+                                  </widget>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                          </widget>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label5">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Main Chronopic&lt;/b&gt; 
(used on all tests)</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="type">label_item</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="GtkFrame" id="frame2">
+                        <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="alignment3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="top_padding">8</property>
+                            <property name="bottom_padding">8</property>
+                            <property name="left_padding">12</property>
+                            <property name="right_padding">12</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <widget class="GtkCheckButton" id="checkbutton_multi_show">
+                                    <property name="label" translatable="yes">Show</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="clicked" handler="on_checkbutton_multi_show_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="GtkTable" id="table_multi_chronopic">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="n_rows">3</property>
+                                    <property name="n_columns">4</property>
+                                    <property name="column_spacing">8</property>
+                                    <property name="row_spacing">8</property>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_linux2">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">/dev/ttyUSB?
+</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_windows2">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">COM?</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox4">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_linux3">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">/dev/ttyUSB?
+</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_windows3">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">COM?</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</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>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkHBox" id="hbox5">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_linux4">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">/dev/ttyUSB?
+</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkComboBox" id="combo_windows4">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="items">COM?</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">1</property>
+                                        <property name="right_attach">2</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp2_no">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-no</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp2_yes">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-yes</property>
+                                            <property name="icon-size">5</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">3</property>
+                                        <property name="right_attach">4</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox4">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp3_no">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-no</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp3_yes">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-yes</property>
+                                            <property name="icon-size">5</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">3</property>
+                                        <property name="right_attach">4</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkVBox" id="vbox7">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp4_no">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-no</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkImage" id="image_cp4_yes">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="stock">gtk-yes</property>
+                                            <property name="icon-size">5</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="expand">True</property>
+                                            <property name="fill">True</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">3</property>
+                                        <property name="right_attach">4</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label">Chronopic 2</property>
+                                      </widget>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label">Chronopic 3</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label">Chronopic 4</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkButton" id="button_connect_cp2">
+                                        <property name="label" translatable="yes">Connect</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkButton" id="button_connect_cp3">
+                                        <property name="label" translatable="yes">Connect</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                        <property name="top_attach">1</property>
+                                        <property name="bottom_attach">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkButton" id="button_connect_cp4">
+                                        <property name="label" translatable="yes">Connect</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
+                                      </widget>
+                                      <packing>
+                                        <property name="left_attach">2</property>
+                                        <property name="right_attach">3</property>
+                                        <property name="top_attach">2</property>
+                                        <property name="bottom_attach">3</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </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">&lt;b&gt;Supplementary&lt;/b&gt; (can 
be used on MultiChronopic)</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="type">label_item</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label8">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Contacts
+(platform or photocell)</property>
+              </widget>
+              <packing>
+                <property name="tab_fill">False</property>
+                <property name="type">tab</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkAlignment" id="alignment4">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">12</property>
+                <property name="bottom_padding">12</property>
+                <property name="left_padding">12</property>
+                <property name="right_padding">12</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox9">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">20</property>
+                    <child>
+                      <widget class="GtkLabel" id="label10">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Select the port where Chronopic is 
connected.
+
+There's no port comprobation or activation on encoder.
+
+Just select and then close this window.</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkHBox" id="hbox6">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">20</property>
+                        <child>
+                          <widget class="GtkLabel" id="label11">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">Chronopic</property>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkHBox" id="hbox7">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <widget class="GtkComboBox" id="combo_linux_encoder">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="items">/dev/ttyUSB?
+</property>
+                              </widget>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">True</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkComboBox" id="combo_windows_encoder">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="items">COM?</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">True</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label9">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Encoder</property>
+              </widget>
+              <packing>
+                <property name="position">1</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>
+        <child>
+          <widget class="GtkAlignment" id="alignment6">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="left_padding">12</property>
+            <property name="right_padding">12</property>
+            <child>
+              <widget class="GtkTextView" id="textview_ports_found_explanation">
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="pixels_above_lines">6</property>
+                <property name="pixels_below_lines">6</property>
+                <property name="editable">False</property>
+                <property name="wrap_mode">word</property>
+                <property name="left_margin">6</property>
+                <property name="right_margin">2</property>
+                <property name="cursor_visible">False</property>
+                <property name="accepts_tab">False</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHButtonBox" id="hbuttonbox1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">spread</property>
+            <child>
+              <widget class="GtkButton" id="button_reload">
+                <property name="label">gtk-refresh</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">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_help">
+                <property name="label">gtk-help</property>
+                <property name="height_request">40</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_button_help_clicked" swapped="no"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="button2">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <signal name="clicked" handler="on_button_close_clicked" swapped="no"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
   <widget class="GtkWindow" id="confirm_window">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -16456,6 +17296,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -16873,6 +17716,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -17721,6 +18567,12 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -19899,7 +20751,7 @@ comments</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">3 0.10000000000000001 3 0.10000000000000001 1 0</property>
+                    <property name="adjustment">1 0.10000000000000001 3 0.10000000000000001 1 0</property>
                     <property name="climb_rate">1</property>
                     <property name="digits">1</property>
                     <property name="snap_to_ticks">True</property>
@@ -23323,534 +24175,6 @@ comments</property>
       </widget>
     </child>
   </widget>
-  <widget class="GtkWindow" id="jump_type_add">
-    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="border_width">10</property>
-    <property name="title" translatable="yes">Create new Jump Type</property>
-    <property name="resizable">False</property>
-    <property name="modal">True</property>
-    <property name="type_hint">dialog</property>
-    <signal name="delete_event" handler="on_jump_type_add_delete_event" swapped="no"/>
-    <child>
-      <widget class="GtkVBox" id="vbox27">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="spacing">8</property>
-        <child>
-          <widget class="GtkLabel" id="label87">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes">Create a new jump type in the database</property>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">False</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkTable" id="table7">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="n_rows">7</property>
-            <property name="n_columns">2</property>
-            <property name="column_spacing">4</property>
-            <property name="row_spacing">4</property>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label81">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Name</property>
-                <property name="use_markup">True</property>
-              </widget>
-              <packing>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label83">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Start inside</property>
-              </widget>
-              <packing>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label84">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Description</property>
-              </widget>
-              <packing>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkScrolledWindow" id="scrolledwindow13">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <child>
-                  <widget class="GtkTextView" id="textview_description">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                  </widget>
-                </child>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">6</property>
-                <property name="bottom_attach">7</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkEntry" id="entry_name">
-                <property name="visible">True</property>
-                <property name="can_focus">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>
-                <signal name="changed" handler="on_entries_required_changed" swapped="no"/>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="hbox59">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">10</property>
-                <child>
-                  <widget class="GtkRadioButton" id="radiobutton_startIn_yes">
-                    <property name="label" translatable="yes">yes</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</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="GtkRadioButton" id="radiobutton_startIn_no">
-                    <property name="label" translatable="yes">no</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                    <property name="group">radiobutton_startIn_yes</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">4</property>
-                <property name="bottom_attach">5</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label85">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Extra weight</property>
-              </widget>
-              <packing>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHBox" id="hbox60">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="spacing">10</property>
-                <child>
-                  <widget class="GtkRadioButton" id="radiobutton_extra_weight_yes">
-                    <property name="label" translatable="yes">yes</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</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="GtkRadioButton" id="radiobutton_extra_weight_no">
-                    <property name="label" translatable="yes">no</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                    <property name="group">radiobutton_extra_weight_yes</property>
-                  </widget>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">1</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">5</property>
-                <property name="bottom_attach">6</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label_main_options">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">Main
-options</property>
-              </widget>
-              <packing>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"/>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkTable" id="table_main_options">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="border_width">8</property>
-                <property name="n_rows">3</property>
-                <property name="n_columns">3</property>
-                <property name="column_spacing">6</property>
-                <property name="row_spacing">4</property>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label129">
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Type</property>
-                  </widget>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label130">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Limited by </property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkLabel" id="label131">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">value</property>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="right_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkVBox" id="vbox_limited">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <widget class="GtkRadioButton" id="radiobutton_limited_jumps">
-                        <property name="label" translatable="yes">jumps</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="toggled" handler="on_radiobutton_limited_jumps_or_time_toggled" 
swapped="no"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkRadioButton" id="radiobutton_limited_time">
-                        <property name="label" translatable="yes">time</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">radiobutton_limited_jumps</property>
-                        <signal name="toggled" handler="on_radiobutton_limited_jumps_or_time_toggled" 
swapped="no"/>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkRadioButton" id="radiobutton_unlimited">
-                        <property name="label" translatable="yes">unlimited</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <property name="group">radiobutton_limited_jumps</property>
-                        <signal name="toggled" handler="on_radiobutton_unlimited_toggled" swapped="no"/>
-                      </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">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkRadioButton" id="radiobutton_simple">
-                    <property name="label" translatable="yes">simple</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                    <signal name="toggled" handler="on_radiobutton_simple_toggled" swapped="no"/>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkRadioButton" id="radiobutton_repetitive">
-                    <property name="label" translatable="yes">repetitive</property>
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="use_underline">True</property>
-                    <property name="draw_indicator">True</property>
-                    <property name="group">radiobutton_simple</property>
-                    <signal name="toggled" handler="on_radiobutton_repetitive_toggled" swapped="no"/>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options"/>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHBox" id="hbox_fixed">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <child>
-                      <widget class="GtkCheckButton" id="checkbutton_limited_fixed">
-                        <property name="label" translatable="yes">fixed: </property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
-                        <signal name="clicked" handler="on_checkbutton_limited_fixed_clicked" swapped="no"/>
-                      </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_fixed_num">
-                        <property name="visible">True</property>
-                        <property name="sensitive">False</property>
-                        <property name="can_focus">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">1 0 100 1 10 0</property>
-                        <property name="climb_rate">1</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                  </widget>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="right_attach">3</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHSeparator" id="hseparator5">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </widget>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="top_attach">3</property>
-                <property name="bottom_attach">4</property>
-                <property name="x_options">GTK_FILL</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkHSeparator" id="hseparator6">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-              </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">False</property>
-            <property name="fill">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkHButtonBox" id="hbuttonbox17">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="layout_style">spread</property>
-            <child>
-              <widget class="GtkButton" id="button_cancel">
-                <property name="label">gtk-cancel</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_cancel_clicked" swapped="no"/>
-              </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_accept">
-                <property name="label">gtk-ok</property>
-                <property name="visible">True</property>
-                <property name="sensitive">False</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_accept_clicked" swapped="no"/>
-              </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>
-    </child>
-  </widget>
   <widget class="GtkWindow" id="jumps_runs_more">
     <property name="width_request">500</property>
     <property name="height_request">350</property>
@@ -24280,6 +24604,24 @@ options</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -25268,6 +25610,9 @@ options</property>
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -25744,6 +26089,9 @@ options</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -27499,6 +27847,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -27580,6 +27931,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -27676,6 +28030,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -27944,654 +28301,408 @@ show elevation as:</property>
       </widget>
     </child>
   </widget>
-  <widget class="GtkWindow" id="chronopic_window">
+  <widget class="GtkWindow" id="jump_type_add">
+    <property name="visible">True</property>
     <property name="can_focus">False</property>
     <property name="border_width">10</property>
-    <property name="title" translatable="yes">Chronopic window</property>
+    <property name="title" translatable="yes">Create new Jump Type</property>
     <property name="resizable">False</property>
-    <property name="window_position">center-always</property>
-    <signal name="delete_event" handler="on_delete_event" swapped="no"/>
+    <property name="modal">True</property>
+    <property name="type_hint">dialog</property>
+    <signal name="delete_event" handler="on_jump_type_add_delete_event" swapped="no"/>
     <child>
-      <widget class="GtkVBox" id="vbox1">
+      <widget class="GtkVBox" id="vbox27">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">12</property>
+        <property name="spacing">8</property>
         <child>
-          <widget class="GtkAlignment" id="alignment5">
+          <widget class="GtkLabel" id="label87">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="top_padding">8</property>
-            <property name="left_padding">12</property>
-            <property name="right_padding">12</property>
+            <property name="label" translatable="yes">Create a new jump type in the database</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkTable" id="table7">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">7</property>
+            <property name="n_columns">2</property>
+            <property name="column_spacing">4</property>
+            <property name="row_spacing">4</property>
             <child>
-              <widget class="GtkFrame" id="frame3">
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label81">
                 <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>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Name</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label83">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Start inside</property>
+              </widget>
+              <packing>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label84">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Description</property>
+              </widget>
+              <packing>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkScrolledWindow" id="scrolledwindow13">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
                 <child>
-                  <widget class="GtkAlignment" id="alignment7">
+                  <widget class="GtkTextView" id="textview_description">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="top_padding">8</property>
-                    <property name="bottom_padding">8</property>
-                    <property name="left_padding">12</property>
-                    <property name="right_padding">12</property>
-                    <child>
-                      <widget class="GtkTable" id="table1">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="n_columns">2</property>
-                        <property name="column_spacing">2</property>
-                        <property name="row_spacing">2</property>
-                        <child>
-                          <widget class="GtkRadioButton" id="radio_contacts">
-                            <property name="label" translatable="yes">Contacts
-(platform or photocell)</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">True</property>
-                            <signal name="toggled" handler="on_radio_contacts_toggled" swapped="no"/>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkRadioButton" id="radio_encoder">
-                            <property name="label" translatable="yes">Encoder</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="draw_indicator">True</property>
-                            <property name="group">radio_contacts</property>
-                            <signal name="toggled" handler="on_radio_encoder_toggled" swapped="no"/>
-                          </widget>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
-                          </packing>
-                        </child>
-                      </widget>
-                    </child>
+                    <property name="can_focus">True</property>
                   </widget>
                 </child>
+              </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">6</property>
+                <property name="bottom_attach">7</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkEntry" id="entry_name">
+                <property name="visible">True</property>
+                <property name="can_focus">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>
+                <signal name="changed" handler="on_entries_required_changed" swapped="no"/>
+              </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox59">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">10</property>
                 <child>
-                  <widget class="GtkLabel" id="label4">
+                  <widget class="GtkRadioButton" id="radiobutton_startIn_yes">
+                    <property name="label" translatable="yes">yes</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="label" translatable="yes">Select your connection</property>
-                    <property name="use_markup">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
                   </widget>
                   <packing>
-                    <property name="type">label_item</property>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkRadioButton" id="radiobutton_startIn_no">
+                    <property name="label" translatable="yes">no</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">radiobutton_startIn_yes</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">4</property>
+                <property name="bottom_attach">5</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</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="GtkNotebook" id="notebook_main">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="show_tabs">False</property>
-            <property name="show_border">False</property>
-            <property name="tab_border">4</property>
-            <property name="tab_hborder">8</property>
-            <property name="tab_vborder">0</property>
             <child>
-              <widget class="GtkAlignment" id="alignment1">
+              <widget class="GtkLabel" id="label85">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="top_padding">12</property>
-                <property name="bottom_padding">12</property>
-                <property name="left_padding">12</property>
-                <property name="right_padding">12</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Extra weight</property>
+              </widget>
+              <packing>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox60">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="spacing">10</property>
                 <child>
-                  <widget class="GtkVBox" id="vbox8">
+                  <widget class="GtkRadioButton" id="radiobutton_extra_weight_yes">
+                    <property name="label" translatable="yes">yes</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</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="GtkRadioButton" id="radiobutton_extra_weight_no">
+                    <property name="label" translatable="yes">no</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">radiobutton_extra_weight_yes</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">5</property>
+                <property name="bottom_attach">6</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label_main_options">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Main
+options</property>
+              </widget>
+              <packing>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options"/>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkTable" id="table_main_options">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="border_width">8</property>
+                <property name="n_rows">3</property>
+                <property name="n_columns">3</property>
+                <property name="column_spacing">6</property>
+                <property name="row_spacing">4</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label129">
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Type</property>
+                  </widget>
+                  <packing>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label130">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">Limited by </property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label131">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="label" translatable="yes">value</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">2</property>
+                    <property name="right_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox_limited">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">12</property>
                     <child>
-                      <widget class="GtkFrame" id="frame1">
+                      <widget class="GtkRadioButton" id="radiobutton_limited_jumps">
+                        <property name="label" translatable="yes">jumps</property>
                         <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="alignment2">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="top_padding">8</property>
-                            <property name="bottom_padding">8</property>
-                            <property name="left_padding">12</property>
-                            <property name="right_padding">12</property>
-                            <child>
-                              <widget class="GtkTable" id="table2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="n_columns">4</property>
-                                <property name="column_spacing">8</property>
-                                <property name="row_spacing">8</property>
-                                <child>
-                                  <widget class="GtkHBox" id="hbox2">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <child>
-                                      <widget class="GtkComboBox" id="combo_linux1">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="items">/dev/ttyUSB?
-</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkComboBox" id="combo_windows1">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="items">COM?</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">1</property>
-                                      </packing>
-                                    </child>
-                                  </widget>
-                                  <packing>
-                                    <property name="left_attach">1</property>
-                                    <property name="right_attach">2</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <widget class="GtkVBox" id="vbox5">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <child>
-                                      <widget class="GtkImage" id="image_cp1_no">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="stock">gtk-no</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkImage" id="image_cp1_yes">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="stock">gtk-yes</property>
-                                        <property name="icon-size">5</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="expand">True</property>
-                                        <property name="fill">True</property>
-                                        <property name="position">1</property>
-                                      </packing>
-                                    </child>
-                                  </widget>
-                                  <packing>
-                                    <property name="left_attach">3</property>
-                                    <property name="right_attach">4</property>
-                                  </packing>
-                                </child>
-                                <child>
-                                  <widget class="GtkLabel" id="label7">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="label">Chronopic 1</property>
-                                  </widget>
-                                </child>
-                                <child>
-                                  <widget class="GtkButton" id="button_connect_cp1">
-                                    <property name="label" translatable="yes">Connect</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">True</property>
-                                    <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
-                                  </widget>
-                                  <packing>
-                                    <property name="left_attach">2</property>
-                                    <property name="right_attach">3</property>
-                                  </packing>
-                                </child>
-                              </widget>
-                            </child>
-                          </widget>
-                        </child>
-                        <child>
-                          <widget class="GtkLabel" id="label5">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">&lt;b&gt;Main Chronopic&lt;/b&gt; 
(used on all tests)</property>
-                            <property name="use_markup">True</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                        <signal name="toggled" handler="on_radiobutton_limited_jumps_or_time_toggled" 
swapped="no"/>
                       </widget>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                         <property name="position">0</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkFrame" id="frame2">
+                      <widget class="GtkRadioButton" id="radiobutton_limited_time">
+                        <property name="label" translatable="yes">time</property>
                         <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="alignment3">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="top_padding">8</property>
-                            <property name="bottom_padding">8</property>
-                            <property name="left_padding">12</property>
-                            <property name="right_padding">12</property>
-                            <child>
-                              <widget class="GtkVBox" id="vbox2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="spacing">4</property>
-                                <child>
-                                  <widget class="GtkCheckButton" id="checkbutton_multi_show">
-                                    <property name="label" translatable="yes">Show</property>
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
-                                    <property name="receives_default">False</property>
-                                    <property name="draw_indicator">True</property>
-                                    <signal name="clicked" handler="on_checkbutton_multi_show_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="GtkTable" id="table_multi_chronopic">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="n_rows">3</property>
-                                    <property name="n_columns">4</property>
-                                    <property name="column_spacing">8</property>
-                                    <property name="row_spacing">8</property>
-                                    <child>
-                                      <widget class="GtkHBox" id="hbox3">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_linux2">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">/dev/ttyUSB?
-</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_windows2">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">COM?</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="right_attach">2</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkHBox" id="hbox4">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_linux3">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">/dev/ttyUSB?
-</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_windows3">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">COM?</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</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>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkHBox" id="hbox5">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_linux4">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">/dev/ttyUSB?
-</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkComboBox" id="combo_windows4">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="items">COM?</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">1</property>
-                                        <property name="right_attach">2</property>
-                                        <property name="top_attach">2</property>
-                                        <property name="bottom_attach">3</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkVBox" id="vbox3">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp2_no">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-no</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp2_yes">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-yes</property>
-                                            <property name="icon-size">5</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">3</property>
-                                        <property name="right_attach">4</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkVBox" id="vbox4">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp3_no">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-no</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp3_yes">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-yes</property>
-                                            <property name="icon-size">5</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">3</property>
-                                        <property name="right_attach">4</property>
-                                        <property name="top_attach">1</property>
-                                        <property name="bottom_attach">2</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkVBox" id="vbox7">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp4_no">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-no</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">0</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="GtkImage" id="image_cp4_yes">
-                                            <property name="visible">True</property>
-                                            <property name="can_focus">False</property>
-                                            <property name="stock">gtk-yes</property>
-                                            <property name="icon-size">5</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="expand">True</property>
-                                            <property name="fill">True</property>
-                                            <property name="position">1</property>
-                                          </packing>
-                                        </child>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">3</property>
-                                        <property name="right_attach">4</property>
-                                        <property name="top_attach">2</property>
-                                        <property name="bottom_attach">3</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkLabel" id="label1">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="label">Chronopic 2</property>
-                                      </widget>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkLabel" id="label2">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="label">Chronopic 3</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="top_attach">1</property>
-                                        <property name="bottom_attach">2</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkLabel" id="label3">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">False</property>
-                                        <property name="label">Chronopic 4</property>
-                                      </widget>
-                                      <packing>
-                                        <property name="top_attach">2</property>
-                                        <property name="bottom_attach">3</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkButton" id="button_connect_cp2">
-                                        <property name="label" translatable="yes">Connect</property>
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">True</property>
-                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">2</property>
-                                        <property name="right_attach">3</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkButton" id="button_connect_cp3">
-                                        <property name="label" translatable="yes">Connect</property>
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">True</property>
-                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">2</property>
-                                        <property name="right_attach">3</property>
-                                        <property name="top_attach">1</property>
-                                        <property name="bottom_attach">2</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <widget class="GtkButton" id="button_connect_cp4">
-                                        <property name="label" translatable="yes">Connect</property>
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="receives_default">True</property>
-                                        <signal name="clicked" handler="on_button_connect_cp_clicked" 
swapped="no"/>
-                                      </widget>
-                                      <packing>
-                                        <property name="left_attach">2</property>
-                                        <property name="right_attach">3</property>
-                                        <property name="top_attach">2</property>
-                                        <property name="bottom_attach">3</property>
-                                      </packing>
-                                    </child>
-                                  </widget>
-                                  <packing>
-                                    <property name="expand">True</property>
-                                    <property name="fill">True</property>
-                                    <property name="position">1</property>
-                                  </packing>
-                                </child>
-                              </widget>
-                            </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">&lt;b&gt;Supplementary&lt;/b&gt; (can 
be used on MultiChronopic)</property>
-                            <property name="use_markup">True</property>
-                          </widget>
-                          <packing>
-                            <property name="type">label_item</property>
-                          </packing>
-                        </child>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">radiobutton_limited_jumps</property>
+                        <signal name="toggled" handler="on_radiobutton_limited_jumps_or_time_toggled" 
swapped="no"/>
                       </widget>
                       <packing>
-                        <property name="expand">True</property>
-                        <property name="fill">True</property>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
+                    <child>
+                      <widget class="GtkRadioButton" id="radiobutton_unlimited">
+                        <property name="label" translatable="yes">unlimited</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">radiobutton_limited_jumps</property>
+                        <signal name="toggled" handler="on_radiobutton_unlimited_toggled" swapped="no"/>
+                      </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">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options">GTK_FILL</property>
+                  </packing>
                 </child>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkLabel" id="label8">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Contacts
-(platform or photocell)</property>
-              </widget>
-              <packing>
-                <property name="tab_fill">False</property>
-                <property name="type">tab</property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkAlignment" id="alignment4">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="top_padding">12</property>
-                <property name="bottom_padding">12</property>
-                <property name="left_padding">12</property>
-                <property name="right_padding">12</property>
                 <child>
-                  <widget class="GtkVBox" id="vbox9">
+                  <widget class="GtkRadioButton" id="radiobutton_simple">
+                    <property name="label" translatable="yes">simple</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                    <signal name="toggled" handler="on_radiobutton_simple_toggled" swapped="no"/>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkRadioButton" id="radiobutton_repetitive">
+                    <property name="label" translatable="yes">repetitive</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">radiobutton_simple</property>
+                    <signal name="toggled" handler="on_radiobutton_repetitive_toggled" swapped="no"/>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options"/>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHBox" id="hbox_fixed">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">20</property>
                     <child>
-                      <widget class="GtkLabel" id="label10">
+                      <widget class="GtkCheckButton" id="checkbutton_limited_fixed">
+                        <property name="label" translatable="yes">fixed: </property>
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Select the port where Chronopic is 
connected.
-
-There's no port comprobation or activation on encoder.
-
-Just select and then close this window.</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="draw_indicator">True</property>
+                        <signal name="clicked" handler="on_checkbutton_limited_fixed_clicked" swapped="no"/>
                       </widget>
                       <packing>
                         <property name="expand">False</property>
@@ -28600,130 +28711,90 @@ Just select and then close this window.</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkHBox" id="hbox6">
+                      <widget class="GtkSpinButton" id="spin_fixed_num">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">20</property>
-                        <child>
-                          <widget class="GtkLabel" id="label11">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Chronopic</property>
-                          </widget>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <widget class="GtkHBox" id="hbox7">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <child>
-                              <widget class="GtkComboBox" id="combo_linux_encoder">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="items">/dev/ttyUSB?
-</property>
-                              </widget>
-                              <packing>
-                                <property name="expand">True</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="GtkComboBox" id="combo_windows_encoder">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="items">COM?</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">True</property>
-                            <property name="position">1</property>
-                          </packing>
-                        </child>
+                        <property name="sensitive">False</property>
+                        <property name="can_focus">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">1 0 100 1 10 0</property>
+                        <property name="climb_rate">1</property>
                       </widget>
                       <packing>
-                        <property name="expand">False</property>
+                        <property name="expand">True</property>
                         <property name="fill">True</property>
                         <property name="position">1</property>
                       </packing>
                     </child>
                   </widget>
+                  <packing>
+                    <property name="left_attach">2</property>
+                    <property name="right_attach">3</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options">GTK_FILL</property>
+                  </packing>
                 </child>
               </widget>
               <packing>
-                <property name="position">1</property>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
+                <property name="x_options">GTK_FILL</property>
+                <property name="y_options">GTK_FILL</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label9">
+              <widget class="GtkHSeparator" id="hseparator5">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Encoder</property>
               </widget>
               <packing>
-                <property name="position">1</property>
-                <property name="tab_fill">False</property>
-                <property name="type">tab</property>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">3</property>
+                <property name="bottom_attach">4</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="GtkAlignment" id="alignment6">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="left_padding">12</property>
-            <property name="right_padding">12</property>
             <child>
-              <widget class="GtkTextView" id="textview_ports_found_explanation">
+              <widget class="GtkHSeparator" id="hseparator6">
                 <property name="visible">True</property>
-                <property name="sensitive">False</property>
-                <property name="can_focus">True</property>
-                <property name="pixels_above_lines">6</property>
-                <property name="pixels_below_lines">6</property>
-                <property name="editable">False</property>
-                <property name="wrap_mode">word</property>
-                <property name="left_margin">6</property>
-                <property name="right_margin">2</property>
-                <property name="cursor_visible">False</property>
-                <property name="accepts_tab">False</property>
+                <property name="can_focus">False</property>
               </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">2</property>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
           </packing>
         </child>
         <child>
-          <widget class="GtkHButtonBox" id="hbuttonbox1">
+          <widget class="GtkHButtonBox" id="hbuttonbox17">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="layout_style">spread</property>
             <child>
-              <widget class="GtkButton" id="button_reload">
-                <property name="label">gtk-refresh</property>
+              <widget class="GtkButton" id="button_cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">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_cancel_clicked" swapped="no"/>
               </widget>
               <packing>
                 <property name="expand">False</property>
@@ -28732,14 +28803,15 @@ Just select and then close this window.</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkButton" id="button_help">
-                <property name="label">gtk-help</property>
-                <property name="height_request">40</property>
+              <widget class="GtkButton" id="button_accept">
+                <property name="label">gtk-ok</property>
                 <property name="visible">True</property>
+                <property name="sensitive">False</property>
                 <property name="can_focus">True</property>
-                <property name="receives_default">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_help_clicked" swapped="no"/>
+                <signal name="clicked" handler="on_button_accept_clicked" swapped="no"/>
               </widget>
               <packing>
                 <property name="expand">False</property>
@@ -28747,26 +28819,11 @@ Just select and then close this window.</property>
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <widget class="GtkButton" id="button2">
-                <property name="label">gtk-close</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-                <signal name="clicked" handler="on_button_close_clicked" swapped="no"/>
-              </widget>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">False</property>
-                <property name="position">2</property>
-              </packing>
-            </child>
           </widget>
           <packing>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
           </packing>
         </child>
       </widget>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index c50a907..51b42b4 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -131,8 +131,7 @@ public partial class ChronoJumpWindow
         Gtk.ListStore encoderCaptureListStore;
        Gtk.ListStore encoderAnalyzeListStore;
 
-       Thread encoderThreadCapture;
-       Thread encoderThreadR;
+       Thread encoderThread;
        
 
        int image_encoder_width;
@@ -183,13 +182,30 @@ public partial class ChronoJumpWindow
         */
        EncoderSQL lastEncoderSQL;
 
-       //CAPTURE is the capture from csharp (not from external python)
-       //
-       //diffrence between:
-       //CALC_RECALC_CURVES: calcule and recalculate, autosaves the curve at end
-       //LOAD curves does snot 
-       //CAPTURE_INERTIA_MOMENT records to get the inertia moment but does not calculate curves in R and not 
updates the treeview
-       enum encoderActions { CAPTURE, CALC_RECALC_CURVES, LOAD, ANALYZE, CAPTURE_INERTIA_MOMENT } 
+       /*
+        * CAPTURE is the capture from csharp (not from external python)
+        * CAPTURE_EXTERNAL is deprecated (from Python)
+        *
+        * difference between:
+        * CURVES: calcule and recalculate, autosaves the curve at end
+        * LOAD curves does snot
+        *
+        * CAPTURE_IM records to get the inertia moment but does not calculate curves in R and not updates 
the treeview
+        * CURVES_AC (After Capture) is like curves but does not start a new thread (uses same pulse as 
capture)
+        */
+       enum encoderActions { CAPTURE, CAPTURE_EXTERNAL, CURVES, CURVES_AC, LOAD, ANALYZE, CAPTURE_IM, 
CURVES_IM } 
+       
+       //STOPPING is used to stop the camera. It has to be called only one time
+       enum encoderCaptureProcess { CAPTURING, STOPPING, STOPPED } 
+       static encoderCaptureProcess capturingCsharp;   
+
+       /* 
+        *
+        * To understand this class threads amnd GUI, see diagram:
+        * encoder-threads.dia
+        *
+        */
+
        enum encoderSensEnum { 
                NOSESSION, NOPERSON, YESPERSON, PROCESSINGCAPTURE, PROCESSINGR, DONENOSIGNAL, DONEYESSIGNAL, 
SELECTEDCURVE }
        encoderSensEnum encoderSensEnumStored; //tracks how was sensitive before PROCESSINGCAPTURE or 
PROCESSINGR
@@ -262,7 +278,7 @@ public partial class ChronoJumpWindow
                //TODO: put a thread in order to interface be updated,
                //maybe on start capturing this will happen because CAPTURE thread will start   
                encoder_configuration_win.Label_im_progress_text = Catalog.GetString("Capturing");
-               on_button_encoder_capture_calcule_inertial();
+               on_button_encoder_capture_calcule_im();
        }
        
        void on_button_encoder_capture_options_clicked (object o, EventArgs args) {
@@ -375,13 +391,15 @@ public partial class ChronoJumpWindow
                        
                        encoderStopVideoRecord();
                        
-                       calculeCurves();
+                       encoderCalculeCurves(encoderActions.CAPTURE_EXTERNAL); //deprecated
                }
                else if (encoderCaptureOptionsWin.radiobutton_encoder_capture_safe.Active) {
                        if(notebook_encoder_capture.CurrentPage == 1)
                                notebook_encoder_capture.PrevPage();
 
                        Log.WriteLine("AAAAAAAAAAAAAAA");
+                       
+                       encoderProcessFinish = false;
                        encoderThreadStart(encoderActions.CAPTURE);
                        
                        //entry_encoder_signal_comment.Text = "";
@@ -390,12 +408,13 @@ public partial class ChronoJumpWindow
                }
        }
        
-       void on_button_encoder_capture_calcule_inertial () 
+       void on_button_encoder_capture_calcule_im () 
        {
                if(! encoderCheckPort())
                        return;
                
-               encoderThreadStart(encoderActions.CAPTURE_INERTIA_MOMENT);
+               encoderProcessFinish = false;
+               encoderThreadStart(encoderActions.CAPTURE_IM);
        }
 
 
@@ -487,14 +506,25 @@ public partial class ChronoJumpWindow
                Sqlite.Delete(false, Constants.Encoder1RMTable, Convert.ToInt32(uniqueID));
        }
        
-
-
-       void calculeCurves() {
-               encoderTimeStamp = UtilDate.ToFile(DateTime.Now);
-               encoderSignalUniqueID = "-1"; //mark to know that there's no ID for this until it's saved on 
database
-
-               encoderThreadStart(encoderActions.CALC_RECALC_CURVES);
+       //action can be CURVES_AC (After Capture) (where signal does not exists, need to define it)
+       //CAPTURE_EXTERNAL, CURVES, LOAD (signal is defined)
+       //CAPTURE_EXTERNAL is not implemented because it's deprecated
+       void encoderCalculeCurves(encoderActions action) {
+               if(action == encoderActions.CURVES_AC) 
+               {
+                       encoderTimeStamp = UtilDate.ToFile(DateTime.Now);
+                       encoderSignalUniqueID = "-1"; //mark to know that there's no ID for this until it's 
saved on database
+                       encoderThreadStart(action);
+               } else {
+                       //calculate and recalculate saves the curve at end
+                       //load does not save the curve 
+                      if(File.Exists(UtilEncoder.GetEncoderDataTempFileName()))
+                              encoderThreadStart(action);
+                      else
+                              encoder_pulsebar_capture.Text = Catalog.GetString("Missing data.");
+               }
        }
+
        
        void on_button_encoder_cancel_clicked (object o, EventArgs args) 
        {
@@ -507,24 +537,9 @@ public partial class ChronoJumpWindow
        }
 
        void on_button_encoder_recalculate_clicked (object o, EventArgs args) {
-               encoder_recalculate(true); //save
-       }
-       
-       void encoder_recalculate(bool saveOrLoad) 
-       {
-               if (File.Exists(UtilEncoder.GetEncoderDataTempFileName())) 
-               {
-                       //calculate and recalculate saves the curve at end
-                       //load does not save the curve 
-                       if(saveOrLoad)          
-                               encoderThreadStart(encoderActions.CALC_RECALC_CURVES);
-                       else
-                               encoderThreadStart(encoderActions.LOAD);
-               }
-               else
-                       encoder_pulsebar_capture.Text = Catalog.GetString("Missing data.");
+               encoderCalculeCurves(encoderActions.CURVES);
        }
-       
+
        private void encoderUpdateTreeViewCapture(string contents)
        {
                if (contents == null || contents == "") {
@@ -616,7 +631,7 @@ public partial class ChronoJumpWindow
        //this is called by non gtk thread. Don't do gtk stuff here
        //I suppose reading gtk is ok, changing will be the problem
        //called on calculatecurves, recalculate and load
-       private void encoderCreateCurvesGraphR() 
+       private void encoderDoCurvesGraphR() 
        {
                string analysis = "curves";
 
@@ -1155,7 +1170,7 @@ public partial class ChronoJumpWindow
 
                if(success) {   
                        //force a recalculate but not save the curve (we are loading)
-                       encoder_recalculate(false); //load
+                       encoderCalculeCurves(encoderActions.LOAD);
                
                        radiobutton_encoder_analyze_data_current_signal.Active = true;
 
@@ -1432,7 +1447,7 @@ public partial class ChronoJumpWindow
                        UtilEncoder.EncoderDeleteCurveFromSignal(UtilEncoder.GetEncoderDataTempFileName(), 
curveStart, duration);
                }
                //force a recalculate
-               encoder_recalculate(true); //save the curve 
+               encoderCalculeCurves(encoderActions.CURVES);
        }
 
        void on_button_encoder_save_clicked (object o, EventArgs args) 
@@ -1668,7 +1683,7 @@ public partial class ChronoJumpWindow
 
        //this is called by non gtk thread. Don't do gtk stuff here
        //I suppose reading gtk is ok, changing will be the problem
-       private void captureCsharp () 
+       private void encoderDoCaptureCsharp () 
        {
                string exerciseNameShown = UtilGtk.ComboGetActive(combo_encoder_exercise);
                bool capturedOk = runEncoderCaptureCsharp( 
@@ -1682,15 +1697,18 @@ public partial class ChronoJumpWindow
 
                //wait to ensure capture thread has ended
                Thread.Sleep(500);      
+                               
+               capturingCsharp = encoderCaptureProcess.STOPPING;
 
                //will start calcule curves thread
                if(capturedOk)
-                       calculeCurves();
+                       encoderCalculeCurves(encoderActions.CURVES_AC);
        }
        
        //this is called by non gtk thread. Don't do gtk stuff here
+       //don't change properties like setting a Visibility status: Gtk.Widget.set_Visible
        //I suppose reading gtk is ok, changing will be the problem
-       private void captureCsharpInertiaMoment () 
+       private void encoderDoCaptureCsharpIM () 
        {
                bool capturedOk = runEncoderCaptureCsharp("Capturing Inertia Moment", 
                                encoder_configuration_win.Spin_im_duration,
@@ -1701,25 +1719,11 @@ public partial class ChronoJumpWindow
                //wait to ensure capture thread has ended
                Thread.Sleep(500);      
 
-               if(capturedOk) {
-                       UtilEncoder.RunEncoderCalculeInertiaMomentum(
+               if(capturedOk)
+                       UtilEncoder.RunEncoderCalculeIM(
                                        encoder_configuration_win.Spin_im_weight,
                                        encoder_configuration_win.Spin_im_length
                                        );
-                               
-                       string imResultText = Util.ChangeDecimalSeparator(
-                                       Util.ReadFile(UtilEncoder.GetEncoderSpecialDataTempFileName(), true) 
);
-                       Log.WriteLine("imResultText = |" + imResultText + "|");
-
-                       double imResult = Constants.EncoderErrorCode;
-
-                       if(imResultText != "NA")
-                               imResult = Convert.ToDouble(imResultText) * 10000.0; //script calculates 
Kg*m^2 -> GUI needs Kg*cm^2
-
-                       encoder_configuration_win.Button_encoder_capture_inertial_do_ended (imResult);
-
-                       encoderButtonsSensitive(encoderSensEnum.DONENOSIGNAL);
-               }
        }
        
        private bool runEncoderCaptureCsharpCheckPort(string port) {
@@ -1793,7 +1797,6 @@ public partial class ChronoJumpWindow
                return true;
        }
        
-       bool capturingCsharp;   
 
        private bool runEncoderCaptureCsharp(string title, int time, string outputData1, string port) 
        {
@@ -1888,8 +1891,12 @@ public partial class ChronoJumpWindow
                                               
                                //stop if n seconds of inactivity
                                //but it has to be moved a little bit first, just to give time to the people
-                               if(consecutiveZeros >= consecutiveZerosMax && sum > 0)
+                               //if(consecutiveZeros >= consecutiveZerosMax && sum > 0) #sum maybe is 0: 
+1,+1,-1,-1
+                               if(consecutiveZeros >= consecutiveZerosMax && ecca.ecc.Count > 0) 
+                               {
                                        encoderProcessFinish = true;
+                                       Log.WriteLine("SHOULD FINISH");
+                               }
 
 
                                sum += byteReaded;
@@ -2002,13 +2009,12 @@ public partial class ChronoJumpWindow
                writer.Flush();
                ((IDisposable)writer).Dispose();
 
-
                return true;
        }
 
        //this is called by non gtk thread. Don't do gtk stuff here
        //I suppose reading gtk is ok, changing will be the problem
-       private void analyze () 
+       private void encoderDoAnalyze () 
        {
                EncoderParams ep = new EncoderParams();
                string dataFileName = "";
@@ -3340,7 +3346,7 @@ Log.WriteLine(str);
        private void RenderN (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, 
Gtk.TreeIter iter)
        {
                //do this in order to have ecconLast useful for RenderN when capturing
-               if(capturingCsharp)
+               if(capturingCsharp == encoderCaptureProcess.CAPTURING)
                        ecconLast = findEccon(false);
 
                EncoderCurve curve = (EncoderCurve) model.GetValue (iter, 0);
@@ -4381,8 +4387,7 @@ Log.WriteLine(str);
 
        private void encoderThreadStart(encoderActions action) {
                encoderProcessCancel = false;
-               encoderProcessFinish = false;
-               if(action == encoderActions.CAPTURE || action == encoderActions.CAPTURE_INERTIA_MOMENT) {
+               if(action == encoderActions.CAPTURE || action == encoderActions.CAPTURE_IM) {
                        //encoder_pulsebar_capture.Text = Catalog.GetString("Please, wait.");
                        Log.WriteLine("CCCCCCCCCCCCCCC");
                        if( runEncoderCaptureCsharpCheckPort(chronopicWin.GetEncoderPort()) ) {
@@ -4407,7 +4412,7 @@ Log.WriteLine(str);
                                        treeviewEncoderCaptureRemoveColumns();
                                        encoderCaptureStringR = 
",series,exercise,mass,start,width,height,meanSpeed,maxSpeed,maxSpeedT,meanPower,peakPower,peakPowerT,pp_ppt,NA,NA,NA";
 
-                                       capturingCsharp = true;
+                                       capturingCsharp = encoderCaptureProcess.CAPTURING;
                                        eccaCreated = false;
 
                                        //TODO: add demult and angle    
@@ -4419,39 +4424,48 @@ Log.WriteLine(str);
 
                                if(action == encoderActions.CAPTURE) {
                                        captureCurvesBarsData = new ArrayList();
-                                       encoderThreadCapture = new Thread(new ThreadStart(captureCsharp));
-                                       GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderCapture));
+                                       encoderThread = new Thread(new ThreadStart(encoderDoCaptureCsharp));
+                                       GLib.Idle.Add (new GLib.IdleHandler 
(pulseGTKEncoderCaptureAndCurves));
                                }
-                               else { //action == encoderActions.CAPTURE_INERTIA_MOMENT)
-                                       encoderThreadCapture = new Thread(new 
ThreadStart(captureCsharpInertiaMoment));
-                                       GLib.Idle.Add (new GLib.IdleHandler 
(pulseGTKEncoderCaptureInertiaMoment));
+                               else { //action == encoderActions.CAPTURE_IM)
+                                       encoderThread = new Thread(new ThreadStart(encoderDoCaptureCsharpIM));
+                                       GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderCaptureIM));
                                }
 
                                Log.WriteLine("DDDDDDDDDDDDDDD");
                                encoderButtonsSensitive(encoderSensEnum.PROCESSINGCAPTURE);
-                               encoderThreadCapture.Start(); 
+                               encoderThread.Start(); 
                        } else {
                                new DialogMessage(Constants.MessageTypes.WARNING, 
                                        Catalog.GetString("Chronopic port is not configured."));
                                createChronopicWindow(true);
                                return;
                        }
-               } else if(action == encoderActions.CALC_RECALC_CURVES || action == encoderActions.LOAD) {
+               } else if(
+                               action == encoderActions.CURVES || 
+                               action == encoderActions.LOAD ||
+                               action == encoderActions.CURVES_AC)     //this does not run a pulseGTK
+               {
                        //image is inside (is smaller than) viewport
                        image_encoder_width = UtilGtk.WidgetWidth(viewport_image_encoder_capture)-5; 
                        image_encoder_height = UtilGtk.WidgetHeight(viewport_image_encoder_capture)-5;
                                
                        prepareEncoderGraphs();
 
-//                     encoder_pulsebar_capture.Text = Catalog.GetString("Please, wait.");
-                       treeview_encoder_capture_curves.Sensitive = false;
-                       encoderThreadR = new Thread(new ThreadStart(encoderCreateCurvesGraphR));
-                       if(action == encoderActions.CALC_RECALC_CURVES)
-                               GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderCalcRecalcCurves));
-                       else // action == encoderActions.LOAD
-                               GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderLoad));
-                       encoderButtonsSensitive(encoderSensEnum.PROCESSINGR);
-                       encoderThreadR.Start(); 
+                       if(action == encoderActions.CURVES_AC) {
+                               //this does not run a pulseGTK
+                               encoderDoCurvesGraphR();
+                               encoderButtonsSensitive(encoderSensEnum.PROCESSINGR);
+                       } else {
+                               treeview_encoder_capture_curves.Sensitive = false;
+                               encoderThread = new Thread(new ThreadStart(encoderDoCurvesGraphR));
+                               if(action == encoderActions.CURVES)
+                                       GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderCurves));
+                               else // action == encoderActions.LOAD
+                                       GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderLoad));
+                               encoderButtonsSensitive(encoderSensEnum.PROCESSINGR);
+                               encoderThread.Start(); 
+                       }
                } else { //encoderActions.ANALYZE
                        //the -3 is because image is inside (is smaller than) viewport
                        image_encoder_width = UtilGtk.WidgetWidth(viewport_image_encoder_analyze)-5; 
@@ -4459,7 +4473,7 @@ Log.WriteLine(str);
 
                        encoder_pulsebar_analyze.Text = Catalog.GetString("Please, wait.");
                
-                       encoderThreadR = new Thread(new ThreadStart(analyze));
+                       encoderThread = new Thread(new ThreadStart(encoderDoAnalyze));
                        GLib.Idle.Add (new GLib.IdleHandler (pulseGTKEncoderAnalyze));
 
                        encoderButtonsSensitive(encoderSensEnum.PROCESSINGR);
@@ -4468,7 +4482,7 @@ Log.WriteLine(str);
                        button_encoder_analyze_table_save.Sensitive = false;
                        button_encoder_analyze_1RM_save.Sensitive = false;
 
-                       encoderThreadR.Start(); 
+                       encoderThread.Start(); 
                }
        }
 
@@ -4493,28 +4507,35 @@ Log.WriteLine(str);
                pen_azul_encoder_capture.Foreground = UtilGtk.BLUE_PLOTS;
        }
 
-       //this is the only who was finish       
-       private bool pulseGTKEncoderCapture ()
+       private bool pulseGTKEncoderCaptureAndCurves ()
        {
-//             Log.WriteLine("PPPPPPPPP");
-               if(! encoderThreadCapture.IsAlive || encoderProcessCancel || encoderProcessFinish) {
-                       finishPulsebar(encoderActions.CAPTURE);
+               if(! encoderThread.IsAlive || encoderProcessCancel) {
+                       finishPulsebar(encoderActions.CURVES);
                        Log.Write("dying");
                        return false;
                }
-               updatePulsebar(encoderActions.CAPTURE); //activity on pulsebar
-               updateEncoderCaptureGraph(true, true, true); //graphSignal, calcCurves, plotCurvesBars
-
+               if(capturingCsharp == encoderCaptureProcess.CAPTURING) {
+                       updatePulsebar(encoderActions.CAPTURE); //activity on pulsebar
+                       updateEncoderCaptureGraph(true, true, true); //graphSignal, calcCurves, plotCurvesBars
+                       Log.Write(" Cap:" + encoderThread.ThreadState.ToString());
+               } else if(capturingCsharp == encoderCaptureProcess.STOPPING) {
+                       //stop video            
+                       encoderStopVideoRecord();
+                       capturingCsharp = encoderCaptureProcess.STOPPED;
+               } else {        //STOPPED       
+                       //do curves, capturingCsharp has ended
+                       updatePulsebar(encoderActions.CURVES); //activity on pulsebar
+                       Log.Write(" Cur:" + encoderThread.ThreadState.ToString());
+               }
+                       
                Thread.Sleep (25);
-               Log.Write("C:" + encoderThreadCapture.ThreadState.ToString());
                return true;
        }
        
-       private bool pulseGTKEncoderCaptureInertiaMoment ()
+       private bool pulseGTKEncoderCaptureIM ()
        {
-//             Log.WriteLine("PPPPPPPPP");
-               if(! encoderThreadCapture.IsAlive || encoderProcessCancel || encoderProcessFinish) {
-                       finishPulsebar(encoderActions.CAPTURE_INERTIA_MOMENT);
+               if(! encoderThread.IsAlive || encoderProcessCancel || encoderProcessFinish) {
+                       finishPulsebar(encoderActions.CAPTURE_IM);
                        Log.Write("dying");
                        return false;
                }
@@ -4522,31 +4543,31 @@ Log.WriteLine(str);
                updateEncoderCaptureGraph(true, false, false); //graphSignal, not calcCurves, not 
plotCurvesBars
 
                Thread.Sleep (25);
-               Log.Write("C:" + encoderThreadCapture.ThreadState.ToString());
+               Log.Write(" CapIM:" + encoderThread.ThreadState.ToString());
                return true;
        }
        
        
-       private bool pulseGTKEncoderCalcRecalcCurves ()
+       private bool pulseGTKEncoderCurves ()
        {
-               if(! encoderThreadR.IsAlive || encoderProcessCancel) {
+               if(! encoderThread.IsAlive || encoderProcessCancel) {
                        if(encoderProcessCancel){
                                UtilEncoder.CancelRScript = true;
                        }
 
-                       finishPulsebar(encoderActions.CALC_RECALC_CURVES);
+                       finishPulsebar(encoderActions.CURVES);
                        Log.Write("dying");
                        return false;
                }
-               updatePulsebar(encoderActions.CALC_RECALC_CURVES); //activity on pulsebar
+               updatePulsebar(encoderActions.CURVES); //activity on pulsebar
                Thread.Sleep (50);
-               Log.Write("R:" + encoderThreadR.ThreadState.ToString());
+               Log.Write(" Cur:" + encoderThread.ThreadState.ToString());
                return true;
        }
        
        private bool pulseGTKEncoderLoad ()
        {
-               if(! encoderThreadR.IsAlive || encoderProcessCancel) {
+               if(! encoderThread.IsAlive || encoderProcessCancel) {
                        if(encoderProcessCancel){
                                UtilEncoder.CancelRScript = true;
                        }
@@ -4557,13 +4578,13 @@ Log.WriteLine(str);
                }
                updatePulsebar(encoderActions.LOAD); //activity on pulsebar
                Thread.Sleep (50);
-               Log.Write("R:" + encoderThreadR.ThreadState.ToString());
+               Log.Write(" L:" + encoderThread.ThreadState.ToString());
                return true;
        }
        
        private bool pulseGTKEncoderAnalyze ()
        {
-               if(! encoderThreadR.IsAlive || encoderProcessCancel) {
+               if(! encoderThread.IsAlive || encoderProcessCancel) {
                        if(encoderProcessCancel){
                                UtilEncoder.CancelRScript = true;
                        }
@@ -4574,7 +4595,7 @@ Log.WriteLine(str);
                }
                updatePulsebar(encoderActions.ANALYZE); //activity on pulsebar
                Thread.Sleep (50);
-               Log.Write("R:" + encoderThreadR.ThreadState.ToString());
+               Log.Write(" A:" + encoderThread.ThreadState.ToString());
                return true;
        }
        
@@ -4602,7 +4623,7 @@ Log.WriteLine(str);
                                                        Convert.ToInt32(contents[1]-48), 
Convert.ToInt32(contents[3]-48) );
                        }
 
-                       if(action == encoderActions.CALC_RECALC_CURVES || action == encoderActions.LOAD) {
+                       if(action == encoderActions.CURVES || action == encoderActions.LOAD) {
                                if(fraction == -1) {
                                        encoder_pulsebar_capture.Pulse();
                                        encoder_pulsebar_capture.Text = contents;
@@ -4629,24 +4650,15 @@ Log.WriteLine(str);
        private void finishPulsebar(encoderActions action) {
                if(
                                action == encoderActions.CAPTURE || 
-                               action == encoderActions.CAPTURE_INERTIA_MOMENT || 
-                               action == encoderActions.CALC_RECALC_CURVES || 
+                               action == encoderActions.CAPTURE_IM || 
+                               action == encoderActions.CURVES || 
                                action == encoderActions.LOAD )
                {
                        Log.WriteLine("ffffffinishPulsebarrrrr");
                
-                       //stop video            
-                       if(action == encoderActions.CAPTURE) 
-                               encoderStopVideoRecord();
-                               
-                       if(action == encoderActions.CAPTURE) 
-                               capturingCsharp = false;
-                       
                        //save video will be later at encoderSaveSignalOrCurve, because there 
encoderSignalUniqueID will be known
                        
                        if(encoderProcessCancel || encoderProcessProblems) {
-                               //encoderButtonsSensitive(encoderSensEnum.DONEYESSIGNAL);
-                               encoderButtonsSensitive(encoderSensEnumStored);
                                if(notebook_encoder_capture.CurrentPage == 0 )
                                        notebook_encoder_capture.NextPage();
                                encoder_pulsebar_capture.Fraction = 1;
@@ -4660,12 +4672,11 @@ Log.WriteLine(str);
                                } else
                                        encoder_pulsebar_capture.Text = Catalog.GetString("Cancelled");
                        }
-                       else if( (action == encoderActions.CAPTURE || action == 
encoderActions.CAPTURE_INERTIA_MOMENT) 
+                       else if( (action == encoderActions.CAPTURE || action == encoderActions.CAPTURE_IM) 
                                        && encoderProcessFinish ) {
-                               encoderButtonsSensitive(encoderSensEnumStored);
                                encoder_pulsebar_capture.Text = Catalog.GetString("Finished");
                        } 
-                       else if(action == encoderActions.CALC_RECALC_CURVES || action == encoderActions.LOAD) 
{
+                       else if(action == encoderActions.CURVES || action == encoderActions.LOAD) {
                                if(notebook_encoder_capture.CurrentPage == 0)
                                        notebook_encoder_capture.NextPage();
 
@@ -4692,12 +4703,29 @@ Log.WriteLine(str);
                                plotCurvesGraphDoPlot(mainVariable, captureCurvesBarsData);
                
                                //autosave signal (but not in load)
-                               if(action == encoderActions.CALC_RECALC_CURVES)
+                               if(action == encoderActions.CURVES)
                                        encoder_pulsebar_capture.Text = encoderSaveSignalOrCurve("signal", 0);
                                else
                                        encoder_pulsebar_capture.Text = "";
                        }
 
+                       if(action == encoderActions.CAPTURE_IM && ! encoderProcessCancel && ! 
encoderProcessProblems) 
+                       {
+                               string imResultText = Util.ChangeDecimalSeparator(
+                                               
Util.ReadFile(UtilEncoder.GetEncoderSpecialDataTempFileName(), true) );
+                               Log.WriteLine("imResultText = |" + imResultText + "|");
+
+                               double imResult = Constants.EncoderErrorCode;
+
+                               if(imResultText != "NA" && imResultText != "")
+                                       imResult = Convert.ToDouble(imResultText) * 10000.0; //script 
calculates Kg*m^2 -> GUI needs Kg*cm^2
+
+                               encoder_configuration_win.Button_encoder_capture_inertial_do_ended (imResult);
+
+                               encoderButtonsSensitive(encoderSensEnum.DONENOSIGNAL);
+                       } else {
+                               encoderButtonsSensitive(encoderSensEnumStored);
+                       }
 
                        encoder_pulsebar_capture.Fraction = 1;
                        //analyze_image_save only has not to be sensitive now because capture graph will be 
saved
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index 8f0e095..bb258ed 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -345,7 +345,8 @@ public class UtilEncoder
                if (File.Exists(es.SpecialData))
                        File.Delete(es.SpecialData);
 
-               try {   
+               //try catch crash sometimes when used in conjunction with RDotNet
+//             try {   
                        p = new Process();
                        p.StartInfo = pinfo;
                        p.Start();
@@ -355,14 +356,17 @@ public class UtilEncoder
                                while ( ! ( File.Exists(outputFileCheck) || CancelRScript) );
                        else
                                while ( ! ( (File.Exists(outputFileCheck) && File.Exists(outputFileCheck2)) 
|| CancelRScript ) );
+               /*
                } catch {
                        return false;
                }
+               */
 
                return true;
        }
        
-       public static void RunEncoderCalculeInertiaMomentum(double weight, double length) 
+       //Inertia Momentum
+       public static void RunEncoderCalculeIM(double weight, double length) 
        {
                CancelRScript = false;
 


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