コード例 #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
        void RgtWarning(int d, int p)
        {
            RGTPOSManager     RGTPOSMgr     = new RGTPOSManager();
            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)
            {
                int c = 0;
                int v = rgp.CType.Volume * rgp.ValidPercent / 100 * 1000;
                switch (rgp.AssayPara)
                {
                case "R1":
                    c = v / 250;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000772";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        TroubleLogSer.Save(trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;

                case "R2":
                    c = v / 150;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000774";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        TroubleLogSer.Save(trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;
                }
            }
        }