コード例 #1
0
 /// <summary>
 /// </summary>
 /// <param name="factory"/>
 /// <param name="hb"/>
 /// <param name="handled"/>
 public void ON_END_LOCATE_WIP0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
 {
     if (SimHelper.IsCellRunning)
     {
         Console.WriteLine();
     }
 }
コード例 #2
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
 /// <summary>
 /// </summary>
 /// <param name="aoFactory"/>
 /// <param name="handled"/>
 public void ON_START0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
 {
     if (InputMart.Instance.GlobalParameters.ApplyArrangeMType)
     {
         EqpArrangeMaster.WriteHistory_Init();
     }
 }
コード例 #3
0
ファイル: FactoryInit.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IList <InOutAgent> INITIALIZE_IN_OUT_AGENTS0(Mozart.SeePlan.Simulation.AoFactory factory, ref bool handled, IList <Mozart.SeePlan.Simulation.InOutAgent> prevReturnValue)
        {
            List <InOutAgent> agents = new List <InOutAgent>();

            if (SimHelper.IsCellRunning)
            {
                InOutAgent cellAgent = new InOutAgent(factory, Constants.AgentKey_Cell);
                cellAgent.Duration    = TimeSpan.FromHours(2);
                cellAgent.FireAtStart = true;
                //agent.Priority = -100;
                agents.Add(cellAgent);
            }
            else
            {
                InOutAgent rpAgent = new InOutAgent(factory, ReleasePlanMaster.AGENT_KEY);
                rpAgent.Duration    = ReleasePlanMaster.CYCLE_TIME;
                rpAgent.FireAtStart = true;
                //agent.Priority = -100;
                agents.Add(rpAgent);

                InOutAgent frontAgent = new InOutAgent(factory, Constants.AgentKey_Front);
                frontAgent.Duration    = TimeSpan.FromHours(1);
                frontAgent.FireAtStart = true;
                //agent.Priority = -100;
                agents.Add(frontAgent);
            }

            return(agents);
        }
コード例 #4
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="aoFactory"/>
        /// <param name="handled"/>
        public void ON_END_INITIALIZE0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
        {
            InFlowAgent.InitConstruct(aoFactory);

            OutCollector.WriteStepWip();
            WeightHelper.WriteWeightPresetLog();
        }
コード例 #5
0
ファイル: FactoryInit.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="wipManager"/>
        /// <param name="handled"/>
        public void INITIALIZE_WIP_GROUP0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IWipManager wipManager, ref bool handled)
        {
            factory.WipManager.AddGroup("StepWips",
                                        "CurrentStepID", "CurrentProductID");

            //factory.WipManager.AddGroup("StepWips",
            //    "CurrentShopID", "CurrentStepID", "CurrentProductID", "CurrentProductVersion", "OwnerType");
        }
コード例 #6
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="aoFactory"/>
        /// <param name="handled"/>
        public void ON_DONE0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
        {
            MaskMaster.OnDone(aoFactory);

            OutCollector.OnDone(aoFactory);

            InFlowMaster.Reset();
        }
コード例 #7
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="aoFactory"/>
        /// <param name="handled"/>
        public void ON_DAY_CHANGED0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
        {
            DateTime now = aoFactory.NowDT;

            if (InputMart.Instance.GlobalParameters.ApplyArrangeMType)
            {
                EqpArrangeMaster.OnDayChanged(now);
                MaskMaster.OnDayChanged(now);
            }

            ReleasePlanMaster.OnDayChanged(now);
        }
コード例 #8
0
        /// <summary>
        /// </summary>
        /// <param name="aoFactory"/>
        /// <param name="handled"/>
        public void ON_DONE0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
        {
            try
            {
                foreach (EqpPlan plan in InputMart.Instance.EqpPlans.Values)
                {
                    OutputMart.Instance.EqpPlan.Add(plan);
                }
            }

            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
コード例 #9
0
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void LOCATE_FOR_DISPATCH1(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
        {
            FabLot lot = hb.ToFabLot();

            if (CheckSimulationRunType(lot) == false)
            {
                return;
            }

            if (hb.IsFinished)
            {
                factory.Router.AddInitial((Entity)hb, hb.IsFinished);
            }
            else
            {
                //InPortWip 처리
                if (InitInPortWip(factory, hb))
                {
                    return;
                }

                var    router      = EntityControl.Instance;
                string dispatchKey = router.GetLotDispatchingKey(hb);

                DispatchingAgent da = factory.GetDispatchingAgent(dispatchKey);

                if (da == null)
                {
                    if (factory.DispatchingAgents.Count > 0)
                    {
                        ModelContext.Current.ErrorLister.Write("Entity/WipInit/LocateForDispatch", Mozart.DataActions.ErrorType.Warning, Strings.CAT_SIM_SECONDRESOURCE,
                                                               string.Format(Strings.WARN_INVALID_IMPLEMENTATION, "Entity/WipInit/LocateForDispatch"));
                        da = factory.DispatchingAgents.FirstOrDefault().Value;
                    }
                    else
                    {
                        throw new InvalidOperationException(Strings.EXCEPTION_NO_REGISTERED_DISPATCHINGAGENT);
                    }
                }

                InFlowMaster.ChangeWipLocation(hb, EventType.StartTOWait);

                da.Take(hb);
            }
        }
コード例 #10
0
ファイル: FactoryInit.cs プロジェクト: yichunbong/CSOT
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IList <SecondResourcePool> GET_SECOND_RESOURCE_POOLS0(Mozart.SeePlan.Simulation.AoFactory factory, ref bool handled, IList <Mozart.SeePlan.Simulation.SecondResourcePool> prevReturnValue)
        {
            List <SecondResourcePool> pools = new List <SecondResourcePool>();

            // SecondResourcePool 객체 생성
            SecondResourcePool pool = new SecondResourcePool(factory, "Mask");

            // TOOL 정보를 기준으로 SecondResource 생성 및 Pool 에 추가
            foreach (FabMask mask in InputMart.Instance.FabMask.Values)
            {
                SecondResource res = new SecondResource(mask.ToolID, mask);

                res.Capacity = mask.Qty;
                res.Uses     = 0;
                res.Pool     = pool;

                pool.Add(res);
            }

            pools.Add(pool);

            return(pools);
        }
コード例 #11
0
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public bool LOCATE_FOR_OTHERS0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled, bool prevReturnValue)
        {
            FabLot lot = hb.ToFabLot();

            if (lot.LotID == "TH9A1308N3B")
            {
                Console.WriteLine();
            }

            if (lot.IsHold || lot.IsMove)
            {
                var router = EntityControl.Instance;

                string           dispatchKey = router.GetLotDispatchingKey(hb);
                DispatchingAgent da          = factory.GetDispatchingAgent(dispatchKey);

                lot.IsInitHold = true;
                da.Take(hb);

                return(true);
            }

            return(false);
        }
コード例 #12
0
        /// <summary>
        /// </summary>
        /// <param name="factory"/>
        /// <param name="hb"/>
        /// <param name="handled"/>
        public void LOCATE_FOR_RUN0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
        {
            var wipInitiator = ServiceLocator.Resolve <WipInitiator>();

            FabLot lot = hb.Sample as FabLot;

            string      eqpID = wipInitiator.GetLoadingEquipment(hb);
            AoEquipment aeqp  = factory.GetEquipment(eqpID);

            if (aeqp == null)
            {
                //If there is not Equipment, handle through Bucketing.
                factory.AddToBucketer(hb);
                Logger.Warn("Eqp {0} is invalid, so locate running wip to dummy bucket. check input data!", eqpID ?? "-");
            }
            else
            {
                //// Checks WIP state that is Run, but processing is completed and located in Outport.
                //bool trackOut = wipInitiator.CheckTrackOut(factory, hb);
                //if (trackOut)
                //{
                //    aeqp.AddOutBuffer(hb);
                //}
                //else
                //{
                //    aeqp.AddRun(hb);
                //}

                var eqp     = aeqp.Target as FabEqp;
                var runWips = eqp.InitRunWips;

                bool lastRunWip = runWips[runWips.Count - 1] == lot;
                if (eqp.State == ResourceState.Up && lastRunWip)
                {
                    MaskMaster.InitLocate(aeqp, hb);
                    JigMaster.InitLocate(aeqp, hb);

                    aeqp.AddRun(hb);                     //※초기Run재공은 OnTrackIn 이벤트 발생안함.
                }
                else
                {
                    DateTime tkInTime     = lot.Wip.LastTrackInTime;
                    var      procTimeInfo = aeqp.GetProcessTime(hb);
                    double   processTime  = procTimeInfo.FlowTime.TotalSeconds + (procTimeInfo.TactTime.TotalSeconds * (hb.UnitQty - 1));
                    DateTime tkOutTime    = tkInTime.AddSeconds(processTime);

                    Time delay = Time.Max((tkOutTime - aeqp.NowDT), Time.Zero);
                    if (delay > Time.Zero)
                    {
                        object[] args = new object[2] {
                            aeqp, hb
                        };
                        aeqp.AddTimeout(delay, SimHelper.OnEqpOutBuffer, args);
                        InFlowMaster.ChangeWipLocation(hb, EventType.TrackIn);

                        lot.CurrentPlan.LoadedResource = eqp;
                    }
                    else
                    {
                        aeqp.AddOutBuffer(hb);
                    }
                }
            }
        }
コード例 #13
0
 /// <summary>
 /// </summary>
 /// <param name="factory"/>
 /// <param name="hb"/>
 /// <param name="handled"/>
 public void ON_BEGIN_LOCATE_WIP0(Mozart.SeePlan.Simulation.AoFactory factory, Mozart.SeePlan.Simulation.IHandlingBatch hb, ref bool handled)
 {
 }
コード例 #14
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
 /// <summary>
 /// </summary>
 /// <param name="aoFactory"/>
 /// <param name="handled"/>
 public void ON_SHIFT_CHANGED0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
 {
 }
コード例 #15
0
ファイル: FactoryEvents.cs プロジェクト: yichunbong/CSOT
 /// <summary>
 /// </summary>
 /// <param name="aoFactory"/>
 /// <param name="handled"/>
 public void ON_SHIFT_CHANGE0(Mozart.SeePlan.Simulation.AoFactory aoFactory, ref bool handled)
 {
     Logger.MonitorInfo(string.Format("{0}..... {1}", aoFactory.NowDT.ToString("yyyy-MM-dd HH:mm:ss"), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
 }