添加部分配置

This commit is contained in:
SIC1016\caipeilun
2026-08-27 16:37:19 +08:00
parent 330e140fca
commit 5ca860c3f3
4 changed files with 65 additions and 39 deletions
@@ -95,48 +95,67 @@ namespace MECF.Framework.Common.Aitex.Core.RT.Device
EventLevel.Warning);
_alarmEvent = SubscribeAlarm($"{Module}.{Display}.ToleranceAlarm", "", ResetAlarmChecker);
if (SC.ContainsItem($"{ScBasePath}.{Display}.EnableAlarm"))
{
SC.RegisterValueChangedCallback($"{ScBasePath}.{Display}.EnableAlarm", (newValue) =>
{
if (!bool.TryParse(newValue.ToString(), out _isEnableErrDetection))
{
_isEnableErrDetection = false;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.EnableAlarm value {newValue} to bool");
}
SC.RegisterValueChangedCallback($"{ScBasePath}.{Display}.EnableAlarm", (newValue) =>
});
}
if (SC.ContainsItem($"{ScBasePath}.AlarmRange"))
{
if (!bool.TryParse(newValue.ToString(), out _isEnableErrDetection))
SC.RegisterValueChangedCallback($"{ScBasePath}.AlarmRange", (newValue) =>
{
_isEnableErrDetection = false;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.EnableAlarm value {newValue} to bool");
}
});
SC.RegisterValueChangedCallback($"{ScBasePath}.AlarmRange", (newValue) =>
if (!double.TryParse(newValue.ToString(), out _alarmRange))
{
_alarmRange = double.NaN;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.AlarmRange value {newValue} to double");
}
});
}
if (SC.ContainsItem($"{ScBasePath}.AlarmTime"))
{
if (!double.TryParse(newValue.ToString(), out _alarmRange))
SC.RegisterValueChangedCallback($"{ScBasePath}.AlarmTime", (newValue) =>
{
_alarmRange = double.NaN;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.AlarmRange value {newValue} to double");
}
});
SC.RegisterValueChangedCallback($"{ScBasePath}.AlarmTime", (newValue) =>
if (!double.TryParse(newValue.ToString(), out _alarmTime))
{
_alarmTime = int.MinValue;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.AlarmRange value {newValue} to double");
}
});
}
if (SC.ContainsItem($"{ScBasePath}.WarningRange"))
{
if (!double.TryParse(newValue.ToString(), out _alarmTime))
SC.RegisterValueChangedCallback($"{ScBasePath}.WarningRange", (newValue) =>
{
_alarmTime = int.MinValue;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.AlarmRange value {newValue} to double");
}
});
SC.RegisterValueChangedCallback($"{ScBasePath}.WarningRange", (newValue) =>
if (!double.TryParse(newValue.ToString(), out _warningRange))
{
_warningRange = double.NaN;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.WarningRange value {newValue} to double");
}
});
}
if (SC.ContainsItem($"{ScBasePath}.WarningTime"))
{
if (!double.TryParse(newValue.ToString(), out _warningRange))
SC.RegisterValueChangedCallback($"{ScBasePath}.WarningTime", (newValue) =>
{
_warningRange = double.NaN;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.WarningRange value {newValue} to double");
}
});
SC.RegisterValueChangedCallback($"{ScBasePath}.WarningTime", (newValue) =>
{
if (!double.TryParse(newValue.ToString(), out _warningTime))
{
_warningTime = int.MinValue;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.WarningTime value {newValue} to double");
}
});
if (!double.TryParse(newValue.ToString(), out _warningTime))
{
_warningTime = int.MinValue;
LOG.Error($"Unable to convert {ScBasePath}.{Display}.WarningTime value {newValue} to double");
}
});
}
}
#endregion