|
|
|
@ -4,6 +4,7 @@ using HybirdFrameworkDriver.TcpClient;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Service.Charger.Common;
|
|
|
|
|
using Service.Charger.Handler;
|
|
|
|
|
using Service.WaterCool.Msg.Host;
|
|
|
|
|
using Service.WaterCool.Msg.WaterCool;
|
|
|
|
|
using Decoder = Service.Charger.Codec.Decoder;
|
|
|
|
|
using Encoder = Service.Charger.Codec.Encoder;
|
|
|
|
@ -25,6 +26,11 @@ public class WaterCoolClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsConnect { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否发送水冷固定帧
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsWaterCoolSend { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
private ILog Log()
|
|
|
|
|
{
|
|
|
|
|
var name = "WaterCool" + this.Sn;
|
|
|
|
@ -38,6 +44,30 @@ public class WaterCoolClient : TcpClient<IBaseHandler, Decoder, Encoder>
|
|
|
|
|
/// 水冷机编号
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Sn { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 无参固定发送
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void Send()
|
|
|
|
|
{
|
|
|
|
|
ModeMsg modeMsg=new ModeMsg();
|
|
|
|
|
Channel.WriteAndFlushAsync(modeMsg);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 发送
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="mode">BMS 请求设定模式</param>
|
|
|
|
|
/// <param name="highTension">高压请求</param>
|
|
|
|
|
/// <param name="chargState">充电状态</param>
|
|
|
|
|
/// <param name="bmsState">BMS 高压继电器状态</param>
|
|
|
|
|
/// <param name="setTemperature">设定温度</param>
|
|
|
|
|
/// <param name="hp">生命帧</param>
|
|
|
|
|
/// <param name="crcCheckValue">CRC 效验值</param>
|
|
|
|
|
public void Send(byte mode,byte highTension,byte chargState,byte bmsState,sbyte setTemperature,byte hp,byte crcCheckValue)
|
|
|
|
|
{
|
|
|
|
|
ModeMsg modeMsg=new ModeMsg(mode,highTension,chargState,bmsState,setTemperature,hp,crcCheckValue);
|
|
|
|
|
Channel.WriteAndFlushAsync(modeMsg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|