|
|
|
@ -27,7 +27,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendInitializeCommandReq/{code}")]
|
|
|
|
|
public Result<bool> SendInitializeCommandReq(string code)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendInitializeCommandReq();
|
|
|
|
@ -44,7 +44,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendOutboundCommandReq/{code}/{outboundMode}/{takePositionNumber}")]
|
|
|
|
|
public Result<bool> SendOutboundCommandReq(string code, byte outboundMode, byte takePositionNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendOutboundCommandReq(outboundMode, takePositionNumber);
|
|
|
|
@ -61,7 +61,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendStartBatterySwapReq/{code}/{takePositionNumber}/{positionNumber}")]
|
|
|
|
|
public Result<bool> SendStartBatterySwapReq(string code, byte takePositionNumber, byte positionNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendStartBatterySwapReq(takePositionNumber, positionNumber);
|
|
|
|
@ -78,7 +78,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendStartMovElectricityReq/{code}/{takeBatteryShelfNumber}/{saveBatteryShelfNumber}")]
|
|
|
|
|
public Result<bool> SendStartMovElectricityReq(string code, byte takeBatteryShelfNumber, byte saveBatteryShelfNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendStartMovElectricityReq(takeBatteryShelfNumber, saveBatteryShelfNumber);
|
|
|
|
@ -95,7 +95,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendVehicleModelReq/{code}/{cartNo}")]
|
|
|
|
|
public Result<bool> SendVehicleModelReq(string code, byte cartNo)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendVehicleModelReq(cartNo);
|
|
|
|
@ -112,7 +112,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendMoveCommandReq/{code}/{takePositionNumber}/{positionNumber}")]
|
|
|
|
|
public Result<bool> SendMoveCommandReq(string code, byte takePositionNumber, byte positionNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendMoveCommandReq(takePositionNumber, positionNumber);
|
|
|
|
@ -129,7 +129,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendContinueCommandReq/{code}")]
|
|
|
|
|
public Result<bool> SendContinueCommandReq(string code)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendContinueCommandReq();
|
|
|
|
@ -146,7 +146,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendPauseCommandReq/{code}")]
|
|
|
|
|
public Result<bool> SendPauseCommandReq(string code)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendPauseCommandReq();
|
|
|
|
@ -163,7 +163,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendInboundCommandsReq/{code}/{positionNumber}")]
|
|
|
|
|
public Result<bool> SendInboundCommandsReq(string code, byte positionNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendInboundCommandsReq(positionNumber);
|
|
|
|
@ -180,7 +180,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendTerminationOrderReq/{code}")]
|
|
|
|
|
public Result<bool> SendTerminationOrderReq(string code)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendTerminationOrderReq();
|
|
|
|
@ -197,7 +197,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendFaultResetReq/{code}")]
|
|
|
|
|
public Result<bool> SendFaultResetReq(string code)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendFaultResetReq();
|
|
|
|
@ -214,7 +214,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
//[Route("SendParameterSettingsReq/{code}/{messageBodyAddress}/{parameterType}/{parameter}")]
|
|
|
|
|
//public Result<bool> SendParameterSettingsReq(string code, byte[] messageBodyAddress, byte parameterType, byte parameter)
|
|
|
|
|
//{
|
|
|
|
|
// Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
// Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
// if (chargerClient != null)
|
|
|
|
|
// {
|
|
|
|
|
// return chargerClient.SendParameterSettingsReq(messageBodyAddress, parameterType, parameter);
|
|
|
|
@ -234,11 +234,11 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendParameterSettingsReq/{code}/{parameterType}/{parameter}")]
|
|
|
|
|
public Result<bool> SendParameterSettingsReq(string code, byte parameterType, byte parameter)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendParameterSettingsReq( parameterType, parameter);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return Result<bool>.Fail("充电机未连接");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,7 +252,7 @@ public class PlcController : ControllerBase
|
|
|
|
|
[Route("SendPrepareBatteryOnReq/{code}/{readyBatterySign}/{takePositionNumber}")]
|
|
|
|
|
public Result<bool> SendPrepareBatteryOnReq(string code, byte readyBatterySign, byte takePositionNumber)
|
|
|
|
|
{
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.GetBySn(code);
|
|
|
|
|
Service.Charger.Server.PlcClient? chargerClient = ClientMgr.PlcClient;
|
|
|
|
|
if (chargerClient != null)
|
|
|
|
|
{
|
|
|
|
|
return chargerClient.SendPrepareBatteryOnReq(readyBatterySign, takePositionNumber);
|
|
|
|
|