Esempio n. 1
0
        private void FinishedTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            _StartTimer.Stop();
            _FinishedTimer.Stop();

            //Processing is completed machine is going back to idle
            ChangeState(MachineStates.Idle, MachineStates.Operating, Int32.MaxValue);

            //Processing is completed, set order state to finished complete
            OrderData.OrderState = MachineOrderStates.FinishedComplete;
            MachineOrderDataChanged?.Invoke(OrderData);
        }
Esempio n. 2
0
        //Preparation finsihed
        private void StartTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            _StartTimer.Stop();
            _FinishedTimer.Start();

            //Preparation is completed now start the processing
            ChangeState(MachineStates.Operating, MachineStates.Idle, 10);

            //Machine starts the processing, set OrderState to started
            OrderData.OrderState = MachineOrderStates.Started;
            MachineOrderDataChanged?.Invoke(OrderData);
        }
Esempio n. 3
0
        //Cancelation of a running order
        public bool CancelOrder(long orderId)
        {
            _StartTimer.Stop();
            _FinishedTimer.Stop();

            ChangeState(MachineStates.Idle, MachineStates.Operating, Int32.MaxValue);

            OrderData.OrderState = MachineOrderStates.Canceled;
            MachineOrderDataChanged?.Invoke(OrderData);

            return(true);
        }
Esempio n. 4
0
        //Starts the processing of the transfered order/programFile
        public bool TransferOrder(MachineOrderData orderData, byte[] programFile)
        {
            if (StateData.CurrentState == MachineStates.Idle)
            {
                OrderData            = orderData;
                OrderData.OrderState = MachineOrderStates.Transfered;
                MachineOrderDataChanged?.Invoke(OrderData);

                _StartTimer.Start();

                return(true);
            }

            return(false);
        }