diff --git a/Entity/Constant/InfoEnum.cs b/Entity/Constant/InfoEnum.cs index f8b90c7..68f7d1b 100644 --- a/Entity/Constant/InfoEnum.cs +++ b/Entity/Constant/InfoEnum.cs @@ -6,48 +6,50 @@ public class InfoEnum { public enum SwapInfo : ushort { - [Info("Rfid读写失败", "Rfid读写失败")] ErrorReadRfid = 1, + + [Info("欢迎光临长治换电站!(正在营业)","欢迎光临长治换电站!,本站正在营业中")]WelcomeInfo=1, + [Info("Rfid读写失败", "Rfid读写失败")] ErrorReadRfid , - [Info("Tbox连接失败", "Tbox连接失败,请联系站务人员")] ErrorTBoxConn = 4, - [Info("云端校验失败", "云端校验失败,请联系站务人员")] ErrorCloudCheck = 5, - [Info("车辆已到位", "车辆已到位")] InfoCarInPosition = 6, - [Info("车辆到位超时", "车辆到位超时")] ErrorCarInPositionTimeout = 7, - [Info("云平台下发换电失败", "云平台下发换电超时")] CloudSendSwapError = 8, - [Info("云平台下发取消换电", "云平台下发取消换电")] CloudSendSwapCancel = 9, + [Info("Tbox连接失败", "Tbox连接失败,请联系站务人员")] ErrorTBoxConn , + [Info("云端校验失败", "云端校验失败,请联系站务人员")] ErrorCloudCheck , + [Info("车辆已到位", "车辆已到位")] InfoCarInPosition , + [Info("车辆到位超时", "车辆到位超时")] ErrorCarInPositionTimeout, + [Info("云平台下发换电失败", "云平台下发换电超时")] CloudSendSwapError , - [Info("解锁车辆失败", "解锁车辆失败")] ErrUnLockCar = 10, - [Info("下发选包结果失败", "下发选包结果失败")] ErrDistributeSelectPack = 11, - [Info("选包失败,请驶离", "选包失败,请驶离")] ErrorSelectPack = 12, + [Info("解锁车辆失败", "解锁车辆失败")] ErrUnLockCar , + [Info("选包失败,请驶离", "选包失败,请驶离")] ErrorSelectPack , [Info("通道拍照定位失败,请重新调整车辆位置", "通道拍照定位失败,请重新调整车辆位置")] - ErrChannelStatus = 14, - [Info("电池拆卸中,请稍后", "电池拆卸中,请稍后")] InfoUnPack = 15, + ErrChannelStatus , + [Info("电池拆卸中,请稍后", "电池拆卸中,请稍后")] InfoUnPack , - [Info("电池安装中,请稍后", "电池安装中,请稍后")] InfoPack = 16, - [Info("电池包已安装完成", "电池包已安装完成")] InfoPackFinish = 17, - [Info("航车已回归安全位置", "航车已回归安全位置")] InfoToSafePosition = 18, - [Info("换电已完成,请驶离", "换电已完成,请驶离")] InfoCarLeave = 20, - [Info("换电失败,请驶离", "换电失败,请驶离")] ErrInfoCarLeave = 21, - [Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoOldBatteryCarryIn = 22, - [Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoNewBatteryCarryOut = 23, - [Info("上锁车辆失败", "上锁车辆失败")] ErrLockCar = 24, + [Info("电池安装中,请稍后", "电池安装中,请稍后")] InfoPack , + [Info("电池包已安装完成", "电池包已安装完成")] InfoPackFinish , + [Info("航车已回归安全位置", "航车已回归安全位置")] InfoToSafePosition , + [Info("换电已完成,请驶离", "换电已完成,请驶离")] InfoCarLeave , + [Info("换电失败,请驶离", "换电失败,请驶离")] ErrInfoCarLeave , + [Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoOldBatteryCarryIn , + [Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoNewBatteryCarryOut , + [Info("车辆上锁失败", "车辆上锁失败")] ErrLockCar , + [Info("通道的电池仓无可用换电电池","通道的电池仓无可用换电电池")] NoBatteryErr, + [Info("结束充电电池数量不足","通道的电池仓无可用换电电池")] LessOfFinishChargingErr, + [Info("空仓数量不足","通道的电池仓无可用换电电池")] LessOfEmptyBinErr, + [Info("符合soc限制数量不足","通道的电池仓无可用换电电池")] LessOfSocErr, + [Info("结束充电大于3分钟的数量不足","通道的电池仓无可用换电电池")] LessOf3MinuteErr, } public enum SelectBinStatusInfo : byte { - [Remark("通道的电池仓无换电电池")] NoBattery, + [Remark("通道的电池仓无可用换电电池")] NoBattery, [Remark("可以换电")] Success, [Remark("结束充电电池数量不足")] LessOfFinishCharging, - [Remark("空仓不够放")] LessOfEmptyBin, + [Remark("空仓数量不足")] LessOfEmptyBin, [Remark("符合soc限制数量不足")] LessOfSoc, [Remark("结束充电大于3分钟的数量不足")] LessOf3Minute, - [Remark("各种差数量不足")] LessOfMean, [Remark("预约电池异常")] AmtError, - [Remark("电池捆绑选包失败")] GroupError, - [Remark("无可用捆绑")] NoGroupError } diff --git a/Service/Execute/StationSoftMgr.cs b/Service/Execute/StationSoftMgr.cs index c49f425..44f4d1a 100644 --- a/Service/Execute/StationSoftMgr.cs +++ b/Service/Execute/StationSoftMgr.cs @@ -1,5 +1,6 @@ using Service.BusinessTask; using Service.BusinessTask.MyTask; +using Service.Execute.StaticTools; namespace Service.Execute { @@ -41,6 +42,7 @@ namespace Service.Execute /// public static void SwappingStateMachineStart() { + SoundTool.PlayOneSound(2); SwappingStateMachine.Start(); } diff --git a/Service/Execute/Step/CarPrepareState.cs b/Service/Execute/Step/CarPrepareState.cs index 56231e5..06fadd5 100644 --- a/Service/Execute/Step/CarPrepareState.cs +++ b/Service/Execute/Step/CarPrepareState.cs @@ -292,7 +292,7 @@ public class CarPrepareState : IState if (orderBatteryInfo.CanSwap != InfoEnum.SelectBinStatusInfo.Success) { // machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorSelectPack.GetLed()); - SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorSelectPack); + SoundTool.PlayOneSound((int)orderBatteryInfo.CanSwap); Thread.Sleep(1000 * 3); _log.Info($"SelectPack error CanSwap={machine.SwapOrderBatteryInfo.CanSwap}"); } diff --git a/Service/Execute/Step/StationReadyState.cs b/Service/Execute/Step/StationReadyState.cs index 0428309..787c69b 100644 --- a/Service/Execute/Step/StationReadyState.cs +++ b/Service/Execute/Step/StationReadyState.cs @@ -92,7 +92,7 @@ public class StationReadyState : IState { //LED显示-欢迎光临_换电站点_正在营业 string welcomeContent = "欢迎光临" + StaticStationInfo.StationName + "正在营业"; - + SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.WelcomeInfo); // machine.LedTool?.WriteContent(welcomeContent); isRemote = true; } diff --git a/WebStarter/Program.cs b/WebStarter/Program.cs index 62d2891..6ea7d1b 100644 --- a/WebStarter/Program.cs +++ b/WebStarter/Program.cs @@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.IdentityModel.Tokens; using Service.Cloud.Client; using Service.Execute; +using Service.Execute.StaticTools; using Service.Plc.Client; using SqlSugar; using SqlSugar.IOC; @@ -152,10 +153,8 @@ AppInfo.Container = app.Services.GetAutofacRoot(); //云平台 CloudClientMgr.Init(); - //PLC PlcMgr.Init(); - //启动换电流程 StationSoftMgr.SwappingStateMachineStart(); //StationSoftMgr.StartTasks();