Beispiel #1
0
        /// <summary>
        /// </summary>
        /// <param name="upWorkStep"/>
        /// <param name="assignEqps"/>
        /// <param name="context"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public List <AssignEqp> DO_FILTER_ASSIGN_EQP0(WorkStep upWorkStep, List <AssignEqp> assignEqps, JobChangeContext context, ref bool handled, List <AssignEqp> prevReturnValue)
        {
            try
            {
                List <AssignEqp> list = new List <AssignEqp>();
                foreach (AssignEqp eqp in assignEqps)
                {
                    if (eqp.WorkStep == null || eqp.WorkStep.OperationType == OperationType.Down)
                    {
                        list.Add(eqp);
                        continue;
                    }

                    int  properEqpCount = SimulationHelper.CalculateProperEqpCount(eqp);
                    bool canFilter      = false;
                    canFilter = SimulationHelper.CanFilterAssignEqp(eqp);

                    if (properEqpCount < eqp.WorkStep.LoadedEqpCount && canFilter)
                    {
#if DEBUG
                        DateTime             nowDt = FindHelper.GetNowDT();
                        MicronBEAssyWorkStep ws    = eqp.WorkStep as MicronBEAssyWorkStep;
                        if (eqp.WorkStep.Key.ToString() == "S0250")
                        {
                            Console.WriteLine();
                        }
                        Logger.MonitorInfo(string.Format("Filtered -> STEP : {0}, EQP_ID : {1}, NowDT : {2}, Available Down : {3}", eqp.WorkStep.Key.ToString(), eqp.Target.EqpID, DateUtility.DbToString(FindHelper.GetNowDT()), DateUtility.DbToString(ws.AvailableDownTime)));
#endif
                        list.Add(eqp);
                    }
                }

                return(list);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(List <AssignEqp>));
            }
        }