Exemple #1
0
        /// <summary>计算峰列表中每个有效峰的相对校正因子</summary>
        /// <param name="std_peak_list">标准峰对象列表</param>
        /// <param name="qm">响应值类型选择</param>
        /// <returns>QualitativeErrorInfo枚举值</returns>
        public static QualitativeErrorInfo GetAdjustFactor(List <Peak> std_peak_list, PeakQuantificationMethod.QualitativeMethod qm)
        {
            QualitativeErrorInfo _rc = QualitativeErrorInfo.Success;
            double _factor           = 0.0;

            if (std_peak_list == null)
            {
                return(QualitativeErrorInfo.PeakListError);
            }

            //至少包含一个内标物和被测物
            if (std_peak_list.Count < 2)
            {
                return(QualitativeErrorInfo.PeakListError);
            }

            //查找内标物
            Peak _internal_standard_peak = std_peak_list.Find(CPeakFilter.FindInternalStandardPeak);

            if (_internal_standard_peak == null)
            {
                return(QualitativeErrorInfo.InternalStandardError);
            }

            //计算内标物的绝对校正因子
            _rc = CQuantificationBase.ComputeAbsoluteAdjustFactor(_internal_standard_peak, qm, ref _factor);
            if (_rc != QualitativeErrorInfo.Success)
            {
                return(QualitativeErrorInfo.InternalStandardError);
            }

            _internal_standard_peak.AdjustFactor = _factor;

            //计算未知物的校正因子(注意未知物列表要剔除内标物)
            foreach (Peak _p in std_peak_list)
            {
                if (!CPeakFilter.FindCheckedPeak(_p) || ((_p.InternalStandard != null) && (_p.InternalStandard != "")))
                {
                    continue;
                }

                _factor = 0.0;

                _rc = CQuantificationBase.ComputeRelativeAdjustFactor(_p, _internal_standard_peak, qm, ref _factor);
                if (_rc == QualitativeErrorInfo.Success)
                {
                    _p.AdjustFactor = _factor;
                }
            }

            return(_rc);
        }
Exemple #2
0
 /// <summary>获取校准曲线方程</summary>
 /// <param name="coefficient">系数</param>
 /// <param name="pqm">定量参数</param>
 /// <returns>校准曲线方程字符串</returns>
 public static string GetFittingFormula(List <double> coefficient, PeakQuantificationMethod pqm)
 {
     return(CQuantificationBase.GetFittingFormula(coefficient, pqm));
 }