43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Collections.Generic;
|
||
|
||
namespace PetroleumViscosityTest.Models
|
||
{
|
||
public static class Constants
|
||
{
|
||
// 表2 粘度计在恒温水浴中的恒温时间
|
||
public static int GetThermostatTime(double temp)
|
||
{
|
||
if (temp == 80 || temp == 100) return 20;
|
||
if (temp == 40 || temp == 50) return 15;
|
||
if (temp >= 20 && temp <= 100) return 15; // 原文"100~50"? 表2写“100~50 15”? 实际根据逻辑
|
||
// 20℃及以下未明确,默认10分钟
|
||
return 10;
|
||
}
|
||
|
||
// 根据温度获取允许偏差(%),用于剔除异常值(5.4条)
|
||
public static double GetAllowedDeviation(double temp)
|
||
{
|
||
if (temp >= 15 && temp <= 100) return 0.5;
|
||
if (temp >= -30 && temp < 15) return 1.5;
|
||
if (temp < -30) return 2.5;
|
||
return 0.5; // 默认
|
||
}
|
||
|
||
// 7.1 重复性(%)
|
||
public static double GetRepeatabilityLimit(double temp)
|
||
{
|
||
if (temp >= 15 && temp <= 100) return 1.0;
|
||
if (temp >= -30 && temp < 15) return 3.0;
|
||
if (temp < -30) return 5.0;
|
||
return 1.0;
|
||
}
|
||
|
||
// 7.2 再现性(%)
|
||
public static double GetReproducibilityLimit(double temp)
|
||
{
|
||
if (temp >= 15 && temp <= 100) return 2.2;
|
||
// 其他温度未给出,按重复性的2倍左右估算
|
||
return 2.2;
|
||
}
|
||
}
|
||
} |