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