|
|
|
@ -67,12 +67,6 @@ public class DoSwappingState : IState
|
|
|
|
|
return SwappingStateMachine.ReturnWithInvokeErr(packFinish, ExceptionReason.None);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//车辆上锁
|
|
|
|
|
//InvokeStatus lockCar = LockCar(machine);
|
|
|
|
|
//if (lockCar != InvokeStatus.Done)
|
|
|
|
|
//{
|
|
|
|
|
// return SwappingStateMachine.ReturnWithInvokeErr(lockCar, ExceptionReason.None);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
//开启雷达
|
|
|
|
|
var beginRadar = ControlRadar(machine, 1);
|
|
|
|
@ -81,13 +75,6 @@ public class DoSwappingState : IState
|
|
|
|
|
return SwappingStateMachine.ReturnWithInvokeErr(beginRadar, ExceptionReason.None);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//车辆离开
|
|
|
|
|
//var adjustCarByRadar = AdjustCarByRadar(machine);
|
|
|
|
|
//machine.Reset();
|
|
|
|
|
//if (InvokeStatus.Done != adjustCarByRadar)
|
|
|
|
|
//{
|
|
|
|
|
// return SwappingStateMachine.ReturnWithInvokeErr(adjustCarByRadar, ExceptionReason.None);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -222,7 +209,7 @@ public class DoSwappingState : IState
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public InvokeStatus UnPack(SwappingStateMachine machine)
|
|
|
|
|
{
|
|
|
|
|
int s = 0;
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
return Invoker.Invoke("plc UnPack", 500, 5, machine.IsCanceled,
|
|
|
|
|
() => machine.UnOldBatteryFlag, () =>
|
|
|
|
@ -231,14 +218,7 @@ public class DoSwappingState : IState
|
|
|
|
|
|
|
|
|
|
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoUnPack.GetLed());
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address11"));
|
|
|
|
|
if (s==0)
|
|
|
|
|
{
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.UnOldBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
//SoundClient.SoundPlay(SoundEnum.music51);
|
|
|
|
|
//s = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
machine.UnOldBatteryFlag = ClientMgr.PlcClient.DisassembleDone;
|
|
|
|
|
|
|
|
|
@ -250,24 +230,17 @@ public class DoSwappingState : IState
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
() =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if(i==0)
|
|
|
|
|
{
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
SoundClient.SoundPlay(SoundEnum.music51);
|
|
|
|
|
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoUnPack);
|
|
|
|
|
i = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, false, () => { }, 10,
|
|
|
|
|
}, false, () => { }, 30,
|
|
|
|
|
InvokeStatus.None);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InvokeStatus Pack(SwappingStateMachine machine)
|
|
|
|
|
{
|
|
|
|
|
int a = 0;
|
|
|
|
|
|
|
|
|
|
return Invoker.Invoke("plc Pack ing", 500, 5, machine.IsCanceled,
|
|
|
|
|
() => machine.InstallNewBatteryFlag, () =>
|
|
|
|
|
{
|
|
|
|
@ -278,9 +251,7 @@ public class DoSwappingState : IState
|
|
|
|
|
|
|
|
|
|
if (machine.InstallNewBatteryFlag)
|
|
|
|
|
{
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.UnOldBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.StorageOldBatteryFlag,
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.InstallNewBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
}
|
|
|
|
|
}, () =>
|
|
|
|
@ -288,16 +259,12 @@ public class DoSwappingState : IState
|
|
|
|
|
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoPack);
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
//SoundClient.SoundPlay(AppSettingsHelper.GetContent("SoundAddr", "Address12"));
|
|
|
|
|
if (a == 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
SoundClient.SoundPlay(SoundEnum.music52);
|
|
|
|
|
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoPack.GetLed());
|
|
|
|
|
a = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},false, () => { },
|
|
|
|
|
10,InvokeStatus.None);
|
|
|
|
|
30,InvokeStatus.None);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InvokeStatus PackFinish(SwappingStateMachine machine)
|
|
|
|
@ -306,28 +273,15 @@ public class DoSwappingState : IState
|
|
|
|
|
return Invoker.Invoke("plc Pack Finish", 500, 5, machine.IsCanceled,
|
|
|
|
|
() => machine.FinishNewBatteryFlag, () =>
|
|
|
|
|
{
|
|
|
|
|
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
|
|
|
|
|
if (ClientMgr.PlcClient.SwapDone)
|
|
|
|
|
{
|
|
|
|
|
machine.FinishNewBatteryFlag = true;
|
|
|
|
|
machine.BusinessSwappingForCloudState =
|
|
|
|
|
InfoEnum.BusinessSwappingForCloudState.SwapFinish;
|
|
|
|
|
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
|
|
|
|
|
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
if (b==0)
|
|
|
|
|
{
|
|
|
|
|
// SoundClient.SoundPlay(SoundEnum.music77);
|
|
|
|
|
|
|
|
|
|
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
|
|
|
|
|
b = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.OutNewBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.InstallNewBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
SoundClient = AppInfo.Container.Resolve<SoundClient>();
|
|
|
|
|
SoundClient.SoundPlay(SoundEnum.music53);
|
|
|
|
|
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.FinishNewBatteryFlag,
|
|
|
|
|
machine);
|
|
|
|
|
//SoundApi.PlayOneSound((int)InfoEnum.SwapInfo.InfoToSafePosition);
|
|
|
|
@ -336,8 +290,12 @@ public class DoSwappingState : IState
|
|
|
|
|
|
|
|
|
|
machine.SwapStatus = 1;
|
|
|
|
|
}
|
|
|
|
|
}, () => { },false, () => { },
|
|
|
|
|
10,InvokeStatus.None);
|
|
|
|
|
}, () =>
|
|
|
|
|
{
|
|
|
|
|
LedClient.SendMsgByKey(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
|
|
|
|
|
|
|
|
|
|
},false, () => { },
|
|
|
|
|
30,InvokeStatus.None);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|