From 18ad4af3ef01ea7473b6ea69c10b2398ee4bf205 Mon Sep 17 00:00:00 2001 From: lch <1627445470@qq.com> Date: Fri, 17 May 2024 11:43:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=83=E8=B7=B3=E3=80=81=E9=81=A5=E4=BF=A1?= =?UTF-8?q?=E3=80=81=E9=81=A5=E6=B5=8BHandler=E7=9A=84=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Charger/Client/ChargerClient.cs | 40 +- Service/Charger/Handler/HeartBeatHandler.cs | 36 + .../Handler/UploadRemoteSignalDataHandler.cs | 44 + .../Handler/UploadTelemetryDataHandler.cs | 41 + .../Msg/Charger/Req/UploadRemoteSignalData.cs | 949 +----------------- .../Msg/Charger/Req/UploadTelemetryData.cs | 102 +- Service/Charger/Msg/Host/Resp/HeartBeatRes.cs | 2 +- 7 files changed, 241 insertions(+), 973 deletions(-) create mode 100644 Service/Charger/Handler/HeartBeatHandler.cs create mode 100644 Service/Charger/Handler/UploadRemoteSignalDataHandler.cs create mode 100644 Service/Charger/Handler/UploadTelemetryDataHandler.cs diff --git a/Service/Charger/Client/ChargerClient.cs b/Service/Charger/Client/ChargerClient.cs index 651ae60..9d2d1cf 100644 --- a/Service/Charger/Client/ChargerClient.cs +++ b/Service/Charger/Client/ChargerClient.cs @@ -4,6 +4,7 @@ using HybirdFrameworkDriver.TcpClient; using Service.Charger.Codec; using Service.Charger.Common; using Service.Charger.Handler; +using Service.Charger.Msg.Charger.Req; using Service.Charger.Msg.Host.Req; namespace Service.Charger.Client; @@ -21,6 +22,9 @@ public class ChargerClient : TcpClient /// 参考 ChargingStatus /// public UInt16 ChargingStatus { get; set; } + /// + /// 是否已经开始充电 + /// public bool IsCharged { get; set; } = false; public bool IsStopped { get; set; } = false; public bool IsCanSendStopCmd { get; set; } = true; @@ -28,7 +32,41 @@ public class ChargerClient : TcpClient public DateTime? ChargingStartTime { get; set; } public DateTime? ChargingStopTime { get; set; } - + + /// + ///充电机遥信数据 + /// + public UploadRemoteSignalData uploadRemoteSignalData = new UploadRemoteSignalData(); + + /// + /// 充电机工作状态-从遥信数据包中得到。00H:待机 01H:工作 02H:工作完成 03H:充/放电暂停 + /// + public byte workstate { get; set; } + /// + /// 充电机故障-遥信数据包总故障 00H正常、01H故障 + /// + public bool totalError { get; set; } + /// + /// 充电机告警-遥信数据包总告警 00H正常、01H告警 + /// + public bool totalWarning { get; set; } + + + /// + /// 充电机遥测数据 + /// + public UploadTelemetryData uploadTelemetryData = new UploadTelemetryData(); + + /// + ///充电机实时充电功率 + /// + public float realTimeChargePower { get; set; } = 0; + /// + /// 心跳-桩状态 + /// + public byte pileState { get; set; } + + #region 发送指令 diff --git a/Service/Charger/Handler/HeartBeatHandler.cs b/Service/Charger/Handler/HeartBeatHandler.cs new file mode 100644 index 0000000..4fa9c86 --- /dev/null +++ b/Service/Charger/Handler/HeartBeatHandler.cs @@ -0,0 +1,36 @@ +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; +using log4net; +using Service.Charger.Client; +using Service.Charger.Common; +using Service.Charger.Msg.Charger.Req; +using Service.Charger.Msg.Host.Resp; + +namespace Service.Charger.Handler +{ + //TODO::心跳的Order 应该是多少 + [Order(8)] + [Scope("InstancePerDependency")] + public class HeartBeatHandler : SimpleChannelInboundHandler, IBaseHandler + { + private static readonly ILog Log = LogManager.GetLogger(typeof(HeartBeatHandler)); + protected override void ChannelRead0(IChannelHandlerContext ctx, HeartBeat msg) + { + if (ClientMgr.TryGetClient(ctx.Channel, out var sn, out var client)) + { + //心跳存储日志 + Log.Info($"receive {msg} from {sn}"); + //心跳桩状态 + client.pileState = msg.Status; + + //监控平台心跳应答:0-正常、1-未注册 + HeartBeatRes heartBeatRes = new HeartBeatRes(0); + ctx.Channel.WriteAndFlushAsync(heartBeatRes); + } + else + { + client.ChargingStatus = (int)ChargingStatus.StartChargingFailed; + } + } + } +} diff --git a/Service/Charger/Handler/UploadRemoteSignalDataHandler.cs b/Service/Charger/Handler/UploadRemoteSignalDataHandler.cs new file mode 100644 index 0000000..cc9c69b --- /dev/null +++ b/Service/Charger/Handler/UploadRemoteSignalDataHandler.cs @@ -0,0 +1,44 @@ +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; +using log4net; +using Service.Charger.Client; +using Service.Charger.Common; +using Service.Charger.Msg.Charger.Req; +using Service.Charger.Msg.Host.Resp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Service.Charger.Handler +{ + /// + /// 遥信数据上报Handler + /// + //TODO::Order 应该是多少 + [Order(8)] + [Scope("InstancePerDependency")] + public class UploadRemoteSignalDataHandler : SimpleChannelInboundHandler, IBaseHandler + { + private static readonly ILog Log = LogManager.GetLogger(typeof(UploadRemoteSignalDataHandler)); + protected override void ChannelRead0(IChannelHandlerContext ctx, UploadRemoteSignalData msg) + { + if (ClientMgr.TryGetClient(ctx.Channel, out var sn, out var client)) + { + //存储日志 + Log.Info($"receive {msg} from {sn}"); + + client.workstate = msg.WorkStatus; + client.IsCharged = msg.WorkStatus == 1 ? true : false; + client.totalError = msg.TotalError; + client.totalWarning = msg.TotalWarning; + client.uploadRemoteSignalData = msg; + } + else + { + client.ChargingStatus = (int)ChargingStatus.StartChargingFailed; + } + } + } +} diff --git a/Service/Charger/Handler/UploadTelemetryDataHandler.cs b/Service/Charger/Handler/UploadTelemetryDataHandler.cs new file mode 100644 index 0000000..20d58be --- /dev/null +++ b/Service/Charger/Handler/UploadTelemetryDataHandler.cs @@ -0,0 +1,41 @@ +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; +using log4net; +using Service.Charger.Client; +using Service.Charger.Common; +using Service.Charger.Msg.Charger.Req; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Service.Charger.Handler +{ + /// + /// 遥测数据上报Handler + /// + //TODO::Order 应该是多少 + [Order(8)] + [Scope("InstancePerDependency")] + public class UploadTelemetryDataHandler : SimpleChannelInboundHandler, IBaseHandler + { + private static readonly ILog Log = LogManager.GetLogger(typeof(UploadTelemetryDataHandler)); + protected override void ChannelRead0(IChannelHandlerContext ctx, UploadTelemetryData msg) + { + if (ClientMgr.TryGetClient(ctx.Channel, out var sn, out var client)) + { + //存储日志 + Log.Info($"receive {msg} from {sn}"); + + client.uploadTelemetryData = msg; + //充电机实时充电功率 + client.realTimeChargePower = msg.HighVoltageAcquisitionCurrent * msg.HighVoltageAcquisitionVoltage; + } + else + { + client.ChargingStatus = (int)ChargingStatus.StartChargingFailed; + } + } + } +} diff --git a/Service/Charger/Msg/Charger/Req/UploadRemoteSignalData.cs b/Service/Charger/Msg/Charger/Req/UploadRemoteSignalData.cs index 6e1a190..2d839a4 100644 --- a/Service/Charger/Msg/Charger/Req/UploadRemoteSignalData.cs +++ b/Service/Charger/Msg/Charger/Req/UploadRemoteSignalData.cs @@ -8,64 +8,64 @@ namespace Service.Charger.Msg.Charger.Req public class UploadRemoteSignalData : ASDU { /// - /// 工作状态 + /// 工作状态 00H:待机、01H:工作、02H:工作完成、03H:充/放电暂停 /// [Property(0, 2)] public byte WorkStatus { get; set; } /// - /// 总故障 + /// 总故障:0-正常、1-故障 /// [Property(2, 1)] public bool TotalError { get; set; } /// - /// 总告警 + /// 总告警:0-正常、1-告警 /// [Property(3, 1)] public bool TotalWarning { get; set; } /// - /// 急停按钮动作故障 + /// 急停按钮动作故障:0-正常、1-故障 /// [Property(4, 1)] public bool EmergencyStop { get; set; } /// - /// 烟感故障 + /// 烟感故障:0-正常、1-故障 /// [Property(5, 1)] public bool SmokeFault { get; set; } /// - /// 充电桩交流输入断路器故障(系统供电断路器) + /// 充电桩交流输入断路器故障(系统供电断路器):0-正常、1-故障 /// [Property(6, 1)] - public bool InputCircuitBreakerError { get; set; } + public bool ChargeACInputCircuitBreakerFault { get; set; } /// - /// A枪直流母线正极输出接触器拒动/误动故障 + /// 直流母线正极输出 接触器拒动/误 动故障:0-正常、1-故障 /// [Property(7, 1)] - public bool AGunPositiveFault { get; set; } + public bool DcBusPositElecContactorRefuFault { get; set; } /// - /// A枪直流母线负级输出接触器拒动/误动故障 + /// 直流母线负极输出 接触器拒动/误 动故障::0-正常、1-故障 /// [Property(8, 1)] - public bool AGunNegativeEleFault { get; set; } + public bool DcBusNegatElecContactorRefuFault { get; set; } /// - /// A枪直流母线正极输出熔断器故障 + /// 直流母线正级输出 熔断器故障 /// [Property(9, 1)] - public bool AGunPFuseFaulty { get; set; } + public bool DcBusPositElecFusesFault { get; set; } /// - /// A枪直流母线负极输出熔断器故障 + /// 直流母线负级输出 熔断器故障 /// [Property(10, 1)] - public bool AGunNPositiveFuseFaulty { get; set; } + public bool DDcBusNegatElecFusesFault { get; set; } /// /// 充电接口电磁锁故障 @@ -164,52 +164,52 @@ namespace Service.Charger.Msg.Charger.Req public bool DcBusOutputOverCurrentError { get; set; } /// - /// A枪车辆连接状态 + /// 车辆连接状态 0-未连接、1-已连接 /// [Property(27, 1)] - public bool AGunVehicleConnStatus { get; set; } + public bool VehicleConnStatus { get; set; } /// - /// B枪车辆连接状态 + /// 充电桩充电枪座状态 0-已连接、1-未连接 /// [Property(28, 1)] - public bool BGunVehicleConnStatus { get; set; } + public bool ChargeStationGunHolderStatus { get; set; } /// - /// 充电接口电子锁状态 + /// 充电接口电子锁状态 0-解锁、1-锁止 /// [Property(29, 1)] public bool ChargingInterfaceLockStatus { get; set; } /// - /// A枪正极直流输出接触器状态 + /// 正极直流输出接触器状态 0-分断、1-闭合 /// [Property(30, 1)] public bool PositiveDcTransmissionContactorStatus { get; set; } /// - /// A枪负极直流输出接触器状态 + /// 负极直流输出接触器状态 0-分断 1-闭合 /// [Property(31, 1)] public bool NegativeDcTransmissionContactorStatus { get; set; } /// - /// 门禁故障 + /// 门禁故障 0-正常 1-故障 /// [Property(32, 1)] public bool EntranceGuardError { get; set; } /// - /// A枪正极直流输出接触器粘连故障 + /// 正极直流输出接触器粘连故障 /// [Property(33, 1)] - public bool AGunPConA3dhesionFailure { get; set; } + public bool PConA3dhesionFailure { get; set; } /// - /// A枪负极直流输出接触器粘连故故障 + /// 负极直流输出接触器粘连故故障 /// [Property(34, 1)] - public bool AGunNConadhesionFailure { get; set; } + public bool NConadhesionFailure { get; set; } /// /// 泄放回路故障 @@ -242,927 +242,54 @@ namespace Service.Charger.Msg.Charger.Req public bool ModuleOutputReverseError { get; set; } /// - /// 充电桩交流接触器状态 + /// 充电桩交流接触器状态 0-分断 1-吸合 /// [Property(40, 1)] public bool AcContactorStatus { get; set; } /// - /// 充电枪过温告警 + /// 充电枪过温告警 0-正常 1-故障 /// [Property(41, 1)] public bool ChargingGunOverTempWarning { get; set; } /// - /// 充电桩过温告警 + /// 充电桩过温告警 0-正常 1-故障 /// [Property(42, 1)] public bool ChargerOverTempWarning { get; set; } /// - /// A枪电表通信异常 + /// 电表通信异常 0-正常 01H-故障 /// [Property(43, 1)] public bool MeterConnError { get; set; } /// - /// A枪电表电度异常 + /// 电表电度异常 0-正常 02H-故障 /// [Property(44, 1)] public bool MeterDataError { get; set; } /// - /// 水浸告警 + /// 水浸告警 0-正常 03H-故障 /// [Property(45, 1)] public bool WaterloggingWarning { get; set; } - /// - /// 电池包辅助电源状态 - /// - [Property(46, 1)] - public bool BatteryPackAuxiliaryPowerStatus { get; set; } /// - /// 逆功率报警 + /// 逆功率报警 00H:正常 01H:故障 + /// 发生该故障后一直保持,只到重合闸完成后,可以重合闸信号变为可用状态时才清零。 /// [Property(47, 1)] public bool ReversePowerWarning { get; set; } - #region 模块1状态 - - /// - /// 模块1状态-bit1 1:模块关机 0:模块运行 - /// - [Property(48, 1)] - public bool ModuleOneStatus1bit1 { get; set; } - - /// - /// 模块1状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(49, 1)] - public bool ModuleOneStatus1bit2 { get; set; } - - /// - /// 模块1状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(50, 1)] - public bool ModuleOneStatus1bit3 { get; set; } - - /// - /// 模块1状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(51, 1)] - public bool ModuleOneStatus1bit4 { get; set; } - - /// - /// 模块1状态-bit5 1:输入过压 0:输入正常 - /// - [Property(52, 1)] - public bool ModuleOneStatus1bit5 { get; set; } - - /// - /// 模块1状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(53, 1)] - public bool ModuleOneStatus1bit6 { get; set; } - - /// - /// 模块1状态-bit7 1:输出过压 0:输出正常 - /// - [Property(54, 1)] - public bool ModuleOneStatus1bit7 { get; set; } - - /// - /// 模块1状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(55, 1)] - public bool ModuleOneStatus1bit8 { get; set; } - - /// - /// 模块1状态2-bit1 1:过流保护 0 正常 - /// - [Property(56, 1)] - public bool ModuleOneStatus2bit1 { get; set; } - - /// - /// 模块1状态2-bit2 1 过温保护 0 正常 - /// - [Property(57, 1)] - public bool ModuleOneStatus2bit2 { get; set; } - - /// - /// 模块1状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(58, 1)] - public bool ModuleOneStatus2bit3 { get; set; } - - /// - /// 模块1状态2-bit4 预留 - /// - [Property(59, 1)] - public bool ModuleOneStatus2bit4 { get; set; } - - /// - /// 模块1状态2-bit5 预留 - /// - [Property(60, 1)] - public bool ModuleOneStatus2bit5 { get; set; } - - /// - /// 模块1状态2-bit6 预留 - /// - [Property(61, 1)] - public bool ModuleOneStatus2bit6 { get; set; } - - /// - /// 模块1状态2-bit7 预留 - /// - [Property(62, 1)] - public bool ModuleOneStatus2bit7 { get; set; } - - /// - /// 模块1状态2-bit8 预留 - /// - [Property(63, 1)] - public bool ModuleOneStatus2bit8 { get; set; } - - #endregion - - #region 模块2状态 - /// - /// 模块2状态-bit1 1:模块关机 0:模块运行 + /// 电池包辅助电源状态 0:辅助电源未给电池包供电、1:辅助电源正在给电池包供电 /// - [Property(64, 1)] - public bool ModuleTwoStatus1bit1 { get; set; } - - /// - /// 模块2状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(65, 1)] - public bool ModuleTwoStatus1bit2 { get; set; } - - /// - /// 模块2状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(66, 1)] - public bool ModuleTwoStatus1bit3 { get; set; } - - /// - /// 模块2状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(67, 1)] - public bool ModuleTwoStatus1bit4 { get; set; } - - /// - /// 模块2状态-bit5 1:输入过压 0:输入正常 - /// - [Property(68, 1)] - public bool ModuleTwoStatus1bit5 { get; set; } - - /// - /// 模块2状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(69, 1)] - public bool ModuleTwoStatus1bit6 { get; set; } - - /// - /// 模块2状态-bit7 1:输出过压 0:输出正常 - /// - [Property(70, 1)] - public bool ModuleTwoStatus1bit7 { get; set; } - - /// - /// 模块2状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(71, 1)] - public bool ModuleTwoStatus1bit8 { get; set; } - - /// - /// 模块2状态2-bit1 1:过流保护 0 正常 - /// - [Property(72, 1)] - public bool ModuleTwoStatus2bit1 { get; set; } - - /// - /// 模块2状态2-bit2 1 过温保护 0 正常 - /// - [Property(73, 1)] - public bool ModuleTwoStatus2bit2 { get; set; } - - /// - /// 模块2状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(74, 1)] - public bool ModuleTwoStatus2bit3 { get; set; } - - /// - /// 模块2状态2-bit4 预留 - /// - [Property(75, 1)] - public bool ModuleTwoStatus2bit4 { get; set; } - - /// - /// 模块2状态2-bit5 预留 - /// - [Property(76, 1)] - public bool ModuleTwoStatus2bit5 { get; set; } - - /// - /// 模块2状态2-bit6 预留 - /// - [Property(77, 1)] - public bool ModuleTwoStatus2bit6 { get; set; } - - /// - /// 模块2状态2-bit7 预留 - /// - [Property(78, 1)] - public bool ModuleTwoStatus2bit7 { get; set; } - - /// - /// 模块2状态2-bit8 预留 - /// - [Property(79, 1)] - public bool ModuleTwoStatus2bit8 { get; set; } - - #endregion - - #region 模块3状态 - - /// - /// 模块3状态-bit1 1:模块关机 0:模块运行 - /// - [Property(80, 1)] - public bool ModuleThreeStatus1bit1 { get; set; } - - /// - /// 模块3状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(81, 1)] - public bool ModuleThreeStatus1bit2 { get; set; } - - /// - /// 模块3状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(82, 1)] - public bool ModuleThreeStatus1bit3 { get; set; } - - /// - /// 模块3状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(83, 1)] - public bool ModuleThreeStatus1bit4 { get; set; } - - /// - /// 模块3状态-bit5 1:输入过压 0:输入正常 - /// - [Property(84, 1)] - public bool ModuleThreeStatus1bit5 { get; set; } - - /// - /// 模块3状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(85, 1)] - public bool ModuleThreeStatus1bit6 { get; set; } - - /// - /// 模块3状态-bit7 1:输出过压 0:输出正常 - /// - [Property(86, 1)] - public bool ModuleThreeStatus1bit7 { get; set; } - - /// - /// 模块3状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(87, 1)] - public bool ModuleThreeStatus1bit8 { get; set; } - - /// - /// 模块3状态2-bit1 1:过流保护 0 正常 - /// - [Property(88, 1)] - public bool ModuleThreeStatus2bit1 { get; set; } - - /// - /// 模块3状态2-bit2 1 过温保护 0 正常 - /// - [Property(89, 1)] - public bool ModuleThreeStatus2bit2 { get; set; } - - /// - /// 模块3状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(90, 1)] - public bool ModuleThreeStatus2bit3 { get; set; } - - /// - /// 模块3状态2-bit4 预留 - /// - [Property(91, 1)] - public bool ModuleThreeStatus2bit4 { get; set; } - - /// - /// 模块3状态2-bit5 预留 - /// - [Property(92, 1)] - public bool ModuleThreeStatus2bit5 { get; set; } - - /// - /// 模块3状态2-bit6 预留 - /// - [Property(93, 1)] - public bool ModuleThreeStatus2bit6 { get; set; } - - /// - /// 模块3状态2-bit7 预留 - /// - [Property(94, 1)] - public bool ModuleThreeStatus2bit7 { get; set; } - - /// - /// 模块3状态2-bit8 预留 - /// - [Property(95, 1)] - public bool ModuleThreeStatus2bit8 { get; set; } - - #endregion - - #region 模块4状态 - - /// - /// 模块4状态-bit1 1:模块关机 0:模块运行 - /// - [Property(96, 1)] - public bool ModuleFourStatus1bit1 { get; set; } - - /// - /// 模块4状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(97, 1)] - public bool ModuleFourStatus1bit2 { get; set; } - - /// - /// 模块4状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(98, 1)] - public bool ModuleFourStatus1bit3 { get; set; } - - /// - /// 模块4状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(99, 1)] - public bool ModuleFourStatus1bit4 { get; set; } - - /// - /// 模块4状态-bit5 1:输入过压 0:输入正常 - /// - [Property(100, 1)] - public bool ModuleFourStatus1bit5 { get; set; } - - /// - /// 模块4状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(101, 1)] - public bool ModuleFourStatus1bit6 { get; set; } - - /// - /// 模块4状态-bit7 1:输出过压 0:输出正常 - /// - [Property(102, 1)] - public bool ModuleFourStatus1bit7 { get; set; } - - /// - /// 模块4状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(103, 1)] - public bool ModuleFourStatus1bit8 { get; set; } - - /// - /// 模块4状态2-bit1 1:过流保护 0 正常 - /// - [Property(104, 1)] - public bool ModuleFourStatus2bit1 { get; set; } - - /// - /// 模块4状态2-bit2 1 过温保护 0 正常 - /// - [Property(105, 1)] - public bool ModuleFourStatus2bit2 { get; set; } - - /// - /// 模块4状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(106, 1)] - public bool ModuleFourStatus2bit3 { get; set; } - - /// - /// 模块4状态2-bit4 预留 - /// - [Property(107, 1)] - public bool ModuleFourStatus2bit4 { get; set; } - - /// - /// 模块4状态2-bit5 预留 - /// - [Property(108, 1)] - public bool ModuleFourStatus2bit5 { get; set; } - - /// - /// 模块4状态2-bit6 预留 - /// - [Property(109, 1)] - public bool ModuleFourStatus2bit6 { get; set; } - - /// - /// 模块4状态2-bit7 预留 - /// - [Property(110, 1)] - public bool ModuleFourStatus2bit7 { get; set; } - - /// - /// 模块4状态2-bit8 预留 - /// - [Property(111, 1)] - public bool ModuleFourStatus2bit8 { get; set; } - - #endregion - - #region 模块5状态 - - /// - /// 模块5状态-bit1 1:模块关机 0:模块运行 - /// - [Property(112, 1)] - public bool ModuleFiveStatus1bit1 { get; set; } - - /// - /// 模块5状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(113, 1)] - public bool ModuleFiveStatus1bit2 { get; set; } - - /// - /// 模块5状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(114, 1)] - public bool ModuleFiveStatus1bit3 { get; set; } - - /// - /// 模块5状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(115, 1)] - public bool ModuleFiveStatus1bit4 { get; set; } - - /// - /// 模块5状态-bit5 1:输入过压 0:输入正常 - /// - [Property(116, 1)] - public bool ModuleFiveStatus1bit5 { get; set; } - - /// - /// 模块5状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(117, 1)] - public bool ModuleFiveStatus1bit6 { get; set; } - - /// - /// 模块5状态-bit7 1:输出过压 0:输出正常 - /// - [Property(118, 1)] - public bool ModuleFiveStatus1bit7 { get; set; } - - /// - /// 模块5状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(119, 1)] - public bool ModuleFiveStatus1bit8 { get; set; } - - /// - /// 模块5状态2-bit1 1:过流保护 0 正常 - /// - [Property(120, 1)] - public bool ModuleFiveStatus2bit1 { get; set; } - - /// - /// 模块5状态2-bit2 1 过温保护 0 正常 - /// - [Property(121, 1)] - public bool ModuleFiveStatus2bit2 { get; set; } - - /// - /// 模块5状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(122, 1)] - public bool ModuleFiveStatus2bit3 { get; set; } - - /// - /// 模块5状态2-bit4 预留 - /// - [Property(123, 1)] - public bool ModuleFiveStatus2bit4 { get; set; } - - /// - /// 模块5状态2-bit5 预留 - /// - [Property(124, 1)] - public bool ModuleFiveStatus2bit5 { get; set; } - - /// - /// 模块5状态2-bit6 预留 - /// - [Property(125, 1)] - public bool ModuleFiveStatus2bit6 { get; set; } - - /// - /// 模块5状态2-bit7 预留 - /// - [Property(126, 1)] - public bool ModuleFiveStatus2bit7 { get; set; } - - /// - /// 模块5状态2-bit8 预留 - /// - [Property(127, 1)] - public bool ModuleFiveStatus2bit8 { get; set; } - - #endregion - - #region 模块6状态 - - /// - /// 模块6状态-bit1 1:模块关机 0:模块运行 - /// - [Property(128, 1)] - public bool ModuleSixStatus1bit1 { get; set; } - - /// - /// 模块6状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(129, 1)] - public bool ModuleSixStatus1bit2 { get; set; } - - /// - /// 模块6状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(130, 1)] - public bool ModuleSixStatus1bit3 { get; set; } - - /// - /// 模块6状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(131, 1)] - public bool ModuleSixStatus1bit4 { get; set; } - - /// - /// 模块6状态-bit5 1:输入过压 0:输入正常 - /// - [Property(132, 1)] - public bool ModuleSixStatus1bit5 { get; set; } - - /// - /// 模块6状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(133, 1)] - public bool ModuleSixStatus1bit6 { get; set; } - - /// - /// 模块6状态-bit7 1:输出过压 0:输出正常 - /// - [Property(134, 1)] - public bool ModuleSixStatus1bit7 { get; set; } - - /// - /// 模块6状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(135, 1)] - public bool ModuleSixStatus1bit8 { get; set; } - - /// - /// 模块6状态2-bit1 1:过流保护 0 正常 - /// - [Property(136, 1)] - public bool ModuleSixStatus2bit1 { get; set; } - - /// - /// 模块6状态2-bit2 1 过温保护 0 正常 - /// - [Property(137, 1)] - public bool ModuleSixStatus2bit2 { get; set; } - - /// - /// 模块6状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(138, 1)] - public bool ModuleSixStatus2bit3 { get; set; } - - /// - /// 模块6状态2-bit4 预留 - /// - [Property(139, 1)] - public bool ModuleSixStatus2bit4 { get; set; } - - /// - /// 模块6状态2-bit5 预留 - /// - [Property(140, 1)] - public bool ModuleSixStatus2bit5 { get; set; } - - /// - /// 模块6状态2-bit6 预留 - /// - [Property(141, 1)] - public bool ModuleSixStatus2bit6 { get; set; } - - /// - /// 模块6状态2-bit7 预留 - /// - [Property(142, 1)] - public bool ModuleSixStatus2bit7 { get; set; } - - /// - /// 模块6状态2-bit8 预留 - /// - [Property(143, 1)] - public bool ModuleSixStatus2bit8 { get; set; } - - #endregion - - #region 模块7状态 - - /// - /// 模块7状态-bit1 1:模块关机 0:模块运行 - /// - [Property(144, 1)] - public bool ModuleSevenStatus1bit1 { get; set; } - - /// - /// 模块7状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(145, 1)] - public bool ModuleSevenStatus1bit2 { get; set; } - - /// - /// 模块7状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(146, 1)] - public bool ModuleSevenStatus1bit3 { get; set; } - - /// - /// 模块7状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(147, 1)] - public bool ModuleSevenStatus1bit4 { get; set; } - - /// - /// 模块7状态-bit5 1:输入过压 0:输入正常 - /// - [Property(148, 1)] - public bool ModuleSevenStatus1bit5 { get; set; } - - /// - /// 模块7状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(149, 1)] - public bool ModuleSevenStatus1bit6 { get; set; } - - /// - /// 模块7状态-bit7 1:输出过压 0:输出正常 - /// - [Property(150, 1)] - public bool ModuleSevenStatus1bit7 { get; set; } - - /// - /// 模块7状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(151, 1)] - public bool ModuleSevenStatus1bit8 { get; set; } - - /// - /// 模块7状态2-bit1 1:过流保护 0 正常 - /// - [Property(152, 1)] - public bool ModuleSevenStatus2bit1 { get; set; } - - /// - /// 模块7状态2-bit2 1 过温保护 0 正常 - /// - [Property(153, 1)] - public bool ModuleSevenStatus2bit2 { get; set; } - - /// - /// 模块7状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(154, 1)] - public bool ModuleSevenStatus2bit3 { get; set; } - - /// - /// 模块7状态2-bit4 预留 - /// - [Property(155, 1)] - public bool ModuleSevenStatus2bit4 { get; set; } - - /// - /// 模块7状态2-bit5 预留 - /// - [Property(156, 1)] - public bool ModuleSevenStatus2bit5 { get; set; } - - /// - /// 模块7状态2-bit6 预留 - /// - [Property(157, 1)] - public bool ModuleSevenStatus2bit6 { get; set; } - - /// - /// 模块7状态2-bit7 预留 - /// - [Property(158, 1)] - public bool ModuleSevenStatus2bit7 { get; set; } - - /// - /// 模块7状态2-bit8 预留 - /// - [Property(159, 1)] - public bool ModuleSevenStatus2bit8 { get; set; } - - #endregion - - #region 模块8状态 - - /// - /// 模块8状态-bit1 1:模块关机 0:模块运行 - /// - [Property(160, 1)] - public bool ModuleEightStatus1bit1 { get; set; } - - /// - /// 模块8状态-bit2 1: 模块故障 0:模块正常 - /// - [Property(161, 1)] - public bool ModuleEightStatus1bit2 { get; set; } - - /// - /// 模块8状态-bit3 1:模块恒流 0:模块恒压 - /// - [Property(162, 1)] - public bool ModuleEightStatus1bit3 { get; set; } - - /// - /// 模块8状态-bit4 1:风扇故障 0:风扇正常 - /// - [Property(163, 1)] - public bool ModuleEightStatus1bit4 { get; set; } - - /// - /// 模块8状态-bit5 1:输入过压 0:输入正常 - /// - [Property(164, 1)] - public bool ModuleEightStatus1bit5 { get; set; } - - /// - /// 模块8状态-bit6 1:输入欠压 0:输入正常 - /// - [Property(165, 1)] - public bool ModuleEightStatus1bit6 { get; set; } - - /// - /// 模块8状态-bit7 1:输出过压 0:输出正常 - /// - [Property(166, 1)] - public bool ModuleEightStatus1bit7 { get; set; } - - /// - /// 模块8状态-bit8 1:输出欠压 0:输出正常 - /// - [Property(167, 1)] - public bool ModuleEightStatus1bit8 { get; set; } - - /// - /// 模块8状态2-bit1 1:过流保护 0 正常 - /// - [Property(168, 1)] - public bool ModuleEightStatus2bit1 { get; set; } - - /// - /// 模块8状态2-bit2 1 过温保护 0 正常 - /// - [Property(169, 1)] - public bool ModuleEightStatus2bit2 { get; set; } - - /// - /// 模块8状态2-bit3 1 设置关机 0 设置开机 - /// - [Property(170, 1)] - public bool ModuleEightStatus2bit3 { get; set; } - - /// - /// 模块8状态2-bit4 预留 - /// - [Property(171, 1)] - public bool ModuleEightStatus2bit4 { get; set; } - - /// - /// 模块8状态2-bit5 预留 - /// - [Property(172, 1)] - public bool ModuleEightStatus2bit5 { get; set; } - - /// - /// 模块8状态2-bit6 预留 - /// - [Property(173, 1)] - public bool ModuleEightStatus2bit6 { get; set; } - - /// - /// 模块8状态2-bit7 预留 - /// - [Property(174, 1)] - public bool ModuleEightStatus2bit7 { get; set; } - - /// - /// 模块8状态2-bit8 预留 - /// - [Property(175, 1)] - public bool ModuleEightStatus2bit8 { get; set; } - - #endregion - - /// - /// B枪直流母线正极输出接触器拒动/误动故障 - /// - [Property(176, 1)] - public bool BGunDcBusPositiveOutputTouchError { get; set; } - - /// - /// B枪直流母线负级输出接触器拒动/误动故障 - /// - [Property(177, 1)] - public bool BGunDcBusNegativeOutputTouchError { get; set; } - - /// - /// B枪直流母线正极输出熔断器故障 - /// - [Property(178, 1)] - public bool BGunDcBusPositiveOutputBreakerError { get; set; } - - /// - /// B枪直流母线负极输出熔断器故障 - /// - [Property(179, 1)] - public bool BGunDcBusNegativeOutputBreakerError { get; set; } - - /// - /// B枪正极直流输出接触器状态 - /// - [Property(180, 1)] - public bool BGunPositiveDcTransmissionContactorStatus { get; set; } - - /// - /// B枪负极直流输出接触器状态 - /// - [Property(181, 1)] - public bool BGunNegativeDcTransmissionContactorStatus { get; set; } - - /// - /// B枪正极直流输出接触器粘连故障 - /// - [Property(182, 1)] - public bool BGunPositionDcTransmissionContactorAdhesionError { get; set; } - - /// - /// B枪负极直流输出接触器粘连故故障 - /// - [Property(183, 1)] - public bool BGunNegationDcTransmissionContactorAdhesionError { get; set; } - - /// - /// B枪电表通信异常 - /// - [Property(184, 1)] - public bool BGunMeterConnError { get; set; } - - /// - /// B枪电表电度异常 - /// - [Property(185, 1)] - public bool BGunMeterDataError { get; set; } - - public UploadRemoteSignalData() - { - } - - /// - /// 消息体个数 - /// - /// - public UploadRemoteSignalData(byte msgBodyCount) - { - FrameTypeNo = 5; - //this.SetReason(2); - MsgBodyCount = msgBodyCount; - } + [Property(46, 1)] + public bool BatteryPackAuxiliaryPowerStatus { get; set; } } } \ No newline at end of file diff --git a/Service/Charger/Msg/Charger/Req/UploadTelemetryData.cs b/Service/Charger/Msg/Charger/Req/UploadTelemetryData.cs index 6e0eaaa..386977b 100644 --- a/Service/Charger/Msg/Charger/Req/UploadTelemetryData.cs +++ b/Service/Charger/Msg/Charger/Req/UploadTelemetryData.cs @@ -16,195 +16,177 @@ namespace Service.Charger.Msg.Charger.Req /// /// 最高蓄电池温度 /// - [Property(8, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(8, 2, PropertyReadConstant.Byte, 1, 0, -50)] public Int16 MaxBatteryTemp { get; set; } /// /// 最高温度检测点编号 /// - [Property(16, 8)] + [Property(24, 16)] public byte MaxTempDetectionPointNo { get; set; } /// /// 最低蓄电池温度 /// - [Property(24, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(40, 16, PropertyReadConstant.Bit, 1, 0, -50)] public Int16 MinBatteryTemp { get; set; } /// /// 最低温度检测点编号 /// - [Property(32, 8)] + [Property(56, 16)] public byte MinTempDetectionPointNo { get; set; } /// /// 单体电池最高电压 /// - [Property(40, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] + [Property(72, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] public float SingleBatteryMaxVoltage { get; set; } /// /// 单体电池最低压 /// - [Property(56, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] + [Property(88, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] public float SingleBatteryMinVoltage { get; set; } /// /// 充电机环境温度 /// - [Property(72, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(104, 8, PropertyReadConstant.Bit, 1, 0, -50)] public Int16 ChargerEnvTemp { get; set; } /// /// 充电导引电压 /// - [Property(80, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] + [Property(112, 16, PropertyReadConstant.Bit, 0.01, 2, 0)] public float ChargingPilotVoltage { get; set; } /// /// BMS 需求电压 /// - [Property(96, 16, PropertyReadConstant.Bit, 0.1, 1, 0)] + [Property(128, 16, PropertyReadConstant.Bit, 0.1, 1, 0)] public float BmsNeedVoltage { get; set; } /// /// BMS 需求电流 /// - [Property(112, 16, PropertyReadConstant.Bit, 0.1, 1, -400)] + [Property(144, 16, PropertyReadConstant.Bit, 0.1, 1, -400)] public float BmsNeedCurrent { get; set; } /// - /// 充电模式 + /// 充电模式 01H:恒压充电、02H恒流充电 /// - [Property(128, 8)] + [Property(160, 8)] public byte ChargeMode { get; set; } /// /// BMS 充电电压测量值 /// - [Property(136, 16, PropertyReadConstant.Bit, 0.1, 1, 0)] + [Property(168, 16, PropertyReadConstant.Bit, 0.1, 1, 0)] public float BmsChargingVoltage { get; set; } /// /// BMS 充电电流测量值 /// - [Property(152, 16, PropertyReadConstant.Bit, 0.1, 1, -400)] + [Property(184, 16, PropertyReadConstant.Bit, 0.1, 1, -400)] public float BmsChargingCurrent { get; set; } /// /// 估算剩余充电时间 /// - [Property(168, 16, PropertyReadConstant.Bit, 1, 0, 0)] + [Property(200, 16, PropertyReadConstant.Bit, 1, 0, 0)] public ushort EstimatedRemainingTime { get; set; } /// /// 充电接口温度探头 1 /// - [Property(184, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(216, 8, PropertyReadConstant.Bit, 1, 0, -50)] public Int16 ChargingInterfaceDetectionOneTemp { get; set; } /// /// 充电接口温度探头 2 /// - [Property(192, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(224, 8, PropertyReadConstant.Bit, 1, 0, -50)] public Int16 ChargingInterfaceDetectionTwoTemp { get; set; } - /// - /// 充电接口温度探头 3 - /// - [Property(200, 8, PropertyReadConstant.Bit, 1, 0, -50)] - public Int16 ChargingInterfaceDetectionThreeTemp { get; set; } - /// /// 充电接口温度探头 4 /// - [Property(208, 8, PropertyReadConstant.Bit, 1, 0, -50)] + [Property(232, 8, PropertyReadConstant.Bit, 1, 0, -50)] public Int16 ChargingInterfaceDetectionFourTemp { get; set; } /// - /// A 枪直流电表当前电量 + /// 直流电表当前电量 /// - [Property(216, 32, PropertyReadConstant.Bit, 0.01, 2)] - public float AGunDcMeterCurrentPower { get; set; } + [Property(240, 32, PropertyReadConstant.Bit, 0.01, 2)] + public float DcMeterCurrentPower { get; set; } /// - /// A 枪充电电压(直流电表电压) + /// 充电电压(直流电表电压) /// - [Property(248, 16, PropertyReadConstant.Bit, 0.1, 1)] - public float AGunDcMeterVoltage { get; set; } + [Property(272, 16, PropertyReadConstant.Bit, 0.1, 1)] + public float DcMeterVoltage { get; set; } /// - /// A 枪充电电流(直流电表电流) + /// 充电电流(直流电表电流) /// - [Property(264, 16, PropertyReadConstant.Bit, 0.1, 1)] - public float AGunDcMeterCurrent { get; set; } + [Property(288, 16, PropertyReadConstant.Bit, 0.1, 1)] + public float DcMeterCurrent { get; set; } /// /// 高压采集电压 /// - [Property(280, 16, PropertyReadConstant.Bit, 0.1, 1)] + [Property(304, 16, PropertyReadConstant.Bit, 0.1, 1)] public float HighVoltageAcquisitionVoltage { get; set; } /// /// 高压采集电流 /// - [Property(296, 16, PropertyReadConstant.Bit, 0.1, 1)] + [Property(320, 16, PropertyReadConstant.Bit, 0.1, 1)] public float HighVoltageAcquisitionCurrent { get; set; } /// /// 桩内部温度 /// - [Property(312, 8, PropertyReadConstant.Bit, 1, 0)] + [Property(336, 8, PropertyReadConstant.Bit, 1, 0)] public byte ChargerInsideTemp { get; set; } /// /// 本次充电时间 /// - [Property(320, 16)] + [Property(344, 16)] public ushort ChargingTime { get; set; } /// /// 模块进风口温度 /// - [Property(336, 8)] + [Property(360, 8)] public byte ModuleOneAirInletTemp { get; set; } /// /// 模块出风口温度 /// - [Property(344, 8)] + [Property(368, 8)] public byte ModuleTwoAirInletTemp { get; set; } /// - /// B 枪直流电表当前电量 + /// 充电模式 0:站内充电 1:站外充电 /// - [Property(352, 32, PropertyReadConstant.Bit, 0.01, 2)] - public float BGunDcMeterCurrentPower { get; set; } + [Property(376, 8)] + public byte ChargeModel { get; set; } /// - /// B 枪充电电压(直流电表电压) + /// 充电启动方式 1:站控启动 2:本地充电 /// - [Property(384, 16, PropertyReadConstant.Bit, 0.1, 1)] - public float BGunDcMeterVoltage { get; set; } + [Property(384, 8)] + public byte ChargingStartMethod { get; set; } /// - /// A 枪充电电流(直流电表电流) + /// 交流电表当前电量 /// + [Property(392, 32, PropertyReadConstant.Bit, 0.01, 2)] + public float ACMeterCurrentBatteryValue { get; set; } - [Property(400, 16, PropertyReadConstant.Bit, 0.1, 1)] - public float BGunDcMeterCurrent { get; set; } - - /// - /// 交流电表值1 - /// - [Property(416, 32, PropertyReadConstant.Bit, 0.01, 2)] - public float ACMeterValue1 { get; set; } - - /// - /// 交流电表值2 - /// - [Property(448, 32, PropertyReadConstant.Bit, 0.01, 2)] - public float ACMeterValue2 { get; set; } } } \ No newline at end of file diff --git a/Service/Charger/Msg/Host/Resp/HeartBeatRes.cs b/Service/Charger/Msg/Host/Resp/HeartBeatRes.cs index 757201c..60690ae 100644 --- a/Service/Charger/Msg/Host/Resp/HeartBeatRes.cs +++ b/Service/Charger/Msg/Host/Resp/HeartBeatRes.cs @@ -16,7 +16,7 @@ namespace Service.Charger.Msg.Host.Resp /// /// 结果 0 正常 1 未注册 /// - [Property(0, 8)] + [Property(8, 8)] public byte Result { get; set; } public HeartBeatRes(byte result)