using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.SCADAControl
{
///
/// 数据来源类型
///
public enum DataTypeEnum
{
///
/// POST接口,GET接口
///
API接口,
///
/// 接收主题MQTT数据
///
MQTT,
///
/// Redis拉取数据
///
Redis,
///
/// 本地数据推送
///
本地源,
///
/// 特定服务推送数据
///
服务推送,
///
/// 静态数据
///
静态数据
}
///
/// 运行状态-枚举
///
public enum InterfaceModeEnum
{
POST,
GET,
PUT
}
///
/// 数据类型枚举
///
public enum EDataType
{
Bool = 1,
Byte = 2,
Int = 3,
Word = 4,
Dint = 5,
Dword = 6,
Float = 7,
Double = 8,
String = 9,
}
public class ReeisDataModel
{
public string VarName { get; set; }
public string VarVaule { get; set; }
public EDataType DataType { get; set; }
}
public class PublishModel
{
///
/// 设备名称
///
public string DeviceName { get; set; } = string.Empty;
///
/// 变量实际地址
///
public string RealAddress { get; set; } = string.Empty;
///
/// 变量名称
///
public string VarName { get; set; } = string.Empty;
///
/// 变量长度
///
public int Length { get; set; } = 1;
///
/// 变量当前值
///
public string Value { get; set; } = string.Empty;
///
/// 变量数据类型
///
public EDataType DataType { get; set; }
}
public class PublishInfo
{
public List PublishModels { get; set; } = new List();
}
///
/// 通讯参数配置
///
public class CommunicationPar
{
public ObservableCollection CommunicationDevices { get; set; } = new ObservableCollection();
}
public class CommunicationModel
{
///
/// 是否激活
///
public bool IsActive { get { return _mIsActive; } set { _mIsActive = value;} }
private bool _mIsActive = true;
///
/// 新增设备名称
///
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; } }
private string _mDeviceName;
///
/// 通讯模块名称
///
public string ModelName { get { return _mModelName; } set { _mModelName = value; } }
private string _mModelName;
///
/// 变量表数据
///
public ObservableCollection VarTableModels { get; set; } = new ObservableCollection();
}
public class VariableInfo
{
public VariableInfo(params object[] s)
{
}
public int ID { get { return _mID; } set { _mID = value; } }
private int _mID;
///
/// 变量名
///
public string VarName
{
get { return _mVarName.Trim()?.Replace(" ", ""); }
set
{
_mVarName = value;
}
}
private string _mVarName = string.Empty;
///
/// 地址
///
public string Address
{
get { return _mAddress.Trim()?.Replace(" ", "").ToUpper(); }
set
{
_mAddress = value;
}
}
private string _mAddress = string.Empty;
///
/// 实际地址
///
public string RealAddress { get; set; }
///
/// 数据类型
///
public string DataType { get { return _mDataType; } set { _mDataType = value; } }
private string _mDataType = string.Empty;
///
/// 是否启用报警
///
public bool IsEnableAlarm { get { return _mIsEnableAlarm; } set { _mIsEnableAlarm = value; } }
private bool _mIsEnableAlarm;
}
}