Beispiel #1
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public TimeSpan GET_TAT0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, TimeSpan prevReturnValue)
        {
            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;
                StepTat stepTat          = FindHelper.FindTAT(pp.Product.ProductID, pp.CurrentStep.StepID, pp.Product.LineID);

                if (stepTat == null)
                {
                    return(TimeSpan.FromSeconds(0));
                }

                double tat = 0;
                if (isRun)
                {
                    tat = (double)stepTat.RUN_TAT;
                }
                else
                {
                    tat = (double)stepTat.WAIT_TAT;
                }

                return(TimeSpan.FromSeconds(tat));
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(TimeSpan));
            }
        }
Beispiel #2
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IList <Mozart.SeePlan.Pegging.IMaterial> GET_ACTS0(Mozart.SeePlan.Pegging.PegPart pegPart, ref bool handled, IList <IMaterial> prevReturnValue)
        {
            List <IMaterial> list = new List <IMaterial>();

            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;

                foreach (MicronBEAssyPlanWip wip in InputMart.Instance.MicronBEAssyActPlanWips.Values)
                {
                    if (wip.GetWipInfo().WipProductID != pp.Product.ProductID || wip.GetWipInfo().LineID != pp.Product.LineID)
                    {
                        continue;
                    }

                    list.Add(wip);
                }
            }

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

            return(list);
        }
Beispiel #3
0
        public static void WriteActPeg(Mozart.SeePlan.Pegging.PegTarget target, Mozart.SeePlan.Pegging.IMaterial m, double qty)
        {
            try
            {
                MicronBEAssyPlanWip    wip = m as MicronBEAssyPlanWip;
                MicronBEAssyBEPegPart  pp  = target.PegPart as MicronBEAssyBEPegPart;
                MicronBEAssyBEMoMaster mo  = pp.MoMaster as MicronBEAssyBEMoMaster;

                PegHistory info = new PegHistory();

                info.LOT_ID        = LotType.ACT.ToString();
                info.LINE_ID       = wip.GetWipInfo().LineID;
                info.PRODUCT_ID    = wip.GetWipInfo().WipProductID;
                info.MAIN_QTY      = Convert.ToDecimal(wip.GetWipInfo().UnitQty);
                info.PEG_QTY       = Convert.ToDecimal(qty);
                info.STEP_ID       = StringUtility.IdentityNull;
                info.MO_PRODUCT_ID = mo.Product.ProductID;
                info.LOT_STATE     = StringUtility.IdentityNull;

                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));
            }
        }
Beispiel #4
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public object GET_STEP_PLAN_KEY0(PegPart pegPart, ref bool handled, object prevReturnValue)
        {
            MicronBEAssyBEPegPart          pp  = pegPart as MicronBEAssyBEPegPart;
            Tuple <string, string, string> key = Tuple.Create(pp.Product.LineID, pp.CurrentStep.StepID, pp.Product.ProductID);

            return(key);
        }
Beispiel #5
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public PegPart PREPARE_TARGET0(PegPart pegPart, ref bool handled, PegPart prevReturnValue)
        {
            try
            {
                MergedPegPart mp = pegPart as MergedPegPart;

                foreach (MicronBEAssyBEMoMaster moMaster in InputMart.Instance.MicronBEAssyBEMoMaster.Values)
                {
                    MicronBEAssyBEPegPart pp = new MicronBEAssyBEPegPart(moMaster, moMaster.Product);

                    foreach (MicronBEAssyBEMoPlan moPlan in moMaster.MoPlanList)
                    {
                        MicronBEAssyBEPegTarget target = new MicronBEAssyBEPegTarget(pp, moPlan);
                        pp.AddPegTarget(target);
                    }

                    mp.Merge(pp);
                }

                return(mp);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(PegPart));
            }
        }
Beispiel #6
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public List <object> GET_PART_CHANGE_INFOS0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, List <object> prevReturnValue)
        {
            try
            {
                MicronBEAssyBEStep    currentStep = pegPart.CurrentStep as MicronBEAssyBEStep;
                MicronBEAssyBEPegPart pp          = pegPart as MicronBEAssyBEPegPart;
                List <object>         list        = new List <object>();

                if (isRun)
                {
                    if (pp.Product is AssyMcpProduct)
                    {
                        AssyMcpProduct mcpProduct = pp.Product as AssyMcpProduct;

                        string stepID = string.Empty;
                        if (mcpProduct.HasPrevs && mcpProduct.Prevs.ElementAt(0) is AssyMcpPart)
                        {
                            stepID = (mcpProduct.Prevs.ElementAt(0) as AssyMcpPart).PartChangeStep;
                        }

                        if (stepID == currentStep.StepID)
                        {
                            list.AddRange(mcpProduct.Prevs);
                        }
                    }
                    else if (pp.Product is AssyMcpPart)
                    {
#if DEBUG
                        if (currentStep.StepID == "DIE ATTACH")
                        {
                            Console.WriteLine();
                        }
#endif
                        AssyMcpPart mcpPart = pp.Product as AssyMcpPart;

                        if (mcpPart.IsMidPart)
                        {
                            string stepID = string.Empty;
                            if (mcpPart.HasPrevs && mcpPart.Prevs.ElementAt(0) is AssyMcpPart)
                            {
                                stepID = (mcpPart.Prevs.ElementAt(0) as AssyMcpPart).PartChangeStep;
                            }

                            if (stepID == currentStep.StepID)
                            {
                                list.AddRange(mcpPart.Prevs);
                            }
                        }
                    }
                }

                return(list);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(new List <object>());
            }
        }
Beispiel #7
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="partChangeInfo"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public PegPart APPLY_PART_CHANGE_INFO0(PegPart pegPart, object partChangeInfo, bool isRun, ref bool handled, PegPart prevReturnValue)
        {
            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;

                pp.Product = partChangeInfo as Product;

#if DEBUG
                if (pp.Product.ProductID == "328622")
                {
                    Console.WriteLine();
                }
#endif

                AssyMcpPart mcpPart = pp.Product as AssyMcpPart;

                BEStep step = null;

                if (mcpPart.FinalProduct == null)
                {
                    return(pegPart);
                }

                if (mcpPart.FinalProduct.MaxSequence == 1 || mcpPart.IsMidPart)
                {
                    step = pp.Product.Process.FindStep(pp.CurrentStep.StepID);
                }
                else
                {
                    step = pp.Product.Process.LastStep;
                }

                pp.CurrentStep = step;

                if (mcpPart.IsMidPart == false)
                {
                    foreach (PegTarget target in pp.PegTargetList)
                    {
                        target.Qty = target.Qty * mcpPart.CompQty;
                    }
                }

                return(pp);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(pegPart);
            }
        }
Beispiel #8
0
 /// <summary>
 /// </summary>
 /// <param name="pegPart"/>
 /// <param name="handled"/>
 /// <param name="prevReturnValue"/>
 /// <returns/>
 public double GET_YIELD0(Mozart.SeePlan.Pegging.PegPart pegPart, ref bool handled, double prevReturnValue)
 {
     try
     {
         MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;
         double yield             = FindHelper.FindYield(pp.Product.ProductID, pp.CurrentStep.StepID, pp.Product.LineID);
         return(yield);
     }
     catch (Exception e)
     {
         WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
         return(1d);
     }
 }
Beispiel #9
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <returns/>
        public Step GETLASTPEGGINGSTEP(Mozart.SeePlan.Pegging.PegPart pegPart)
        {
            try
            {
                MicronBEAssyBEPegPart pp      = pegPart as MicronBEAssyBEPegPart;
                MicronBEAssyProcess   process = pp.Product.Process as MicronBEAssyProcess;

                return(process.LastStep);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(Step));
            }
        }
Beispiel #10
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));
            }
        }
Beispiel #11
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <returns/>
        public PegPart UPDATE_TARGET_INFO(PegPart pegPart)
        {
            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;
                BEStep step = pp.Product.Process.FindStep(pp.CurrentStep.StepID);

                if (pp.Product is AssyMcpPart)
                {
                    AssyMcpPart mcpPart = pp.Product as AssyMcpPart;
                }

                return(pp);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(PegPart));
            }
        }
Beispiel #12
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));
            }
        }
Beispiel #13
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isRun"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public IList <Mozart.SeePlan.Pegging.IMaterial> GET_WIPS0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isRun, ref bool handled, IList <IMaterial> prevReturnValue)
        {
            try
            {
                MicronBEAssyBEPegPart pp = pegPart as MicronBEAssyBEPegPart;

                List <IMaterial> wips = new List <IMaterial>();

                ICollection <MicronBEAssyPlanWip> wipList = null;
                if (InputMart.Instance.MicronBEAssyPlanWip.TryGetValue(pegPart.CurrentStep.StepID, out wipList))
                {
                    foreach (MicronBEAssyPlanWip wip in wipList)
                    {
                        if (wip.Qty <= 0)
                        {
                            continue;
                        }

                        if (isRun)
                        {
                            if (wip.Wip.CurrentState != EntityState.RUN)
                            {
                                continue;
                            }
                        }
                        else
                        {
                            if (wip.Wip.CurrentState == EntityState.RUN)
                            {
                                continue;
                            }
                        }

                        if (pp.CurrentStep.StepID == Constants.LOTSRECEIVED)
                        {
#if DEBUG
                            if (pp.Product.HasPrevs && pp.Product.Prevs.Contains(wip.Product))
                            {
                                Console.WriteLine();
                            }
#endif

                            if (pp.Product.ProductID == wip.Product.ProductID ||
                                (pp.Product.HasPrevs && pp.Product.Prevs.Contains(wip.Product)))
                            {
                                wip.MapCount++;
                                wips.Add(wip);
                            }
                        }
                        else
                        {
                            if (pp.Product.ProductID == wip.Product.ProductID)
                            {
                                wip.MapCount++;
                                wips.Add(wip);
                            }
                        }
                    }
                }

                return(wips);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
                return(default(IList <Mozart.SeePlan.Pegging.IMaterial>));
            }
        }