public SubCondition(SubAlarmType type, float threshold = 0f, Severity severity = Severity.Normal, string message = "", bool enabled = true) { this.SubAlarmType = type; this.Threshold = threshold; this.Severity = severity; this.Message = message; this.IsEnabled = enabled; }
public AlarmItem() { this._startTime = DateTime.Now; this._alarmType = SubAlarmType.None; this._alarmText = string.Empty; this._severity = Severity.Normal; this._condiId = -1; this._source = string.Empty; }
public AlarmItem(DateTime time, string alarmText, object alarmValue, SubAlarmType type, Severity severity, int condId, string source) { this._startTime = time; this._alarmType = type; this._alarmText = alarmText; this._alarmValue = alarmValue; this._severity = severity; this._condiId = condId; this._source = source; }
public static SubCondition FindSubConditon(this ICondition cond, SubAlarmType alarmType) { var subs = cond.SubConditions; if (subs != null && subs.Count > 0) { foreach (var sub in subs) { if (sub.SubAlarmType == alarmType) { return(sub); } } } return(SubCondition.Empty); }
FindSubConditon(this IAlarmServer server, string sourceName, SubAlarmType alarmType) { var conds = server.QueryConditions(sourceName); if (conds == null) { return(SubCondition.Empty); } foreach (ICondition cond in conds) { SubCondition sub = cond.FindSubConditon(alarmType); if (sub.SubAlarmType == alarmType) { return(sub); } } return(SubCondition.Empty); }
public static bool HasSubCondition(this IDataServer dserver, string sourceName, SubAlarmType alarmType) { IAlarmServer server = dserver as IAlarmServer; if (server == null) { return(false); } var conds = server.QueryConditions(sourceName); if (conds == null) { return(false); } foreach (ICondition cond in conds) { var subs = cond.SubConditions; if (subs != null && subs.Count > 0) { foreach (var sub in subs) { if (sub.SubAlarmType == alarmType) { return(true); } } } } return(false); }