Esempio n. 1
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="isOut"/>
        /// <param name="handled"/>
        public void WRITE_TARGET0(Mozart.SeePlan.Pegging.PegPart pegPart, bool isOut, ref bool handled)
        {
            FabPegPart pp      = pegPart as FabPegPart;
            FabStep    step    = pegPart.CurrentStage.Tag as FabStep;
            FabProduct product = pp.Product as FabProduct;

            foreach (FabPegTarget pt in pegPart.PegTargetList)
            {
                PegHelper.WriteStepTarget(pt, isOut, step.StepType);
            }
        }
Esempio n. 2
0
        public static IPockyBot CreatePockyBot(PockyBotSettings settings, IChatHelper chatHelper, IResultsUploader resultsUploader, ILoggerFactory loggerFactory)
        {
            var wrappedSettings        = new OptionsWrapper <PockyBotSettings>(settings);
            var dbContext              = DatabaseContextBuilder.BuildDatabaseContext(settings.DatabaseConnectionString);
            var pockyUserRepository    = new PockyUserRepository(dbContext);
            var configRepository       = new ConfigRepository(dbContext);
            var pegRepository          = new PegRepository(dbContext);
            var locationRepository     = new LocationRepository(dbContext);
            var userLocationRepository = new UserLocationRepository(dbContext);

            var triggerResponseTester = new TriggerResponseTester(wrappedSettings, pockyUserRepository);
            var pegRequestValidator   = new PegRequestValidator(wrappedSettings, configRepository);
            var pegHelper             = new PegHelper(configRepository);
            var pegGiver = new PegGiver(pegRepository, chatHelper);
            var directResultsMessageSender = new DirectResultsMessageSender(chatHelper.Messages);
            var pegResultsHelper           = new PegResultsHelper(configRepository, pegHelper);
            var userLocationGetter         = new UserLocationGetter(pockyUserRepository);
            var userLocationSetter         =
                new UserLocationSetter(pockyUserRepository, locationRepository, userLocationRepository, chatHelper);
            var userLocationDeleter  = new UserLocationDeleter(userLocationRepository);
            var resultsFileGenerator = new ResultsFileGenerator(pegResultsHelper, loggerFactory.CreateLogger <ResultsFileGenerator>(), resultsUploader);
            var usernameUpdater      = new UsernameUpdater(chatHelper.People, pockyUserRepository);

            var triggers = new List <ITrigger>
            {
                new Ping(),
                new Help(pockyUserRepository, wrappedSettings, configRepository),
                new Welcome(wrappedSettings, configRepository),
                new Peg(pegRequestValidator, pockyUserRepository, pegHelper, configRepository, chatHelper, pegGiver, loggerFactory.CreateLogger <Peg>()),
                new Status(pockyUserRepository, configRepository, pegHelper, loggerFactory.CreateLogger <Status>()),
                new Results(pockyUserRepository, pegResultsHelper, resultsFileGenerator, loggerFactory.CreateLogger <Results>()),
                new Finish(pockyUserRepository, pegResultsHelper, directResultsMessageSender, resultsFileGenerator, loggerFactory.CreateLogger <Finish>(), usernameUpdater),
                new Reset(pegRepository, loggerFactory.CreateLogger <Reset>()),
                new Keywords(configRepository),
                new Rotation(configRepository),
                new LocationConfig(locationRepository, pockyUserRepository),
                new UserLocation(pockyUserRepository, userLocationGetter, userLocationSetter, userLocationDeleter),
                new NumberConfig(configRepository),
                new StringConfig(configRepository),
                new RoleConfig(pockyUserRepository, chatHelper),
                new RemoveUser(pockyUserRepository, loggerFactory.CreateLogger <RemoveUser>()),
                new LocationWeight(configRepository, locationRepository),
                new Default(wrappedSettings)
            };

            return(new PockyBot(triggers, triggerResponseTester, chatHelper, loggerFactory.CreateLogger <PockyBot>()));
        }
Esempio n. 3
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public PegPart PREPARE_WIP0(PegPart pegPart, ref bool handled, PegPart prevReturnValue)
        {
            foreach (FabWipInfo wip in InputMart.Instance.FabWipInfo.Values)
            {
                FabPlanWip planWip = CreateHelper.CreatePlanWip(wip);

                //OwnerE 는 패깅하지 않음.
                if (wip.OwnerType == Constants.OwnerE)
                {
                    PegHelper.WriteUnpegHistory(planWip, wip.OwnerType);
                    continue;
                }

                InputMart.Instance.FabPlanWip.ImportRow(planWip);
            }

            return(pegPart);
        }
Esempio n. 4
0
        private void WriteUnpegHistory(FabPlanWip planWip)
        {
            if (planWip.Qty == 0)
            {
                return;
            }

            if (planWip.Qty == 0)
            {
                PegHelper.WriteUnpegHistory(planWip, "LOT_KIT_REMAIN");
            }
            else if (planWip.MapCount == 0)
            {
                PegHelper.WriteUnpegHistory(planWip, "NO TARGET");
            }
            else if (planWip.Qty > 0)
            {
                PegHelper.WriteUnpegHistory(planWip, "EXCESS");
            }
        }
Esempio n. 5
0
        /// <summary>
        /// </summary>
        /// <param name="pegPart"/>
        /// <param name="handled"/>
        /// <param name="prevReturnValue"/>
        /// <returns/>
        public PegPart BUILD_IN_PLAN0(PegPart pegPart, ref bool handled, PegPart prevReturnValue)
        {
            foreach (FabPegPart pp in (pegPart as MergedPegPart).Items)
            {
                FabProduct prod = pp.Product as FabProduct;
                FabStep    step = pp.Current.Step;

                foreach (FabPegTarget pt in pp.PegTargetList)
                {
                    PegHelper.WriteStepTarget(pt, false, Constants.IN, true);

                    if (pt.Qty > 0)
                    {
                        ShopInTarget inTarget = InputMart.Instance.ShopInTargetView.FindRows(step.ShopID, prod.ProductID, pt.CalcDate).FirstOrDefault();

                        if (inTarget == null)
                        {
                            inTarget = CreateHelper.CreateShopInTarget(pt, prod, step);
                            InputMart.Instance.ShopInTarget.Rows.Add(inTarget);
                        }

                        inTarget.TargetQty += (int)pt.CalcQty;

                        var mo = pt.MoPlan as FabMoPlan;
                        if (inTarget.Mo.Contains(mo) == false)
                        {
                            inTarget.Mo.Add(mo);
                        }

                        if (inTarget.Targets.Contains(pt) == false)
                        {
                            inTarget.Targets.Add(pt);
                        }
                    }
                }
            }

            return(pegPart);
        }
Esempio n. 6
0
 /// <summary>
 /// </summary>
 /// <param name="x"/>
 /// <param name="y"/>
 /// <returns/>
 public int COMPAREPEGTARGET(PegTarget x, PegTarget y)
 {
     return(PegHelper.ComparePegTarget(x, y));
 }
Esempio n. 7
0
 /// <summary>
 /// </summary>
 /// <param name="x"/>
 /// <param name="y"/>
 /// <returns/>
 public int COMPAREPEGPART(PegPart x, PegPart y)
 {
     return(PegHelper.ComparePegPart(x, y));
 }
Esempio n. 8
0
 /// <summary>
 /// </summary>
 /// <param name="pegPart"/>
 /// <param name="currentStep"/>
 /// <returns/>
 public Step GETPREVPEGGINGSTEP(PegPart pegPart, Step currentStep)
 {
     return(PegHelper.GetPrevPeggingStep(pegPart, currentStep));
 }
Esempio n. 9
0
 /// <summary>
 /// </summary>
 /// <param name="pegPart"/>
 /// <returns/>
 public Step GETLASTPEGGINGSTEP(Mozart.SeePlan.Pegging.PegPart pegPart)
 {
     return(PegHelper.GetLastPeggingStgep(pegPart));
 }
        public PegCommentValidatorTests()
        {
            var configRepository = Substitute.For <IConfigRepository>();

            _subject = new PegHelper(configRepository);
        }
Esempio n. 11
0
 /// <summary>
 /// </summary>
 /// <param name="target"/>
 /// <param name="m"/>
 /// <param name="qty"/>
 /// <param name="handled"/>
 public void WRITE_PEG0(Mozart.SeePlan.Pegging.PegTarget target, Mozart.SeePlan.Pegging.IMaterial m, double qty, ref bool handled)
 {
     PegHelper.WritePeg(target, m, qty);
 }
Esempio n. 12
0
 public PegHelperTests()
 {
     _configRepository = Substitute.For <IConfigRepository>();
     _subject          = new PegHelper(_configRepository);
 }