Files
PetroleumViscosityTest/Models/Constants.cs
2026-02-12 17:03:23 +08:00

43 lines
1.4 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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; // 原文"10050"? 表2写“10050 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;
}
}
}