[chronojump] ...Almost done



commit 27a5b19f3d571071bf771a481bb1d0c7818c51a2
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jan 30 17:06:06 2020 +0100

    ...Almost done

 glade/app1.glade             | 72 +++-----------------------------------------
 src/gui/app1/chronojump.cs   | 49 ++++++------------------------
 src/gui/chronopicRegister.cs | 11 +------
 src/gui/encoder.cs           |  2 +-
 src/gui/guiTests.cs          |  2 +-
 src/gui/networks.cs          |  2 +-
 6 files changed, 19 insertions(+), 119 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 7b215121..60a9b6ee 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -33956,74 +33956,12 @@ then click this button.</property>
                                                     <property name="position">1</property>
                                                   </packing>
                                                 </child>
-                                                <child>
-                                                  <widget class="GtkHBox" id="hbox356">
-                                                    <property name="visible">True</property>
-                                                    <property name="can_focus">False</property>
-                                                    <child>
-                                                      <widget class="GtkButton" 
id="button_activate_chronopics_encoder_networks_problems">
-                                                        <property name="visible">True</property>
-                                                        <property name="can_focus">True</property>
-                                                        <property name="can_default">True</property>
-                                                        <property name="receives_default">True</property>
-                                                        <property name="has_tooltip">True</property>
-                                                        <property name="tooltip" translatable="yes">Connect 
encoder</property>
-                                                        <property name="relief">half</property>
-                                                        <signal name="clicked" 
handler="on_chronopic_encoder_clicked" swapped="no"/>
-                                                        <child>
-                                                          <widget class="GtkHBox" id="hbox357">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="border_width">6</property>
-                                                            <property name="spacing">4</property>
-                                                            <child>
-                                                            <widget class="GtkLabel" id="label435">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property name="label" 
translatable="yes">Device</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_chronopic_connect_encoder1">
-                                                            <property name="visible">True</property>
-                                                            <property name="can_focus">False</property>
-                                                            <property 
name="stock">gtk-missing-image</property>
-                                                            <property name="icon-size">2</property>
-                                                            </widget>
-                                                            <packing>
-                                                            <property name="expand">True</property>
-                                                            <property name="fill">True</property>
-                                                            <property name="position">1</property>
-                                                            </packing>
-                                                            </child>
-                                                          </widget>
-                                                        </child>
-                                                      </widget>
-                                                      <packing>
-                                                        <property name="expand">True</property>
-                                                        <property name="fill">False</property>
-                                                        <property name="position">0</property>
-                                                      </packing>
-                                                    </child>
-                                                  </widget>
-                                                  <packing>
-                                                    <property name="expand">True</property>
-                                                    <property name="fill">False</property>
-                                                    <property name="padding">12</property>
-                                                    <property name="position">2</property>
-                                                  </packing>
-                                                </child>
                                                 <child>
                                                   <widget class="GtkHBox" id="hbox358">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">False</property>
                                                     <child>
-                                                      <widget class="GtkButton" 
id="button_activate_chronopics_encoder_networks_problems1">
+                                                      <widget class="GtkButton" 
id="button_activate_chronopics_encoder_networks_problems">
                                                         <property name="visible">True</property>
                                                         <property name="can_focus">True</property>
                                                         <property name="can_default">True</property>
@@ -34037,12 +33975,12 @@ then click this button.</property>
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="border_width">6</property>
-                                                            <property name="spacing">4</property>
+                                                            <property name="spacing">6</property>
                                                             <child>
                                                             <widget class="GtkLabel" id="label437">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
-                                                            <property name="label">Check</property>
+                                                            <property name="label" 
translatable="yes">Check</property>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">True</property>
@@ -34051,7 +33989,7 @@ then click this button.</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkImage" 
id="image_chronopic_connect_encoder2">
+                                                            <widget class="GtkImage" 
id="image_chronopic_connect_encoder1">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property 
name="stock">gtk-missing-image</property>
@@ -34076,7 +34014,7 @@ then click this button.</property>
                                                   <packing>
                                                     <property name="expand">True</property>
                                                     <property name="fill">False</property>
-                                                    <property name="position">3</property>
+                                                    <property name="position">2</property>
                                                   </packing>
                                                 </child>
                                               </widget>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index b1eea316..b7782ca8 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -715,7 +715,7 @@ public partial class ChronoJumpWindow
                if(needToShowChronopicRegisterWindow)
                {
                        LogB.Information("Show chronopic resgister win");
-                       chronopicRegisterWin.Show(false);
+                       chronopicRegisterWin.Show();
                }
                LogB.Information("Chronojump window started");
        }
@@ -3428,7 +3428,7 @@ public partial class ChronoJumpWindow
 
                last_menuitem_mode_defined = true;
 
-               chronopicRegisterUpdate(false, false);
+               chronopicRegisterUpdate(false);
 
                chronojumpWindowTestsNext();
 
@@ -3798,7 +3798,7 @@ public partial class ChronoJumpWindow
                if(current_menuitem_mode == Constants.Menuitem_modes.RUNSINTERVALLIC && compujumpAutologout 
!= null)
                        compujumpAutologout.StartCapturingRunInterval();
 
-               chronopicRegisterUpdate(false, false);
+               chronopicRegisterUpdate(false);
 
                int numContacts = chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.CONTACTS);
                LogB.Information("numContacts: " + numContacts);
@@ -3830,7 +3830,7 @@ public partial class ChronoJumpWindow
                                //new DialogMessage(Constants.MessageTypes.WARNING, 
Constants.SimulatedTestsNotAllowed);
                                //UtilGtk.DeviceColors(viewport_chronopics, false);
                                //open device window
-                               chronopicRegisterUpdate(true, false);
+                               chronopicRegisterUpdate(true);
 
                                return;
                        }
@@ -5285,7 +5285,7 @@ public partial class ChronoJumpWindow
                */
 
                //TODO: on Windows need to close the sp if it's open, and maybe the cp
-               chronopicRegisterUpdate(true, false);
+               chronopicRegisterUpdate(true);
        }
 
        private void on_chronopic_encoder_clicked (object o, EventArgs args) {
@@ -5297,10 +5297,7 @@ public partial class ChronoJumpWindow
 
                //TODO: on Windows need to close the sp if it's open, and maybe the cp
 
-               if(o == (object) button_activate_chronopics_encoder_networks_problems)
-                       chronopicRegisterUpdate(true, true);
-               else
-                       chronopicRegisterUpdate(true, false);
+               chronopicRegisterUpdate(true);
        }
 
        
@@ -7504,7 +7501,7 @@ LogB.Debug("mc finished 5");
         * sensitive GUI on executeAuto methods 
         */
 
-       private void chronopicRegisterUpdate(bool openWindow, bool networksNeedCheckEncoder)
+       private void chronopicRegisterUpdate(bool openWindow)
        {
                //on Windows need to close the port before reading with FTDI dll
                if(UtilAll.IsWindows())
@@ -7546,41 +7543,15 @@ LogB.Debug("mc finished 5");
                        cp2016.WindowOpened = true;
 
                        if(app1Shown)
-                       {
-                               chronopicRegisterWin.Show(networksNeedCheckEncoder);
-
-                               /*
-                               if (networksNeedCheckEncoder)
-                                       chronopicRegisterWin.FakeButtonNetworksCheckSensors.Clicked +=
-                                               new 
EventHandler(on_chronopic_register_win_close_networks_check_encoder);
-                                               */
-                       } else
+                               chronopicRegisterWin.Show();
+                       else
                                needToShowChronopicRegisterWindow = true;
                }
        }
 
-       /*
-        * on networks when there's no encoder, hbox_encoder_disconnected is shown
-        * it has button_activate_chronopics_encoder_networks_problems
-        * this calls chronopicRegisterUpdate(true, true);
-        * second true is the networksNeedCheckEncoder
-        * so check here if encodee is configured
-        * when ChronopicRegisterWindow is close or destroyed (delete_event)
-        */
-       /*
-       private void on_chronopic_register_win_close_networks_check_encoder (object o, EventArgs args)
-       {
-               chronopicRegisterWin.FakeButtonNetworksCheckSensors.Clicked -=
-                       new EventHandler(on_chronopic_register_win_close_networks_check_encoder);
-
-               chronopicRegisterUpdate(false, false);
-               if(chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ENCODER) > 0)
-                       notebook_start.CurrentPage = 1;
-       }
-       */
        private void on_chronopic_register_win_close_networks_check_encoder (object o, EventArgs args)
        {
-               chronopicRegisterUpdate(false, false);
+               chronopicRegisterUpdate(false);
                if(chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ENCODER) > 0)
                        notebook_start.CurrentPage = 1;
        }
diff --git a/src/gui/chronopicRegister.cs b/src/gui/chronopicRegister.cs
index 753e6afc..5a450f94 100644
--- a/src/gui/chronopicRegister.cs
+++ b/src/gui/chronopicRegister.cs
@@ -101,8 +101,6 @@ public class ChronopicRegisterWindow
        Gtk.Window chronopic_register_win;
        Gtk.VBox vbox_main;
        private List<ChronopicRegisterPort> listConnected;
-       private bool networksNeedCheckEncoder;
-       public Gtk.Button FakeButtonNetworksCheckSensors;
        public Gtk.Button FakeButtonCloseSerialPort;
 
        public ChronopicRegisterWindow(Gtk.Window app1, List<ChronopicRegisterPort> listAll)
@@ -132,14 +130,10 @@ public class ChronopicRegisterWindow
                createButtons();
        }
 
-       public void Show(bool networksNeedCheckEncoder)
+       public void Show()
        {
                chronopic_register_win.ShowAll();
                list_labels_selected_show(); //hide some label_selected if they are UNKNOWN
-
-               this.networksNeedCheckEncoder = networksNeedCheckEncoder;
-               if(networksNeedCheckEncoder)
-                       FakeButtonNetworksCheckSensors = new Gtk.Button();
        }
 
        private void createWindow(Gtk.Window app1)
@@ -450,9 +444,6 @@ public class ChronopicRegisterWindow
 
        private void on_button_close_clicked(object o, EventArgs args)
        {
-               if(networksNeedCheckEncoder && FakeButtonNetworksCheckSensors != null)
-                       FakeButtonNetworksCheckSensors.Click();
-
                chronopic_register_win.Hide();
                chronopic_register_win = null;
        }
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index df9d8d46..7da0d654 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -686,7 +686,7 @@ public partial class ChronoJumpWindow
                if(currentSession.Name == Constants.SessionSimulatedName && testsActive)
                        return true;
 
-               chronopicRegisterUpdate(false, false);
+               chronopicRegisterUpdate(false);
                int numEncoders = chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.ENCODER);
                LogB.Information("numEncoders: " + numEncoders);
                if(numEncoders == 0)
diff --git a/src/gui/guiTests.cs b/src/gui/guiTests.cs
index 2b7730be..042adc9b 100644
--- a/src/gui/guiTests.cs
+++ b/src/gui/guiTests.cs
@@ -467,7 +467,7 @@ public partial class ChronoJumpWindow
        {
                LogB.TestStart("chronojumpWindowTestsChronopicContactReal");
 
-               chronopicRegisterUpdate(false, false);
+               chronopicRegisterUpdate(false);
                if(chronopicRegister.NumConnectedOfType(ChronopicRegisterPort.Types.CONTACTS) != 1)
                {
                        testsActive = false;
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 5c0edc41..7eac0160 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -201,7 +201,7 @@ public partial class ChronoJumpWindow
                        rfidProcessCancel = false;
                        networksRunIntervalCanChangePersonSQLReady = true;
 
-                       chronopicRegisterUpdate(false, false);
+                       chronopicRegisterUpdate(false);
                        if(chronopicRegister != null && chronopicRegister.GetRfidPortName() != "")
                        {
                                networksShowDeviceMissingRFID (false);


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