You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB

using Entity.Constant;
namespace Service.Execute.Step;
/// <summary>
/// 云平台下发换电
/// </summary>
public class CloudSendOutSwapState: IState
{
public StateResult Handle(SwappingStateMachine machine)
{
return new StateResult()
{
SwappingState = SwappingState.StationReady
};
}
/// <summary>
/// 等待云平台下发换电
/// </summary>
/// <returns></returns>
/*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);
}*/
}