|
|
|
@ -17,6 +17,7 @@ using Service.Execute.Utils;
|
|
|
|
|
using Service.Init;
|
|
|
|
|
using Service.Led;
|
|
|
|
|
using Service.Padar.Client;
|
|
|
|
|
using Service.PlcAfrica.Client;
|
|
|
|
|
using Service.Sound.SoundClient;
|
|
|
|
|
|
|
|
|
|
namespace Service.Execute.Step;
|
|
|
|
@ -67,7 +68,7 @@ public class DoSwappingState : IState
|
|
|
|
|
{
|
|
|
|
|
return SwappingStateMachine.ReturnWithInvokeErr(packFinish, ExceptionReason.None);
|
|
|
|
|
}
|
|
|
|
|
ClientMgr.PlcClient.ResetTaskNo();
|
|
|
|
|
PlcAfricaMgr.PlcAfricaClient.ResetTaskNo();
|
|
|
|
|
|
|
|
|
|
return new StateResult()
|
|
|
|
|
{
|
|
|
|
@ -131,10 +132,9 @@ public class DoSwappingState : IState
|
|
|
|
|
return Invoker.Invoke("StartSwapping", 1000, 5, machine.IsCanceled,
|
|
|
|
|
() => machine.StartSwappingFlag, () =>
|
|
|
|
|
{
|
|
|
|
|
if (ClientMgr.PlcClient.IsTaskFree())
|
|
|
|
|
if (PlcAfricaMgr.PlcAfricaClient.IsTaskFree())
|
|
|
|
|
{
|
|
|
|
|
PlcApi.CarStatus(1);
|
|
|
|
|
// ClientMgr.PlcClient.ExChangeTaskNo(1);
|
|
|
|
|
var startSwapping = PlcApi.StartSwapping(machine.SwapOrderBatteryInfo.InBinInfo.No,
|
|
|
|
|
machine.SwapOrderBatteryInfo.UpBinInfo.No);
|
|
|
|
|
|
|
|
|
@ -151,7 +151,7 @@ public class DoSwappingState : IState
|
|
|
|
|
//查詢當前任務狀態是否被更改
|
|
|
|
|
if (startSwapping)
|
|
|
|
|
{
|
|
|
|
|
ClientMgr.PlcClient.ExChangeTaskNo(1);
|
|
|
|
|
PlcAfricaMgr.PlcAfricaClient.ExChangeTaskNo(1);
|
|
|
|
|
machine.SwapOrder.SwapBeginTime = DateTime.Now;
|
|
|
|
|
_CommonMgr.UpdateSwapOrder(machine);
|
|
|
|
|
machine.SwapStatus = 0;
|
|
|
|
|