コード例 #1
0
ファイル: Parse082.cs プロジェクト: s1366560/hrd_bio
        void RgtWarning(int d, int p)
        {
            RGTPOSManager       RGTPOSMgr       = new RGTPOSManager();
            AssayRunParaService AssayRunParaSer = new AssayRunParaService();
            RunService          RunSer          = new RunService();
            TroubleLogService   TroubleLogSer   = new TroubleLogService();

            int rgtwarncount  = RunSer.GetRgtWarnCount();
            int rgtleastcount = RunSer.GetRgtLeastCount();

            RGTPosition rgp = RGTPOSMgr.Get(1, p.ToString());

            if (rgp != null)
            {
                AssayRunPara arp = AssayRunParaSer.Get(rgp.Assay) as AssayRunPara;
                int          c   = 0;
                int          v   = rgp.CType.Volume * rgp.ValidPercent / 100 * 1000;
                switch (rgp.AssayPara)
                {
                case "R1":
                    c = arp.R1Vol == 0 ? 0 : v / arp.R1Vol;
                    if (c < rgtleastcount)
                    {
                        if (RunSer.IsMutiRgtEnable() == true)    //多试剂位开关标志
                        {
                            RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                            if (mrgt != null)
                            {
                                RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                if (RunSer.IsLockRgtEnable() == true)
                                {
                                    rgp.IsLocked = true;
                                    RGTPOSMgr.UpdateLockState(rgp);

                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.WARN;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                                else
                                {
                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.ERR;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                            }
                        }
                        else
                        {
                            if (RunSer.IsLockRgtEnable() == true)
                            {
                                rgp.IsLocked = true;
                                RGTPOSMgr.UpdateLockState(rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.ERR;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                        }
                    }

                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}项目{1}:试剂1余量即将耗尽. ", p, rgp.Assay);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;

                case "R2":
                    c = arp.R2Vol == 0 ? 0 : v / arp.R2Vol;
                    if (c < rgtleastcount)
                    {
                        if (RunSer.IsMutiRgtEnable() == true)    //多试剂位开关标志
                        {
                            RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                            if (mrgt != null)
                            {
                                RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                if (RunSer.IsLockRgtEnable() == true)
                                {
                                    rgp.IsLocked = true;
                                    RGTPOSMgr.UpdateLockState(rgp);

                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.WARN;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                                else
                                {
                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.ERR;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                            }
                        }
                        else
                        {
                            if (RunSer.IsLockRgtEnable() == true)
                            {
                                rgp.IsLocked = true;
                                RGTPOSMgr.UpdateLockState(rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.ERR;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                        }
                    }
                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}项目{1}:试剂2余量即将耗尽. ", p, rgp.Assay);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;
                }
            }
        }
コード例 #2
0
ファイル: HCReagentBarcode.cs プロジェクト: s1366560/hrd_bio
        void DoSaveAssayRunPara(ReagentItem ReagentItem)
        {
            //加载测试参数
            AssayRunPara a = new AssayRunPara();

            a.Name     = ReagentItem.ItemName;
            a.FullName = ReagentItem.LongName;
            //分析方法
            a.AnalyzeMethod = ReagentItem.AnalyzeMethod;
            //第一测试点S
            a.FirstPointS = ReagentItem.FirstPointS;
            //第一测试点E
            a.FirstPointE = ReagentItem.FirstPointE;
            //第二测试点S
            a.SecondPointS = ReagentItem.SecondPointS;
            //第二测试点E
            a.SecondPointE = ReagentItem.SecondPointE;
            //主波长
            a.MainWaveLength = ReagentItem.MainWaveLength;
            //次波长
            a.SubWaveLength = ReagentItem.SubWaveLength;
            //测试次数
            a.DoCount = ReagentItem.DoCount;
            //质控间隔
            a.QCSpace = ReagentItem.QCSpace;
            //定标次数
            a.SDTCount = ReagentItem.SDTCount;
            //试剂1体积
            a.R1Vol = ReagentItem.R1Vol;
            //试剂2体积
            a.R2Vol = ReagentItem.R2Vol;
            //样本反应体积
            a.SerumIncreaseVol.VolPre = ReagentItem.IncreaseVol;
            a.SerumIncreaseVol.VolAft = 0;
            a.SerumIncreaseVol.VolDil = 0;
            a.SerumNormalVol.VolPre   = ReagentItem.NormalVol;
            a.SerumNormalVol.VolAft   = 0;
            a.SerumNormalVol.VolDil   = 0;
            a.SerumDecreaseVol.VolPre = ReagentItem.DecreaseVol;
            a.SerumDecreaseVol.VolAft = 0;
            a.SerumDecreaseVol.VolDil = 0;
            a.UrineIncreaseVol.VolPre = ReagentItem.IncreaseVol;
            a.UrineIncreaseVol.VolAft = 0;
            a.UrineIncreaseVol.VolDil = 0;
            a.UrineNormalVol.VolPre   = ReagentItem.NormalVol;
            a.UrineNormalVol.VolAft   = 0;
            a.UrineNormalVol.VolDil   = 0;
            a.UrineDecreaseVol.VolPre = ReagentItem.DecreaseVol;
            a.UrineDecreaseVol.VolAft = 0;
            a.UrineDecreaseVol.VolDil = 0;
            a.SDTVol.VolPre           = ReagentItem.SDTVol;
            a.SDTVol.VolAft           = 0;
            a.SDTVol.VolDil           = 0;
            //反应方向
            a.ReacteDirect = ReagentItem.ReacteDirect;
            //搅拌强度
            a.Stiring1Force = ReagentItem.Stiring1Force;
            a.Stiring2Force = ReagentItem.Stiring2Force;
            //显示顺序
            int m = new RGTPOSManager().GetReagentMode();

            AssayRunPara a1 = new AssayRunParaService().Get(ReagentItem.ItemName) as AssayRunPara;

            if (a1 != null && a1.DisplaySQ <= 0)
            {
                new AssayRunParaService().Delete(a1.DisplaySQ);
            }
            a1 = new AssayRunParaService().Get(ReagentItem.ItemName) as AssayRunPara;
            if (a1 == null)
            {
                for (int i = 1; i <= 120; i++)
                {
                    AssayRunPara e = new AssayRunParaService().Get(i) as AssayRunPara;
                    if (e == null)
                    {
                        if (m == 3)
                        {
                            List <int> itemnumbers = new RGTPOSManager().GetReagentNumbers();
                            bool       isflag      = false;
                            foreach (int ie in itemnumbers)
                            {
                                if (ie == i)
                                {
                                    isflag = true;
                                }
                            }

                            if (isflag == true)
                            {
                                continue;
                            }
                            else
                            {
                                a.DisplaySQ = i;
                                break;
                            }
                        }


                        if (m == 2)
                        {
                            a.DisplaySQ = i;
                            break;
                        }
                    }
                }
            }
            else
            {
                a.DisplaySQ = a1.DisplaySQ;
            }

            new AssayRunParaService().Delete(ReagentItem.ItemName);
            new AssayRunParaService().Delete(a.DisplaySQ);
            new AssayRunParaService().Save(a);
        }