|
@@ -157,10 +157,6 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// </summary>
|
|
|
private int _manualReplenSecond = 0;
|
|
|
/// <summary>
|
|
|
- /// 注水是否出错
|
|
|
- /// </summary>
|
|
|
- private bool _isDiReplenInFault = false;
|
|
|
- /// <summary>
|
|
|
/// Fast leak Test时间间隔
|
|
|
/// </summary>
|
|
|
private int _aNLeakOperatingUpdateTime;
|
|
@@ -269,10 +265,6 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// </summary>
|
|
|
private HashSet<string> errorLogSet = new HashSet<string>();
|
|
|
/// <summary>
|
|
|
- /// 累计补水超时
|
|
|
- /// </summary>
|
|
|
- private bool _diReplenMaxTimeOut;
|
|
|
- /// <summary>
|
|
|
/// 是否有其他DIReplen的警告
|
|
|
/// </summary>
|
|
|
private bool _isOtherDIReplenWarnOn = false;
|
|
@@ -280,6 +272,14 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// Facility DIReplen Off Warning
|
|
|
/// </summary>
|
|
|
private bool _isTotalDIReplenWarnOn = false;
|
|
|
+ /// <summary>
|
|
|
+ /// 累计补水是否超时
|
|
|
+ /// </summary>
|
|
|
+ private bool _isDIReplenMaxTimeOut = false;
|
|
|
+ /// <summary>
|
|
|
+ /// 单次补水是否超时
|
|
|
+ /// </summary>
|
|
|
+ private bool _isDIReplenPerfillTimeOut = false;
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
@@ -340,16 +340,13 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// </summary>
|
|
|
public CounterFlowData ReservoirCounterByPassFlow { get { return _reservoirCounterByPassFlow; } }
|
|
|
/// <summary>
|
|
|
- /// 补水累计超时
|
|
|
+ /// 累计补水是否超时
|
|
|
/// </summary>
|
|
|
- public bool DiReplenMaxTimeOut
|
|
|
- {
|
|
|
- get { return _diReplenMaxTimeOut; }
|
|
|
- }
|
|
|
+ public bool IsDIReplenMaxTimeOut { get { return _isDIReplenMaxTimeOut; } }
|
|
|
/// <summary>
|
|
|
- /// 注水是否出错
|
|
|
+ /// 单次补水是否超时
|
|
|
/// </summary>
|
|
|
- public bool IsDiReplenInFault { get { return _isDiReplenInFault; } }
|
|
|
+ public bool IsDIReplenPerfillTimeOut { get { return _isDIReplenPerfillTimeOut; } }
|
|
|
/// <summary>
|
|
|
/// Facility DIReplenOn
|
|
|
/// </summary>
|
|
@@ -488,13 +485,13 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
DATA.Subscribe($"{Module}.IsCALowLevel", () => IsCALowLevel, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.IsANHighLevel", () => IsANHighLevel, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.IsANLowLevel", () => IsANLowLevel, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
- DATA.Subscribe($"{Module}.IsDIReplenInFault", () => _isDiReplenInFault, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.EvaporatorType", () => reservoirItem.EvaporatorType, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.CroseDoseType", () => reservoirItem.CrossDoseType, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.IsLeakDetected", () => _isLeakDetected, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.IsCrossDoseInstalled", () => _isCrossDoseInstalled, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
DATA.Subscribe($"{Module}.ANBypassCounterFlow", () => ReservoirCounterByPassFlow.CounterValue, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
- DATA.Subscribe($"{Module}.DIReplenMaxTimeOut", () => _diReplenMaxTimeOut, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+ DATA.Subscribe($"{Module}.IsDIReplenPerfillTimeOut", () => _isDIReplenPerfillTimeOut, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
+ DATA.Subscribe($"{Module}.IsDIReplenMaxTimeOut", () => _isDIReplenMaxTimeOut, SubscriptionAttribute.FLAG.IgnoreSaveDB);
|
|
|
|
|
|
if (_isCrossDoseInstalled)
|
|
|
{
|
|
@@ -567,17 +564,10 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// <param name="args"></param>
|
|
|
private bool DIReplenClearError(string cmd, object[] args)
|
|
|
{
|
|
|
- _isDiReplenInFault = false;
|
|
|
+ _isDIReplenPerfillTimeOut = false;
|
|
|
return true;
|
|
|
}
|
|
|
/// <summary>
|
|
|
- /// DI Replen超时
|
|
|
- /// </summary>
|
|
|
- private void DiReplenTimeOutOpeartion(bool timeOutFlag)
|
|
|
- {
|
|
|
- _diReplenMaxTimeOut = timeOutFlag;
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
/// 重置时长
|
|
|
/// </summary>
|
|
|
/// <param name="cmd"></param>
|
|
@@ -585,7 +575,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// <returns></returns>
|
|
|
private bool ResetTotalTime(string cmd, object[] objs)
|
|
|
{
|
|
|
- _diReplenMaxTimeOut = false;
|
|
|
+ _isDIReplenMaxTimeOut = false;
|
|
|
_persistentValue.TotalReplen = 0;
|
|
|
_persistentValue.LastTotalReplen = 0;
|
|
|
ReservoirsPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
@@ -729,7 +719,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
|
|
|
if (_reservoirData.ANDiReplen) ANDiReplenOff("", null);
|
|
|
if (_reservoirData.CADiReplen) CADiReplenOff("", null);
|
|
|
- _isDiReplenInFault = false;
|
|
|
+ _isDIReplenPerfillTimeOut = false;
|
|
|
|
|
|
_persistentValue.OperatingMode = currentOperation;
|
|
|
|
|
@@ -902,7 +892,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (!_isTotalDIReplenWarnOn)
|
|
|
{
|
|
|
_isTotalDIReplenWarnOn = true;
|
|
|
- LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, "Facilities DiReplen is Off");
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, "Facilities DiReplen is Off, can't start auto diReplen");
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
@@ -913,7 +903,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
SafetyDevice safetyDevice = DEVICE.GetDevice<SafetyDevice>("Safety");
|
|
|
if (safetyDevice != null && safetyDevice.SafetyData.ReservoirHighLevel)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"Safety high is Activate");
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"Safety high is Activate, can't start auto diReplen");
|
|
|
return false;
|
|
|
}
|
|
|
if (CheckOtherReservoirDiReplenStatus())
|
|
@@ -955,7 +945,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (!_isOtherDIReplenWarnOn)
|
|
|
{
|
|
|
_isOtherDIReplenWarnOn = true;
|
|
|
- LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} DIReplen is on");
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} DiReplen valve is on. {Module} is waiting DiReplen");
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -968,7 +958,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (!_isOtherDIReplenWarnOn)
|
|
|
{
|
|
|
_isOtherDIReplenWarnOn = true;
|
|
|
- LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} AN_DIReplen is on");
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} AN DiReplen valve is on. {Module} is waiting DiReplen");
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -977,7 +967,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (!_isOtherDIReplenWarnOn)
|
|
|
{
|
|
|
_isOtherDIReplenWarnOn = true;
|
|
|
- LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} CA_DIReplen is on");
|
|
|
+ LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"{item} CA DiReplen valve is on. {Module} is waiting DiReplen");
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -1559,16 +1549,16 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"{Module} is not initialized. Can't start DiReplen");
|
|
|
return false;
|
|
|
}
|
|
|
- if (DiReplenMaxTimeOut)
|
|
|
+ if (IsDIReplenMaxTimeOut)
|
|
|
{
|
|
|
double diValveMaxOnTime = SC.GetValue<double>($"Reservoir.{Module}.DIValveMaxOnTime");
|
|
|
- LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"Direplen time over conifg's DIValveMaxOnTime:{diValveMaxOnTime} min");
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"DiReplen time over conifg's DIValveMaxOnTime:{diValveMaxOnTime} min");
|
|
|
return false;
|
|
|
}
|
|
|
- if (IsDiReplenInFault)
|
|
|
+ if (IsDIReplenPerfillTimeOut)
|
|
|
{
|
|
|
double diValveMaxOnTimePerFill = SC.GetValue<double>($"Reservoir.{Module}.DIValveMaxOnTimePerFill");
|
|
|
- LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"Direplen time over conifg's DIValveMaxOnTimePerFill:{diValveMaxOnTimePerFill} min");
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"DiReplen time over conifg's DIValveMaxOnTimePerFill:{diValveMaxOnTimePerFill} min");
|
|
|
return false;
|
|
|
}
|
|
|
bool result = direplenOn("", null);
|
|
@@ -2417,40 +2407,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// <returns></returns>
|
|
|
private bool OnTimer()
|
|
|
{
|
|
|
- //补水监控
|
|
|
- if (_direplenHelper != null)
|
|
|
- {
|
|
|
- _direplenHelper.MonitorPeriodTime(DiReplenTimeOutOpeartion);
|
|
|
- if (!_diReplenMaxTimeOut && !_isDiReplenInFault && TotalDIReplenOn)
|
|
|
- {
|
|
|
- if (_currentOperation == ReservoirOperation.ManualANDiReplen)
|
|
|
- {
|
|
|
- bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, ANDiReplenOff, DiReplenTimeOutOpeartion);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- _currentOperation = ReservoirOperation.None;
|
|
|
- }
|
|
|
- }
|
|
|
- if (_currentOperation == ReservoirOperation.ManualCADiReplen)
|
|
|
- {
|
|
|
- bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, CADiReplenOff, DiReplenTimeOutOpeartion);
|
|
|
- if (result)
|
|
|
- {
|
|
|
- _currentOperation = ReservoirOperation.None;
|
|
|
- }
|
|
|
- }
|
|
|
- if (_currentOperation == ReservoirOperation.AutoANDiReplen)
|
|
|
- {
|
|
|
- AutoDiReplenMonitor(ANDiReplenOff, _reservoirData.ANLevel, _resRecipe.ReservoirANLevel, _resRecipe.ANDIReplenEnable,
|
|
|
- _resRecipe.ANDIReplenTimeRate, _resRecipe.ANDIReplenCurrentRate);
|
|
|
- }
|
|
|
- if (_currentOperation == ReservoirOperation.AutoCADiReplen)
|
|
|
- {
|
|
|
- AutoDiReplenMonitor(CADiReplenOff, _reservoirData.CALevel, _resRecipe.ReservoirCALevel, _resRecipe.DIReplenEnable,
|
|
|
- _resRecipe.DIReplenTimeRate, _resRecipe.DIReplenCurrentRate);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
//计算AN/CA level的平均值
|
|
|
if (ReservoirData != null)
|
|
|
{
|
|
@@ -2570,17 +2527,49 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
if (ReservoirData.CASampleFlow) CASampleOff("", null);
|
|
|
}
|
|
|
//DIReplen总阀未开关闭槽体DIReplen;未初始化关闭槽体DIReplen
|
|
|
- if (!systemFacility.DIReplenEnable || (reservoirEntity == null || !reservoirEntity.IsInitialized))
|
|
|
+ if (!systemFacility.DIReplenEnable || reservoirEntity == null || !reservoirEntity.IsInitialized)
|
|
|
{
|
|
|
if (_reservoirData.ANDiReplen) ANDiReplenOff("", null);
|
|
|
if (_reservoirData.CADiReplen) CADiReplenOff("", null);
|
|
|
}
|
|
|
if (reservoirEntity == null || !reservoirEntity.IsInitialized)
|
|
|
{
|
|
|
- if (_reservoirData.ANDiReplen) ANDiReplenOff("", null);
|
|
|
- if (_reservoirData.CADiReplen) CADiReplenOff("", null);
|
|
|
return true;
|
|
|
}
|
|
|
+ //补水监控
|
|
|
+ if (_direplenHelper != null)
|
|
|
+ {
|
|
|
+ _direplenHelper.MonitorPeriodTime(ref _isDIReplenMaxTimeOut);
|
|
|
+ if (!_isDIReplenMaxTimeOut && !_isDIReplenPerfillTimeOut && TotalDIReplenOn)
|
|
|
+ {
|
|
|
+ if (_currentOperation == ReservoirOperation.ManualANDiReplen)
|
|
|
+ {
|
|
|
+ bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, ANDiReplenOff, ref _isDIReplenMaxTimeOut);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _currentOperation = ReservoirOperation.None;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (_currentOperation == ReservoirOperation.ManualCADiReplen)
|
|
|
+ {
|
|
|
+ bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, CADiReplenOff, ref _isDIReplenMaxTimeOut);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _currentOperation = ReservoirOperation.None;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (_currentOperation == ReservoirOperation.AutoANDiReplen)
|
|
|
+ {
|
|
|
+ AutoDiReplenMonitor(ANDiReplenOff, _reservoirData.ANLevel, _resRecipe.ReservoirANLevel, _resRecipe.ANDIReplenEnable,
|
|
|
+ _resRecipe.ANDIReplenTimeRate, _resRecipe.ANDIReplenCurrentRate);
|
|
|
+ }
|
|
|
+ if (_currentOperation == ReservoirOperation.AutoCADiReplen)
|
|
|
+ {
|
|
|
+ AutoDiReplenMonitor(CADiReplenOff, _reservoirData.CALevel, _resRecipe.ReservoirCALevel, _resRecipe.DIReplenEnable,
|
|
|
+ _resRecipe.DIReplenTimeRate, _resRecipe.DIReplenCurrentRate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
if (_isCrossDoseInstalled)
|
|
|
{
|
|
|
if (_crossDoseHelper.CrossDoseState == RState.Running)
|
|
@@ -2633,12 +2622,10 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
private void AutoDiReplenMonitor(Func<string, object[], bool> direplenOff, double level, double recipeLevel, bool replenEnable,
|
|
|
int direplenTimeRate, int direplenCurrentRate)
|
|
|
{
|
|
|
- var result = _direplenHelper.AutoDiReplenMonitorTimeOut(direplenOff, DiReplenTimeOutOpeartion);
|
|
|
- if (result.Item1)
|
|
|
+ var result = _direplenHelper.AutoDiReplenMonitorTimeOut(direplenOff, ref _isDIReplenMaxTimeOut, ref _isDIReplenPerfillTimeOut);
|
|
|
+ if (result)
|
|
|
{
|
|
|
_currentOperation = ReservoirOperation.None;
|
|
|
- //触发注水异常信号
|
|
|
- if (result.Item2 == DIReplenFaultType.PerFillTimeOut) _isDiReplenInFault = true;
|
|
|
}
|
|
|
else
|
|
|
{
|