手动确认解锁成功失败

zw
lxw 5 months ago
parent 91aa8c12e6
commit 7319365131

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

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

@ -32,11 +32,12 @@ public class SwappingStateMachine : IDisposable
//手动确认换电成功 //手动确认换电成功
public bool ManualSwapSuccFlag { get; set; } = false; 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 OperateModel OperateModel = null;
public readonly LedTool? LedTool = null; public readonly LedTool? LedTool = null;
@ -279,6 +280,23 @@ public class SwappingStateMachine : IDisposable
Log.Info($"ManualSwapSuccFlag machine ok"); Log.Info($"ManualSwapSuccFlag machine ok");
return true; 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() private void ResetData()
@ -305,8 +323,8 @@ public class SwappingStateMachine : IDisposable
PlcSwapFlag = false; PlcSwapFlag = false;
ManualSwapSuccFlag = false; ManualSwapSuccFlag = false;
OperateModel = null; OperateModel = null;
ManualConfirmCarOperateFlag = false; ManualConfirmCarUnlockFlag = false;
ManualConfirmCarLockFlag = false;
CancelFlag = false; CancelFlag = false;
StopFlag = false; StopFlag = false;
} }

@ -293,4 +293,24 @@ public class SwapMonitorController : ControllerBase
return Result<List<TboxCarInfoModel>>.Success(carInfoList.Where(i => i.CarNo.Length >= 17).ToList()); 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