namespace APS7100TestTool.Models
{
///
/// 设备类型枚举
///
public enum DeviceType
{
APS7100, // AC 可编程电源
PSW250 // DC 可编程电源
}
///
/// 设备信息
///
public class DeviceInfo
{
public DeviceType Type { get; set; }
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public string VoltageRange { get; set; } = string.Empty;
public string CurrentRange { get; set; } = string.Empty;
public bool HasFrequencyControl { get; set; }
public bool HasWaveformControl { get; set; }
public static DeviceInfo GetDeviceInfo(DeviceType type)
{
return type switch
{
DeviceType.APS7100 => new DeviceInfo
{
Type = DeviceType.APS7100,
Name = "APS-7100",
Description = "AC 可编程电源 (1kVA)",
VoltageRange = "0-350 Vrms",
CurrentRange = "限流保护",
HasFrequencyControl = true,
HasWaveformControl = true
},
DeviceType.PSW250 => new DeviceInfo
{
Type = DeviceType.PSW250,
Name = "PSW250-4.5",
Description = "DC 可编程电源 (250W)",
VoltageRange = "0-72 V",
CurrentRange = "0-4.5 A",
HasFrequencyControl = false,
HasWaveformControl = false
},
_ => throw new System.ArgumentException("未知的设备类型")
};
}
}
}