|
@@ -163,6 +163,14 @@ namespace CyberX8_RT.Modules.Metal
|
|
|
private bool _isCurrentWarningB = false;
|
|
|
private bool _isZeroCurrent = false;
|
|
|
private int _totalMicrosecond = 0;
|
|
|
+
|
|
|
+ private double _currentHoldoffTime;
|
|
|
+ private double _voltageHoldoffTime;
|
|
|
+ private double _cellFlowHoldoffTime;
|
|
|
+
|
|
|
+ private HoldoffTimeSignalMonitor _currentHoldoffTimeSignalMonitor;
|
|
|
+ private HoldoffTimeSignalMonitor _voltageHoldoffTimeSignalMonitor;
|
|
|
+ private HoldoffTimeSignalMonitor _cellFlowHoldoffTimeSignalMonitor;
|
|
|
#endregion
|
|
|
#region 属性
|
|
|
/// <summary>
|
|
@@ -187,7 +195,13 @@ namespace CyberX8_RT.Modules.Metal
|
|
|
/// </summary>
|
|
|
public ReservoirRunRecipeRoutine(string moduleName) : base(moduleName)
|
|
|
{
|
|
|
+ _currentHoldoffTime = SC.GetValue<double>($"Metal.CurrentAlarmHoldoffTime");
|
|
|
+ _voltageHoldoffTime = SC.GetValue<double>($"Metal.VoltageAlarmHoldoffTime");
|
|
|
+ _cellFlowHoldoffTime = SC.GetValue<double>($"Metal.CellFlowAlarmHoldoffTime");
|
|
|
|
|
|
+ _currentHoldoffTimeSignalMonitor = new HoldoffTimeSignalMonitor(Module, "Current");
|
|
|
+ _voltageHoldoffTimeSignalMonitor = new HoldoffTimeSignalMonitor(Module, "Voltage");
|
|
|
+ _cellFlowHoldoffTimeSignalMonitor = new HoldoffTimeSignalMonitor(Module, "CellFlow");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -647,9 +661,43 @@ namespace CyberX8_RT.Modules.Metal
|
|
|
Abort();
|
|
|
return true;
|
|
|
}
|
|
|
+ if (!CheckMetalCellFlow()) //校验Manual 状态下run recipe的 cell flow和hold flow
|
|
|
+ {
|
|
|
+ Abort();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
return false;
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 监控流量
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ private bool CheckMetalCellFlow()
|
|
|
+ {
|
|
|
+ MetalEntity metalEntity = Singleton<RouteManager>.Instance.GetModule<MetalEntity>(Module);
|
|
|
+ if (metalEntity != null && metalEntity.IsManual)
|
|
|
+ {
|
|
|
+ MetalItem metalItem = MetalItemManager.Instance.GetMetalItem(Module);
|
|
|
+ _metalType = metalItem.SubType;
|
|
|
+ if (_metalType == STRATUS)
|
|
|
+ {
|
|
|
+ StandardHotMetalDevice _standardHotMetalDevice = DEVICE.GetDevice<StandardHotMetalDevice>(Module.ToString());
|
|
|
+ //if (_standardHotMetalDevice.MetalDeviceData.CellFlow <= 0)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_METAL, Module.ToString(), $"{Module} metal cell flow is 0");
|
|
|
+ // return false;
|
|
|
+ //}
|
|
|
+ bool cellFlowSignalresulte = _cellFlowHoldoffTimeSignalMonitor.IsSignalAbnormal(_cellFlowHoldoffTime, _standardHotMetalDevice.MetalDeviceData.CellFlow, null, 0);
|
|
|
+ if (cellFlowSignalresulte)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module.ToString(), $"{Module} metal cell flow is 0");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 检验电压电流的合理性
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
@@ -736,17 +784,29 @@ namespace CyberX8_RT.Modules.Metal
|
|
|
double maxVoltage = _recipe.VolatageLimitMax;
|
|
|
double warnVoltage = _recipe.VoltageWarningLevel;
|
|
|
double minVoltage = _recipe.VolatageLimitMin;
|
|
|
- if (voltage > maxVoltage)
|
|
|
+ //if (voltage > maxVoltage)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is large than recipe max voltage {maxVoltage}");
|
|
|
+ // return true;
|
|
|
+ //}
|
|
|
+ //if (voltage < minVoltage)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is less than recipe min voltage {minVoltage}");
|
|
|
+ // return true;
|
|
|
+ //}
|
|
|
+ bool voltageSignalresulte = _voltageHoldoffTimeSignalMonitor.IsSignalAbnormal(_voltageHoldoffTime, voltage, maxVoltage, minVoltage);
|
|
|
+ if (voltageSignalresulte)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is large than recipe max voltage {maxVoltage}");
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (voltage < minVoltage)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is less than recipe min voltage {minVoltage}");
|
|
|
+ if (voltage > maxVoltage)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is large than recipe max voltage {maxVoltage}");
|
|
|
+ }
|
|
|
+ if (voltage < minVoltage)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} voltage {voltage} is less than recipe min voltage {minVoltage}");
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
if (voltage > warnVoltage)
|
|
|
{
|
|
|
string str = $"{side} voltage is {voltage} in warning";
|
|
@@ -760,17 +820,29 @@ namespace CyberX8_RT.Modules.Metal
|
|
|
double minErrorCurrent = _powerSupplierStepPeriodDatas[_stepIndex].Current * (double)(1 - _recipe.FaultPercent * 0.01);
|
|
|
double maxWarnCurrent = _powerSupplierStepPeriodDatas[_stepIndex].Current * (double)(1 + _recipe.CurrentWarningLevel * 0.01);
|
|
|
double minWarnCurrent = _powerSupplierStepPeriodDatas[_stepIndex].Current * (double)(1 - _recipe.CurrentWarningLevel * 0.01);
|
|
|
- if (current > maxErrorCurrent)
|
|
|
+ //if (current > maxErrorCurrent)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is large than recipe max current {maxErrorCurrent}");
|
|
|
+ // return true;
|
|
|
+ //}
|
|
|
+ //if (current < minErrorCurrent)
|
|
|
+ //{
|
|
|
+ // LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is less than recipe min current {minErrorCurrent}");
|
|
|
+ // return true;
|
|
|
+ //}
|
|
|
+ bool currentSignalresulte = _currentHoldoffTimeSignalMonitor.IsSignalAbnormal(_currentHoldoffTime, current, maxErrorCurrent, minErrorCurrent);
|
|
|
+ if (currentSignalresulte)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is large than recipe max current {maxErrorCurrent}");
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (current < minErrorCurrent)
|
|
|
- {
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is less than recipe min current {minErrorCurrent}");
|
|
|
+ if (current > maxErrorCurrent)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is large than recipe max current {maxErrorCurrent}");
|
|
|
+ }
|
|
|
+ if (current < minErrorCurrent)
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_METAL, Module, $"{side} current {current} is less than recipe min current {minErrorCurrent}");
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
if ((current <= maxErrorCurrent && current >= maxWarnCurrent) || (current >= minErrorCurrent && current <= minWarnCurrent))
|
|
|
{
|
|
|
string str = $"{side} current {current} is in warning";
|