[chronojump] Initial RFID support



commit 57f277246ed301b44442928d3017d2cb03a21082
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Feb 26 14:16:22 2015 +0100

    Initial RFID support

 glade/chronojump.glade |   93 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/gui/encoder.cs     |   16 ++++++++
 src/util.cs            |    6 +++
 3 files changed, 115 insertions(+), 0 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 82f5853..df9e671 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -6579,6 +6579,9 @@ Second Chronopic to platforms.</property>
                                                         <child>
                                                           <placeholder/>
                                                         </child>
+                                                        <child>
+                                                          <placeholder/>
+                                                        </child>
                                                       </widget>
                                                       <packing>
                                                         <property name="expand">True</property>
@@ -7405,6 +7408,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             </child>
                                                             <child>
@@ -8483,6 +8489,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">2</property>
@@ -9202,6 +9211,9 @@ Second Chronopic to platforms.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="position">4</property>
@@ -13371,6 +13383,42 @@ on current Chronojump version.</property>
                                                         <property name="position">3</property>
                                                       </packing>
                                                     </child>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox_rfid">
+                                                        <property name="can_focus">False</property>
+                                                        <property name="spacing">10</property>
+                                                        <child>
+                                                          <widget class="GtkButton" id="button_rfid_read">
+                                                            <property name="label">Read RFID</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <signal name="clicked" 
handler="on_button_rfid_read_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="GtkLabel" id="label_rfid">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</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">4</property>
+                                                      </packing>
+                                                    </child>
                                                   </widget>
                                                   <packing>
                                                     <property name="y_options"/>
@@ -19551,6 +19599,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -20178,6 +20229,9 @@ by you</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                     </child>
                   </widget>
@@ -21297,6 +21351,9 @@ by you</property>
               <placeholder/>
             </child>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkButton" id="button_video_url">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -21473,6 +21530,9 @@ by you</property>
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
@@ -31131,6 +31191,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>
@@ -33138,6 +33216,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>
@@ -33803,6 +33884,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>
@@ -36434,6 +36518,9 @@ show elevation as:</property>
                         <child>
                           <placeholder/>
                         </child>
+                        <child>
+                          <placeholder/>
+                        </child>
                       </widget>
                       <packing>
                         <property name="left_attach">2</property>
@@ -36725,6 +36812,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -37031,6 +37121,9 @@ show elevation as:</property>
                     <child>
                       <placeholder/>
                     </child>
+                    <child>
+                      <placeholder/>
+                    </child>
                   </widget>
                 </child>
               </widget>
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index c948e3f..2f70d99 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -171,6 +171,10 @@ public partial class ChronoJumpWindow
        Gdk.Pixmap encoder_capture_signal_pixmap = null;
        Gdk.Pixmap encoder_capture_curves_bars_pixmap = null;
 
+       //RFID
+       [Widget] Gtk.Box hbox_rfid;
+       [Widget] Gtk.Label label_rfid;
+
        ArrayList encoderCaptureCurves;
         Gtk.ListStore encoderCaptureListStore;
        Gtk.ListStore encoderAnalyzeListStore; //can be EncoderCurves or EncoderNeuromuscularData
@@ -317,8 +321,20 @@ public partial class ChronoJumpWindow
                RInitialized = Constants.Status.UNSTARTED;
        
                playVideoEncoderInitialSetup();
+
+               if(Util.FileExists(Util.GetRFIDMarkFile()))
+                       hbox_rfid.Visible = true;
+       }
+
+       //rfid
+       void on_button_rfid_read_clicked (object o, EventArgs args) {
+               string file = "/tmp/chronojump_rfid.txt";
+
+               if(Util.FileExists(file))
+                       label_rfid.Text = Util.ReadFile(file, true);
        }
 
+
        void on_menuitem_test_rdotnet_activate (object o, EventArgs args) {
                if(useRDotNet) {
                        if(RInitialized == Constants.Status.UNSTARTED)
diff --git a/src/util.cs b/src/util.cs
index d7b1ace..9ae625a 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -786,6 +786,12 @@ public class Util
 
        /********** end of database paths ************/
        
+       public static string GetRFIDMarkFile() {
+               return Path.Combine(
+                               Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
+                               "Chronojump" + Path.DirectorySeparatorChar + "rfid_mark_file.txt");
+       }
+       
 
        /********** start of multimedia paths ************/
 


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