[chronojump] networks RFID improvements while capturing



commit 233c0ba8f6fad2dff70a1d7958d44368e40145bb
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Feb 26 14:03:44 2020 +0100

    networks RFID improvements while capturing

 src/RFID.cs         | 10 +++++++++-
 src/gui/networks.cs |  9 +++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/RFID.cs b/src/RFID.cs
index 3dfd0ea4..c7f11119 100644
--- a/src/RFID.cs
+++ b/src/RFID.cs
@@ -40,6 +40,8 @@ public class RFID
        private Gtk.Button fakeButtonReopenDialog;
        private Gtk.Button fakeButtonDisconnected;
 
+       private string lastRFID;
+
        public RFID(string portName)
        {
                this.portName = portName;
@@ -61,7 +63,7 @@ public class RFID
                 */
                //List<string> l = getPorts(false);
                
-               string lastRFID = "";
+               lastRFID = "";
                string str = "";
                DateTime dtWaitingLastTimeAdminDetected = new DateTime(); //to be able to detect other person 
after the AdminDetected
 
@@ -143,6 +145,12 @@ public class RFID
                this.adminRFID = adminRFID;
        }
 
+       //reset lastRFID in order to be able to use that RFID after capture (if same wristband is used again)
+       public void ResetLastRFID()
+       {
+               lastRFID = "";
+       }
+
        private bool findRFIDPort(List<string> l)
        {
                foreach(string p in l)
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 00e42f28..3071000a 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -103,12 +103,12 @@ public partial class ChronoJumpWindow
 
        static Thread threadRFID;
        public RFID rfid;
-       private static string capturedRFID;
+       private static string capturedRFID; //current RFID in use
        private static bool shouldUpdateRFIDGui;
        private static bool shouldShowRFIDDisconnected;
        private static bool updatingRFIDGuiStuff;
        private static bool networksRunIntervalCanChangePersonSQLReady;
-       private static DateTime startedRFIDWait;
+       private static DateTime startedRFIDWait; //just to display a message at the moment of try to 
wristband change while capturing
        private bool rfidProcessCancel;
        private bool rfidIsDifferent;
        //private bool compujumpAutologout;
@@ -256,6 +256,11 @@ public partial class ChronoJumpWindow
                {
                        startedRFIDWait = DateTime.Now;
                        LogB.Information("... but we are on the middle of capture");
+
+                       //reset lastRFID in order to be able to use that RFID after capture (if same 
wristband is used again)
+                       //maybe better do this when Capturing ends
+                       rfid.ResetLastRFID();
+
                        return;
                }
 


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