public static QualitativeErrorInfo QA_CreateCalibrationCoeff(List <PeakAndPointList> standard_papl, List <Peak> peak_param, AnalyzerMethod am) { if ((standard_papl == null) || (standard_papl.Count == 0) || (peak_param == null) || (peak_param.Count == 0)) { return(QualitativeErrorInfo.PeakListError); } QualitativeErrorInfo _rc = QualitativeErrorInfo.Success; //计算标样的峰信息 foreach (PeakAndPointList _papl in standard_papl) { _rc = CCalculationFactory.ComputePeakInfo(_papl.PeakList, _papl.PointList, am.CalculationMethod); if (_rc != QualitativeErrorInfo.Success) { continue; } CIdentificationFactory.Identify(peak_param, _papl.PeakList, am.IdentificationMethod); } foreach (Peak _p in peak_param) { List <Peak> _peak_list = CQuantificationFactory.GetStandardPeakList(standard_papl, _p.Name, am.QuantificationMethod); if (_peak_list == null) { continue; } _p.Coefficient = CQuantificationFactory.GetCoefficient(_peak_list, am.QuantificationMethod); if (_p.Coefficient == null) { continue; } string _fitting_formula = CQuantificationFactory.GetFittingFormula(_p.Coefficient, am.QuantificationMethod); foreach (Peak _p0 in _peak_list) { if ((_p0.InternalStandard == null) || _p0.InternalStandard.Trim() == "") { _p0.Coefficient = _p.Coefficient.GetRange(0, _p.Coefficient.Count); _p0.FittingFormula = _fitting_formula; } } } return(_rc); }
/// <summary>获取校准曲线</summary> /// <param name="standard_papl">标样列表</param> /// <param name="peak_param">峰参数</param> /// <param name="am">分析参数</param> /// <returns>QualitativeErrorInfo枚举值</returns> public static List <object> GetFittingPoint(List <PeakAndPointList> std_papl, AnalyzerMethod am) { if ((std_papl == null) || (std_papl.Count == 0)) { return(null); } List <Peak> _standard_peaks = std_papl[0].PeakList.FindAll(CPeakFilter.FindCheckedPeak); if (_standard_peaks == null) { return(null); } List <Object> _obj_list = new List <object>(); foreach (Peak _p in _standard_peaks) { List <Peak> _peak_list = CQuantificationFactory.GetStandardPeakList(std_papl, _p.Name, am.QuantificationMethod); if (_peak_list == null) { continue; } List <PointF> _point_list = CQuantificationFactory.GetCalibrationCurve(_peak_list, am.QuantificationMethod); if (_point_list == null) { continue; } List <Object> _obj = new List <object>(); _obj.Add(_point_list); _obj.Add(_p.Name); _obj_list.Add(_obj); } return((_obj_list.Count > 0) ? _obj_list : null); }