添加部分配置
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -61,7 +61,10 @@ namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.GasFlow
|
||||
public void Initialize(string moduleName)
|
||||
{
|
||||
ModuleName = moduleName;
|
||||
SC.RegisterValueChangedCallback($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}", OnGasFlowRatioSCChanged);
|
||||
if (SC.ContainsItem($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}"))
|
||||
{
|
||||
SC.RegisterValueChangedCallback($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}", OnGasFlowRatioSCChanged);
|
||||
}
|
||||
GasFlowRatioValue = SC.SafeGetValue<double>($"PM.{ModuleName}.Efficiency.{GasFlowRatioName}", 1d);
|
||||
|
||||
if (GasName == "O2_Vent")
|
||||
|
||||
Reference in New Issue
Block a user