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