|
|
@@ -20,6 +20,7 @@ using PunkHPX8_RT.Devices.Reservoir;
|
|
|
using PunkHPX8_RT.Devices.VpwMain;
|
|
|
using PunkHPX8_RT.Modules;
|
|
|
using PunkHPX8_RT.Modules.PlatingCell;
|
|
|
+using PunkHPX8_RT.Modules.Reservoir;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
@@ -428,7 +429,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
string preOperation = _persistentValue.OperatingMode;
|
|
|
if (platingCellEntity.IsBusy)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{Module} is Busy, can't switch to Disabled mode");
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{Module} is Busy, can't switch to Disabled mode");
|
|
|
return false;
|
|
|
}
|
|
|
//if (SchedulerMetalTimeManager.Instance.Contained(Module))
|
|
|
@@ -439,7 +440,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
platingCellEntity.EnterInit();
|
|
|
_persistentValue.OperatingMode = currentOperation;
|
|
|
|
|
|
- LOG.WriteLog(eEvent.INFO_METAL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
+ LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
}
|
|
|
PlatingCellPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
|
return true;
|
|
|
@@ -459,7 +460,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
string preOperation = _persistentValue.OperatingMode;
|
|
|
if (platingCellEntity.IsBusy)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{Module} is Busy, can't switch to Manual mode");
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{Module} is Busy, can't switch to Manual mode");
|
|
|
return false;
|
|
|
}
|
|
|
//if (SchedulerMetalTimeManager.Instance.Contained(Module))
|
|
|
@@ -470,7 +471,7 @@ namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
platingCellEntity.EnterInit();
|
|
|
_persistentValue.OperatingMode = currentOperation;
|
|
|
|
|
|
- LOG.WriteLog(eEvent.INFO_METAL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
+ LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
}
|
|
|
|
|
|
PlatingCellPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
|
@@ -485,19 +486,26 @@ namespace PunkHPX8_RT.Devices.PlatingCell
|
|
|
public bool AutoOperation(string cmd, object[] args)
|
|
|
{
|
|
|
string currentOperation = "Auto";
|
|
|
+ ReservoirEntity reservoirEntity = Singleton<RouteManager>.Instance.GetModule<ReservoirEntity>(_reservoirName);
|
|
|
+ if (reservoirEntity!=null && reservoirEntity.PersistentValue.OperatingMode!="Auto")
|
|
|
+ {
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{_reservoirName} not in Auto mode, can't switch to Auto mode");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
PlatingCellEntity platingCellEntity = Singleton<RouteManager>.Instance.GetModule<PlatingCellEntity>(Module);
|
|
|
+
|
|
|
if (platingCellEntity != null && _persistentValue != null && _persistentValue.OperatingMode != currentOperation)
|
|
|
{
|
|
|
string preOperation = _persistentValue.OperatingMode;
|
|
|
if (platingCellEntity.IsBusy)
|
|
|
{
|
|
|
- LOG.WriteLog(eEvent.ERR_METAL, Module, $"{Module} is Busy, can't switch to Auto mode");
|
|
|
+ LOG.WriteLog(eEvent.ERR_PLATINGCELL, Module, $"{Module} is Busy, can't switch to Auto mode");
|
|
|
return false;
|
|
|
}
|
|
|
platingCellEntity.EnterInit();
|
|
|
_persistentValue.OperatingMode = currentOperation;
|
|
|
|
|
|
- LOG.WriteLog(eEvent.INFO_METAL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
+ LOG.WriteLog(eEvent.INFO_PLATINGCELL, Module, $"Operating mode is switched from {preOperation} to {currentOperation}");
|
|
|
}
|
|
|
PlatingCellPersistentManager.Instance.UpdatePersistentValue(Module);
|
|
|
return true;
|