using Misc;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
namespace FLY.Modbus
{
///
/// 加载通讯列表用
///
public class PLCGroup
{
public class PLCDevice
{
[JsonConverter(typeof(IPEndPointJsonConverter))]
public IPEndPoint EP;
}
public class PLCVariable
{
///
/// 设备序号
///
public int DeviceIndex;
///
/// 值为 0,1,3,4 ;对应modbus寄存器的区号
///
public string Mode;
///
/// 区号的地址
///
public int Addr;
///
/// 类型 只有 bool 才对应 bool, 其它数值类型 都转为 float
///
public string Type;
///
/// 放大倍数
///
public double Scale;
///
/// 属性拥有者名称
///
public string OwnerName;
///
/// 属性名称
///
public string PropertyName;
public override string ToString()
{
return OwnerName + "." + PropertyName + " dev" + DeviceIndex + " [" + Mode + "](" + Addr + ")";
}
}
public List Devices = new List();
public List Variables = new List();
}
}