Пример #1
0
        public void NextPiece()
        {
            DateTime now = DateTime.UtcNow;
            var      job = new JobPlan("job1", 1);

            job.PartName = "part1";

            //set up a program
            var inspProg = new JobInspectionData("insp1", "counter1", 3, TimeSpan.FromHours(11));

            job.AddInspection(inspProg);

            //set the count as zero, otherwise it chooses a random
            InspectCount cnt = new InspectCount();

            cnt.Counter = "counter1";
            cnt.Value   = 0;
            cnt.LastUTC = DateTime.UtcNow.AddHours(-10);
            _insp.SetInspectCounts(new InspectCount[] { cnt });

            PalletLocation palLoc = new PalletLocation(PalletLocationEnum.Machine, "MC", 1);

            _insp.NextPieceInspection(palLoc, "insp1");
            _insp.CheckMaterialForNextPeiceInspection(palLoc, 1);

            CheckCount("counter1", 0);

            _insp.MakeInspectionDecisions(1, 1, new[] { inspProg }, now);
            CheckCount("counter1", 1);
            CheckDecision(1, "insp1", "counter1", true, now, true);
        }