Ejemplo n.º 1
0
        private string TranslateResult(PipettingResult result)
        {
            string s = "";

            switch (result)
            {
            case PipettingResult.abort:
                s = "中止!";
                break;

            case PipettingResult.air:
                s = "吸空气";
                break;

            case PipettingResult.nothing:
                s = "跳过";
                break;

            case PipettingResult.ok:
                s = "";
                break;

            case PipettingResult.zmax:
                s = "zMax";
                break;
            }
            return(s);
        }
Ejemplo n.º 2
0
 public PipettingTrackInfo(string labware, string wellID,
                           double volume, PipettingResult result, string barcode = "", bool isAsp = true)
 {
     this.labware = labware;
     this.wellID  = wellID;
     this.volume  = volume;
     this.result  = result;
     this.isAsp   = isAsp;
     this.barcode = barcode;
 }
Ejemplo n.º 3
0
        public void Dispense(string labwareLabel, List <int> wellIDs, List <double> volumes, LiquidClass liquidClass, out PipettingResult pipettingResult, string barcode = "")
        {
            int    wellID       = wellIDs.First();
            double volume       = Math.Round(volumes.First(), 1);
            string sWellID      = wellID.ToString();
            string sCommandDesc = string.Format("Dispense to:{0} at:{1} volume:{2},{3}", labwareLabel, wellID, volume, liquidClass);

            log.InfoFormat(sCommandDesc);

            //air gap
            int airGap = liquidClass.AspirationSinglePipetting.TrailingAirgap + liquidClass.AspirationSinglePipetting.LeadingAirgap;

            volume += airGap;

            Move2Position(labwareLabel, wellID);
            Move2Position(labwareLabel, wellID, "ZDispense");
            var res = MoveController.Instance.Dispense(volume, maxSpeedV, startSpeedV, endSpeedV);

            pipettingResult = res == e_RSPErrorCode.RSP_ERROR_NONE ? PipettingResult.ok : PipettingResult.abort;
            PipettingTrackInfo pipettingTrackInfo = new PipettingTrackInfo(labwareLabel, sWellID, volume, pipettingResult, barcode, false);

            ThrowCriticalException(res, "喷液");
            Move2Position(labwareLabel, wellID);
        }
Ejemplo n.º 4
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;
            }
        }
Ejemplo n.º 5
0
        public void Aspirate(string labwareLabel, List <int> wellIDs, List <double> volumes, LiquidClass liquidClass, out PipettingResult pipettingResult, string barcode = "")
        {
            string errMsg = "";

            pipettingResult = PipettingResult.ok;
            int    wellID        = wellIDs.First();
            double volume        = volumes.First();
            double leadingAirGap = liquidClass.AspirationSinglePipetting.LeadingAirgap;
            string sCommandDesc  = string.Format("Aspirate volume:{0} from:{1} in:{2},lc:{3}", volume, wellID, labwareLabel, liquidClass.SaveName);

            log.Info(sCommandDesc);
            Move2Position(labwareLabel, wellID);
            var labware = layout.FindLabware(labwareLabel);

            Move2Position(labwareLabel, wellID, "ZStart");
            //aspirate air gap
            var res = MoveController.Instance.Aspirate(leadingAirGap, maxSpeedV, startSpeedV, endSpeedV);

            ThrowCriticalException(res, "吸液");

            int speedMMPerSecond = 30;

            res = MoveController.Instance.DetectLiquid(labware.ZValues.ZStart, labware.ZValues.ZMax, speedMMPerSecond);
            ThrowCriticalException(res, "液面检测移动");
            MoveController.Instance.StopLiquidDetection();
            //检测不到或液体不够,循环询问,
            double z               = MoveController.Instance.GetZPos(_eARM.左臂);
            bool   bok             = z < labware.ZValues.ZMax;
            bool   hasEnoughLiquid = false;

            if (bok)
            {
                hasEnoughLiquid = IsEnoughLiquid(labware, volume, liquidClass.AspirationSinglePipetting.SubMergeMM);
                if (!hasEnoughLiquid)
                {
                    bok = false;
                }
            }

            if (!bok)
            {
                string            title = !hasEnoughLiquid ? "液体不足" : "";
                LiquidNotDetected liquidNotDetectForm = new LiquidNotDetected(title);
                liquidNotDetectForm.ShowDialog();
                var userSelection = liquidNotDetectForm.UserSelection;


                switch (userSelection)
                {
                case NextActionOfNoLiquid.abort:
                    pipettingResult = PipettingResult.abort;
                    errMsg          = "无法检测到液体,放弃运行程序!";
                    log.Error(errMsg);
                    throw new CriticalException(errMsg);

                case NextActionOfNoLiquid.aspirateAir:
                    pipettingResult = PipettingResult.air;
                    Move2Position(labwareLabel, wellID);
                    res = MoveController.Instance.Aspirate(volumes.First(), maxSpeedV, startSpeedV, endSpeedV);
                    ThrowCriticalException(res, "吸空气");
                    break;

                case NextActionOfNoLiquid.gotoZMax:
                    Move2Position(labwareLabel, wellID, "ZMax");
                    pipettingResult = PipettingResult.zmax;
                    res             = MoveController.Instance.Aspirate(volumes.First(), maxSpeedV, startSpeedV, endSpeedV);
                    ThrowCriticalException(res, "ZMax吸液体");
                    break;

                case NextActionOfNoLiquid.retry:
                    log.Debug("retry liquid detection");
                    break;

                case NextActionOfNoLiquid.skip:
                    log.Info("Skipped the pipetting");
                    pipettingResult = PipettingResult.nothing;
                    return;
                }
            }
            else //tracking 吸液
            {
                DoTracking(labware, volume, liquidClass);
            }

            res = MoveController.Instance.Aspirate(volume + excessVolume, liquidClass.AspirationSinglePipetting.AspirationSpeed, startSpeedV, endSpeedV);
            if (res == e_RSPErrorCode.RSP_ERROR_NONE)
            {
                pipettingResult = PipettingResult.ok;
            }
            else if (res == e_RSPErrorCode.凝块)
            {
                ProcessClot(labware, wellID, volume, liquidClass, out pipettingResult, barcode);
            }
            else if (res == e_RSPErrorCode.泡沫)
            {
                //currently ignore, just mark the result
                pipettingResult = PipettingResult.bubble;
            }
            else
            {
                ThrowCriticalException(res, "吸液");
                res = MoveController.Instance.Dispense(excessVolume, liquidClass.AspirationSinglePipetting.AspirationSpeed, startSpeedV, endSpeedV);
                ThrowCriticalException(res, "喷液");
                //到zStart吸 trailing airGap
                Move2Position(labwareLabel, wellID, "ZStart");
                double trailingAirGap = liquidClass.AspirationSinglePipetting.TrailingAirgap;
                MoveController.Instance.Aspirate(trailingAirGap, liquidClass.AspirationSinglePipetting.AspirationSpeed, startSpeedV, endSpeedV);
                //delay
                int delayMS = liquidClass.AspirationSinglePipetting.Delay;
                Thread.Sleep(delayMS);
            }


            //Move 2 ZTravel
            Move2Position(labwareLabel, wellID);
        }
Ejemplo n.º 6
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);
        }