예제 #1
0
        internal static ProductDetail NewProductDetail(ProductMaster entity, MicronBEAssyProcess process)
        {
            try
            {
                ProductDetail productDetail = new ProductDetail();

                productDetail.LineID        = entity.LINE_ID;
                productDetail.ProductID     = entity.PRODUCT_ID;
                productDetail.ProductName   = entity.PRODUCT_NAME;
                productDetail.Process       = process;
                productDetail.DesignID      = entity.DESIGN_ID;
                productDetail.MaterialGroup = entity.MATERIAL_GROUP;
                productDetail.PkgFamily     = entity.PKG_FAMILY;
                productDetail.PkgType       = entity.PKG_TYPE;
                productDetail.PkgLeadCount  = entity.PKG_LEAD_COUNT;
                productDetail.PkgWidth      = entity.PKG_WIDTH;
                productDetail.PkgLength     = entity.PKG_LENGTH;
                productDetail.PkgHeight     = entity.PKG_HEIGHT;
                productDetail.NetDie        = entity.NET_DIE;

                return(productDetail);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #2
0
        public static bool IsNeedSetupProfile(WorkEqp weqp, IHandlingBatch hb)
        {
            try
            {
                MicronBEAssyEqp eqp = null;
                if (InputMart.Instance.MicronBEAssyEqp.ContainsKey(weqp.Target.EqpID))
                {
                    eqp = InputMart.Instance.MicronBEAssyEqp[weqp.Target.EqpID];
                }

                if (eqp == null)
                {
                    return(false);
                }

                MicronBEAssyBELot lot = hb as MicronBEAssyBELot;

                BEStep     step = lot.CurrentStep;
                StepMaster sm   = InputMart.Instance.StepMasterView.FindRows(step.StepID).FirstOrDefault();

                if (sm == null)
                {
                    return(false);
                }

                foreach (var info in InputMart.Instance.SetupInfo.DefaultView)
                {
                    if (info.LINE_ID != eqp.LineID)
                    {
                        continue;
                    }

                    //if (UtilityHelper.StringToEnum(info.STEP_GROUP, StepGroup.NONE) != eqp.StepGroup)
                    //    continue;

                    //if (LikeUtility.Like(eqp.EqpModel, info.EQP_MODEL) == false)
                    //    continue;

                    SetupType type = SimulationHelper.CheckSetupProfile(weqp, hb);

                    if (type != SetupType.NONE)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }

                return(false);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(false);
            }
        }
예제 #3
0
 internal static void WriteUnpeg(Inputs.Wip entity, string designID, bool isBase, EntityState state, UnpegReason reason, string reasonDeatil)
 {
     try
     {
         WriteUnpeg(entity.LINE_ID, entity.LOT_ID, entity.PRODUCT_ID, entity.STEP_ID, entity.LOT_QTY, entity.LOT_QTY, designID, isBase, state.ToString(), reason.ToString(), reasonDeatil);
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
     }
 }
예제 #4
0
 public static string GetEqpPlanKey(MicronBEAssyBELot lot, string eqpID, string status)
 {
     try
     {
         return(string.Concat(lot.LotID, lot.CurrentStepID, eqpID, status));
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
         return(default(string));
     }
 }
예제 #5
0
 private static Step GetCurrentStep(PlanWip planWip)
 {
     try
     {
         return(planWip.MapStep);
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
         return(default(Step));
     }
 }
예제 #6
0
 public static MicronBEAssyWipInfo GetWipInfo(this MicronBEAssyPlanWip planWip)
 {
     try
     {
         return(planWip.Wip as MicronBEAssyWipInfo);
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
         return(default(MicronBEAssyWipInfo));
     }
 }
예제 #7
0
 public static DateTime GetEngineStartTime()
 {
     try
     {
         var context = ServiceLocator.Resolve <ModelContext>();
         return(context.StartTime);
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
         return(default(DateTime));
     }
 }
예제 #8
0
 public static void RegisterInputMart(List <PlanWip> planWips)
 {
     try
     {
         foreach (MicronBEAssyPlanWip wip in planWips)
         {
             InputMart.Instance.MicronBEAssyPlanWip.Add(wip.MapStep.StepID, wip);
         }
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
     }
 }
예제 #9
0
        public static List <IWipInfo> GetWipInfoList()
        {
            try
            {
                List <IWipInfo> wipInfoList = new List <IWipInfo>(InputMart.Instance.MicronBEAssyWipInfo.Values);

                return(wipInfoList);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(List <IWipInfo>));
            }
        }
예제 #10
0
        public static void SetSteps(MicronBEAssyBatch batch, Product product)
        {
            try
            {
                if (product.IsMcp())
                {
                    AssyMcpProduct mcpProduct = null;

                    if (product is AssyMcpPart)
                    {
                        mcpProduct = (product as AssyMcpPart).FinalProduct as AssyMcpProduct;
                    }
                    else
                    {
                        mcpProduct = product as AssyMcpProduct;
                    }

                    foreach (AssyMcpPart mcpPart in mcpProduct.AllParts)
                    {
                        //if (mcpPart.IsMain == false)
                        //    continue;

                        MicronBEAssyProcess proc = mcpPart.Process as MicronBEAssyProcess;

                        int seq = mcpPart.CompSeq;
                        //if (proc.ProcessType == ProcessType.COW)
                        //{
                        //    if (mcpPart.IsMidPart == false && mcpPart.IsBase)//COW 1차는 Merge 후 2차 DA에서 진행하기 때문에 없다고 판단해야함.
                        //    {
                        //        continue;
                        //    }
                        //}

                        AddSteps(batch, proc, seq);
                    }

                    AddSteps(batch, mcpProduct.Process as MicronBEAssyProcess, mcpProduct.MaxSequence);
                }
                else
                {
                    AddSteps(batch, product.Process as MicronBEAssyProcess, 1);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
예제 #11
0
        public static double GetTactTime(string lineID, string stepID, string productID, MicronBEAssyEqp eqp)
        {
            try
            {
                Tuple <string, string, string> key = Tuple.Create(lineID, stepID, productID);
                double tactTime = 0d;
                if (InputMart.Instance.TactTimeCache.TryGetValue(key, out tactTime))
                {
                    return(tactTime);
                }
                else
                {
                    foreach (StepTime st in InputMart.Instance.StepTime.DefaultView)
                    {
                        if (st.LINE_ID != lineID)
                        {
                            continue;
                        }

                        if (st.STEP_ID != stepID)
                        {
                            continue;
                        }

                        if (LikeUtility.Like(eqp.EqpID, st.EQP_ID) == false)
                        {
                            continue;
                        }

                        if (LikeUtility.Like(productID, st.PRODUCT_ID) == false)
                        {
                            continue;
                        }

                        tactTime = (double)st.TACT_TIME;
                        break;
                    }

                    InputMart.Instance.TactTimeCache.Add(key, tactTime);
                    return(tactTime);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(double));
            }
        }
예제 #12
0
        internal static MicronBEAssyProcess NewProcess(string lineID, string processID)
        {
            try
            {
                MicronBEAssyProcess process = new MicronBEAssyProcess(processID);
                process.LineID         = lineID;
                process.DieAttachSteps = new List <MicronBEAssyBEStep>();

                return(process);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #13
0
        public static MicronBEAssyBEStep CreateStep(ProcessStep processStep)
        {
            try
            {
                MicronBEAssyBEStep step = new MicronBEAssyBEStep();
                step.StepID    = processStep.STEP_ID;
                step.Sequence  = (int)(processStep.SEQUENCE);
                step.StepGroup = processStep.STEP_GROUP == null ? string.Empty : processStep.STEP_GROUP;

                return(step);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(MicronBEAssyBEStep));
            }
        }
예제 #14
0
        public static List <PlanWip> GetPlanWips(IWipInfo wipInfo)
        {
            try
            {
                List <PlanWip> wips = new List <PlanWip>();

                PlanWip planWip = CreateHelper.CreatePlanWip(wipInfo);
                wips.Add(planWip);

                return(wips);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(List <PlanWip>));
            }
        }
예제 #15
0
        public static bool IsMcp(this Product product)
        {
            try
            {
                if (product is AssyMcpPart || product is AssyMcpProduct)
                {
                    return(true);
                }

                return(false);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(bool));
            }
        }
예제 #16
0
        public static void UpdateEqpPlanQty(MicronBEAssyBELot lot, string eqpID, string status, double qty)
        {
            try
            {
                string key = SimulationHelper.GetEqpPlanKey(lot, eqpID, status);

                EqpPlan eqpPlan = null;
                if (InputMart.Instance.EqpPlans.TryGetValue(key, out eqpPlan))
                {
                    eqpPlan.QTY = Convert.ToDecimal(qty);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
예제 #17
0
        public static bool IsRun(MicronBEAssyBELot lot)
        {
            try
            {
                if (lot.CurrentPlan.LoadedResource != null && lot.IsStarted && lot.IsFinished == false)
                {
                    return(true);
                }

                return(false);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(bool));
            }
        }
예제 #18
0
        public static Time GetSetupTimeProfile(WorkEqp weqp, IHandlingBatch hb)
        {
            try
            {
                MicronBEAssyEqp eqp = null;
                if (InputMart.Instance.MicronBEAssyEqp.ContainsKey(weqp.Target.EqpID))
                {
                    eqp = InputMart.Instance.MicronBEAssyEqp[weqp.Target.EqpID];
                }

                if (eqp == null)
                {
                    return(default(Time));
                }

                MicronBEAssyBELot lot = hb as MicronBEAssyBELot;

                BEStep     step = lot.CurrentStep;
                StepMaster sm   = InputMart.Instance.StepMasterView.FindRows(step.StepID).FirstOrDefault();

                foreach (var info in InputMart.Instance.SetupInfo.DefaultView)
                {
                    if (info.LINE_ID != sm.LINE_ID)
                    {
                        continue;
                    }

                    //if (UtilityHelper.StringToEnum(info.STEP_GROUP, StepGroup.NONE) != eqp.StepGroup)
                    //    continue;

                    //if (LikeUtility.Like(eqp.EqpModel, info.EQP_MODEL) == false)
                    //    continue;

                    double setupTimeBySec = (double)info.SETUP_TIME;
                    return(Time.FromSeconds(setupTimeBySec));
                }

                return(default(Time));
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(Time));
            }
        }
예제 #19
0
        public static List <MicronBEAssyBELot> GetSplitLots(MicronBEAssyBELot lot, double stdLotSize)
        {
            try
            {
                List <MicronBEAssyBELot> splitLots = new List <MicronBEAssyBELot>();

                int splitQty = (int)Math.Ceiling(lot.UnitQtyDouble / stdLotSize);

                double unitQty = lot.UnitQtyDouble;

                for (int i = 1; i <= splitQty; i++)
                {
                    string splitLotID = GenerateSplitNo(lot, i);

                    double splitLotQty = stdLotSize < unitQty ? stdLotSize : unitQty;

                    MicronBEAssyBELot splitLot = lot.Clone() as MicronBEAssyBELot;
                    splitLot.LotID = splitLotID;

                    splitLot.UnitQtyDouble = splitLotQty;

                    MicronBEAssyPlanInfo plan = new MicronBEAssyPlanInfo();

                    plan.Init(splitLot.CurrentStep);
                    plan.LotID     = splitLot.LotID;
                    plan.UnitQty   = splitLot.UnitQtyDouble;
                    plan.ProductID = splitLot.Product.ProductID;
                    plan.ProcessID = splitLot.Process.ProcessID;

                    splitLot.SetCurrentPlan(plan);

                    unitQty -= splitLotQty;

                    splitLots.Add(splitLot);
                }

                return(splitLots);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #20
0
        public static MicronBEAssyProcess FindProcess(string lineID, string processID)
        {
            try
            {
                Tuple <string, string> key = Tuple.Create(lineID, processID);
                MicronBEAssyProcess    process;
                if (InputMart.Instance.MicronBEAssyProcess.TryGetValue(key, out process))
                {
                    return(process);
                }

                return(null);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #21
0
        public static void WriteUnpeg(MicronBEAssyPlanWip planWip, UnpegReason unpegReason)
        {
            try
            {
                MicronBEAssyWipInfo wipInfo = planWip.GetWipInfo();

                if (planWip.Product != null)
                {
                    WriteUnpeg(wipInfo.LineID, wipInfo.LotID, planWip.Product.ProductID,
                               planWip.MapStep.StepID, (decimal)wipInfo.UnitQty, (decimal)planWip.Qty,
                               planWip.Product.DesignID(), planWip.Product.IsBase(), wipInfo.CurrentState.ToString(),
                               unpegReason.ToString(), string.Empty);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
예제 #22
0
        public static void WriteStepTarget(Mozart.SeePlan.Pegging.PegPart pegPart, bool isOut)
        {
            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;

                foreach (MicronBEAssyBEPegTarget target in pegPart.PegTargetList)
                {
                    MicronBEAssyBEMoPlan   moPlan   = target.Mo as MicronBEAssyBEMoPlan;
                    MicronBEAssyBEMoMaster moMaster = moPlan.MoMaster as MicronBEAssyBEMoMaster;

                    StepTarget info = new StepTarget();

                    info.LINE_ID    = pp.Product.LineID;
                    info.PRODUCT_ID = pp.Product.ProductID;
                    info.PROCESS_ID = pp.CurrentStep.RouteID;
                    info.STEP_ID    = pp.CurrentStep.StepID;

                    if (isOut)
                    {
                        info.OUT_QTY = Convert.ToDecimal(target.Qty);
                    }
                    else
                    {
                        info.IN_QTY = Convert.ToDecimal(target.Qty);
                    }

                    info.TARGET_DATE   = target.DueDate;
                    info.MO_PRODUCT_ID = moPlan.ProductID;
                    info.DESIGN_ID     = pp.Product.DesignID();
                    info.DEMAND_ID     = moPlan.DemandID;
                    info.WEEK_NO       = moPlan.WeekNo;
                    info.SEQUENCE      = (pp.CurrentStep as MicronBEAssyBEStep).Sequence;
                    info.IS_BASE       = UtilityHelper.IsYN(pp.Product.IsBase());

                    OutputMart.Instance.StepTarget.Add(info);
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
예제 #23
0
            public int Compare(object x, object y)
            {
                try
                {
                    MicronBEAssyBELot lotx = null;
                    MicronBEAssyBELot loty = null;

                    int cmp = 0;

                    if (x is WorkLot && y is WorkLot)
                    {
                        WorkLot workLotx = x as WorkLot;
                        WorkLot workLoty = y as WorkLot;

                        if (cmp == 0)
                        {
                            cmp = workLotx.AvailableTime.CompareTo(workLoty.AvailableTime);
                        }

                        lotx = workLotx.Lot as MicronBEAssyBELot;
                        loty = workLoty.Lot as MicronBEAssyBELot;
                    }

                    if (x is MicronBEAssyBELot && y is MicronBEAssyBELot)
                    {
                        lotx = x as MicronBEAssyBELot;
                        loty = y as MicronBEAssyBELot;
                    }

                    if (cmp == 0)
                    {
                        cmp = lotx.LotID.CompareTo(loty.LotID);
                    }

                    return(cmp);
                }
                catch (Exception e)
                {
                    WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                    return(0);
                }
            }
예제 #24
0
        public static Product FindProduct(string lineID, string productID, bool isMcpPart = false, bool isMidPart = false, int compSeq = 1)
        {
            try
            {
                Tuple <string, string, bool, bool, int> key = new Tuple <string, string, bool, bool, int>(lineID, productID, isMcpPart, isMidPart, compSeq);

                Product product;
                if (InputMart.Instance.MicronBEProducts.TryGetValue(key, out product))
                {
                    return(product);
                }

                return(null);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #25
0
        public static AssyMcpPart GetMcpPart(this AssyMcpProduct mcpProduct, string mcpCode)
        {
            try
            {
                foreach (AssyMcpPart mcpPart in mcpProduct.AllParts)
                {
                    if (mcpPart.ProductID == mcpCode)
                    {
                        return(mcpPart);
                    }
                }

                return(null);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(null);
            }
        }
예제 #26
0
        public static void WritePeg(Mozart.SeePlan.Pegging.IMaterial m, Mozart.SeePlan.Pegging.PegTarget target, double qty)
        {
            try
            {
                MicronBEAssyPlanWip    wip    = m as MicronBEAssyPlanWip;
                MicronBEAssyBEPegPart  pp     = target.PegPart as MicronBEAssyBEPegPart;
                MicronBEAssyBEMoMaster mo     = pp.MoMaster as MicronBEAssyBEMoMaster;
                MicronBEAssyBEMoPlan   moPlan = target.MoPlan as MicronBEAssyBEMoPlan;

                PegHistory info = new PegHistory();

                info.LOT_ID        = wip.LotID;
                info.PRODUCT_ID    = wip.Product.ProductID;
                info.STEP_ID       = string.IsNullOrEmpty(wip.MapStep.StepID) ? StringUtility.IdentityNull : wip.MapStep.StepID;
                info.MAIN_QTY      = Convert.ToDecimal(wip.Wip.UnitQty);
                info.PEG_QTY       = Convert.ToDecimal(qty);
                info.LOT_STATE     = wip.Wip.CurrentState.ToString();
                info.LINE_ID       = wip.Product.LineID;
                info.MO_PRODUCT_ID = mo.Product.ProductID;
                info.DESIGN_ID     = wip.Product.DesignID();
                info.DEMAND_ID     = moPlan.DemandID;
                info.WEEK_NO       = moPlan.WeekNo;
                info.IS_BASE       = UtilityHelper.IsYN(pp.Product.IsBase());

                if (pp.Product is AssyMcpPart)
                {
                    info.COMP_SEQ = (pp.Product as AssyMcpPart).CompSeq;
                }
                else
                {
                    info.COMP_SEQ = 1;
                }


                OutputMart.Instance.PegHistory.Add(info);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
예제 #27
0
        public static DateTime GetNowDT()
        {
            try
            {
                var factory = ServiceLocator.Resolve <AoFactory>();

                if (factory == null)
                {
                    return(GetEngineStartTime());
                }

                DateTime now = factory.NowDT;

                return(now);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(DateTime));
            }
        }
예제 #28
0
        public static MicronBEAssyWorkLot CreateWorkLot(IHandlingBatch hb, Mozart.Simulation.Engine.Time availableTime, object wstepKey, Mozart.SeePlan.DataModel.Step targetStep, AoEquipment reservationEqp)
        {
            try
            {
                MicronBEAssyBELot lot = hb as MicronBEAssyBELot;

                MicronBEAssyWorkLot wLot = new MicronBEAssyWorkLot(hb, availableTime, wstepKey, targetStep);

                wLot.LotID          = lot.LotID;
                wLot.Product        = lot.Product;
                wLot.UnitQty        = lot.UnitQtyDouble;
                wLot.ReservationEqp = reservationEqp;

                return(wLot);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(MicronBEAssyWorkLot));
            }
        }
예제 #29
0
        public static SetupType CheckSetupProfile(WorkEqp weqp, Mozart.SeePlan.Simulation.IHandlingBatch hb)
        {
            try
            {
                MicronBEAssyBELot lot = hb as MicronBEAssyBELot;
                var workLots          = weqp.Step.Profiles[weqp];
                var lastLot           = workLots.Last().Lot as MicronBEAssyBELot;

                if (lastLot.Product.ProductID != lot.Product.ProductID)
                {
                    return(SetupType.PART_CHG);
                }

                return(SetupType.NONE);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(SetupType.NONE);
            }
        }
예제 #30
0
        private static void AddSteps(MicronBEAssyBatch batch, MicronBEAssyProcess proc, int seq)
        {
            try
            {
                foreach (MicronBEAssyBEStep step in proc.Steps)
                {
                    //if (step.StepGroup == StepGroup.NONE)
                    //    continue;

                    string key = step.StepID;
                    if (batch.StepList.ContainsKey(key) == false)
                    {
                        batch.StepList.Add(key, step);
                    }
                }
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }