|
@@ -269,6 +269,10 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// 用于控制打印错误log
|
|
|
/// </summary>
|
|
|
private HashSet<string> errorLogSet = new HashSet<string>();
|
|
|
+ /// <summary>
|
|
|
+ /// 累计补水超时
|
|
|
+ /// </summary>
|
|
|
+ private bool _diReplenMaxTimeOut;
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
@@ -328,6 +332,13 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// ReservoirCounterByPassFlow
|
|
|
/// </summary>
|
|
|
public CounterFlowData ReservoirCounterByPassFlow { get { return _reservoirCounterByPassFlow; } }
|
|
|
+ /// <summary>
|
|
|
+ /// 补水累计超时
|
|
|
+ /// </summary>
|
|
|
+ public bool DiReplenMaxTimeOut
|
|
|
+ {
|
|
|
+ get { return _diReplenMaxTimeOut; }
|
|
|
+ }
|
|
|
#endregion
|
|
|
/// <summary>
|
|
|
/// 初始化成功清除对应的错误log
|
|
@@ -526,6 +537,13 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
|
|
|
#region Operation
|
|
|
/// <summary>
|
|
|
+ /// DI Replen超时
|
|
|
+ /// </summary>
|
|
|
+ private void DiReplenTimeOutOpeartion(bool timeOutFlag)
|
|
|
+ {
|
|
|
+ _diReplenMaxTimeOut = timeOutFlag;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 重置时长
|
|
|
/// </summary>
|
|
|
/// <param name="cmd"></param>
|
|
@@ -533,6 +551,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
/// <returns></returns>
|
|
|
private bool ResetTotalTime(string cmd, object[] objs)
|
|
|
{
|
|
|
+ _diReplenMaxTimeOut = false;
|
|
|
_persistentValue.TotalReplen = 0;
|
|
|
_persistentValue.LastTotalReplen = 0;
|
|
|
ReservoirsPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
@@ -1479,6 +1498,18 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
LOG.WriteLog(eEvent.ERR_RESERVOIR, Module, $"current operation is {_currentOperation},cannot execute {direplenOperation}");
|
|
|
return false;
|
|
|
}
|
|
|
+ ReservoirEntity reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(Module);
|
|
|
+ if (!reservoirEntity.IsInitialized)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"{Module} is not initialized. Can't start DiReplen");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (DiReplenMaxTimeOut)
|
|
|
+ {
|
|
|
+ double diValveMaxOnTime = SC.GetValue<double>($"Reservoir.{Module}.DIValveMaxOnTime");
|
|
|
+ LOG.WriteLog(eEvent.WARN_RESERVOIR, Module, $"Direplen time over conifg's DIValveMaxOnTime:{diValveMaxOnTime} min");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
bool result = direplenOn("", null);
|
|
|
if (result)
|
|
|
{
|
|
@@ -2328,34 +2359,36 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
//补水监控
|
|
|
if (_direplenHelper != null)
|
|
|
{
|
|
|
- _direplenHelper.MonitorPeriodTime();
|
|
|
-
|
|
|
- if (_currentOperation == ReservoirOperation.ManualANDiReplen)
|
|
|
+ _direplenHelper.MonitorPeriodTime(DiReplenTimeOutOpeartion);
|
|
|
+ if (!_diReplenMaxTimeOut)
|
|
|
{
|
|
|
- bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, ANDiReplenOff);
|
|
|
- if (result)
|
|
|
+ if (_currentOperation == ReservoirOperation.ManualANDiReplen)
|
|
|
{
|
|
|
- _currentOperation = ReservoirOperation.None;
|
|
|
+ bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, ANDiReplenOff, DiReplenTimeOutOpeartion);
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ _currentOperation = ReservoirOperation.None;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (_currentOperation == ReservoirOperation.ManualCADiReplen)
|
|
|
- {
|
|
|
- bool result = _direplenHelper.MonitorManualDiReplenComplete(_manualReplenSecond, CADiReplenOff);
|
|
|
- if (result)
|
|
|
+ if (_currentOperation == ReservoirOperation.ManualCADiReplen)
|
|
|
{
|
|
|
- _currentOperation = ReservoirOperation.None;
|
|
|
+ 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);
|
|
|
- }
|
|
|
+ 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)
|
|
@@ -2478,6 +2511,8 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
|
|
|
if (reservoirEntity == null || !reservoirEntity.IsInitialized)
|
|
|
{
|
|
|
+ if (_reservoirData.ANDiReplen) ANDiReplenOff("", null);
|
|
|
+ if (_reservoirData.CADiReplen) CADiReplenOff("", null);
|
|
|
return true;
|
|
|
}
|
|
|
if (_isCrossDoseInstalled)
|
|
@@ -2532,7 +2567,7 @@ namespace CyberX8_RT.Devices.Reservoir
|
|
|
private void AutoDiReplenMonitor(Func<string, object[], bool> direplenOff, double level, double recipeLevel, bool replenEnable,
|
|
|
int direplenTimeRate, int direplenCurrentRate)
|
|
|
{
|
|
|
- bool result = _direplenHelper.AutoDiReplenMonitorTimeOut(direplenOff);
|
|
|
+ bool result = _direplenHelper.AutoDiReplenMonitorTimeOut(direplenOff, DiReplenTimeOutOpeartion);
|
|
|
if (result)
|
|
|
{
|
|
|
_currentOperation = ReservoirOperation.None;
|