修改BaseRoutineWithDeviceLocker中的输出信息。

This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2022-11-18 16:58:06 +08:00
parent 2f04489b1d
commit 88db09ea52
1 changed files with 14 additions and 3 deletions

View File

@ -31,27 +31,38 @@ namespace MECF.Framework.RT.EquipmentLibrary.Core
public void LockPump2(out string reason, int timeoutMs = Int32.MaxValue)
{
reason = "";
EV.PostInfoLog(Module, $"[{Module}] is locking the Pump2");
var ret = _lockerPump2?.TryLock(Module, out reason, timeoutMs);
if (ret.HasValue == false || ret == DeviceLocker.Results.Ok ||
ret == DeviceLocker.Results.IHaveLocker) // 不需要锁定、已锁定成功、或已占有该锁
{
EV.PostInfoLog(Module, $"[{Module}] locked the Pump2, Result: {ret}");
return;
}
// 无法锁定设备。
EV.PostWarningLog(Module, $"[{Module}] was unable to lock Pump2, {reason}");
throw new Exception($"unable to lock {_lockerPump2.LockerName} by {Module}, {reason}");
}
public void UnlockPump2()
{
EV.PostInfoLog(Module, $"[{Module}] is unlocking the Pump2");
var reason = "";
var ret = _lockerPump2?.TryUnlock(Module, out reason);
if (ret.HasValue == false || ret == DeviceLocker.Results.Ok) // 不需要锁定、解锁成功
{
EV.PostInfoLog(Module, $"[{Module}] unlock the Pump2, Result: {ret}");
return;
EV.PostWarningLog(Module, $"Unable to unlock pump2, {reason}");
}
EV.PostWarningLog(Module, $"[{Module}] was unable to unlock pump2, {reason}");
}
public void ResetLockerPump2()
{
EV.PostInfoLog(Module, $"{Module} reset the locker of Pump2");
_lockerPump2?.Reset();
}