Files
ASTM-D7896-19TransientHot-W…/Models/AppConfig.cs

53 lines
1.7 KiB
C#
Raw Normal View History

2026-04-18 19:00:34 +08:00
using System.ComponentModel.DataAnnotations;
namespace ASTM_D7896_Tester.Models;
public class AppConfig
{
public PlcConnectionConfig PlcConnection { get; set; } = new();
public PlcRegisterAddresses PlcRegisterAddresses { get; set; } = new();
public TestParameters TestParameters { get; set; } = new();
public AppSettings AppSettings { get; set; } = new();
}
public class PlcConnectionConfig
{
public string IpAddress { get; set; } = "127.0.0.1";
public int Port { get; set; } = 502;
public int TimeoutMs { get; set; } = 5000;
}
public class PlcRegisterAddresses
{
public int ThermalConductivity { get; set; } = 40001;
public int ThermalDiffusivity { get; set; } = 40003;
public int TestTemperature { get; set; } = 40005;
public int StartCommand { get; set; } = 40010;
public int ResetCommand { get; set; } = 40011;
}
public class TestParameters
{
[Range(1, 100)]
public int MeasurementCount { get; set; } = 10;
[Range(5, 300)]
public int IntervalSeconds { get; set; } = 30;
public double PlatinumWireLength { get; set; } = 0.04;
public double PlatinumWireDiameter { get; set; } = 0.00006;
public string ReportOutputPath { get; set; } = "Reports\\";
public double DefaultSampleVolume { get; set; } = 40.0;
public double DefaultPressure { get; set; } = 0.0;
public bool UsePressure { get; set; } = false;
public string ReferenceLiquid { get; set; } = "蒸馏水";
public double ReferenceConductivity { get; set; } = 0.606;
}
public class AppSettings
{
public int WindowWidth { get; set; } = 1024;
public int WindowHeight { get; set; } = 768;
public string ThemeColor { get; set; } = "Blue";
}