|
|
|
@ -21,12 +21,12 @@ namespace Service.Station;
|
|
|
|
|
[Scope("SingleInstance")]
|
|
|
|
|
public class MonitorService
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
private static readonly ILog Log = LogManager.GetLogger(typeof(MonitorService));
|
|
|
|
|
public BinInfoRepository BinInfoRepository { get; set; }
|
|
|
|
|
public SwapOrderRepository SwapOrderRepository { get; set; }
|
|
|
|
|
public ChargeOrderRepository ChargeOrderRepository { get; set; }
|
|
|
|
|
public PlcTaskMgr PlcTaskMgr { get; set; }
|
|
|
|
|
|
|
|
|
|
public Result<SwapMonitorScreenResp> GetSwapMonitorData()
|
|
|
|
|
{
|
|
|
|
|
var configBinInfo =
|
|
|
|
@ -102,14 +102,14 @@ public class MonitorService
|
|
|
|
|
/// 连接状态类
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public Result<DeviceStateResp> GetDeviceState()
|
|
|
|
|
public async Task<Result<DeviceStateResp>> GetDeviceState()
|
|
|
|
|
{
|
|
|
|
|
var isConnected = TBoxApi.IsConnected();
|
|
|
|
|
var isConnected = await TBoxApi.IsConnected();
|
|
|
|
|
DeviceStateResp resp = new()
|
|
|
|
|
{
|
|
|
|
|
BoxConnectFlag = isConnected.Result != null ? isConnected.Result : false,
|
|
|
|
|
CloudConnectFlag = CloudClientMgr.CloudClient.Connected,
|
|
|
|
|
PlcConnectFlag = PlcMgr.PlcClient.Connected
|
|
|
|
|
BoxConnectFlag = isConnected != null ? isConnected : false,
|
|
|
|
|
CloudConnectFlag = CloudClientMgr.CloudClient==null? false:CloudClientMgr.CloudClient.Connected,
|
|
|
|
|
PlcConnectFlag = PlcMgr.PlcClient==null? false:PlcMgr.PlcClient.Connected
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return Result<DeviceStateResp>.Success(resp);
|
|
|
|
@ -175,9 +175,9 @@ public class MonitorService
|
|
|
|
|
result = PlcMgr.HoldOn();
|
|
|
|
|
if (!result)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Fail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log.Info($"battery move task Manual removeBinNo={removeBinNo}, putBinNo={putBinNo} ");
|
|
|
|
|
|
|
|
|
|
var queryPlcTask = PlcTaskMgr.QueryPlcTask(2, 1200, 1201);
|
|
|
|
@ -206,8 +206,8 @@ public class MonitorService
|
|
|
|
|
removeBin.Soh = -1;
|
|
|
|
|
BinInfoRepository.Update(removeBin);
|
|
|
|
|
}
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Result<bool>.Success();
|
|
|
|
|