示例#1
0
        //–  Dispense back into vessel and then pipette nothing
        //–  Ignore clot error and continue
        //–  Discard the DITI and pipette nothing

        private void ProcessClot(Labware labware, int wellID, double volume, LiquidClass liquidClass, out PipettingResult pipettingResult, string barcode = "")
        {
            string           labwareLabel = labware.Label;
            ClotDetectedForm clotForm     = new ClotDetectedForm();

            clotForm.ShowDialog();
            e_RSPErrorCode res           = e_RSPErrorCode.RSP_ERROR_NONE;
            var            userSelection = clotForm.UserSelection;

            pipettingResult = PipettingResult.ok;
            DitiTrackInfo trackInfo = new DitiTrackInfo(Labware.WasteLabel, 1, true, false);

            switch (userSelection)
            {
            case ClotDetectedAction.dispenseBackThenDropDiti:
                pipettingResult = PipettingResult.clotDispenseBack;
                res             = MoveController.Instance.Move2Z(_eARM.左臂, labware.ZValues.ZDispense);
                ThrowCriticalException(res, "遇到凝块,移动到ZDispense");
                res = MoveController.Instance.Dispense(volume + excessVolume, liquidClass.AspirationSinglePipetting.AspirationSpeed, startSpeedV, endSpeedV);
                ThrowCriticalException(res, "遇到凝块,打回容器");
                DropTip(out trackInfo);
                break;

            case ClotDetectedAction.dropDiti:
                pipettingResult = PipettingResult.clotDropDiti;
                DropTip(out trackInfo);
                break;

            case ClotDetectedAction.ignore:
                pipettingResult = PipettingResult.clotIgnore;
                break;
            }
        }
示例#2
0
 public void GetTip(List <int> tipIDs, DitiType ditiType, out DitiTrackInfo trackInfos)
 {
     //throw new NotImplementedException();
     Debug.WriteLine("Get tip:{0}", tipIDs.First());
     trackInfos   = new Core.Data.DitiTrackInfo("diti1", tipID++, true);
     isTipMounted = true;
     Delay();
 }
示例#3
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);
                }
            }
        }
示例#4
0
        public void DropTip(out DitiTrackInfo ditiTrackInfo)
        {
            string sCommandDesc = "丢弃枪头";

            log.Debug(sCommandDesc);
            var position = layout.GetWastePosition();

            xyz.X = position.X;
            xyz.Y = position.Y;
            Move2XYZ(xyz);
            string errMsg = "";

            while (true)
            {
                var  res = MoveController.Instance.DropDiti();
                bool bok = res == e_RSPErrorCode.RSP_ERROR_NONE;
                log.DebugFormat("丢弃枪头:{0}", bok ? success : fail);
                ditiTrackInfo = new DitiTrackInfo(Labware.WasteLabel, 1, bok, false);
                if (bok)
                {
                    bok = !MoveController.Instance.IsTipMounted;
                }

                if (bok)
                {
                    break;
                }

                DitiNotDropped ditiNotDroppedForm = new DitiNotDropped();
                ditiNotDroppedForm.ShowDialog();
                var userSelection = ditiNotDroppedForm.UserSelection;
                switch (userSelection)
                {
                case DitiNotDroppedAction.abort:
                    errMsg = "无法丢弃枪头,放弃运行程序!";
                    log.Error(errMsg);
                    throw new CriticalException(errMsg);

                default:
                    break;
                }
            }
        }
示例#5
0
        private bool RunLihaCommand(ILiquidHandlerCommand machineCommand)
        {
            if (hardwareController.Liha.IsTipMounted)
            {
                DitiTrackInfo trackInfo = null;
                hardwareController.Liha.DropTip(out trackInfo);
            }


            LihaCommand   lihaCommand    = machineCommand as LihaCommand;
            DitiTrackInfo ditiTrackInfos = null;

            hardwareController.Liha.GetTip(new List <int>()
            {
                1
            }, lihaCommand.ditiType, out ditiTrackInfos);

            OnCommandExecuted(ditiTrackInfos);
            if (NeedPauseOrStop())
            {
                return(true);
            }
            var liquidClass = PipettorElementManager.Instance.LiquidClasses.First(x => x.SaveName == lihaCommand.liquidClass);

            PipettingResult pipettingResult = PipettingResult.ok;

            hardwareController.Liha.Aspirate(lihaCommand.srcLabware, new List <int>()
            {
                lihaCommand.srcWellID
            }, new List <double>()
            {
                lihaCommand.volume
            }, liquidClass, out pipettingResult);
            PipettingTrackInfo aspTrackInfo = new PipettingTrackInfo(lihaCommand.srcLabware, LihaCommand.GetWellDesc(lihaCommand.srcWellID), lihaCommand.volume, pipettingResult, lihaCommand.barcode);

            OnCommandExecuted(aspTrackInfo);

            if (NeedPauseOrStop())
            {
                return(true);
            }
            if (pipettingResult == PipettingResult.ok ||
                pipettingResult == PipettingResult.air ||
                pipettingResult == PipettingResult.clotIgnore ||
                pipettingResult == PipettingResult.zmax)
            {
                pipettingResult = PipettingResult.ok;
                hardwareController.Liha.Dispense(lihaCommand.dstLabware, new List <int>()
                {
                    lihaCommand.dstWellID
                }, new List <double>()
                {
                    lihaCommand.volume
                }, liquidClass, out pipettingResult);
                var dispTrackInfo = new PipettingTrackInfo(lihaCommand.dstLabware, LihaCommand.GetWellDesc(lihaCommand.dstWellID), lihaCommand.volume, pipettingResult, lihaCommand.barcode, false);
                OnCommandExecuted(dispTrackInfo);
            }

            if (NeedPauseOrStop())
            {
                return(true);
            }
            DitiTrackInfo ditiTrackInfo = null;

            hardwareController.Liha.DropTip(out ditiTrackInfo);
            OnCommandExecuted(ditiTrackInfo);
            return(false);
        }