/// <summary> /// 获取计算不确定度 /// </summary> ///<param name="paras">请求参数对象</param> /// <returns></returns> public static string GetBuQueDingDu(BuQueDingBuInput paras) { if (string.IsNullOrWhiteSpace(paras.ShuChuShiJiZhi) || string.IsNullOrWhiteSpace(paras.ShuChuShiZhi)) { return(null); } var buQueDingBuJiHe = new BuQueDingDu(); if (string.IsNullOrWhiteSpace(paras.XuanYongDianZu)) {//无电阻 buQueDingBuJiHe = (from f in BuQueDingBuJiHe.jihe where f.RuleID == paras.RuleID select f).First(); } else {//有电阻 buQueDingBuJiHe = (from f in BuQueDingBuJiHe.jihe where f.RuleID == paras.RuleID && f.DianZu == "Y" select f).First(); } //获取数据库表 UNCERTAINTYTABLEBLL bll = new BLL.UNCERTAINTYTABLEBLL(); List <UNCERTAINTYTABLE> data = bll.GetByASSESSMENTITEM(buQueDingBuJiHe.MingChen); var re = GongShi.GetBuQueDingDu(paras, data, buQueDingBuJiHe); string str = ((decimal)re).ToString(); return(str); //if (!string.IsNullOrWhiteSpace(paras.ShuChuShiJiZhi)) //{ // return "10.123"; //} //else //{ // return ""; //} }
public static UNCERTAINTYTABLE GetUNCERTAINTYTABLE(BuQueDingBuInput paras, List <UNCERTAINTYTABLE> data, BuQueDingDu buQueDingDu) { double liangcheng = 0; if (buQueDingDu.ShuChu == "Y") {//是测量的则为量程 liangcheng = DanWei(paras.LiangChengDanWei, paras.LiangCheng); } else { liangcheng = DanWei(paras.ShuChuShiZhiDanWei, paras.ShuChuShiZhi); } foreach (var f in data) { // if (f.THERELATIONSHIP == ">") //量程起关系 { if (f.ENDRELATIONSHIP == "<") //量程结束关系 { if ((liangcheng > DanWei(f.THEUNIT, f.THERANGESCOPE)) && liangcheng < (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } else if (f.ENDRELATIONSHIP == "<=")//量程结束关系 { if ((liangcheng > DanWei(f.THEUNIT, f.THERANGESCOPE)) && liangcheng <= (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } } else if (f.THERELATIONSHIP == ">=") { if (f.ENDRELATIONSHIP == "<") { if (liangcheng >= (DanWei(f.THEUNIT, f.THERANGESCOPE)) && liangcheng < (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } else if (f.ENDRELATIONSHIP == "<=") { if (liangcheng >= (DanWei(f.THEUNIT, f.THERANGESCOPE)) && liangcheng <= (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } } else {//没有起量程 if (f.ENDRELATIONSHIP == "<") { if (liangcheng < (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } else if (f.ENDRELATIONSHIP == "<=") { if (liangcheng <= (DanWei(f.ENDUNIT, f.ENDRANGESCOPE))) { if (!string.IsNullOrWhiteSpace(paras.PinLv)) { #region 频率 var pinglv = DanWei(paras.PinLvDanWei, paras.PinLv); if (f.THERELATIONSHIPFREQUENCY == ">") //频率起关系 { if (f.ENDRELATIONSHIPFREQUENCY == "<") //频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=")//频率结束关系 { if ((pinglv > DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else if (f.THERELATIONSHIPFREQUENCY == ">=") { if (f.ENDRELATIONSHIPFREQUENCY == "<") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if ((pinglv >= DanWei(f.THEUNITFREQUENCY, f.THEFREQUENCY)) && pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } else {//没有起频率 if (f.ENDRELATIONSHIPFREQUENCY == "<") { if (pinglv < (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } else if (f.ENDRELATIONSHIPFREQUENCY == "<=") { if (pinglv <= (DanWei(f.ENDUNITFREQUENCY, f.ENDFREQUENCY))) { return(f); } } } #endregion } else { return(f); } } } } } return(null); }
public static double GetBuQueDingDu(BuQueDingBuInput paras, List <UNCERTAINTYTABLE> data, BuQueDingDu buQueDingDu) { double result = 0; if (paras.K == "√3") { paras.K = Math.Sqrt(3).ToString(); } switch (buQueDingDu.GongShi) { case "2": /* * 每行算一个不确定度 * 根据标准值判定所在范围的指标 * 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【显示值+】位数一致 * 被试设备分辨力ui=(10-n/2)/√3 备注:n=【显示值+】的小数位数 * 最大允许误差ui=(指标1*10-6*ABS【显示值+】+指标2)/2,备注指标2的单位要换算成和【显示值+】单位一致 * */ var length = 0; var split = paras.ShuChuShiJiZhi.Split('.'); if (split.Length > 1) { length = split[1].Length; //备注:n =【显示值 +】的小数位数 } var ui = Math.Pow(10, -length) / 2 / Math.Sqrt(3); //被试设备分辨力ui = (10 - n / 2) /√3 // 最大允许误差ui=(指标1*10-6*ABS【显示值+】+指标2)/2,备注指标2的单位要换算成和【显示值+】单位一致 UNCERTAINTYTABLE d = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax = (Convert.ToDouble(d.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(d.INDEX2) * Math.Pow(10, DanWeiHuanSuan(d.INDEX2UNIT, paras.ShuChuShiJiZhiDanWei))) / 2; // 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【显示值+】位数一致 return(Math.Pow((Math.Pow(ui, 2) + Math.Pow(uiMax, 2)), 0.5) * Convert.ToDouble(paras.K)); case "9": /* * 每行算一个不确定度 * 根据输出示值判定应该取的量程范围内的指标,一个量程内取指标肯定参考指标表一个量程内的 * 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【输出实际值】位数一致 * 被试设备分辨力ui=(10-n/2)/√3 备注:n=【输出实际值】的小数位数 * 最大允许误差ui=(指标1*10-6*ABS【输出实际值】+指标2*10-6*量程)/2 * * 例如第一个行不确定度U(k=2)= 0.0001 V * 公式为:((10^(-4)/2/SQRT(3))^2+((3*10^(-6)*ABS(S16)+0.2*10^(-6)*20)/2)^2)^0.5*2 */ var length9 = 0; var split9 = paras.ShuChuShiJiZhi.Split('.'); if (split9.Length > 1) { length9 = split9[1].Length; //备注:n =【显示值 +】的小数位数 } var ui9 = Math.Pow(10, -length9) / 2 / Math.Sqrt(3); //被试设备分辨力ui = (10 - n / 2) /√3 UNCERTAINTYTABLE d9 = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax9 = (Convert.ToDouble(d9.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(d9.INDEX2) * Math.Pow(10, -6) * Convert.ToDouble(d9.ENDRANGESCOPE)) / 2; // 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【显示值+】位数一致 return(Math.Pow((Math.Pow(ui9, 2) + Math.Pow(uiMax9, 2)), 0.5) * Convert.ToDouble(paras.K)); case "5": /* * 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【显示值】位数一致 * 被试设备分辨力ui=(10-n/2)/√3 备注:n=【显示值】的小数位数 * 最大允许误差ui=(指标1*10-6*ABS【显示值】+指标2)/2,备注指标2为0 */ var length5 = 0; var split5 = paras.ShuChuShiJiZhi.Split('.'); if (split5.Length > 1) { length5 = split5[1].Length; //备注:n =【显示值 +】的小数位数 } var ui5 = Math.Pow(10, -length5) / 2 / Math.Sqrt(3); //被试设备分辨力ui = (10 - n / 2) /√3 UNCERTAINTYTABLE d5 = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax5 = (Convert.ToDouble(d5.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + 0) / 2; // 算法=((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【显示值+】位数一致 return(Math.Pow((Math.Pow(ui5, 2) + Math.Pow(uiMax5, 2)), 0.5) * Convert.ToDouble(paras.K)); case "6": /* * 2、算法,分两种情况 * 2.1、如有没有使用变换器参与运算:((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【输出实际值】位数一致 * 如果没有使用变换器,参考8508A交流电流并结合当前量程取指标值 * 2.2、如有变换器参与运算:((被试设备分辨力ui)^2+(最大允许误差ui)^2+(变换器指标ui)^2)^0.5*k,小数位数要与【输出实际值】位数一致 * 如果有变换器,那么参考8508A交流电压,永远取2V量程档的指标85、10 * 被试设备分辨力ui=(10-n/2)/√3 备注:n=【输出实际值】的小数位数 * 最大允许误差ui=(指标1*10-6*ABS【输出实际值】+指标2*10-6*量程)/2 * 变换器指标ui=变换器指标/2,备注:标准电阻指标为0.00005 */ var length6 = 0; var split6 = paras.ShuChuShiJiZhi.Split('.'); if (split6.Length > 1) { length6 = split6[1].Length; //备注:n =【显示值 +】的小数位数 } var ui6 = Math.Pow(10, -length6) / 2 / Math.Sqrt(3); //被试设备分辨力ui = (10 - n / 2) /√3 if (paras.XuanYongDianZu == "是") { var uiMax6 = (Convert.ToDouble(85) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(10) * Math.Pow(10, -6) * Convert.ToDouble(2)) / 2; return(Math.Pow((Math.Pow(ui6, 2) + Math.Pow(uiMax6, 2) + Math.Pow(0.00005 / 2, 2)), 0.5) * Convert.ToDouble(paras.K)); } else { UNCERTAINTYTABLE d6 = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax6 = (Convert.ToDouble(d6.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(d6.INDEX2) * Math.Pow(10, -6) * Convert.ToDouble(d6.ENDRANGESCOPE)) / 2; return(Math.Pow((Math.Pow(ui6, 2) + Math.Pow(uiMax6, 2)), 0.5) * Convert.ToDouble(paras.K)); } case "8": /* * 1、每行算一个不确定度,根据输出示值判断应该取自哪个量程范围内的指标,一个量程内取指标肯定参考指标表一个量程内的 * 2、算法,分两种情况 * 2.1、如有无选用电阻参与运算:((被试设备分辨力ui)^2+(最大允许误差ui)^2)^0.5*k,小数位数要与【输出实际值】位数一致 * 如果无选用电阻,参考8508A直流电流并结合当前量程取指标值 * 2.2、如有有选用电阻参与运算:((被试设备分辨力ui)^2+(最大允许误差ui)^2+(标准电阻指标ui)^2)^0.5*k,小数位数要与【输出实际值】位数一致 * 如果有选用电阻,那么参考8508A直流电压,并判定应该取的量程段的指标值 * 被试设备分辨力ui=(10-n/2)/√3 备注:n=【输出实际值】的小数位数 * 最大允许误差ui=(指标1*10-6*ABS【输出实际值】+指标2*10-6*量程)/2 * 标准电阻指标ui=标准电阻/2,备注:如果选用电阻阻值为0.01,那么标准电阻指标为0.00001,如果为0.001,那么标准电阻指标为0.0001,以此类推 * * 例如第一个量程有选用电阻参与运算,第一个行不确定度U(k=2)= 0.001 mA * 公式为:((10^(-3)/2/SQRT(3))^2+((3.0*10^(-6)*ABS(AD36)+0.2*10^(-6)*2)/2)^2+(0.00001/2)^2)^0.5*2 * * 例如第二个量程无选用电阻参与运算,第一个行不确定度U(k=2)= 0.003 μA * 公式为:((10^(-3)/2/SQRT(3))^2+((12*10^(-6)*ABS(AD36)+2*10^(-6)*200)/2)^2)^0.5*2 * */ var length8 = 0; var split8 = paras.ShuChuShiJiZhi.Split('.'); if (split8.Length > 1) { length8 = split8[1].Length; //备注:n =【显示值 +】的小数位数 } var ui8 = Math.Pow(10, -length8) / 2 / Math.Sqrt(3); //被试设备分辨力ui = (10 - n / 2) /√3 if (!string.IsNullOrWhiteSpace(paras.XuanYongDianZu)) { // var zhi = Convert.ToDouble(paras.XuanYongDianZu) * DanWei(paras.ShuChuShiJiZhiDanWei, paras.ShuChuShiJiZhi) * 0.001 * 0.001; var zhi = Convert.ToDouble(paras.XuanYongDianZu) * DanWei(paras.LiangChengDanWei, paras.LiangCheng) * 0.001 * 0.001; string str = (((decimal)zhi)).ToString(); paras.LiangCheng = str; paras.LiangChengDanWei = "μV"; UNCERTAINTYTABLE d8 = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax8 = (Convert.ToDouble(d8.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(d8.INDEX2) * Math.Pow(10, -6) * Convert.ToDouble(d8.ENDRANGESCOPE)) / 2; var dsf = Convert.ToDouble(paras.XuanYongDianZu); var dd = Convert.ToDecimal(0.0000001 / dsf / 2); return(Math.Pow((Math.Pow(ui8, 2) + Math.Pow(uiMax8, 2) + Math.Pow(Convert.ToDouble(dd), 2)), 0.5) * Convert.ToDouble(paras.K)); } else { UNCERTAINTYTABLE d8 = GetUNCERTAINTYTABLE(paras, data, buQueDingDu); var uiMax8 = (Convert.ToDouble(d8.INDEX1) * Math.Pow(10, -6) * Math.Abs(Convert.ToDouble(paras.ShuChuShiJiZhi)) + Convert.ToDouble(d8.INDEX2) * Math.Pow(10, -6) * Convert.ToDouble(d8.ENDRANGESCOPE)) / 2; return(Math.Pow((Math.Pow(ui8, 2) + Math.Pow(uiMax8, 2)), 0.5) * Convert.ToDouble(paras.K)); } default: break; } return(result); }