手动确认解锁成功失败

master
lxw 5 months ago
parent 91aa8c12e6
commit 7319365131

@ -61,8 +61,9 @@ public class CarCtrlState : IState
//查询车辆锁止状态
Task<TboxCarInfoModel> carInfo = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin);
var resultHeartBeatMsg = carInfo.Result.CarStatus;
if (resultHeartBeatMsg?.LockStatus == 1)
if (resultHeartBeatMsg?.LockStatus == 1 || machine.ManualConfirmCarUnlockFlag)
{
machine.ManualConfirmCarUnlockFlag = false;
machine.BoxCarInfoModel = carInfo.Result;
machine.VelUnlockFlag = true;
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.VelUnlockFlag,

@ -103,8 +103,9 @@ public class SwapDoneState : IState
{
//查询车辆锁止状态
Task<TboxCarInfoModel> carInfo = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin);
if (carInfo.Result?.CarStatus?.LockStatus == 2)
if (carInfo.Result?.CarStatus?.LockStatus == 2 || machine.ManualConfirmCarLockFlag)
{
machine.ManualConfirmCarLockFlag = false;
machine.BoxCarInfoModel = carInfo.Result;
//设置出口的是绿灯
if (PlcApi.WriteExistLamp(1000))

@ -34,9 +34,10 @@ public class SwappingStateMachine : IDisposable
public bool ManualSwapSuccFlag { get; set; } = false;
//手动确认解锁/上锁成功
public bool ManualConfirmCarOperateFlag { get; set; }
public bool ManualConfirmCarUnlockFlag { get; set; }
//手动确认解锁/上锁成功
public bool ManualConfirmCarLockFlag { get; set; }
public OperateModel OperateModel = null;
public readonly LedTool? LedTool = null;
@ -280,6 +281,23 @@ public class SwappingStateMachine : IDisposable
return true;
}
public bool ManualConfirmLockCar()
{
ManualConfirmCarLockFlag = true;
Thread.Sleep(2000);
Log.Info($"ManualConfirmLockCar ok");
return true;
}
public bool ManualConfirmUnLockCar()
{
ManualConfirmCarUnlockFlag = true;
Thread.Sleep(2000);
Log.Info($"ManualConfirmLockCar ok");
return true;
}
private void ResetData()
{
@ -305,8 +323,8 @@ public class SwappingStateMachine : IDisposable
PlcSwapFlag = false;
ManualSwapSuccFlag = false;
OperateModel = null;
ManualConfirmCarOperateFlag = false;
ManualConfirmCarUnlockFlag = false;
ManualConfirmCarLockFlag = false;
CancelFlag = false;
StopFlag = false;
}

@ -293,4 +293,24 @@ public class SwapMonitorController : ControllerBase
return Result<List<TboxCarInfoModel>>.Success(carInfoList.Where(i => i.CarNo.Length >= 17).ToList());
}
/// <summary>
/// 确认上锁成功
/// </summary>
[HttpGet("ConfirmLockSucc")]
public async Task<Result<bool>> ConfirmLockSucc()
{
StationSoftMgr.SwappingStateMachine.ManualConfirmLockCar();
return Result<bool>.Success();
}
/// <summary>
/// 确认解锁成功
/// </summary>
[HttpGet("ConfirmUnLockSucc")]
public async Task<Result<bool>> ConfirmUnLockSucc()
{
StationSoftMgr.SwappingStateMachine.ManualConfirmUnLockCar();
return Result<bool>.Success();
}
}
Loading…
Cancel
Save