现场调试更新

master
xjl 4 weeks ago
parent e6f9a74079
commit 08790cb902

@ -51,6 +51,7 @@ public class ChargerService
float? chargePower = EquipInfoRepository.QueryPowerByCode(binInfo.ChargerNo); float? chargePower = EquipInfoRepository.QueryPowerByCode(binInfo.ChargerNo);
float? power = chargePower == null ? StaticStationInfo.ChargePower : chargePower; float? power = chargePower == null ? StaticStationInfo.ChargePower : chargePower;
power = power * 10;
return chargerClient.StartCharge(chargeSoc, (float)power, 1); return chargerClient.StartCharge(chargeSoc, (float)power, 1);
} }
@ -79,19 +80,23 @@ public class ChargerService
} }
// //
WaterCoolClientMgr.Dictionary.TryGetValue(StaticStationInfo.RelationMap[chargerClient.Sn].WaterCoolerCode, #region 水冷判断先屏蔽
out WaterCoolClient client); //WaterCoolClientMgr.Dictionary.TryGetValue(StaticStationInfo.RelationMap[chargerClient.Sn].WaterCoolerCode,
if (client == null) // out WaterCoolClient client);
{ //if (client == null)
return Result<bool>.Fail("未初始化液冷"); //{
} // return Result<bool>.Fail("未初始化液冷");
//}
//if (!client.HeartManageStop())
//{
// return Result<bool>.Fail("液冷系统断开失败");
//}
//client.StopFlag = true;
#endregion
if (!client.HeartManageStop())
{
return Result<bool>.Fail("液冷系统断开失败");
}
client.StopFlag = true;
chargerClient.SendRemoteStopCharging(); chargerClient.SendRemoteStopCharging();
@ -253,11 +258,13 @@ public class ChargerService
chargerClient.SendAuxiliaryPower(openFlag); chargerClient.SendAuxiliaryPower(openFlag);
return Result<bool>.Success(true); return Result<bool>.Success(true);
} }
/// <summary> /// <summary>
/// 监控平台下发辅源控制指令 /// 监控平台下发电池仓的状态
/// </summary> /// </summary>
/// <param name="openFlag">打开辅助电源标志 1电池包辅助电源导通 0电池包辅助电源断开</param> /// <param name="battery">是否有电池 0:无电池 1有电池</param>
/// <param name="connectionState">电接头连接状态 0:未连接 1: 已连接</param>
/// <param name="waterCondition">水接头状态 0:未连接 1: 已连接</param>
public Result<bool> SendBatteryHolderStatus(string binNo, byte battery, byte connectionState, byte waterCondition) public Result<bool> SendBatteryHolderStatus(string binNo, byte battery, byte connectionState, byte waterCondition)
{ {
BinInfo? binInfo = BinInfoRepository.QueryByBinNo(binNo); BinInfo? binInfo = BinInfoRepository.QueryByBinNo(binNo);
@ -279,4 +286,85 @@ public class ChargerService
chargerClient.SendBatteryHolderStatus(battery,connectionState,waterCondition); chargerClient.SendBatteryHolderStatus(battery,connectionState,waterCondition);
return Result<bool>.Success(true); return Result<bool>.Success(true);
} }
/// <summary>
/// 监控平台下发掉线停止充电
/// </summary>
/// <param name="Value"> 0不使能 1使能</param>
public Result<bool> SendOfflineStopCharging(string binNo, byte Value)
{
BinInfo? binInfo = BinInfoRepository.QueryByBinNo(binNo);
if (binInfo == null)
{
return Result<bool>.Fail(@"充电仓不存在");
}
if (string.IsNullOrWhiteSpace(binInfo.ChargerNo))
{
return Result<bool>.Fail(@"充电仓未配置充电机编号");
}
ChargerClient? chargerClient = ClientMgr.GetBySn(binInfo.ChargerNo);
if (chargerClient == null || !chargerClient.Connected)
{
return Result<bool>.Fail(@"充电机未连接");
}
chargerClient.SendOfflineStopCharging(Value);
return Result<bool>.Success(true);
}
/// <summary>
/// 监控平台下发站外允许充电 SOC
/// </summary>
/// <param name="binNo"></param>
/// <param name="Value"></param>
/// <returns></returns>
public Result<bool> SendOutSideAllowChargingSoc(string binNo, byte Value)
{
BinInfo? binInfo = BinInfoRepository.QueryByBinNo(binNo);
if (binInfo == null)
{
return Result<bool>.Fail(@"充电仓不存在");
}
if (string.IsNullOrWhiteSpace(binInfo.ChargerNo))
{
return Result<bool>.Fail(@"充电仓未配置充电机编号");
}
ChargerClient? chargerClient = ClientMgr.GetBySn(binInfo.ChargerNo);
if (chargerClient == null || !chargerClient.Connected)
{
return Result<bool>.Fail(@"充电机未连接");
}
chargerClient.SendOutSideAllowChargingSoc(Value);
return Result<bool>.Success(true);
}
/// <summary>
/// 站控设备切换站内/站外充电切换
/// </summary>
/// <param name="Value"> 00:无效 01:站内 02:站外</param>
public Result<bool> SendChangeChargeMode(string binNo, byte Value)
{
BinInfo? binInfo = BinInfoRepository.QueryByBinNo(binNo);
if (binInfo == null)
{
return Result<bool>.Fail(@"充电仓不存在");
}
if (string.IsNullOrWhiteSpace(binInfo.ChargerNo))
{
return Result<bool>.Fail(@"充电仓未配置充电机编号");
}
ChargerClient? chargerClient = ClientMgr.GetBySn(binInfo.ChargerNo);
if (chargerClient == null || !chargerClient.Connected)
{
return Result<bool>.Fail(@"充电机未连接");
}
chargerClient.SendChangeChargeMode(Value);
return Result<bool>.Success(true);
}
} }

@ -239,7 +239,10 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
_chargeOrderRepository = chargeOrderRepository; _chargeOrderRepository = chargeOrderRepository;
_binInfoRepository = binInfoRepository; _binInfoRepository = binInfoRepository;
} }
public ChargerClient()
{
}
private ILog Log() private ILog Log()
{ {
var name = "Charger" + this.Sn; var name = "Charger" + this.Sn;
@ -300,9 +303,9 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
/// </summary> /// </summary>
/// <param name="socLimit">SOC限制.百分比</param> /// <param name="socLimit">SOC限制.百分比</param>
/// <param name="changePowerCmdType">功率调节指令类型.默认1 绝对功率值</param> /// <param name="changePowerCmdType">功率调节指令类型.默认1 绝对功率值</param>
/// <param name="changePower">1kw/位,默认3600</param> /// <param name="changePower">1kw/位,默认2400</param>
/// <param name="chargeOrderNo">充电流水号</param> /// <param name="chargeOrderNo">充电流水号</param>
public Result<string> SendRemoteStartCharging(byte socLimit, float changePower = 360, byte changePowerCmdType = 1, public Result<string> SendRemoteStartCharging(byte socLimit, float changePower = 2400, byte changePowerCmdType = 1,
string? chargeOrderNo = null) string? chargeOrderNo = null)
{ {
if (!Connected) if (!Connected)
@ -321,11 +324,11 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" + CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging, Formatting.Indented) + "\r\n" +
BitUtls.BytesToHexStr(remoteStartCharging.ToBytes()); BitUtls.BytesToHexStr(remoteStartCharging.ToBytes());
AuxiliaryPower auxiliaryPower0 = new AuxiliaryPower(0); AuxiliaryPower auxiliaryPower0 = new AuxiliaryPower(2);
AuxiliaryPower auxiliaryPower1 = new AuxiliaryPower(1); AuxiliaryPower auxiliaryPower1 = new AuxiliaryPower(1);
this.Channel.WriteAndFlushAsync(auxiliaryPower0); //this.Channel.WriteAndFlushAsync(auxiliaryPower0);
Thread.Sleep(3000); //Thread.Sleep(3000);
this.Channel.WriteAndFlushAsync(auxiliaryPower1); //this.Channel.WriteAndFlushAsync(auxiliaryPower1);
this.Channel.WriteAndFlushAsync(remoteStartCharging); this.Channel.WriteAndFlushAsync(remoteStartCharging);
return Result<string>.Success(chargeOrderNo); return Result<string>.Success(chargeOrderNo);
} }
@ -358,7 +361,6 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
{ {
return Result<bool>.Fail($"charger-{BinNo} disconnect"); return Result<bool>.Fail($"charger-{BinNo} disconnect");
} }
PowerRegulation powerRegulation = new PowerRegulation(expectedOperatingPower); PowerRegulation powerRegulation = new PowerRegulation(expectedOperatingPower);
this.Channel.WriteAndFlushAsync(powerRegulation); this.Channel.WriteAndFlushAsync(powerRegulation);
return Result<bool>.Success(); return Result<bool>.Success();
@ -501,7 +503,23 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
this.Channel.WriteAndFlushAsync(offlineStopCharging); this.Channel.WriteAndFlushAsync(offlineStopCharging);
return Result<bool>.Success(); return Result<bool>.Success();
} }
/// <summary>
/// 3.4.9 监控平台下发站外允许充电 SOC
/// </summary>
/// <param name="enabled"> </param>
public Result<bool> SendOutSideAllowChargingSoc(byte enabled)
{
if (!Connected)
{
return Result<bool>.Fail($"charger-{BinNo} disconnect");
}
OutSideAllowChargingSoc offlineStopCharging = new OutSideAllowChargingSoc(enabled);
CurrentCmd = JsonConvert.SerializeObject(offlineStopCharging, Formatting.Indented) + "\r\n" +
BitUtls.BytesToHexStr(offlineStopCharging.ToBytes());
this.Channel.WriteAndFlushAsync(offlineStopCharging);
return Result<bool>.Success();
}
/// <summary> /// <summary>
/// 3.4.12 站控设备切换站内/站外充电切换 /// 3.4.12 站控设备切换站内/站外充电切换
/// </summary> /// </summary>
@ -592,7 +610,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
} }
/// <summary> /// <summary>
/// ///查询电池信息
/// </summary> /// </summary>
public Result<bool> SendQueryBattery() public Result<bool> SendQueryBattery()
{ {
@ -652,19 +670,23 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
//判断水冷继电器状态为断开 //判断水冷继电器状态为断开
var relation = StaticStationInfo.RelationMap[Sn]; #region 水冷判断先屏蔽
var waterCoolClient = WaterCoolClientMgr.GetBySn(relation.WaterCoolerCode) // TODO 水冷判断先屏蔽
; //var relation = StaticStationInfo.RelationMap[Sn];
if (waterCoolClient == null) //var waterCoolClient = WaterCoolClientMgr.GetBySn(relation.WaterCoolerCode)
{ // ;
return Result<bool>.Fail($"液冷机组未初始化"); //if (waterCoolClient == null)
} //{
// return Result<bool>.Fail($"液冷机组未初始化");
//}
if (!waterCoolClient.WaitIsClose()) //if (!waterCoolClient.WaitIsClose())
{ //{
return Result<bool>.Fail($"继电器未断开"); // return Result<bool>.Fail($"继电器未断开");
} //}
#endregion
RedisHelper redisHelper = AppInfo.Container.Resolve<RedisHelper>(); RedisHelper redisHelper = AppInfo.Container.Resolve<RedisHelper>();
@ -693,7 +715,7 @@ public class ChargerClient : TcpClient<IBaseHandler, Decoder, Encoder>
BatteryNo = BatteryNo, BatteryNo = BatteryNo,
CmdStatus = 0, CmdStatus = 0,
ChargerNo = BinNo, ChargerNo = BinNo,
ChargeMode = 1, ChargeMode = 0,
SwapOrderSn = swapOrder?.SwapOrderSn, SwapOrderSn = swapOrder?.SwapOrderSn,
StartMode = 1, StartMode = 1,
StartType = startType StartType = startType

@ -133,6 +133,9 @@ public class Decoder : ByteToMessageDecoder
ASDU asdu = cmd switch ASDU asdu = cmd switch
{ {
5 => ModelConvert.Decode<UploadRemoteSignalData>(bytes), 5 => ModelConvert.Decode<UploadRemoteSignalData>(bytes),
11 => ModelConvert.Decode<UploadTelemetryData>(bytes),
42 => ModelConvert.Decode<RecordCharge>(bytes),
#region 45 #region 45
45 => recordType switch 45 => recordType switch
{ {
@ -255,8 +258,6 @@ public class Decoder : ByteToMessageDecoder
}, },
#endregion #endregion
42 => ModelConvert.Decode<RecordCharge>(bytes),
11 => ModelConvert.Decode<UploadTelemetryData>(bytes),
49 => ModelConvert.Decode<RemoteStartChargingRes>(bytes), 49 => ModelConvert.Decode<RemoteStartChargingRes>(bytes),
50 => ModelConvert.Decode<RemoteStopChargingRes>(bytes), 50 => ModelConvert.Decode<RemoteStopChargingRes>(bytes),

@ -34,7 +34,9 @@ namespace Service.Charger.Handler
client.UploadTelemetryData = msg; client.UploadTelemetryData = msg;
//充电机实时充电功率 //充电机实时充电功率
client.RealTimeChargePower = msg.HighVoltageAcquisitionCurrent * msg.HighVoltageAcquisitionVoltage; //client.RealTimeChargePower = msg.HighVoltageAcquisitionCurrent * msg.HighVoltageAcquisitionVoltage;
client.RealTimeChargePower = msg.DcMeterCurrent * msg.DcMeterVoltage;
} }
} }
} }

@ -44,13 +44,13 @@ namespace Service.Charger.Msg.Charger.Req
/// <summary> /// <summary>
/// 当前SOH 分辨率1%/位偏移量0%,数值范围 0%~100% /// 当前SOH 分辨率1%/位偏移量0%,数值范围 0%~100%
/// </summary> /// </summary>
[Property(80, 8, scale: 0.01)] [Property(80, 8)]
public float SOH { get; set; } public float SOH { get; set; }
///// <summary> /// <summary>
///// 保留 /// 保留
///// </summary> /// </summary>
//[Property(88, 8)] [Property(88, 8)]
//public byte Reserve { get; set; } public byte Reserve { get; set; }
} }
} }

@ -43,4 +43,5 @@ public class QueryBatterySnRes : ASDU
/// </summary> /// </summary>
[Property(start: 48, length: 27, PropertyReadConstant.Byte)] [Property(start: 48, length: 27, PropertyReadConstant.Byte)]
public byte[] BatterSnBytes { get; set; } public byte[] BatterSnBytes { get; set; }
} }

@ -29,107 +29,107 @@ namespace Service.Charger.Msg.Charger.Resp
/// <summary> /// <summary>
/// 单体蓄电池或蓄电池模块电压越限 /// 单体蓄电池或蓄电池模块电压越限
/// </summary> /// </summary>
[Property(32, 16)] [Property(32, 2)]
public short SingleBattery { get; set; } public byte SingleBattery { get; set; }
/// <summary> /// <summary>
/// 电压偏差越限 /// 电压偏差越限
/// </summary> /// </summary>
[Property(48, 16)] [Property(34, 2)]
public short VoltageOvershoot { get; set; } public byte VoltageOvershoot { get; set; }
/// <summary> /// <summary>
/// 温度越限 /// 温度越限
/// </summary> /// </summary>
[Property(64, 16)] [Property(36, 2)]
public short TemperatureExceedance { get; set; } public byte TemperatureExceedance { get; set; }
/// <summary> /// <summary>
/// 温度偏差越限 /// 温度偏差越限
/// </summary> /// </summary>
[Property(80, 16)] [Property(38, 2)]
public short TemperatureDifference { get; set; } public byte TemperatureDifference { get; set; }
/// <summary> /// <summary>
/// SOC 低 /// SOC 低
/// </summary> /// </summary>
[Property(96, 16)] [Property(40, 2)]
public short LowSOC { get; set; } public byte LowSOC { get; set; }
/// <summary> /// <summary>
/// 放电电流越限 /// 放电电流越限
/// </summary> /// </summary>
[Property(112, 16)] [Property(42, 2)]
public short DischargeCurrent { get; set; } public short DischargeCurrent { get; set; }
/// <summary> /// <summary>
/// 充电电流限 /// 充电电流限
/// </summary> /// </summary>
[Property(128, 16)] [Property(44, 2)]
public short ChargingCurrentLimit { get; set; } public short ChargingCurrentLimit { get; set; }
/// <summary> /// <summary>
/// 总正负极柱温度越限 /// 总正负极柱温度越限
/// </summary> /// </summary>
[Property(144, 16)] [Property(46, 2)]
public short TotalTemp { get; set; } public short TotalTemp { get; set; }
/// <summary> /// <summary>
/// 电池系统故障码 /// 电池系统故障码 2字节
/// </summary> /// </summary>
[Property(160, 16)] [Property(48, 16)]
public short BatteryFaultCode { get; set; } public short BatteryFaultCode { get; set; }
/// <summary> /// <summary>
/// 高压绝缘低 /// 高压绝缘低
/// </summary> /// </summary>
[Property(176, 16)] [Property(64, 2)]
public short HighVoltageLow { get; set; } public short HighVoltageLow { get; set; }
/// <summary> /// <summary>
/// 单体蓄电池或蓄电池模块电压越极限 /// 单体蓄电池或蓄电池模块电压越极限
/// </summary> /// </summary>
[Property(192, 16)] [Property(66, 2)]
public short MonomerLimit { get; set; } public short MonomerLimit { get; set; }
/// <summary> /// <summary>
/// 电压偏差越极限a /// 电压偏差越极限a
/// </summary> /// </summary>
[Property(200, 16)] [Property(68, 2)]
public short VoltageDifference { get; set; } public short VoltageDifference { get; set; }
/// <summary> /// <summary>
/// 温度越极限 /// 温度越极限
/// </summary> /// </summary>
[Property(216, 16)] [Property(70, 2)]
public short TemperatureOvershoot { get; set; } public short TemperatureOvershoot { get; set; }
/// <summary> /// <summary>
/// 温度偏差越极限 /// 温度偏差越极限
/// </summary> /// </summary>
[Property(232, 16)] [Property(72 ,2)]
public short TempDifference { get; set; } public short TempDifference { get; set; }
/// <summary> /// <summary>
/// SOC 极低 /// SOC 极低
/// </summary> /// </summary>
[Property(248, 16)] [Property(74, 2)]
public short VeryLowSOC { get; set; } public short VeryLowSOC { get; set; }
/// <summary> /// <summary>
/// 放电电流越极限 /// 放电电流越极限
/// </summary> /// </summary>
[Property(264, 16)] [Property(76, 2)]
public short DischargeCurrentLimit { get; set; } public short DischargeCurrentLimit { get; set; }
/// <summary> /// <summary>
/// 充电电流越极限 /// 充电电流越极限
/// </summary> /// </summary>
[Property(280, 16)] [Property(78, 2)]
public short ChargingCurrent { get; set; } public short ChargingCurrent { get; set; }
/// <summary> /// <summary>
/// 总正负极柱温度越极限 /// 总正负极柱温度越极限
/// </summary> /// </summary>
[Property(296, 16)] [Property(80, 2)]
public short TotalTempLimit { get; set; } public short TotalTempLimit { get; set; }
/// <summary> /// <summary>
/// 高压绝缘极低 /// 高压绝缘极低
/// </summary> /// </summary>
[Property(312, 16)] [Property(82, 2)]
public short highVoltageInsulation { get; set; } public short highVoltageInsulation { get; set; }
/// <summary> /// <summary>
/// 硬件故障 /// 硬件故障
/// </summary> /// </summary>
[Property(328, 16)] [Property(84, 2)]
public short HardwareFailure { get; set; } public short HardwareFailure { get; set; }
/// <summary> /// <summary>
/// 保留 /// 保留
/// </summary> /// </summary>
[Property(344, 16)] [Property(86, 2)]
public short Reserve { get; set; } public short Reserve { get; set; }
} }
} }

@ -13,7 +13,7 @@ namespace Service.Charger.Msg.Host.Req
[Property(0, 8)] [Property(0, 8)]
public byte RecordType { get; set; } public byte RecordType { get; set; }
/// <summary> /// <summary>
///打开辅助电源标志 1电池包辅助电源导通 0:电池包辅助电源断开 ///打开辅助电源标志 1电池包辅助电源导通 2:电池包辅助电源断开
/// </summary> /// </summary>
[Property(8, 8)] [Property(8, 8)]
public byte OpenFlag { get; set; } public byte OpenFlag { get; set; }

@ -3,7 +3,7 @@
namespace Service.Charger.Msg.Host.Req.Bms namespace Service.Charger.Msg.Host.Req.Bms
{ {
/// <summary> /// <summary>
/// 3.4.1 监控平台发送功率调节指令 /// 3.6.2.1 监控平台下发PGN查询电池信息(PGN:0x00F82C)
/// </summary> /// </summary>
public class QueryBattery : ASDU public class QueryBattery : ASDU
{ {
@ -14,13 +14,13 @@ namespace Service.Charger.Msg.Host.Req.Bms
public byte RecordType { get; set; } public byte RecordType { get; set; }
/// <summary> /// <summary>
/// 记录类型 /// PGN 码
/// </summary> /// </summary>
[Property(8, 3, PropertyReadConstant.Byte)] [Property(8, 3, PropertyReadConstant.Byte)]
public byte[] Pgn { get; set; } = { 0x00, 0xf8, 0x2c }; public byte[] Pgn { get; set; } = { 0x00, 0xf8, 0x2c };
/// <summary> /// <summary>
/// 记录类型 /// 要查询的PGN
/// </summary> /// </summary>
[Property(32, 3, PropertyReadConstant.Byte)] [Property(32, 3, PropertyReadConstant.Byte)]
public byte[] QueryPgn { get; set; } public byte[] QueryPgn { get; set; }

@ -7,11 +7,32 @@ namespace Service.Charger.Msg.Host.Req
/// </summary> /// </summary>
public class OutSideAllowChargingSoc : ASDU public class OutSideAllowChargingSoc : ASDU
{ {
/// <summary> /// <summary>
/// SOC 限制值 /// 记录类型
/// </summary> /// </summary>
[Property(0, 8)] [Property(0, 8)]
public byte RecordType { get; set; }
/// <summary>
/// SOC 限制值
/// </summary>
[Property(8, 8)]
public byte SocValue { get; set; } public byte SocValue { get; set; }
public OutSideAllowChargingSoc(byte enabled)
{
FrameTypeNo = 45;
MsgBodyCount = 1;
TransReason = 3;
PublicAddr = 0;
MsgBodyAddr = new byte[] { 0, 0, 0 };
RecordType = 45;
SocValue = enabled;
}
} }
} }

@ -33,7 +33,8 @@ public class AutoChargeTask : ITask
public int Interval() public int Interval()
{ {
return 1000 * 10; //充电机说启动失败不要频繁发商定1分钟
return 1000 * 60;
} }
public void Handle() public void Handle()

@ -5,6 +5,9 @@ using Service.Charger.Client;
namespace Service.Charger.MyTask; namespace Service.Charger.MyTask;
/// <summary>
/// 查询电池信息任务
/// </summary>
[Scope] [Scope]
public class QueryBatteryInfoTask : ITask public class QueryBatteryInfoTask : ITask
{ {
@ -27,7 +30,8 @@ public class QueryBatteryInfoTask : ITask
{ {
foreach (var (key, client) in ClientMgr.Dictionary) foreach (var (key, client) in ClientMgr.Dictionary)
{ {
client.SendQueryBattery(); //取消查询,充电机会主动上报
//client.SendQueryBattery();
} }
} }
catch (Exception e) catch (Exception e)

@ -43,9 +43,27 @@ public class BinInfoService : BaseServices<BinInfo>
if (chargerClient.BatteryPackTotalElectricity != null) if (chargerClient.BatteryPackTotalElectricity != null)
binInfoResp.OnceElectricCharge = chargerClient.BatteryPackTotalElectricity.OnceElectricCharge; binInfoResp.OnceElectricCharge = chargerClient.BatteryPackTotalElectricity.OnceElectricCharge;
binInfoResp.BmsNeedVoltage = chargerClient.UploadTelemetryData.BmsNeedVoltage; binInfoResp.BmsNeedVoltage = chargerClient.UploadTelemetryData.BmsNeedVoltage;
binInfoResp.BmsNeedCurrent = chargerClient.UploadTelemetryData.BmsNeedCurrent; //binInfoResp.BmsNeedCurrent = chargerClient.UploadTelemetryData.BmsNeedCurrent;
//if (chargerClient.BatteryPackData != null)
// binInfoResp.TotalCurrent = chargerClient.BatteryPackData.TotalCurrent;
#region 正负显示统一
if (binInfoResp.ChargeStatus == 1)
{
binInfoResp.BmsNeedCurrent = chargerClient.UploadTelemetryData.BmsNeedCurrent;
binInfoResp.BmsNeedCurrent = 0 - binInfoResp.BmsNeedCurrent;
}
else
{ binInfoResp.BmsNeedCurrent = 0; }
if (chargerClient.BatteryPackData != null) if (chargerClient.BatteryPackData != null)
binInfoResp.TotalCurrent = chargerClient.BatteryPackData.TotalCurrent; {
if (binInfoResp.ChargeStatus == 1)
{ binInfoResp.TotalCurrent = chargerClient.BatteryPackData.TotalCurrent; }
else
{ binInfoResp.TotalCurrent = 0; }
}
#endregion
if (chargerClient.BatteryPackDataVoltage != null) if (chargerClient.BatteryPackDataVoltage != null)
binInfoResp.CellTemperatureMax = chargerClient.BatteryPackDataVoltage.CellTemperatureMax; binInfoResp.CellTemperatureMax = chargerClient.BatteryPackDataVoltage.CellTemperatureMax;
if (chargerClient.BatteryPackDataVoltage != null) if (chargerClient.BatteryPackDataVoltage != null)

@ -72,9 +72,9 @@ public class ChargeController : ControllerBase
[Route("SendPowerRegulation/{code}/{power}")] [Route("SendPowerRegulation/{code}/{power}")]
public Result<bool> SendPowerRegulation(string code, float power) public Result<bool> SendPowerRegulation(string code, float power)
{ {
if (power <=0 || power > 360) if (power <=0 || power > 240)
{ {
return Result<bool>.Fail("功率值范围1到360"); return Result<bool>.Fail("功率值范围1到240");
} }
string _code = _binInfoService.QueryByClause(i => i.Code == code).ChargerNo; string _code = _binInfoService.QueryByClause(i => i.Code == code).ChargerNo;
@ -198,4 +198,41 @@ public class ChargeController : ControllerBase
{ {
return _chargerService.SendBatteryHolderStatus( binNo,battery,connectionState,waterCondition); return _chargerService.SendBatteryHolderStatus( binNo,battery,connectionState,waterCondition);
} }
/// <summary>
/// 下发掉线停止充电
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("SendOfflineStopCharging")]
public Result<bool> SendOfflineStopCharging(string binNo, byte openFlag)
{
return _chargerService.SendOfflineStopCharging(binNo, openFlag);
}
/// <summary>
/// 站控设备切换站内/站外充电切换
/// </summary>
/// <param name="Value"> 00:无效 01:站内 02:站外</param>
[HttpGet]
[Route("SendChangeChargeMode")]
public Result<bool> SendChangeChargeMode(string binNo, byte Value)
{
return _chargerService.SendChangeChargeMode(binNo, Value);
}
/// <summary>
/// 监控平台下发站外允许充电 SOC
/// </summary>
/// <param name="Value"> 限制值</param>
[HttpGet]
[Route("SendOutSideAllowChargingSoc")]
public Result<bool> SendOutSideAllowChargingSoc(string binNo, byte Value)
{
return _chargerService.SendOutSideAllowChargingSoc(binNo, Value);
}
} }

@ -119,6 +119,6 @@ StaticStationInfo.Init();
// 水冷连接 // 水冷连接
WaterCoolClientMgr.InitClient(); //WaterCoolClientMgr.InitClient();
app.Run(); app.Run();

@ -2,7 +2,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "master", "ConfigId": "master",
"DbType": "MySql", "DbType": "MySql",
"SqlConnection": "server=180.76.133.253;Port=16306;Database=nhet_dev;Uid=root;Pwd=Rszn123;Charset=utf8;" "SqlConnection": "server=127.0.0.1;Port=3306;Database=nhet_cn_dev;Uid=root;Pwd=123456;Charset=utf8;"
}, },
"Update": { "Update": {
"AutoUpdate": "false", "AutoUpdate": "false",
@ -10,7 +10,7 @@
"Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml" "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml"
}, },
"Redis": { "Redis": {
"Connection": "192.168.2.2:6379,password=dev", "Connection": "127.0.0.1:6379,password=123456",
"InstanceName": "local", "InstanceName": "local",
"DefaultDB": "8" "DefaultDB": "8"
}, },

@ -2,7 +2,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "master", "ConfigId": "master",
"DbType": "MySql", "DbType": "MySql",
"SqlConnection": "server=localhost;Port=3306;Database=huanneng_dev;Uid=root;Pwd=123456;Charset=utf8;" "SqlConnection": "server=localhost;Port=3306;Database=nhet_cn_dev;Uid=root;Pwd=123456;Charset=utf8;"
}, },
"Update": { "Update": {
"AutoUpdate": "false", "AutoUpdate": "false",
@ -35,8 +35,8 @@
"Job": { "Job": {
"Enabled": false "Enabled": false
}, },
"Task": { //"Task": {
"Disabled": "UploadTelemetryData" // "Disabled": "UploadTelemetryData"
}, //},
"AllowedHosts": "*" "AllowedHosts": "*"
} }

Loading…
Cancel
Save