master
CZ 10 months ago
commit c2eb836ed8

@ -993,8 +993,13 @@ namespace BatCharging.Service
if (CMD2 != null)
{
byte type = 0;
uint startAddress = 0;
byte num = 0;
byte[] setData = null;
//(CMD=1)后台服务器下发充电桩整形工作参数
CmnChargerParam._CHR00TCPCLIENT.Send1();
CmnChargerParam._CHR00TCPCLIENT.Send1(type, startAddress, num, setData);
}
}
@ -1008,8 +1013,12 @@ namespace BatCharging.Service
if (CMD4 != null)
{
byte type = 0;
uint startAddress = 0;
byte[] setData = null;
//(CMD=3)后台服务器下发充电桩字符型参数
CmnChargerParam._CHR00TCPCLIENT.Send3();
CmnChargerParam._CHR00TCPCLIENT.Send3(type, startAddress, setData);
}
}
@ -1023,8 +1032,13 @@ namespace BatCharging.Service
if (CMD6 != null)
{
byte type = 0;
uint startAddress = 0;
byte num = 0;
byte[] setData = null;
//(CMD=5)后台服务器下发充电桩控制命令
CmnChargerParam._CHR00TCPCLIENT.Send5();
CmnChargerParam._CHR00TCPCLIENT.Send5(type, startAddress, num, setData);
}
}
@ -1038,8 +1052,10 @@ namespace BatCharging.Service
if (CMD8 != null)
{
CMD7 CMD = new CMD7();
//(CMD=1)后台服务器下发充电桩整形工作参数
CmnChargerParam._CHR00TCPCLIENT.Send7();
CmnChargerParam._CHR00TCPCLIENT.Send7(CMD);
}
}
@ -1053,8 +1069,12 @@ namespace BatCharging.Service
if (CMD10 != null)
{
byte chargeMuzzle = 0;
uint executeResult = 0;
uint address = 0;
byte[] setData = null;
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send9();
CmnChargerParam._CHR00TCPCLIENT.Send9(chargeMuzzle, executeResult, address, setData);
}
}
@ -1072,8 +1092,9 @@ namespace BatCharging.Service
if (CMD102 != null)
{
ushort heartbeatNum = 0;
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send101();
CmnChargerParam._CHR00TCPCLIENT.Send101(heartbeatNum);
}
}
@ -1087,8 +1108,13 @@ namespace BatCharging.Service
if (CMD104 != null)
{
byte chargeMuzzle = 0;
uint executeResult = 0;
uint address = 0;
byte[] setData = null;
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send103();
CmnChargerParam._CHR00TCPCLIENT.Send103(chargeMuzzle, executeResult, address, setData);
}
}
@ -1102,8 +1128,9 @@ namespace BatCharging.Service
if (CMD106 != null)
{
CMD105 CMD = new CMD105();
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send105();
CmnChargerParam._CHR00TCPCLIENT.Send105(CMD);
}
}
@ -1147,8 +1174,9 @@ namespace BatCharging.Service
if (CMD112 != null)
{
byte messageType = 0;
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send111();
CmnChargerParam._CHR00TCPCLIENT.Send111(messageType);
}
}
@ -1162,8 +1190,11 @@ namespace BatCharging.Service
if (CMD114 != null)
{
byte chargeNum = 0;
byte sign = 0;
//(CMD=9)后台服务器应答桩上传命令请求(预留)
CmnChargerParam._CHR00TCPCLIENT.Send113();
CmnChargerParam._CHR00TCPCLIENT.Send113(chargeNum, sign);
}
}
@ -3228,13 +3259,13 @@ namespace BatCharging.Service
/// <param name="num">设置/查询个数</param>
/// <param name="vs">设置数据</param>
public void Send1(byte type,uint startAddress,byte num,byte[] setData)
public void Send1(byte type, uint startAddress, byte num, byte[] setData)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send1(_chr_client,type,startAddress,num, setData);
new ChargerSendMsgUtils().Send1(_chr_client, type, startAddress, num, setData);
}
}
}
@ -3250,7 +3281,7 @@ namespace BatCharging.Service
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send3(_chr_client,type,startAddress,setData);
new ChargerSendMsgUtils().Send3(_chr_client, type, startAddress, setData);
}
}
}
@ -3261,65 +3292,65 @@ namespace BatCharging.Service
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send5(_chr_client,type, startAddress, num, setData);
new ChargerSendMsgUtils().Send5(_chr_client, type, startAddress, num, setData);
}
}
}
public void Send7()
public void Send7(CMD7 CMD)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send7(_chr_client);
new ChargerSendMsgUtils().Send7(_chr_client, CMD);
}
}
}
public void Send9()
public void Send9(byte chargeMuzzle, uint executeResult, uint address, byte[] setData)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send9(_chr_client);
new ChargerSendMsgUtils().Send9(_chr_client, chargeMuzzle, executeResult, address, setData);
}
}
}
#endregion 协议格式
#region 充电桩主动上传数据
public void Send101()
public void Send101(ushort heartbeatNum)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send101(_chr_client);
new ChargerSendMsgUtils().Send101(_chr_client, heartbeatNum);
}
}
}
public void Send103()
public void Send103(byte chargeMuzzle, uint executeResult, uint address, byte[] setData)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send9(_chr_client);
new ChargerSendMsgUtils().Send9(_chr_client, chargeMuzzle, executeResult, address, setData);
}
}
}
public void Send105()
public void Send105(CMD105 CMD)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send105(_chr_client);
new ChargerSendMsgUtils().Send105(_chr_client, CMD);
}
}
}
@ -3343,23 +3374,23 @@ namespace BatCharging.Service
}
}
}
public void Send111()
public void Send111(byte messageType)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send111(_chr_client);
new ChargerSendMsgUtils().Send111(_chr_client, messageType);
}
}
}
public void Send113()
public void Send113(byte chargeNum, byte sign)
{
if (_chr_client != null)
{
if (_chr_client.Connected)
{
new ChargerSendMsgUtils().Send113(_chr_client);
new ChargerSendMsgUtils().Send113(_chr_client, chargeNum, sign);
}
}
}

@ -164,13 +164,11 @@ namespace BatCharging.Service
lstContent.Add(CMD.value3);
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
lstContent.Add(CMD.value5);
lstContent.AddRange(BitConverter.GetBytes(CMD.value7));
lstContent.AddRange(CMD.value7);
if (CMD.value3 == 1)
{
CMD.value4 = 1;
CMD.value7 = 1;
lstContent.AddRange(BitConverter.GetBytes(CMD.value4));
lstContent.AddRange(BitConverter.GetBytes(CMD.value7));
lstContent.AddRange(CMD.value7);
}
results = lstContent.ToArray();
}
@ -279,7 +277,7 @@ namespace BatCharging.Service
lstContent.AddRange(BitConverter.GetBytes(CMD.value04));
lstContent.AddRange(BitConverter.GetBytes(CMD.value05));
lstContent.AddRange(BitConverter.GetBytes(CMD.value06));
lstContent.AddRange(ByteUtils.ToByteByHexStr(CMD.value07));
lstContent.AddRange(CMD.value07);
results = lstContent.ToArray();
}

@ -480,7 +480,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button14_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send1();
//CmnChargerParam._CHR00TCPCLIENT.Send1();
}
/// <summary>
/// (CMD=3)后台服务器下发充电桩字符型参数
@ -489,7 +489,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button15_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send3();
//CmnChargerParam._CHR00TCPCLIENT.Send3();
}
/// <summary>
/// (CMD=5)后台服务器下发充电桩控制命令
@ -498,7 +498,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button16_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send5();
//CmnChargerParam._CHR00TCPCLIENT.Send5();
}
/// <summary>
/// (CMD=7)后台服务器下发充电桩开启充电控制命令
@ -507,7 +507,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button17_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send7();
//CmnChargerParam._CHR00TCPCLIENT.Send7();
}
/// <summary>
/// (CMD=9)后台服务器应答桩上传命令请求(预留)
@ -516,7 +516,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button18_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send9();
//CmnChargerParam._CHR00TCPCLIENT.Send9();
}
#endregion
@ -528,7 +528,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button20_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send101();
//CmnChargerParam._CHR00TCPCLIENT.Send101();
}
/// <summary>
///
@ -537,7 +537,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button21_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send103();
//CmnChargerParam._CHR00TCPCLIENT.Send103();
}
/// <summary>
@ -547,7 +547,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button19_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send105();
//CmnChargerParam._CHR00TCPCLIENT.Send105();
}
/// <summary>
@ -577,7 +577,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button24_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send111();
//CmnChargerParam._CHR00TCPCLIENT.Send111();
}
/// <summary>
@ -587,7 +587,7 @@ namespace Monitor.ChargeTest
/// <param name="e"></param>
private void button26_Click(object sender, EventArgs e)
{
CmnChargerParam._CHR00TCPCLIENT.Send113();
//CmnChargerParam._CHR00TCPCLIENT.Send113();
}
#endregion

Loading…
Cancel
Save