充电机部分修改1,增加能一行 标称重量入口,去掉换能自动消防策略

master
lxw 1 week ago
parent 2180a4a5f5
commit f0aa89d43b

@ -196,5 +196,11 @@ namespace Entity.DbModel.Station
/// </summary> /// </summary>
[SugarColumn(ColumnName = "in_time")] [SugarColumn(ColumnName = "in_time")]
public DateTime? InTime { get; set; } public DateTime? InTime { get; set; }
/// <summary>
/// 电池标称能量
/// </summary>
[SugarColumn(ColumnName = "nominal_energy")]
public decimal? NominalEnergy { get; set; }
} }
} }

@ -1,5 +1,6 @@
using DotNetty.Transport.Channels; using DotNetty.Transport.Channels;
using log4net; using log4net;
using Repository.Station;
using Service.Charger.Client; using Service.Charger.Client;
using Service.Charger.Msg.Charger.Resp; using Service.Charger.Msg.Charger.Resp;
@ -11,13 +12,20 @@ namespace Service.Charger.Handler;
public class BatteryBaseInfoHandler : SimpleChannelInboundHandler<BatteryBaseInfo>, IBaseHandler public class BatteryBaseInfoHandler : SimpleChannelInboundHandler<BatteryBaseInfo>, IBaseHandler
{ {
private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryBaseInfoHandler)); private static readonly ILog Log = LogManager.GetLogger(typeof(BatteryBaseInfoHandler));
public BinInfoRepository BinInfoRepository { get; set; }
protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryBaseInfo msg) protected override void ChannelRead0(IChannelHandlerContext ctx, BatteryBaseInfo msg)
{ {
if (ClientMgr.TryGetClient(ctx.Channel, out string sn, out var client)) if (ClientMgr.TryGetClient(ctx.Channel, out string sn, out var client))
{ {
Log.Info($"receive {msg} from {sn}"); Log.Info($"receive {msg} from {sn}");
client.BatteryBaseInfo = msg; client.BatteryBaseInfo = msg;
float msgBatteryNominalEnergy = msg.RatedBatteryPack;
decimal? nominalEnergyValue = (decimal?)msgBatteryNominalEnergy;
BinInfoRepository.Update(t => t.NominalEnergy == nominalEnergyValue, t => t.No == client.BinNo);
} }
} }
} }

@ -38,7 +38,8 @@ namespace Service.Charger.Handler
client.RemoteSignaling = msg; client.RemoteSignaling = msg;
if (StaticStationInfo.AutoFireRelocation == 1) //TODO::自动消防策略注释
/*if (StaticStationInfo.AutoFireRelocation == 1)
{ {
if (msg.MaximumAlarmLevel == 3|| msg.FireAlarm==1 || msg.SmokeAlarm==1 ) if (msg.MaximumAlarmLevel == 3|| msg.FireAlarm==1 || msg.SmokeAlarm==1 )
@ -55,7 +56,7 @@ namespace Service.Charger.Handler
} }
} }*/
List<string> lstAlarm = new List<string>(); List<string> lstAlarm = new List<string>();
if (msg.CurrentBMS==1) { lstAlarm.Add("52"); } if (msg.CurrentBMS==1) { lstAlarm.Add("52"); }
if (msg.CurrentStatusBMS==3) { lstAlarm.Add("53"); } if (msg.CurrentStatusBMS==3) { lstAlarm.Add("53"); }

@ -29,8 +29,8 @@ public class BatteryBaseInfo: ASDU
/// <summary> /// <summary>
/// 电池包额定总能量 /// 电池包额定总能量
/// </summary> /// </summary>
[Property(32+8*17, 16)] [Property(32+8*17, 16,scale:0.1)]
public byte RatedBatteryPack{get;set;} public float RatedBatteryPack{get;set;}
/// <summary> /// <summary>
/// 电池冷却方式 /// 电池冷却方式
/// </summary> /// </summary>

Loading…
Cancel
Save