spaw7000设备命令修改
This commit is contained in:
@@ -96,7 +96,11 @@ namespace UIShare.GlobalVariable
|
||||
Time = now
|
||||
});
|
||||
|
||||
ValueLimitAlarmHelper.CheckAlarm(scope, signalFingerprint, methodName, physicalValue, _globalInfo);
|
||||
string MonitorSatus = ValueLimitAlarmHelper.CheckAlarm(scope, signalFingerprint, methodName, physicalValue, _globalInfo);
|
||||
if(MonitorSatus!=""|| MonitorSatus != "未报警")
|
||||
{
|
||||
//_eventAggregator.GetEvent<AlarmEvent>().Publish(canFingerprint, MonitorSatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,11 @@ namespace UIShare.GlobalVariable
|
||||
});
|
||||
|
||||
// 同步检查该作用域 ValueLimitList 是否超限
|
||||
ValueLimitAlarmHelper.CheckAlarm(scope, entry.Fingerprint, entry.MethodName, value, _globalInfo);
|
||||
string MonitorSatus= ValueLimitAlarmHelper.CheckAlarm(scope, entry.Fingerprint, entry.MethodName, value, _globalInfo);
|
||||
if (MonitorSatus != "" || MonitorSatus != "未报警")
|
||||
{
|
||||
// _eventAggregator.GetEvent<AlarmEvent>().Publish(entry.Fingerprint, MonitorSatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace UIShare.PubEvent
|
||||
{
|
||||
public class AlarmEvent :PubSubEvent
|
||||
public class AlarmEvent :PubSubEvent<Tuple<string,string>>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user