设备编辑管理界面

This commit is contained in:
hsc
2026-06-12 10:00:13 +08:00
parent ffb22e1f20
commit cba9af2892
42 changed files with 4419 additions and 17 deletions

View File

@@ -0,0 +1,48 @@
using Common.Attributes;
using DeviceCommand.Base;
using NModbus;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeviceCommand.Device
{
[ADPCommand]
public class IOBoard : ModbusTcp
{
//只有两个,八台产品公用两两分组各用一个
public IOBoard(string Ip地址, int , int , int )
{
ConfigureDevice(Ip地址, , , );
}
public async Task (byte , ushort , bool data)
{
await Modbus.WriteSingleCoilAsync(, , data);
}
public async Task (byte , ushort , bool[] datas)
{
var = await Modbus.ReadCoilsAsync(1, 0, 16);
for (int i = 0; i < datas.Length; i++)
{
if ( + i < .Length)
{
[ + i] = datas[i];
}
}
await Modbus.WriteMultipleCoilsAsync(, 0, );
}
public async Task (byte , ushort )
{
await Modbus.ReadCoilsAsync(, , 1);
}
public async Task<bool[]> (byte , ushort ,ushort )
{
return await Modbus.ReadCoilsAsync(, , );
}
}
}

View File

@@ -11,6 +11,7 @@ namespace DeviceCommand.Device
[ADPCommand]
public class IT7800E : Tcp
{
//只有一个,八台产品一起用一个
// 根据通用 SCPI 指令规范,使用换行符 (ASCII 字符 LF即 \n) 作为标准结束符
private const string ScpiDelimiter = "\n";

View File

@@ -11,6 +11,7 @@ namespace DeviceCommand.Device
[ADPCommand]
public class N36200 : Tcp
{
//只有一个,八台产品一起用一个
// 手册第 9 页 2.2.4 明确规定:命令结束符为换行符 (ASCII 字符 LF即 \n)
private const string ScpiDelimiter = "\n";

View File

@@ -11,6 +11,7 @@ namespace DeviceCommand.Device
[ADPCommand]
public class SDS2000X_HD : Tcp
{
//只有两个,八台产品公用两两分组各用一个
// 示波器底层 Socket 字符串命令通常以换行符 \n 结束
private const string ScpiDelimiter = "\n";

View File

@@ -11,6 +11,7 @@ namespace DeviceCommand.Device
[ADPCommand]
public class SPAW7000 : Tcp
{
//只有两个,八台产品公用两两分组各用一个
// 根据通用 SCPI 与远宽指令规范,使用换行符 (ASCII 字符 LF即 \n) 作为标准结束符
private const string ScpiDelimiter = "\n";