|
|
|
@ -3,6 +3,7 @@ using Entity.Constant;
|
|
|
|
|
using HybirdFrameworkCore.Entity;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Service.Execute;
|
|
|
|
|
using Service.Execute.Api;
|
|
|
|
|
using Service.Init;
|
|
|
|
|
using Service.Plc.Client;
|
|
|
|
|
using Service.Station;
|
|
|
|
@ -56,6 +57,38 @@ public class SwapMonitorController : ControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 车辆手动上锁解锁
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("LockCar")]
|
|
|
|
|
public async Task<Result<bool>> LockCar()
|
|
|
|
|
{
|
|
|
|
|
if (StationSoftMgr.SwappingStateMachine.RfidReadModel == null)
|
|
|
|
|
{
|
|
|
|
|
return Result<bool>.Fail("暂无车辆");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var success = await TBoxApi.LockCarManyTimes(StationSoftMgr.SwappingStateMachine.RfidReadModel.VelNo);
|
|
|
|
|
return success ? Result<bool>.Success() : Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 车辆手动解锁
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost("UnLockCar")]
|
|
|
|
|
public async Task<Result<bool>> UnLockCar()
|
|
|
|
|
{
|
|
|
|
|
if (StationSoftMgr.SwappingStateMachine.RfidReadModel == null)
|
|
|
|
|
{
|
|
|
|
|
return Result<bool>.Fail("暂无车辆");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var success = await TBoxApi.UnLockCarManyTimes(StationSoftMgr.SwappingStateMachine.RfidReadModel.VelNo);
|
|
|
|
|
return success ? Result<bool>.Success() : Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取充电监控大屏 充电次数 每五分钟获取一次
|
|
|
|
|
/// </summary>
|
|
|
|
@ -77,15 +110,6 @@ public class SwapMonitorController : ControllerBase
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 设置换电方式:1:自动换电 2:手动换电
|
|
|
|
|
/// </summary>
|
|
|
|
|
[HttpPost("SetSwapWay/{swapWay}")]
|
|
|
|
|
public async Task<Result<bool>> SetSwapWay(int stationSwapWay)
|
|
|
|
|
{
|
|
|
|
|
StaticStationInfo.StationWay = stationSwapWay;
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -125,7 +149,7 @@ public class SwapMonitorController : ControllerBase
|
|
|
|
|
[HttpPost("AllLightsOff")]
|
|
|
|
|
public async Task<Result<bool>> AllLightsOff()
|
|
|
|
|
{
|
|
|
|
|
return PlcMgr.AllLightsOff()? Result<bool>.Success(true):Result<bool>.Fail();
|
|
|
|
|
return PlcMgr.AllLightsOff() ? Result<bool>.Success(true) : Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -135,8 +159,9 @@ public class SwapMonitorController : ControllerBase
|
|
|
|
|
[HttpPost("AllLightsOn")]
|
|
|
|
|
public async Task<Result<bool>> AllLightsOn()
|
|
|
|
|
{
|
|
|
|
|
return PlcMgr.AllLightsOn()? Result<bool>.Success(true):Result<bool>.Fail();
|
|
|
|
|
return PlcMgr.AllLightsOn() ? Result<bool>.Success(true) : Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 得到现在灯光状态
|
|
|
|
|
/// </summary>
|
|
|
|
@ -144,7 +169,7 @@ public class SwapMonitorController : ControllerBase
|
|
|
|
|
[HttpPost("GetNowLightsOn")]
|
|
|
|
|
public async Task<Result<ushort>> GetNowLightsOn()
|
|
|
|
|
{
|
|
|
|
|
return Result<ushort>.Success(PlcMgr.GetNowLightsOn());
|
|
|
|
|
return Result<ushort>.Success(PlcMgr.GetNowLightsOn());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|