master
CZ 8 months ago
commit 9c5e927ac7

Binary file not shown.

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetty.Transport" Version="0.7.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BatCharging.Service\BatCharging.Service.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,85 @@
using BatCharging.Service;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BatCharging.Manager
{
public class ChargerEqmManager
{
#region 定义锁
private object lockObj = new object(); //线程同步锁
#endregion 定义锁
#region 字段属性
/// <summary>
/// 是否可以发送充电机数据到云平台
/// </summary>
private bool _can_send_chrg_data = true;
/// <summary>
/// 是否可以发送充电机数据到云平台
/// </summary>
public bool F_CanSendChrgData
{
get { return _can_send_chrg_data; }
set
{
lock (lockObj)
{
_can_send_chrg_data = value;
}
}
}
/// <summary>
/// 是否启动智能充电方法
/// </summary>
private bool _can_smart_chrg = true;
/// <summary>
/// 是否启动智能充电方法
/// </summary>
public bool F_CanSmartChrg
{
get { return _can_smart_chrg; }
set
{
lock (lockObj)
{
_can_smart_chrg = value;
}
}
}
/// <summary>
/// 发送充电机数据到云平台的周期(单位:秒)
/// </summary>
private int _send_chrg_data_period = 30;
/// <summary>
/// 发送充电机数据到云平台的周期(单位:秒)
/// </summary>
public int F_SendChrgDataPeriod
{
get { return _send_chrg_data_period; }
set
{
lock (lockObj)
{
_send_chrg_data_period = value;
}
}
}
#endregion 字段属性
}
}

@ -0,0 +1,118 @@
using BatCharging.Service;
using DotNetty.Transport.Channels;
using System;
namespace BatCharging.Manager
{
public class CmnChargingsEqmInfo
{
#region 定义锁
private static object lockObj = new object(); //线程同步锁
#endregion 定义锁
#region 字段属性
/// <summary>
/// 换电站编码
/// </summary>
internal static string _station_no = "";
/// <summary>
/// 换电站编码
/// </summary>
public static string F_StationNo
{
get
{
return _station_no;
}
set
{
lock (lockObj)
{
_station_no = value;
}
}
}
/// <summary>
/// 仓位中充电实时功率
/// </summary>
internal static float[] _bin_powers = new float[7] { 0, 0, 0, 0, 0, 0, 0 };
/// <summary>
/// 仓位中充电实时功率
/// </summary>
public static float[] F_BinPowers
{
get
{
return _bin_powers;
}
set
{
lock (lockObj)
{
_bin_powers = value;
}
}
}
#endregion 字段属性
#region 基础字段
public static string _OUTCHR01IPADDR = "172.0.30.30";
public static string _OUTCHR02IPADDR = "172.0.30.31";
public static string _OUTCHR03IPADDR = "172.0.30.32";
public static string _OUTCHR04IPADDR = "172.0.30.33";
public static int _OUTCHR01PORT = 4567;
public static int _OUTCHR02PORT = 4567;
public static int _OUTCHR03PORT = 4567;
public static int _OUTCHR04PORT = 4567;
public static IChannelId _ID;
public static string _CHR0IPADDR = "0.0.0.0";
public static int _CHR0PORT = 4567;
public static string _EQMCODE = "";
public volatile static ChargerMgrTool _CHR01 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR02 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR03 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR04 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR05 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR06 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR07 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR08 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR09 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR10 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR11 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR12 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR13 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR14 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR15 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR16 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR17 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR18 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR19 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR20 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR21 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR22 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR23 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR24 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
#endregion 基础字段
#region 充电机工作状态值
public static byte _CHR01WORKVAL = 0;
public static byte _CHR02WORKVAL = 0;
public static byte _CHR03WORKVAL = 0;
public static byte _CHR04WORKVAL = 0;
public static byte _CHR05WORKVAL = 0;
public static byte _CHR06WORKVAL = 0;
public static byte _CHR07WORKVAL = 0;
public static byte[] _CHRSWORKVAL = new byte[] { 0, 0, 0, 0, 0, 0, 0 };
#endregion 充电机工作状态值
}
}

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DotNetty.Transport" Version="0.7.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BatCharging.Model\BatCharging.Model.csproj" />
</ItemGroup>
</Project>

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace HybirdFrameworkEntity namespace BatCharging.Service
{ {
public class ByteUtils public class ByteUtils
{ {

File diff suppressed because it is too large Load Diff

@ -1,7 +0,0 @@
namespace HybirdFrameworkEntity
{
public class Class1
{
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,117 @@
using DotNetty.Transport.Channels;
using System;
namespace HybirdFrameworkServices
{
public class CmnChargingsEqmInfo
{
#region 定义锁
private static object lockObj = new object(); //线程同步锁
#endregion 定义锁
#region 字段属性
/// <summary>
/// 换电站编码
/// </summary>
internal static string _station_no = "";
/// <summary>
/// 换电站编码
/// </summary>
public static string F_StationNo
{
get
{
return _station_no;
}
set
{
lock (lockObj)
{
_station_no = value;
}
}
}
/// <summary>
/// 仓位中充电实时功率
/// </summary>
internal static float[] _bin_powers = new float[7] { 0, 0, 0, 0, 0, 0, 0 };
/// <summary>
/// 仓位中充电实时功率
/// </summary>
public static float[] F_BinPowers
{
get
{
return _bin_powers;
}
set
{
lock (lockObj)
{
_bin_powers = value;
}
}
}
#endregion 字段属性
#region 基础字段
public static string _OUTCHR01IPADDR = "172.0.30.30";
public static string _OUTCHR02IPADDR = "172.0.30.31";
public static string _OUTCHR03IPADDR = "172.0.30.32";
public static string _OUTCHR04IPADDR = "172.0.30.33";
public static int _OUTCHR01PORT = 4567;
public static int _OUTCHR02PORT = 4567;
public static int _OUTCHR03PORT = 4567;
public static int _OUTCHR04PORT = 4567;
public static IChannelId _ID;
public static string _CHR0IPADDR = "0.0.0.0";
public static int _CHR0PORT = 4567;
public static string _EQMCODE = "";
public volatile static ChargerMgrTool _CHR01 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR02 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR03 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR04 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR05 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR06 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR07 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR08 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR09 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR10 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR11 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR12 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR13 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR14 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR15 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR16 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR17 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR18 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR19 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR20 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR21 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR22 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR23 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
public volatile static ChargerMgrTool _CHR24 = new ChargerMgrTool(_ID, _CHR0IPADDR, _CHR0PORT, _EQMCODE);
#endregion 基础字段
#region 充电机工作状态值
public static byte _CHR01WORKVAL = 0;
public static byte _CHR02WORKVAL = 0;
public static byte _CHR03WORKVAL = 0;
public static byte _CHR04WORKVAL = 0;
public static byte _CHR05WORKVAL = 0;
public static byte _CHR06WORKVAL = 0;
public static byte _CHR07WORKVAL = 0;
public static byte[] _CHRSWORKVAL = new byte[] { 0, 0, 0, 0, 0, 0, 0 };
#endregion 充电机工作状态值
}
}

@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class APDUModel
{
/// <summary>
/// 起始域
/// </summary>
public byte OriginDomain1 { get; set; } = 0xAA;
/// <summary>
/// 起始域2
/// </summary>
public byte OriginDomain2 { get; set; } = 0xF5;
/// <summary>
/// 长度域
/// </summary>
public UInt16 LengthDomain { get; set; }
/// <summary>
/// 信息域
///
/// 除了 CMD=1202 加密能用 RSA 加密方式,
/// 其他报文若是加密,全部是采用 AES方式加密。
/// <para>bit0-3 当前协议是V2.6值填0x02</para>
/// </summary>
public byte infoDomain { get; set; }
/// <summary>
/// 序列号域
/// </summary>
public byte SerialNumberDomain { get; set; }
/// <summary>
/// 命令代CMD
/// </summary>
public UInt16 CMD { get; set; }
/// <summary>
/// 数据域
/// </summary>
public byte[] dataDomain = new byte[0];
/// <summary>
/// 校验和域
/// </summary>
public byte checksumDomain { get; set; }
}
}

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD10
{
/// <summary>
/// 预留
/// </summary>
public ushort Reserved1 { get; set; }
/// <summary>
/// 预留
/// </summary>
public ushort Reserved2 { get; set; }
/// <summary>
/// 充电桩编码 32
/// </summary>
public string ASCIINum { get; set; }
/// <summary>
/// 充电枪号
/// </summary>
public byte ChargGunNum { get; set; }
/// <summary>
/// 请求启始地址
/// </summary>
public uint RequestStaIP { get; set; }
/// <summary>
/// 参数
/// </summary>
public float Parameter { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1002
{
/// <summary>
/// 擦除完成百分比
/// 当为 100%时表示擦除完成
/// </summary>
public byte ErasurePercentage { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1004
{
/// <summary>
/// 允许服务发送的升级数据报文数据长度
/// 1. CMD=1007 的数据长度不能超过此限制, 建议不超过 4096 byte
/// </summary>
public int DataLength { get; set; }
}
}

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1006
{
/// <summary>
/// 响应标志
/// 0-正常 、1-大小异常
/// </summary>
public int ResponseFlag { get; set; }
}
}

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1008
{
/// <summary>
/// 正确接收到SN
/// </summary>
public byte ReceiveSN { get; set; }
/// <summary>
/// 写入成功标志
/// 0-写入成功 、1-写入失败
/// </summary>
public byte WriteFlag { get; set; }
/// <summary>
/// 预留
/// </summary>
public short Reserved1 { get; set; }
/// <summary>
/// 预留
/// </summary>
public int Reserved2 { get; set; }
}
}

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1010
{
/// <summary>
/// 预留
/// </summary>
public int Reserved1 { get; set; }
}
}

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HybirdFrameworkServices
{
public class CMD1012
{
/// <summary>
/// 预留
/// </summary>
public int Reserved1 { get; set; }
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save