添加了事件服务,并完成了设备状态改变后写入数据库
This commit is contained in:
11
DMS.Application/Interfaces/IDeviceMonitoringService.cs
Normal file
11
DMS.Application/Interfaces/IDeviceMonitoringService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using DMS.Application.Events;
|
||||
|
||||
namespace DMS.Application.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// 设备监视服务接口,用于监视设备的状态变化
|
||||
/// </summary>
|
||||
public interface IDeviceMonitoringService
|
||||
{
|
||||
}
|
||||
58
DMS.Application/Interfaces/IEventService.cs
Normal file
58
DMS.Application/Interfaces/IEventService.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using DMS.Application.Events;
|
||||
|
||||
namespace DMS.Application.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// 事件服务接口,用于统一管理应用程序中的各种事件
|
||||
/// </summary>
|
||||
public interface IEventService
|
||||
{
|
||||
#region 设备事件
|
||||
|
||||
/// <summary>
|
||||
/// 设备状态改变事件
|
||||
/// </summary>
|
||||
event EventHandler<DeviceActiveChangedEventArgs> OnDeviceActiveChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发设备状态改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">设备状态改变事件参数</param>
|
||||
void RaiseDeviceStatusChanged(object sender, DeviceActiveChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
|
||||
#region 变量事件
|
||||
|
||||
/// <summary>
|
||||
/// 变量值改变事件
|
||||
/// </summary>
|
||||
event EventHandler<VariableValueChangedEventArgs> VariableValueChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发变量值改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">变量值改变事件参数</param>
|
||||
void RaiseVariableValueChanged(object sender, VariableValueChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
|
||||
#region MQTT事件
|
||||
|
||||
/// <summary>
|
||||
/// MQTT连接状态改变事件
|
||||
/// </summary>
|
||||
event EventHandler<MqttConnectionChangedEventArgs> MqttConnectionChanged;
|
||||
|
||||
/// <summary>
|
||||
/// 触发MQTT连接状态改变事件
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">MQTT连接状态改变事件参数</param>
|
||||
void RaiseMqttConnectionChanged(object sender, MqttConnectionChangedEventArgs e);
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user