Пример #1
0
        public void DoRobotCommandFor(RobotCommand robotCommand)
        {
            Task.Run(() =>
            {
                if (robotCommand.GetTransferStepType() == EnumTransferStepType.Load)
                {
                    RobotStatus = new RobotStatus()
                    {
                        EnumRobotState = EnumRobotState.Busy, IsHome = false
                    };

                    OnUpdateRobotStatusEvent?.Invoke(this, RobotStatus);

                    System.Threading.Thread.Sleep(2000);

                    CarrierSlotStatus = new CarrierSlotStatus()
                    {
                        CarrierId = robotCommand.CassetteId, EnumCarrierSlotState = EnumCarrierSlotState.Loading, SlotNumber = robotCommand.SlotNumber
                    };

                    OnUpdateCarrierSlotStatusEvent?.Invoke(this, CarrierSlotStatus);

                    System.Threading.Thread.Sleep(2000);

                    RobotStatus = new RobotStatus()
                    {
                        EnumRobotState = EnumRobotState.Idle, IsHome = true
                    };

                    OnUpdateRobotStatusEvent?.Invoke(this, RobotStatus);

                    OnRobotEndEvent?.Invoke(this, EnumRobotEndType.Finished);
                }
                else if (robotCommand.GetTransferStepType() == EnumTransferStepType.Unload)
                {
                    RobotStatus = new RobotStatus()
                    {
                        EnumRobotState = EnumRobotState.Busy, IsHome = false
                    };

                    OnUpdateRobotStatusEvent?.Invoke(this, RobotStatus);

                    System.Threading.Thread.Sleep(2000);

                    CarrierSlotStatus = new CarrierSlotStatus()
                    {
                        CarrierId = "", EnumCarrierSlotState = EnumCarrierSlotState.Empty, SlotNumber = robotCommand.SlotNumber
                    };

                    OnUpdateCarrierSlotStatusEvent?.Invoke(this, CarrierSlotStatus);

                    System.Threading.Thread.Sleep(2000);

                    RobotStatus = new RobotStatus()
                    {
                        EnumRobotState = EnumRobotState.Idle, IsHome = true
                    };

                    OnUpdateRobotStatusEvent?.Invoke(this, RobotStatus);

                    OnRobotEndEvent?.Invoke(this, EnumRobotEndType.Finished);
                }
            });
        }
Пример #2
0
        private void LoadUnloadControl_ForkCompleteEvent(object sender, EnumLoadUnloadComplete enumLoadUnloadComplete)
        {
            EnumRobotEndType robotEndType = GetEnumRobotEndTypeFrom(enumLoadUnloadComplete);

            OnRobotEndEvent?.Invoke(this, robotEndType);
        }