Esempio n. 1
0
        private void SocketEvent_ProcessMessage(object sender, SocketEventArgs data)
        {
            if (!SocketEvent_InSync)
            {
                SocketEvent_InSync = true;
                this.Queue(false, new Action(() => SocketEvent_InSyncEvent?.Invoke(this, true)));
            }

            switch (data.Command)
            {
            case 1:     //Initial Scan
                this.Queue(false, new Action(() => HealthCheck?.Invoke(sender, new HealthCheckEventArgs(data.ID))));
                HealthCheckEventArgs hc = new HealthCheckEventArgs(data.ID);
                hc.Valid  = flipflop;
                flipflop ^= true;
                HealthCheckResponse(hc);
                break;

            case 10:     //Tote ready for pickup.
                this.Queue(false, new Action(() => ToteReady?.Invoke(sender, data)));
                break;

            case 12:     //Tote Loading complete.
                this.Queue(false, new Action(() => ToteLoadComplete?.Invoke(sender, data)));
                break;

            case 13:     //Tote Unloading complete.
                this.Queue(false, new Action(() => ToteUnloadComplete?.Invoke(sender, data)));
                break;
            }
        }
 protected virtual void OnHealthCheck(object source)
 {
     HealthCheck?.Invoke(source, EventArgs.Empty);
 }