BOB/DeviceCommand/Device/IT6724CReverse.cs

70 lines
3.1 KiB
C#

using Common.Attributes;
using DeviceCommand.Base;
using System;
using System.IO.Ports;
using System.Threading;
using System.Threading.Tasks;
namespace DeviceCommand.Device
{
[BOBCommand]
public class IT6724CReverse : Serial_Port
{
public IT6724CReverse(string COMPort, int BaudRate, int DataBits, StopBits stopBits, Parity parity, int ReadTimeout, int ReceiveTimeout)
{
ConfigureDevice(COMPort, BaudRate, DataBits, stopBits, parity, ReadTimeout, ReceiveTimeout);
}
public IT6724CReverse() { }
#region
public virtual async Task (CancellationToken ct = default)
=>await SendAsync("PROTection:CLEar\r\n", ct);
public virtual async Task (bool , CancellationToken ct = default)
=>await SendAsync($"OUTPut {(开关 ? 1 : 0)}\r\n", ct);
public virtual async Task (CancellationToken ct = default)
=>await SendAsync("SYSTem:REMote\r\n", ct);
public virtual async Task (CancellationToken ct = default)
=>await SendAsync("SYSTem:BEEPer\r\n", ct);
public virtual async Task (double , CancellationToken ct = default)
=>await SendAsync($"CURRent {电流}\r\n", ct);
public virtual async Task OCP电流(double , CancellationToken ct = default)
=>await SendAsync($"CURRent:PROTection {电流}\r\n", ct);
public virtual async Task OCP开关(bool , CancellationToken ct = default)
=>await SendAsync($"CURRent:PROTection:STATe {(开关 ? 1 : 0)}\r\n", ct);
public virtual async Task (double , CancellationToken ct = default)
=>await SendAsync($"VOLTage {电压}\r\n", ct);
public virtual async Task OVP电压(double , CancellationToken ct = default)
=>await SendAsync($"VOLT:PROTection {电压}\r\n", ct);
public virtual async Task OVP开关(bool , CancellationToken ct = default)
=>await SendAsync($"VOLT:PROTection:STATe {(开关 ? 1 : 0)}\r\n", ct);
public virtual async Task (double , CancellationToken ct = default)
=>await SendAsync($"POWer:PROTection {电压}\r\n", ct);
public virtual async Task (bool , CancellationToken ct = default)
=>await SendAsync($"POWer:PROTection:STATe {(开关 ? 1 : 0)}\r\n", ct);
public virtual async Task (double , double , CancellationToken ct = default)
=>await SendAsync($"CURRent:SLEW {上升斜率},{下降斜率}\r\n", ct);
public virtual async Task (double , double , CancellationToken ct = default)
=>await SendAsync($"VOLTage:SLEW {上升斜率},{下降斜率}\r\n", ct);
public virtual async Task (string , CancellationToken ct = default)
=>await SendAsync($"{指令}\r\n", ct);
#endregion
}
}