From fc5190578436f0a62ea8ff588c54cb79d5168027 Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Fri, 12 Jul 2024 15:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=A2=E7=94=B5=E5=B0=8F=E6=AD=A5=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Entity/Constant/InfoEnum.cs | 2 +- Service/Execute/Mgr/CommonMgr.cs | 4 ++-- Service/Execute/Step/CarCtrlState.cs | 10 +++++----- Service/Execute/SwappingStateMachine.cs | 21 +++++++++++---------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Entity/Constant/InfoEnum.cs b/Entity/Constant/InfoEnum.cs index 8182e5c..3e121c3 100644 --- a/Entity/Constant/InfoEnum.cs +++ b/Entity/Constant/InfoEnum.cs @@ -107,7 +107,7 @@ public class InfoEnum [Const("车辆到位")] CarInPositionFlag, [Const("云平台下发换电指令")] CloudCarCanStartFlag, [Const("车辆解锁")] VelUnlockFlag, - [Const("下发plc选包")] DistributeSelectPackFlag, + // [Const("下发plc选包")] DistributeSelectPackFlag, [Const("开始换电")] StartSwappingFlag, [Const("拆旧电池完成")] UnOldBatteryFlag, diff --git a/Service/Execute/Mgr/CommonMgr.cs b/Service/Execute/Mgr/CommonMgr.cs index af17f8f..210883e 100644 --- a/Service/Execute/Mgr/CommonMgr.cs +++ b/Service/Execute/Mgr/CommonMgr.cs @@ -42,11 +42,11 @@ public class CommonMgr var stepModel = new StepModel { StepName = BaseEnumExtensions.GetDescription(step), - StepNo = machine.StepSort, + StepNo = (int)step, StartTime = DateTime.Now, Status = 1 }; - machine.StepModel[machine.StepSort.ToString()] = stepModel; + machine.StepModel[stepModel.StepNo.ToString()] = stepModel; _swapOrderStepService.InsertSwapStepForSwapMain(step, diff --git a/Service/Execute/Step/CarCtrlState.cs b/Service/Execute/Step/CarCtrlState.cs index 2503e3d..fe76338 100644 --- a/Service/Execute/Step/CarCtrlState.cs +++ b/Service/Execute/Step/CarCtrlState.cs @@ -92,11 +92,11 @@ public class CarCtrlState : IState machine.DistributeSelectPackFlag = PlcApi.DistributeSelectPack(swapOrderBatteryInfo.InBinInfo.No, swapOrderBatteryInfo.UpBinInfo.No); - if (machine.DistributeSelectPackFlag) - { - _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.DistributeSelectPackFlag, - machine); - } + // if (machine.DistributeSelectPackFlag) + // { + // _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.DistributeSelectPackFlag, + // machine); + // } }, () => { // machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrDistributeSelectPack.GetLed()); diff --git a/Service/Execute/SwappingStateMachine.cs b/Service/Execute/SwappingStateMachine.cs index b65070e..55c66bb 100644 --- a/Service/Execute/SwappingStateMachine.cs +++ b/Service/Execute/SwappingStateMachine.cs @@ -75,18 +75,19 @@ public class SwappingStateMachine : IDisposable ["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 = "车辆解锁" }, + ["5"] = new StepModel { StepNo = 5, Status = 0, StepName = "云平台下发换电指令" }, + ["6"] = new StepModel { StepNo = 6, 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 = "换电失败(车辆驶离)" }, + ["7"] = new StepModel { StepNo = 7, Status = 0, StepName = "开始换电" }, + ["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 = "换电失败(车辆驶离)" }, }; #region 小步状态