41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
|
namespace SSPCTester.Devices.Interfaces;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 可编程负载(IT8733P / IT8702P)的工作模式。
|
|||
|
|
/// </summary>
|
|||
|
|
public enum LoadMode
|
|||
|
|
{
|
|||
|
|
/// <summary>恒流。</summary>
|
|||
|
|
CC,
|
|||
|
|
/// <summary>恒压。</summary>
|
|||
|
|
CV,
|
|||
|
|
/// <summary>恒阻。</summary>
|
|||
|
|
CR,
|
|||
|
|
/// <summary>恒功率。</summary>
|
|||
|
|
CP
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public readonly record struct PowerReading(double Volts, double Amps, double Watts);
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 可编程负载抽象接口。
|
|||
|
|
/// </summary>
|
|||
|
|
public interface ILoad : IDeviceConnection
|
|||
|
|
{
|
|||
|
|
/// <summary>切换工作模式。</summary>
|
|||
|
|
Task SetModeAsync(LoadMode mode, CancellationToken ct = default);
|
|||
|
|
|
|||
|
|
/// <summary>设定目标值(含义取决于当前模式:A / V / Ω / W)。</summary>
|
|||
|
|
Task SetValueAsync(double value, CancellationToken ct = default);
|
|||
|
|
|
|||
|
|
/// <summary>开启 / 关闭负载输入。</summary>
|
|||
|
|
Task InputAsync(bool on, CancellationToken ct = default);
|
|||
|
|
|
|||
|
|
/// <summary>读取实际电压、电流。</summary>
|
|||
|
|
Task<(double volts, double amps)> ReadAsync(CancellationToken ct = default);
|
|||
|
|
|
|||
|
|
Task<PowerReading> ReadPowerAsync(CancellationToken ct = default);
|
|||
|
|
|
|||
|
|
Task<string> QueryIdentityAsync(CancellationToken ct = default);
|
|||
|
|
}
|