Esempio n. 1
0
 /*---- Start Code Migration ----*/
 public void CheckNotifications()
 {
     // Check if we need to call BeginInvoke.
     if (this.InvokeRequired)
     {
         // Pass the same function to BeginInvoke,
         // but the call would come on the correct
         // thread and InvokeRequired will be false.
         this.BeginInvoke(new Action(CheckNotifications));
         return;
     }
     Thread.Sleep(50);  //Delay 50ms.
     // --------------------------------------------
     if (OPC.GetNotificationReceived("RequestVerify"))
     {
         var mac            = this.machine;
         var _requestVerify = OPC.GetNotifiedBOOL("RequestVerify");
         if (_requestVerify)
         {
             mac.RequestVerifyCode = true;
             this.machine          = mac;
             VerityCode(this.machine, null);
         }
         else if (!_requestVerify)
         {
             mac.RequestVerifyCode = false;
             this.machine          = mac;
             ResetVerify(this.machine, null);
         }
     }
     // --------------------------------------------
     if (OPC.GetNotificationReceived("MachineStatus"))
     {
         var mac = this.machine;
         mac.OnlineFlag = OPC.GetNotifiedSINT("MachineStatus");
         this.machine   = mac;
     }
     // --------------------------------------------
     if (OPC.GetNotificationReceived("RequestLogging"))
     {
         var mac          = this.machine;
         var _requestFlag = OPC.GetNotifiedBOOL("RequestLogging");
         if (_requestFlag)
         {
             mac.RequestLogging = true;
             this.machine       = mac;
             KeepLogging(this.machine, null);
         }
         else if (!_requestFlag)
         {
             mac.RequestLogging = false;
             this.machine       = mac;
             ResetComplete(this.machine, null);
         }
     }
     //------------------------------------------------
     if (OPC.GetNotificationReceived("TraceabilityRdy"))
     {
         if (OPC.GetNotifiedBOOL("TraceabilityRdy"))
         {
             this.systemReady = true;
         }
         else
         {
             this.systemReady = false;
         }
     }
     // --------------------------------------------
     if (OPC.GetNotificationReceived("LoggingApp"))
     {
         var mac = this.machine;
         mac.CompletedLogging = OPC.GetNotifiedSINT("LoggingApp");
         this.machine         = mac;
     }
 }