From 0afd37583c5356d0125e1c19ae57a9dd3a8ca9b1 Mon Sep 17 00:00:00 2001 From: lxw Date: Wed, 29 May 2024 12:13:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AF=AD=E9=9F=B3=E6=92=AD?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Constant/InfoEnum.cs | 4 ++-- Service/Execute/Step/StationReadyState.cs | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Entity/Constant/InfoEnum.cs b/Entity/Constant/InfoEnum.cs index 388c03b..99e9eed 100644 --- a/Entity/Constant/InfoEnum.cs +++ b/Entity/Constant/InfoEnum.cs @@ -38,9 +38,9 @@ public class InfoEnum [Info("空仓数量不足","通道的电池仓无可用换电电池")] LessOfEmptyBinErr, [Info("符合soc限制数量不足","通道的电池仓无可用换电电池")] LessOfSocErr, [Info("结束充电大于3分钟的数量不足","通道的电池仓无可用换电电池")] LessOf3MinuteErr, - [Info("换电站处于手动模式,不能自动换电","换电站处于手动模式,不能自动换电")]InfoStationModel, + [Info("换电站处于手动模式,不能自动换电","换电站处于手动模式,不能自动换电")] InfoStationModel, - [Info("换电站处于本地模式,不能远程换电","换电站处于本地模式,不能远程换电")]InfoStationModelRemoteErr, + [Info("换电站处于本地模式,不能远程换电","换电站处于本地模式,不能远程换电")] InfoStationModelRemoteErr, } public enum SelectBinStatusInfo : byte diff --git a/Service/Execute/Step/StationReadyState.cs b/Service/Execute/Step/StationReadyState.cs index 8533be9..d401d41 100644 --- a/Service/Execute/Step/StationReadyState.cs +++ b/Service/Execute/Step/StationReadyState.cs @@ -78,6 +78,24 @@ public class StationReadyState : IState }; } + public InvokeStatus PlcIsAuto(SwappingStateMachine machine) + { + bool isAuto = false; + return Invoker.Invoke("check plc remote", 1000, 5, machine.IsCanceled, () => isAuto, + () => + { + if (PlcApi.IsAuto()) + { + isAuto = true; + } + }, + () => + { + SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoStationModel) + ; + }, true, () => { }, 5, InvokeStatus.None); + } + public InvokeStatus PlcIsRemote(SwappingStateMachine machine) { @@ -102,7 +120,7 @@ public class StationReadyState : IState { SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoStationModelRemoteErr) ; - }, true); + }, true, () => { }, 5, InvokeStatus.None); } public InvokeStatus EntranceRadar(SwappingStateMachine machine)