예제 #1
0
        /// <summary>
        /// </summary>
        /// <param name="hb"/>
        /// <param name="wagent"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public object GET_WORK_GROUP_KEY0(IHandlingBatch hb, WorkAgent wagent, ref bool handled, object prevReturnValue)
        {
            try
            {
                MicronBEAssyBELot lot       = hb.Sample as MicronBEAssyBELot;
                string            productID = lot.Product.ProductID;
                Product           prod      = null;
                InputMart.Instance.MicronBEProducts.TryGetValue(productID, out prod);

                AssyMcpProduct aoProd = null;
                if (prod is AssyMcpPart)
                {
                    AssyMcpPart part = prod as AssyMcpPart;
                    aoProd = part.FinalProduct as AssyMcpProduct;
                }
                if (prod is AssyMcpProduct)
                {
                    aoProd = prod as AssyMcpProduct;
                }

                if (aoProd != null)
                {
                    return(aoProd.ProductID);
                }

                return(null);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(object));
            }
        }
예제 #2
0
        public void ON_AFTER_RUN0(WorkAgent wagent, ref bool handled)
        {
            if (wagent.Groups == null)
            {
                return;
            }

            else
            {
                var nowDT = FindHelper.GetNowDT();
                //if (count > 1)
                //    return;

                foreach (var wg in wagent.Groups)
                {
                    foreach (var ws in wg.Steps)
                    {
                        foreach (var profile in ws.Profiles)
                        {
                            foreach (var lot in profile.Value)
                            {
                                if (ws.Key.ToString() == "S0250" && profile.Key.Target.EqpID == "WB02" && nowDT >= new DateTime(2018, 01, 12, 12, 10, 00))
                                {
                                    if (ws.Inflows.Contains(lot))
                                    {
                                        Logger.MonitorInfo("Inflow Profile -> STEP : {0}, EQP_ID : {1}, LOT_ID : {2}, IN_TIME : {3}, OUT_TIME : {4}, NowDT : {5}", ws.Key.ToString(), profile.Key.Target.EqpID, lot.Lot.LotID, lot.InTime, lot.OutTime, wagent.NowDT);
                                    }

                                    else
                                    {
                                        Logger.MonitorInfo("Profile -> STEP : {0}, EQP_ID : {1}, LOT_ID : {2}, IN_TIME : {3}, OUT_TIME : {4}, NowDT : {5}", ws.Key.ToString(), profile.Key.Target.EqpID, lot.Lot.LotID, lot.InTime, lot.OutTime, wagent.NowDT);
                                    }
                                }
                            }
                        }
                    }
                }

                count++;
            }
        }
예제 #3
0
        public override void EndWorkItem(WorkAgent agent, WorkItem workItem)
        {
            Send("WorkItemAction Complete " + agent.AgentId + " " + workItem.taskID);
            Thread.Sleep(1000);
            // Before requesting the next task, make sure that th
            if (_oThread.ThreadState == ThreadState.Stopped)
                _oThread.Start();
            else if (_oThread.ThreadState == ThreadState.Suspended)
                _oThread.Resume();
            else if (_oThread.ThreadState == ThreadState.WaitSleepJoin)
                _oThread.Interrupt();

            Send("GetTaskQueue " + WorkAgent.STARTED + " " + agent.AgentId);
            Send("GetTaskQueue " + WorkAgent.OFFERED + " " + agent.AgentId);
        }
예제 #4
0
 public override void Delegate(WorkItem item, WorkAgent other, WorkflowProvider provider)
 {
     delegated.Add(item);
     provider.Send("WorkItemAction Delegate " + this.YawlId + " " + item.taskID + " " + other.AgentId);
 }