完成S7变量启用和停用更新
This commit is contained in:
43
DMS.Core/Events/DeviceActiveChangedEventArgs.cs
Normal file
43
DMS.Core/Events/DeviceActiveChangedEventArgs.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
namespace DMS.Core.Events;
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态改变事件参数
|
||||
/// </summary>
|
||||
public class DeviceActiveChangedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public int DeviceId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public string DeviceName { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 新状态
|
||||
/// </summary>
|
||||
public bool NewStatus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态改变时间
|
||||
/// </summary>
|
||||
public DateTime ChangeTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化DeviceStatusChangedEventArgs类的新实例
|
||||
/// </summary>
|
||||
/// <param name="deviceId">设备ID</param>
|
||||
/// <param name="deviceName">设备名称</param>
|
||||
/// <param name="oldStatus">旧状态</param>
|
||||
/// <param name="newStatus">新状态</param>
|
||||
public DeviceActiveChangedEventArgs(int deviceId, string deviceName, bool newStatus)
|
||||
{
|
||||
DeviceId = deviceId;
|
||||
DeviceName = deviceName;
|
||||
NewStatus = newStatus;
|
||||
ChangeTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
33
DMS.Core/Events/DeviceConnectChangedEventArgs.cs
Normal file
33
DMS.Core/Events/DeviceConnectChangedEventArgs.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
namespace DMS.Core.Events;
|
||||
|
||||
public class DeviceConnectChangedEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// 设备ID
|
||||
/// </summary>
|
||||
public int DeviceId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 设备名称
|
||||
/// </summary>
|
||||
public string DeviceName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 新状态
|
||||
/// </summary>
|
||||
public bool NewStatus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化DeviceStatusChangedEventArgs类的新实例
|
||||
/// </summary>
|
||||
/// <param name="deviceId">设备ID</param>
|
||||
/// <param name="deviceName">设备名称</param>
|
||||
/// <param name="oldStatus">旧状态</param>
|
||||
/// <param name="newStatus">新状态</param>
|
||||
public DeviceConnectChangedEventArgs(int deviceId, string deviceName, bool newStatus)
|
||||
{
|
||||
DeviceId = deviceId;
|
||||
DeviceName = deviceName;
|
||||
NewStatus = newStatus;
|
||||
}
|
||||
}
|
||||
48
DMS.Core/Events/MqttConnectionChangedEventArgs.cs
Normal file
48
DMS.Core/Events/MqttConnectionChangedEventArgs.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
namespace DMS.Core.Events;
|
||||
|
||||
/// <summary>
|
||||
/// MQTT连接状态改变事件参数
|
||||
/// </summary>
|
||||
public class MqttConnectionChangedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// MQTT服务器ID
|
||||
/// </summary>
|
||||
public int MqttServerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// MQTT服务器名称
|
||||
/// </summary>
|
||||
public string MqttServerName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 旧连接状态
|
||||
/// </summary>
|
||||
public bool OldConnectionStatus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 新连接状态
|
||||
/// </summary>
|
||||
public bool NewConnectionStatus { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 状态改变时间
|
||||
/// </summary>
|
||||
public DateTime ChangeTime { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 初始化MqttConnectionChangedEventArgs类的新实例
|
||||
/// </summary>
|
||||
/// <param name="mqttServerId">MQTT服务器ID</param>
|
||||
/// <param name="mqttServerName">MQTT服务器名称</param>
|
||||
/// <param name="oldStatus">旧连接状态</param>
|
||||
/// <param name="newStatus">新连接状态</param>
|
||||
public MqttConnectionChangedEventArgs(int mqttServerId, string mqttServerName, bool oldStatus, bool newStatus)
|
||||
{
|
||||
MqttServerId = mqttServerId;
|
||||
MqttServerName = mqttServerName;
|
||||
OldConnectionStatus = oldStatus;
|
||||
NewConnectionStatus = newStatus;
|
||||
ChangeTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
20
DMS.Core/Events/VariableActiveChangedEventArgs.cs
Normal file
20
DMS.Core/Events/VariableActiveChangedEventArgs.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace DMS.Core.Events;
|
||||
|
||||
public class VariablesActiveChangedEventArgs: EventArgs
|
||||
{
|
||||
|
||||
public List<int> VariableIds { get; }
|
||||
|
||||
public int DeviceId{get;}
|
||||
|
||||
public bool NewStatus { get; }
|
||||
|
||||
|
||||
|
||||
public VariablesActiveChangedEventArgs(List<int> variableIds,int deviceId, bool newStatus)
|
||||
{
|
||||
VariableIds = variableIds;
|
||||
DeviceId=deviceId;
|
||||
NewStatus = newStatus;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user