using Entity.Constant;
namespace Service.Execute.Step;
///
/// 云平台下发换电
///
public class CloudSendOutSwapState: IState
{
public StateResult Handle(SwappingStateMachine machine)
{
return new StateResult()
{
SwappingState = SwappingState.StationReady
};
}
///
/// 等待云平台下发换电
///
///
/*public InvokeStatus CloudSendOutSwap(SwappingStateMachine machine)
{
return Invoker.Invoke("check CarInPosition", 500, 50, machine.IsCanceled,
() => SwappingStateMachine.VehiclesInPlaceFlag, () =>
{
var result = TBoxApi.GetCarInfo();
TboxCarInfoModel tboxCarInfoModel = result.Result;
if (tboxCarInfoModel.HeartBeatMsg.KeyStatus == 0)
{
SwappingStateMachine.VehiclesInPlaceFlag = true;
//写入口等 :红灯
if (PlcApi.WriteEntranceLamp(1020))
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoCarInPosition.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoCarInPosition);
SwappingStateMachine.VehiclesInPlaceFlag = true;
}
}
}, () =>
{
SwappingStateMachine.ExceptionReason = ExceptionReason.CarInPositionError;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorCarInPositionTimeout);
}, false, () => { }
, 20, InvokeStatus.None);
}*/
}