spaw7000设备命令修改
This commit is contained in:
@@ -16,26 +16,16 @@ namespace UIShare.GlobalVariable
|
||||
/// <param name="methodName">方法名/信号标识</param>
|
||||
/// <param name="value">当前采样值</param>
|
||||
/// <param name="globalInfo">全局信息</param>
|
||||
public static void CheckAlarm(string scope, string fingerprint, string methodName, double value, GlobalInfo globalInfo)
|
||||
public static string CheckAlarm(string scope, string fingerprint, string methodName, double value, GlobalInfo globalInfo)
|
||||
{
|
||||
if (globalInfo?.ConfigDic == null) return;
|
||||
if (!globalInfo.ConfigDic.TryGetValue(scope, out var systemConfig)) return;
|
||||
if (systemConfig.ValueLimitList == null) return;
|
||||
if (globalInfo?.ConfigDic == null) return "";
|
||||
if (!globalInfo.ConfigDic.TryGetValue(scope, out var systemConfig)) return "";
|
||||
if (systemConfig.ValueLimitList == null) return "";
|
||||
|
||||
var limit = systemConfig.ValueLimitList.FirstOrDefault(x =>
|
||||
x.Fingerprint == fingerprint && x.MethodName == methodName);
|
||||
if (limit == null) return;
|
||||
if (value > limit.Upper)
|
||||
{
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超上限;
|
||||
}
|
||||
else if (value < limit.Lower)
|
||||
{
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超下限;
|
||||
}
|
||||
else if(value > limit.UpperExtreme)
|
||||
if (limit == null) return "";
|
||||
if (value > limit.UpperExtreme)
|
||||
{
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超上极限;
|
||||
@@ -45,12 +35,22 @@ namespace UIShare.GlobalVariable
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超下极限;
|
||||
}
|
||||
else if (value > limit.Upper)
|
||||
{
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超上限;
|
||||
}
|
||||
else if (value < limit.Lower)
|
||||
{
|
||||
limit.IsAlarm = true;
|
||||
limit.AlarmSatus = AlarmStatus.超下限;
|
||||
}
|
||||
else
|
||||
{
|
||||
limit.IsAlarm = false;
|
||||
limit.AlarmSatus = AlarmStatus.未报警;
|
||||
}
|
||||
|
||||
return limit.AlarmSatus.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user