Exemplo n.º 1
0
        public void AssignAssets(BatteryClass Battery, ChamberClass Chamber, TesterChannelClass TesterChannel)
        {
            //Check if the assets is in use or not first
            if (WaitingList.Count == 0) //Prompt warning
            {
                System.Windows.MessageBox.Show("No waiting tasks to assign assets to!");
                return;
            }
            RequestedSubProgramClass RequestedSubProgram = TopWaitingRequestedSubProgram;
            ExecutorClass            validExecutor       = TopWaitingRequestedSubProgram.TopWaitingRequestedRecipe.ValidExecutor;

            validExecutor.AssignAssets(Battery, Chamber, TesterChannel);
        }
Exemplo n.º 2
0
        public void AssignAssets(BatteryClass Battery, ChamberClass Chamber, TesterChannelClass TesterChannel)
        {
            if (this.Status != ExecutorStatus.Waiting)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("Only waiting task can be assign assets to!");
                return;
            }

            if (Battery.Status != AssetStatusEnum.IDLE)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("Battery is in use!");
                return;
            }

            if (Chamber != null)
            {
                if (Chamber.Status != AssetStatusEnum.IDLE)
                {
                    //Todo: prompt warning message
                    System.Windows.MessageBox.Show("Chamber is in use!");
                    return;
                }
                if (this.RequestedRecipe.Recipe.ChamberRecipe == null)
                {
                    //Todo: prompt warning message but do not return
                    System.Windows.MessageBox.Show("No chamber recipe but chamber is provided!");
                    //return;
                }
            }
            else if (this.RequestedRecipe.Recipe.ChamberRecipe != null)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("No chamber to be assigned to chamber recipe!");
                return;
            }

            if (TesterChannel.Status != AssetStatusEnum.IDLE)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("Test Channel is in use!");
                return;
            }

            if (TesterChannel.Tester != this.RequestedRecipe.Recipe.TesterRecipe.Tester)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("Recipe and Tester are not compatible!");
                return;
            }

            if (Battery.BatteryType != this.RequestedRecipe.Recipe.TesterRecipe.BatteryType)
            {
                //Todo: prompt warning message
                System.Windows.MessageBox.Show("Recipe and Battery are not compatible!");
                return;
            }

            this.Battery   = Battery;
            Battery.Status = AssetStatusEnum.ASSIGNED;
            if (this.RequestedRecipe.Recipe.ChamberRecipe != null) //If there is no chamber recipe, then we don't need to assign chamber at all.
            {
                this.Chamber   = Chamber;
                Chamber.Status = AssetStatusEnum.ASSIGNED;
            }
            this.TesterChannel   = TesterChannel;
            TesterChannel.Status = AssetStatusEnum.ASSIGNED;
            this.Status          = ExecutorStatus.Ready;
        }