Exemplo n.º 1
0
        public void Use3DitiBoxes()
        {
            var           layout        = CreateDitiLayout();
            DitiInfo      ditiInfo      = new DitiInfo();
            TipManagement tipManagement = new TipManagement(layout);

            try
            {
                for (int i = 0; i < 96 * 3; i++)
                {
                    tipManagement.GetTip(DitiType.OneK, 1);
                }
                try
                {
                    tipManagement.GetTip(DitiType.OneK, 1);
                }
                catch (NoEngouhDitiException ex)
                {
                    layout.DitiInfo.DitiBoxInfos[0].count = 96;
                    tipManagement.GetTip(DitiType.OneK, 1);
                    Assert.AreEqual(layout.DitiInfo.DitiBoxInfos[0].count, 95);
                    Assert.AreEqual(tipManagement.GetCurrentDitiBox(DitiType.OneK).Label, "diti1");
                    return;
                }
            }
            catch (NoEngouhDitiException ex)
            {
                Assert.AreEqual(ex.LabwareTrait.Label, "diti2");
                Assert.AreEqual(tipManagement.GetCurrentDitiBox(DitiType.OneK), "diti2");
                return;
            }

            Assert.Fail();
        }
Exemplo n.º 2
0
        public void GetTip(List <int> tipIDs, DitiType ditiType, out DitiTrackInfo trackInfo)
        {
            string sCommandDesc = string.Format("从ditibox:{0}中取枪头,还剩:{1}",
                                                tipManagement.GetCurrentDitiBox(ditiType),
                                                tipManagement.GetCurrentDitiID(ditiType));

            log.Debug(sCommandDesc);
            string errDes = "只支持单针!";

            if (tipIDs.Count != 1)
            {
                log.Error(errDes);
                throw new Exception(errDes);
            }

            var tuple   = Move2NextTipPosition(DitiType.OneK);
            var ditiBox = tuple.Item1;

            //zDistanceFetchTip = ditiBox.ZValues.ZMax - ditiBox.ZValues.ZStart;
            //get tip
            while (true)
            {
                bool bok = TryGetTip(ditiBox.ZValues.ZMax);

                log.DebugFormat("获取枪头:{0}", bok ? success:fail);
                trackInfo = new DitiTrackInfo(tipManagement.GetCurrentDitiBox(ditiType).Label, tipManagement.GetCurrentDitiID(ditiType), bok);
                if (bok)
                {
                    break;
                }
                TipNotFetched tipNotFetched = new TipNotFetched();
                tipNotFetched.ShowDialog();
                if (tipNotFetched.UserSelection == NextActionOfNoTip.abort)
                {
                    errDes = "取不到枪头,放弃运行程序!";
                    log.Error(errDes);
                    throw new CriticalException(errDes);
                }

                else if (tipNotFetched.UserSelection == NextActionOfNoTip.retryNextPosition)
                {
                    tuple = Move2NextTipPosition(DitiType.OneK);
                }
                else
                {
                    Move2SearchTipPosition(tuple);
                }
            }
        }
Exemplo n.º 3
0
        public void NextBoxHasTips_Diti1000Diti200Mix() //when one diti box has run out, go to next,
        {
            //TipManagement

            Layout        layout        = CreateDitiLayoutMix();
            TipManagement tipManagement = new TipManagement(layout);

            for (int i = 0; i < 97; i++)
            {
                tipManagement.GetTip(DitiType.OneK, 1);
            }
            string currentDitiBox = tipManagement.GetCurrentDitiBox(DitiType.OneK).Label;

            Assert.AreEqual("diti3", currentDitiBox);
        }
Exemplo n.º 4
0
        public void AllDitiBoxRunOutStartsFromFirst()
        {
            var           layout        = CreateDitiLayout();
            TipManagement tipManagement = new TipManagement(layout);

            try
            {
                for (int i = 0; i < 96 * 3 + 1; i++)
                {
                    tipManagement.GetTip(DitiType.OneK, 1);
                }
            }
            catch (NoEngouhDitiException ex)
            {
                Assert.AreEqual("diti1", ex.LabwareTrait.Label);
                Assert.AreEqual("diti1", tipManagement.GetCurrentDitiBox(DitiType.OneK).Label);
                return;
            }
            Assert.Fail();
        }