From 397f38845e141d5f7d963348374918abc1dd19af Mon Sep 17 00:00:00 2001 From: xjl <2595686544@qq.com> Date: Sat, 6 Jul 2024 17:46:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=B0=E5=9C=BA=E6=8F=90=E4=BA=A4=EF=BC=8C?= =?UTF-8?q?=E6=8D=A2=E7=94=B5=E5=A4=A7=E5=B1=8Fbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Execute/Mgr/CommonMgr.cs | 5 ++-- Service/Execute/SwappingStateMachine.cs | 33 +++++++++++++------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index 6b578f2..af17f8f 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -42,11 +42,12 @@ public class CommonMgr var stepModel = new StepModel { StepName = BaseEnumExtensions.GetDescription(step), - StepNo = (int)step, + StepNo = machine.StepSort, StartTime = DateTime.Now, Status = 1 }; - machine.StepModel[step.ToString()] = stepModel; + machine.StepModel[machine.StepSort.ToString()] = stepModel; + _swapOrderStepService.InsertSwapStepForSwapMain(step, machine.StepSort++, machine.SwapOrder.Sn); diff --git a/Service/Execute/SwappingStateMachine.cs b/Service/Execute/SwappingStateMachine.cs index 0fa9635..b65070e 100644 --- a/Service/Execute/SwappingStateMachine.cs +++ b/Service/Execute/SwappingStateMachine.cs @@ -70,22 +70,23 @@ public class SwappingStateMachine : IDisposable public ConcurrentDictionary StepModel = new ConcurrentDictionary { - ["1"] = new StepModel { StepNo = 1, Status = 0, StepName = "空闲" }, - ["2"] = new StepModel { StepNo = 2, Status = 0, StepName = "车辆到站(入口雷达检测到车辆驶入)" }, - ["3"] = new StepModel { StepNo = 3, Status = 0, StepName = "rfid扫描完成" }, - ["4"] = new StepModel { StepNo = 4, Status = 0, StepName = "云平台车辆认证" }, - ["5"] = new StepModel { StepNo = 5, Status = 0, StepName = "车辆到位" }, - ["6"] = new StepModel { StepNo = 6, Status = 0, StepName = "车辆解锁" }, - ["7"] = new StepModel { StepNo = 7, Status = 0, StepName = "下发plc选包" }, - ["8"] = new StepModel { StepNo = 8, Status = 0, StepName = "开始换电" }, - ["9"] = new StepModel { StepNo = 9, Status = 0, StepName = "拆旧电池完成" }, - ["10"] = new StepModel { StepNo = 10, Status = 0, StepName = "入库旧电池完成" }, - ["11"] = new StepModel { StepNo = 11, Status = 0, StepName = "搬运新电池完成" }, - ["12"] = new StepModel { StepNo = 12, Status = 0, StepName = "安装新电池完成" }, - ["13"] = new StepModel { StepNo = 13, Status = 0, StepName = "安装完成" }, - ["14"] = new StepModel { StepNo = 14, Status = 0, StepName = "车辆上锁" }, - ["15"] = new StepModel { StepNo = 15, Status = 0, StepName = "换电完成(车辆驶离)" }, - ["16"] = new StepModel { StepNo = 16, Status = 0, StepName = "换电失败(车辆驶离)" }, + ["0"] = new StepModel { StepNo = 0, Status = 0, StepName = "空闲" }, + ["1"] = new StepModel { StepNo = 1, Status = 0, StepName = "车辆到站(入口雷达检测到车辆驶入)" }, + ["2"] = new StepModel { StepNo = 2, Status = 0, StepName = "rfid扫描完成" }, + ["3"] = new StepModel { StepNo = 3, Status = 0, StepName = "云平台车辆认证" }, + ["4"] = new StepModel { StepNo = 4, Status = 0, StepName = "车辆到位" }, + ["5"] = new StepModel { StepNo = 5, Status = 0, StepName = "车辆解锁" }, + //["6"] = new StepModel { StepNo = 6, Status = 0, StepName = "下发plc选包" }, + + ["6"] = new StepModel { StepNo = 7, Status = 0, StepName = "开始换电" }, + ["7"] = new StepModel { StepNo = 8, Status = 0, StepName = "拆旧电池完成" }, + ["8"] = new StepModel { StepNo = 9, Status = 0, StepName = "入库旧电池完成" }, + ["9"] = new StepModel { StepNo = 10, Status = 0, StepName = "搬运新电池完成" }, + ["10"] = new StepModel { StepNo = 11, Status = 0, StepName = "安装新电池完成" }, + ["11"] = new StepModel { StepNo = 12, Status = 0, StepName = "安装完成" }, + ["12"] = new StepModel { StepNo = 13, Status = 0, StepName = "车辆上锁" }, + ["13"] = new StepModel { StepNo = 14, Status = 0, StepName = "换电完成(车辆驶离)" }, + ["14"] = new StepModel { StepNo = 15, Status = 0, StepName = "换电失败(车辆驶离)" }, }; #region 小步状态