初步添加报警功能

This commit is contained in:
2025-09-13 12:30:12 +08:00
parent 5a39796f0e
commit 15e2caed22
12 changed files with 457 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
using System;
namespace DMS.Core.Events
{
public class AlarmEventArgs : EventArgs
{
public int VariableId { get; }
public string VariableName { get; }
public double CurrentValue { get; }
public double ThresholdValue { get; }
public string Message { get; }
public DateTime Timestamp { get; }
public string AlarmType { get; } // 可以是 "High", "Low", "Change" 等
public AlarmEventArgs(int variableId, string variableName, double currentValue,
double thresholdValue, string message, string alarmType)
{
VariableId = variableId;
VariableName = variableName;
CurrentValue = currentValue;
ThresholdValue = thresholdValue;
Message = message;
Timestamp = DateTime.Now;
AlarmType = alarmType;
}
}
}