diff --git a/Common/lib/HybirdFrameworkCore.dll b/Common/lib/HybirdFrameworkCore.dll index e5693b3..8c29e73 100644 Binary files a/Common/lib/HybirdFrameworkCore.dll and b/Common/lib/HybirdFrameworkCore.dll differ diff --git a/Service/Charger/Client/ChargerClient.cs b/Service/Charger/Client/ChargerClient.cs index 14ef6e4..ae49cee 100644 --- a/Service/Charger/Client/ChargerClient.cs +++ b/Service/Charger/Client/ChargerClient.cs @@ -30,7 +30,6 @@ namespace Service.Charger.Client; [Scope("InstancePerDependency")] public class ChargerClient : TcpClient { - #region 属性 /// @@ -50,9 +49,8 @@ public class ChargerClient : TcpClient /// 是否已经开始充电 /// public bool IsCharged { get; set; } = false; - - - + + /// /// 站外两枪时是否在充电 /// @@ -61,6 +59,7 @@ public class ChargerClient : TcpClient [1] = false, [2] = false }; + /// /// 充电桩连接状态 /// @@ -69,7 +68,7 @@ public class ChargerClient : TcpClient [1] = false, [2] = false }; - + public bool IsStopped { get; set; } = false; public bool IsCanSendStopCmd { get; set; } = true; @@ -151,30 +150,32 @@ public class ChargerClient : TcpClient /// 充电机遥测数据 /// public UploadTelemetryData UploadTelemetryData = new UploadTelemetryData(); - + /// /// 充放电机上传单体动力蓄电池电压极值统计 /// public VoltageExtremumStatistics? VoltageExtremumStatistics = new VoltageExtremumStatistics(); - + /// /// 充电桩的遥测 /// public ConcurrentDictionary PileUploadTelemetry = new(); + /// /// 充电桩的遥信 /// public ConcurrentDictionary PileUploadRemoteSignal = new(); - + /// /// 充电桩状态信息 /// public ConcurrentDictionary ChargerPile = new(); + /// ///充电机实时充电功率 /// public float RealTimeChargePower { get; set; } = 0; - + /// /// 心跳-桩状态 /// @@ -460,7 +461,7 @@ public class ChargerClient : TcpClient BitUtls.BytesToHexStr(setPeakValleyTime.ToBytes()); this.Channel.WriteAndFlushAsync(setPeakValleyTime); - Log().Info($"SendSetPeakValleyTime{CurrentCmd} to chargeOrderNo={BinNo}"); + Log().Info($"SendSetPeakValleyTime{CurrentCmd} to chargeOrderNo={BinNo}"); return Result.Success(); } @@ -498,6 +499,7 @@ public class ChargerClient : TcpClient this.Channel.WriteAndFlushAsync(req); return Result.Success(); } + /// /// 3.7.1 监控平台远程启动充电桩充电 /// @@ -507,7 +509,8 @@ public class ChargerClient : TcpClient /// 功率调节参数 /// /// 充电流水号 - public Result SendStartOutCharger(byte pn, byte socValue, short changePower=360,byte changePowerCmdType=1 , + public Result SendStartOutCharger(byte pn, byte socValue, short changePower = 360, + byte changePowerCmdType = 1, string? chargeOrderNo = null) { if (!Connected) @@ -523,12 +526,14 @@ public class ChargerClient : TcpClient Log().Info( $"SendStartOutCharger pn={pn}, socValue={socValue}, changePower={changePower}, changePowerCmdType={changePowerCmdType}, chargeOrderNo={chargeOrderNo}"); - PileStartCharge pileStartCharge = new PileStartCharge(pn, socValue, changePowerCmdType, changePower,chargeOrderNo); - + PileStartCharge pileStartCharge = + new PileStartCharge(pn, socValue, changePowerCmdType, changePower, chargeOrderNo); + this.Channel.WriteAndFlushAsync(pileStartCharge); return Result.Success(chargeOrderNo); } + /// /// 3.7.3 监控平台远程停止充电桩充电 /// @@ -541,32 +546,33 @@ public class ChargerClient : TcpClient { return Result.Fail($"充电机{BinNo}未连接"); } - + Log().Info( $"SendStartOutCharger pn={pn}, stopReason={stopReason}"); - PileStopCharge pileStopCharge=new PileStopCharge(pn,stopReason); + PileStopCharge pileStopCharge = new PileStopCharge(pn, stopReason); this.Channel.WriteAndFlushAsync(pileStopCharge); return Result.Success(); } - + /// /// 3.7.9 监控平台发送充电桩功率调节指令 /// /// /// /// - public Result SendPileAdjustPower(byte pn,float expectedOperatingPower) + public Result SendPileAdjustPower(byte pn, float expectedOperatingPower) { if (!Connected) { return Result.Fail($"charger-{BinNo} disconnect"); } - PileAdjustPower powerRegulation = new PileAdjustPower(pn,expectedOperatingPower); + PileAdjustPower powerRegulation = new PileAdjustPower(pn, expectedOperatingPower); this.Channel.WriteAndFlushAsync(powerRegulation); return Result.Success(); } + /// /// /// @@ -592,7 +598,7 @@ public class ChargerClient : TcpClient /// /// /// - public Result StartCharge(byte chargeSoc, float chargePower) + public Result StartCharge(byte chargeSoc, float chargePower) { if (string.IsNullOrWhiteSpace(BinNo)) { @@ -616,12 +622,12 @@ public class ChargerClient : TcpClient return Result.Fail($"charger-{BinNo} battery not exist"); } - if (binInfo.AmtLock == 1) + if (binInfo.AmtLock == 1) { return Result.Fail($"仓-{BinNo} 被锁定"); } - if (binInfo.CanChargeFlag == 0) + if (binInfo.CanChargeFlag == 0) { return Result.Fail($"仓-{BinNo} 被禁用"); }