[chronojump] Chronopic Automatic version can be checked from chronopic window



commit fa9080c3988d401a7b8891a60f5cb54bc959d3ed
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Sep 12 19:28:17 2014 +0200

    Chronopic Automatic version can be checked from chronopic window

 glade/chronojump.glade |  242 ++++++++++++++++++++++++++++++++++++++++++++++-
 src/chronopic.cs       |   23 +++++
 src/gui/chronopic.cs   |   38 ++++++++
 3 files changed, 297 insertions(+), 6 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 163e016..9c39423 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6215,6 +6215,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -6846,6 +6849,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -7611,6 +7617,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -8135,6 +8144,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -15036,7 +15048,7 @@ Evaluator can use real name or nickname.</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="shadow_type">in</property>
                         <child>
                           <widget class="GtkAlignment" id="alignment2">
                             <property name="visible">True</property>
@@ -15170,7 +15182,7 @@ Evaluator can use real name or nickname.</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="shadow_type">in</property>
                         <child>
                           <widget class="GtkAlignment" id="alignment3">
                             <property name="visible">True</property>
@@ -15531,7 +15543,7 @@ Evaluator can use real name or nickname.</property>
                         <property name="can_focus">False</property>
                         <property name="label_xalign">0</property>
                         <property name="label_yalign">0.69999998807907104</property>
-                        <property name="shadow_type">none</property>
+                        <property name="shadow_type">in</property>
                         <child>
                           <widget class="GtkAlignment" id="alignment5">
                             <property name="visible">True</property>
@@ -15611,6 +15623,179 @@ Evaluator can use real name or nickname.</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
+                                <child>
+                                  <widget class="GtkVBox" id="vbox6">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">4</property>
+                                    <child>
+                                      <widget class="GtkCheckButton" id="check_show_automatic">
+                                        <property name="label">Show advanced stuff</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_show_automatic_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_chronopic_auto">
+                                        <property name="can_focus">False</property>
+                                        <property name="n_rows">4</property>
+                                        <property name="n_columns">2</property>
+                                        <property name="column_spacing">4</property>
+                                        <property name="row_spacing">4</property>
+                                        <child>
+                                          <widget class="GtkButton" id="button_auto_check_auto">
+                                            <property name="label">Check Automatic Firmware</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <signal name="clicked" 
handler="on_button_auto_check_auto_clicked" swapped="no"/>
+                                          </widget>
+                                          <packing>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options">GTK_FILL</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkButton" id="button_auto_check_version">
+                                            <property name="label">Check version</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <signal name="clicked" 
handler="on_button_auto_check_version_clicked" 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">GTK_FILL</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkButton" id="button_auto_check_debounce">
+                                            <property name="label">Check debounce</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">True</property>
+                                            <signal name="clicked" 
handler="on_button_auto_check_debounce_clicked" 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">GTK_FILL</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkHBox" id="hbox1">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="spacing">4</property>
+                                            <child>
+                                              <widget class="GtkSpinButton" id="spin_auto_change_debounce">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="invisible_char">●</property>
+                                                <property name="primary_icon_activatable">False</property>
+                                                <property name="secondary_icon_activatable">False</property>
+                                                <property name="primary_icon_sensitive">True</property>
+                                                <property name="secondary_icon_sensitive">True</property>
+                                                <property name="adjustment">50 10 90 10 10 0</property>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <widget class="GtkButton" id="button_auto_change_debounce">
+                                                <property name="label">Change debounce</property>
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="receives_default">True</property>
+                                                <signal name="clicked" 
handler="on_button_auto_change_debounce_clicked" swapped="no"/>
+                                              </widget>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="fill">True</property>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </widget>
+                                          <packing>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label_auto_check_auto">
+                                            <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>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label_auto_check_version">
+                                            <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>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label_auto_check_debounce">
+                                            <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">2</property>
+                                            <property name="bottom_attach">3</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label_auto_change_debounce">
+                                            <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>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -17442,6 +17627,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -17874,6 +18062,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -18752,6 +18943,12 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -22304,6 +22501,9 @@ comments</property>
                               </packing>
                             </child>
                             <child>
+                              <placeholder/>
+                            </child>
+                            <child>
                               <widget class="GtkSpinButton" id="spin_im_weights_weight">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
@@ -22340,9 +22540,6 @@ comments</property>
                                 <property name="x_options">GTK_FILL</property>
                               </packing>
                             </child>
-                            <child>
-                              <placeholder/>
-                            </child>
                           </widget>
                           <packing>
                             <property name="expand">False</property>
@@ -26720,6 +26917,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>
@@ -28542,6 +28757,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                                 <child>
                                   <placeholder/>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                               </widget>
                             </child>
                           </widget>
@@ -29033,6 +29251,9 @@ To differentiate between male and female, use the values 1/0, or m/f, or M/F on
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -31497,6 +31718,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -31593,6 +31817,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -31704,6 +31931,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/chronopic.cs b/src/chronopic.cs
index 262ce56..5a69436 100644
--- a/src/chronopic.cs
+++ b/src/chronopic.cs
@@ -202,6 +202,29 @@ Console.Write("4");
                Console.WriteLine("---------------------------");
 
        }
+       
+       public string Read_variables_automatic_version() 
+       {
+               if (sp == null) {
+                       sp.Open();
+               }       
+       
+               string version = "";    
+               try {
+                       sp.Write("V");
+                       int major = (char) sp.ReadByte() - '0'; 
+                       sp.ReadByte();          //.
+                       int minor = (char) sp.ReadByte() - '0'; 
+                       version = major.ToString() + "." + minor.ToString();
+               } catch {
+                       this.error=ErrorType.Timeout;
+                       Console.WriteLine("Timeout. This is not Chronopic-Automatic-Firmware");
+                       version = "Error";
+               }
+               
+               return version;
+       }
+
 
        //----------------------------------------
        //-- Obtener el estado de la plataforma
diff --git a/src/gui/chronopic.cs b/src/gui/chronopic.cs
index 7a32566..35665f7 100644
--- a/src/gui/chronopic.cs
+++ b/src/gui/chronopic.cs
@@ -96,6 +96,15 @@ public class ChronopicWindow
        [Widget] Gtk.Image chronopic_image;
        [Widget] Gtk.TextView textview_ports_found_explanation;
 
+       //Automatic firmware stuff
+       [Widget] Gtk.CheckButton check_show_automatic;
+       [Widget] Gtk.Table table_chronopic_auto;
+       [Widget] Gtk.SpinButton spin_auto_change_debounce;
+       [Widget] Gtk.Label label_auto_check_auto;
+       [Widget] Gtk.Label label_auto_check_version;
+       [Widget] Gtk.Label label_auto_check_debounce;
+       [Widget] Gtk.Label label_auto_change_debounce;
+
        //chronopic connection thread
        Thread thread;
        bool needUpdateChronopicWin;
@@ -683,6 +692,35 @@ Log.WriteLine("bbb");
        }
 
 
+       // Chronopic Automatic Firmware ---------------
+       
+       private void on_checkbutton_show_automatic_clicked (object o, EventArgs args) 
+       {
+               table_chronopic_auto.Visible = check_show_automatic.Active;
+       }
+
+       private void on_button_auto_check_auto_clicked (object o, EventArgs args)
+       {
+       }       
+
+       private void on_button_auto_check_version_clicked (object o, EventArgs args)
+       {
+               if(cp == null)
+                       Log.WriteLine("cp == NULL");
+               else
+                       label_auto_check_version.Text = cp.Read_variables_automatic_version();
+       }       
+       
+       private void on_button_auto_check_debounce_clicked (object o, EventArgs args)
+       {
+       }       
+
+       private void on_button_auto_change_debounce_clicked (object o, EventArgs args)
+       {
+       }       
+       // end of Chronopic Automatic Firmware ---------------
+
+
        void prepareChronopicConnection() {
                frame_connection.Visible = true;
                


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