diff --git a/ConsoleStarter/ConsoleStarter.csproj b/ConsoleStarter/ConsoleStarter.csproj index 5849726..c6dee9f 100644 --- a/ConsoleStarter/ConsoleStarter.csproj +++ b/ConsoleStarter/ConsoleStarter.csproj @@ -31,6 +31,9 @@ Always + + Always + diff --git a/ConsoleStarter/Program.cs b/ConsoleStarter/Program.cs index 19fc46a..8d9621f 100644 --- a/ConsoleStarter/Program.cs +++ b/ConsoleStarter/Program.cs @@ -1,14 +1,42 @@ // See https://aka.ms/new-console-template for more information -using ConsoleStarter; +using DotNetty.Codecs; +using DotNetty.Common.Internal.Logging; +using DotNetty.Handlers.Logging; +using DotNetty.Handlers.Timeout; +using DotNetty.Transport.Bootstrapping; +using DotNetty.Transport.Channels; +using DotNetty.Transport.Channels.Sockets; using log4net.Config; +using Microsoft.Extensions.Logging; +using LogLevel = DotNetty.Handlers.Logging.LogLevel; internal class Program { public static void Main(string[] args) { XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.xml")); - var exportDb = new ExportDb(); - exportDb.Export(); + InternalLoggerFactory.DefaultFactory.AddProvider(new Log4NetProvider()); + + Bootstrap bootstrap = new Bootstrap(); + bootstrap + .Group(new MultithreadEventLoopGroup()) + .Channel() + .Option(ChannelOption.TcpNodelay, true) + .Handler(new ActionChannelInitializer(channel => + { + + var pipeline = channel.Pipeline; + pipeline.AddLast(new StringDecoder()); + pipeline.AddLast(new StringEncoder()); + // 监听器 + pipeline.AddLast(new LoggingHandler(LogLevel.TRACE)); + pipeline.AddLast("idleStateHandler", new IdleStateHandler(30, 0, 0)); // 触发读取超时 + + })); + + Task task = bootstrap.ConnectAsync("127.0.0.1", 9998); + IChannel channel = task.Result; + channel.WriteAndFlushAsync("1111111111"); } } \ No newline at end of file diff --git a/ConsoleStarter/log4net.config b/ConsoleStarter/log4net.config new file mode 100644 index 0000000..0cdbee3 --- /dev/null +++ b/ConsoleStarter/log4net.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Entity/Entity.csproj b/Entity/Entity.csproj index e72fe21..b49ee37 100644 --- a/Entity/Entity.csproj +++ b/Entity/Entity.csproj @@ -7,6 +7,10 @@ True + + bin\Debug\Entity.xml + + diff --git a/HybirdFrameworkCore/HybirdFrameworkCore.csproj b/HybirdFrameworkCore/HybirdFrameworkCore.csproj index e36a488..f8142b8 100644 --- a/HybirdFrameworkCore/HybirdFrameworkCore.csproj +++ b/HybirdFrameworkCore/HybirdFrameworkCore.csproj @@ -7,6 +7,10 @@ True + + bin\Debug\HybirdFrameworkCore.xml + + diff --git a/HybirdFrameworkDriver/HybirdFrameworkDriver.csproj b/HybirdFrameworkDriver/HybirdFrameworkDriver.csproj index 02708b7..310ba74 100644 --- a/HybirdFrameworkDriver/HybirdFrameworkDriver.csproj +++ b/HybirdFrameworkDriver/HybirdFrameworkDriver.csproj @@ -6,6 +6,10 @@ enable + + bin\Debug\HybirdFrameworkDriver.xml + + @@ -17,6 +21,7 @@ + diff --git a/HybirdFrameworkDriver/TcpClient/ClientListenerHandler.cs b/HybirdFrameworkDriver/TcpClient/ClientListenerHandler.cs index 188d354..ceb36be 100644 --- a/HybirdFrameworkDriver/TcpClient/ClientListenerHandler.cs +++ b/HybirdFrameworkDriver/TcpClient/ClientListenerHandler.cs @@ -11,10 +11,13 @@ public class ClientListenerHandler : ChannelHandlerAdapter where TH where TE : ChannelHandlerAdapter, new() { private static readonly ILog Log = LogManager.GetLogger(typeof(ClientListenerHandler)); + + private bool AutoReconnect { get; set; } - public ClientListenerHandler(TcpClient client) + public ClientListenerHandler(TcpClient client, bool autoReconnect) { Client = client; + AutoReconnect = autoReconnect; } public TcpClient Client { get; set; } @@ -47,7 +50,10 @@ public class ClientListenerHandler : ChannelHandlerAdapter where TH context.Channel.CloseAsync().Wait(); context.Channel.CloseCompletion.Wait(); - new Thread(Client.BaseConnect).Start(); + if (AutoReconnect) + { + new Thread(Client.BaseConnect).Start(); + } } public override void UserEventTriggered(IChannelHandlerContext context, object evt) diff --git a/HybirdFrameworkDriver/TcpClient/TcpClient.cs b/HybirdFrameworkDriver/TcpClient/TcpClient.cs index d22cd64..49fc129 100644 --- a/HybirdFrameworkDriver/TcpClient/TcpClient.cs +++ b/HybirdFrameworkDriver/TcpClient/TcpClient.cs @@ -1,8 +1,9 @@ -using System.Net; using System.Reflection; using Autofac; using Autofac.Core; using DotNetty.Codecs; +using DotNetty.Common.Internal.Logging; +using DotNetty.Handlers.Logging; using DotNetty.Handlers.Timeout; using DotNetty.Transport.Bootstrapping; using DotNetty.Transport.Channels; @@ -10,37 +11,55 @@ using DotNetty.Transport.Channels.Sockets; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac.Attribute; using log4net; +using Microsoft.Extensions.Logging; +using LogLevel = DotNetty.Handlers.Logging.LogLevel; namespace HybirdFrameworkDriver.TcpClient; -public class TcpClient where TH : IChannelHandler +public class TcpClient : IDisposable where TH : IChannelHandler where TD : ByteToMessageDecoder, new() where TE : ChannelHandlerAdapter, new() { private static readonly ILog Log = LogManager.GetLogger(typeof(TcpClient)); + private Bootstrap? _bootstrap; - - public IChannel Channel { get; set; } + private IEventLoopGroup? _eventLoopGroup; + public IChannel? Channel { get; set; } public bool Connected { get; set; } public string Host { get; set; } public int Port { get; set; } + + public bool AutoReconnect { get; set; } + public LogLevel? LogLevel { get; set; } + public void InitBootstrap(string host, int port, Action? channelInactiveHandler = null) { Host = host; Port = port; + + if (LogLevel != null) + { + InternalLoggerFactory.DefaultFactory.AddProvider(new Log4NetProvider()); + } + _bootstrap = new Bootstrap(); + _eventLoopGroup = new MultithreadEventLoopGroup(); _bootstrap - .Group(new MultithreadEventLoopGroup()) + .Group(_eventLoopGroup) .Channel() .Option(ChannelOption.TcpNodelay, true) .Handler(new ActionChannelInitializer(channel => { - var clientListenerHandler = new ClientListenerHandler(this); + var clientListenerHandler = new ClientListenerHandler(this, AutoReconnect); var pipeline = channel.Pipeline; + if (LogLevel != null) + { + pipeline.AddLast(new LoggingHandler(LogLevel.Value)); + } // 监听器 pipeline.AddLast(clientListenerHandler); pipeline.AddLast("idleStateHandler", new IdleStateHandler(30, 0, 0)); // 触发读取超时 @@ -114,7 +133,7 @@ public class TcpClient where TH : IChannelHandler { try { - Task task = _bootstrap!.ConnectAsync(new IPEndPoint(IPAddress.Parse(Host), Port)); + Task task = _bootstrap!.ConnectAsync(Host, Port); Channel = task.Result; Connected = Channel.Open; } @@ -127,4 +146,17 @@ public class TcpClient where TH : IChannelHandler Thread.Sleep(1000); } } + + public void Close() + { + this.Channel?.CloseAsync().Wait(); + this.Channel?.CloseCompletion.Wait(); + _eventLoopGroup?.ShutdownGracefullyAsync().Wait(); + } + + public void Dispose() + { + this.Close(); + this.Connected = false; + } } \ No newline at end of file diff --git a/Repository/Repository.csproj b/Repository/Repository.csproj index 7e55f6e..4121957 100644 --- a/Repository/Repository.csproj +++ b/Repository/Repository.csproj @@ -6,6 +6,10 @@ enable + + bin\Debug\Repository.xml + + diff --git a/Repository/Station/EquipInfoRepository.cs b/Repository/Station/EquipInfoRepository.cs index 1080680..d6583ff 100644 --- a/Repository/Station/EquipInfoRepository.cs +++ b/Repository/Station/EquipInfoRepository.cs @@ -4,7 +4,7 @@ using SqlSugar; namespace Repository.Station; [Scope("SingleInstance")] -public class EquipInfoRepository:BaseRepository +public class EquipInfoRepository: BaseRepository { public EquipInfoRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) { diff --git a/Service/Charger/Client/ChargerClient.cs b/Service/Charger/Client/ChargerClient.cs index 96869a1..b3dece0 100644 --- a/Service/Charger/Client/ChargerClient.cs +++ b/Service/Charger/Client/ChargerClient.cs @@ -1,7 +1,8 @@ using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkCore.Utils; using HybirdFrameworkDriver.Session; using HybirdFrameworkDriver.TcpClient; -using HybirdFrameworkServices.Charger.Handler; +using Newtonsoft.Json; using Service.Charger.Codec; using Service.Charger.Common; using Service.Charger.Handler; @@ -116,6 +117,9 @@ public class ChargerClient : TcpClient /// 远程升级-监控网关上送升级完成确认帧 /// public UplinkUpgrade UplinkUpgrade { get; set; } + + public string? CurrentCmd { get; set; } + #region 发送指令 private ushort IncreAuthTimes() @@ -131,6 +135,7 @@ public class ChargerClient : TcpClient return AuthTimes; } + /// /// 发送鉴权 @@ -140,6 +145,7 @@ public class ChargerClient : TcpClient byte authCodeKey = ChargerUtils.GetByteRandomNum(); //鉴码KEY[随机数] byte[] authCodes = ChargerUtils.GetAuthCodesResult(ChargerConst.AuthCode, authCodeKey); //鉴权码 Auth auth = new Auth(IncreAuthTimes(), authCodes, authCodeKey); + CurrentCmd = JsonConvert.SerializeObject(auth)+ "\r\n" + BitUtls.BytesToHexStr(auth.ToBytes()); this.Channel.WriteAndFlushAsync(auth); } @@ -158,6 +164,7 @@ public class ChargerClient : TcpClient chargeOrderNo = ChargerUtils.GenChargeOrderSn(); } var remoteStartCharging = new RemoteStartCharging(socLimit, changePowerCmdType, changePower, chargeOrderNo); + CurrentCmd = JsonConvert.SerializeObject(remoteStartCharging)+ "\r\n" + BitUtls.BytesToHexStr(remoteStartCharging.ToBytes()); this.Channel.WriteAndFlushAsync(remoteStartCharging); } @@ -168,6 +175,7 @@ public class ChargerClient : TcpClient public void SendRemoteStopCharging(byte reason) { RemoteStopCharging remoteStopCharging = new RemoteStopCharging(reason); + CurrentCmd = JsonConvert.SerializeObject(remoteStopCharging) + "\r\n" + BitUtls.BytesToHexStr(remoteStopCharging.ToBytes()); this.Channel.WriteAndFlushAsync(remoteStopCharging); } @@ -244,11 +252,11 @@ public class ChargerClient : TcpClient #endregion - public void SessionAttr(int sn, int eqmTypeNo, string eqmCode, string destAddr) + public void SessionAttr(string sn, string destAddr) { - ChannelUtils.AddAttr(Channel, ChargerConst.ChargerSn, sn.ToString()); - ChannelUtils.AddAttr(Channel, ChargerConst.EqmTypeNo, eqmTypeNo.ToString()); - ChannelUtils.AddAttr(Channel, ChargerConst.EqmCode, eqmCode); + ChannelUtils.AddAttr(Channel, ChargerConst.ChargerSn, sn); + ChannelUtils.AddAttr(Channel, ChargerConst.EqmTypeNo, sn); + ChannelUtils.AddAttr(Channel, ChargerConst.EqmCode, sn); ChannelUtils.AddAttr(Channel, ChargerConst.DestAddr, destAddr); } } \ No newline at end of file diff --git a/Service/Charger/Client/ClientMgr.cs b/Service/Charger/Client/ClientMgr.cs index ff71616..c9e9eed 100644 --- a/Service/Charger/Client/ClientMgr.cs +++ b/Service/Charger/Client/ClientMgr.cs @@ -1,7 +1,13 @@ -using DotNetty.Transport.Channels; +using Autofac; +using DotNetty.Transport.Channels; +using Entity.DbModel.Station; +using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Autofac.Attribute; using HybirdFrameworkDriver.Session; +using log4net; +using Repository.Station; using Service.Charger.Common; +using Service.Equipment; namespace Service.Charger.Client; @@ -11,9 +17,12 @@ namespace Service.Charger.Client; [Scope("SingleInstance")] public static class ClientMgr { - private static readonly Dictionary Dictionary = new(); - public static ChargerClient? GetBySn(int sn) + private static readonly ILog Log = LogManager.GetLogger(typeof(ClientMgr)); + + private static readonly Dictionary Dictionary = new(); + + public static ChargerClient? GetBySn(string sn) { Dictionary.TryGetValue(sn, out var o); return o; @@ -25,7 +34,7 @@ public static class ClientMgr if (!string.IsNullOrWhiteSpace(snt)) { - var chargerClient = GetBySn(int.Parse(snt)); + var chargerClient = GetBySn(snt); if (chargerClient != null) { sn = snt; @@ -39,7 +48,7 @@ public static class ClientMgr return false; } - public static void AddBySn(int sn, ChargerClient client) + public static void AddBySn(string sn, ChargerClient client) { Dictionary[sn] = client; } @@ -47,5 +56,31 @@ public static class ClientMgr //TODO 连接、鉴权,开始充电,结束充电,设置尖峰平谷,读取尖峰平谷,发送功率调节指令,发送辅助源控制指令,下发掉线停止充电, public static void InitClient() { + EquipInfoRepository equipInfoRepository = AppInfo.Container.Resolve(); + EquipNetInfoRepository netInfoRepository = AppInfo.Container.Resolve(); + List equipInfos = equipInfoRepository.QueryListByClause(it => it.TypeCode == (int)EquipmentType.Charger); + if (equipInfos.Count > 0) + { + Dictionary set = equipInfos.ToDictionary(it => it.Code, it => it); + List equipNetInfos = netInfoRepository.QueryListByClause(it => set.ContainsKey(it.Code)); + foreach (EquipNetInfo netInfo in equipNetInfos) + { + Task.Run(() => + { + ConnClient(netInfo); + }); + } + } + } + + private static void ConnClient(EquipNetInfo netInfo) + { + Log.Info($"begin to connect {netInfo.Code} {netInfo.NetAddr}:{netInfo.NetPort}"); + ChargerClient client = AppInfo.Container.Resolve(); + client.InitBootstrap(netInfo.NetAddr, int.Parse(netInfo.NetPort)); + client.Connect(); + client.SessionAttr(netInfo.Code, netInfo.NetAddr); + AddBySn(netInfo.Code, client); + Log.Info($"connected {netInfo.Code} {netInfo.NetAddr}:{netInfo.NetPort}"); } } \ No newline at end of file diff --git a/Service/Charger/Codec/Decoder.cs b/Service/Charger/Codec/Decoder.cs index 52cc868..cd9c1e1 100644 --- a/Service/Charger/Codec/Decoder.cs +++ b/Service/Charger/Codec/Decoder.cs @@ -2,6 +2,9 @@ using DotNetty.Codecs; using DotNetty.Transport.Channels; using HybirdFrameworkCore.Utils; +using HybirdFrameworkDriver.Session; +using log4net; +using Newtonsoft.Json; using Service.Charger.Common; using Service.Charger.Msg; using Service.Charger.Msg.Bms; @@ -13,6 +16,8 @@ namespace Service.Charger.Codec; public class Decoder : ByteToMessageDecoder { + + private static readonly ILog Log = LogManager.GetLogger(typeof(Decoder)); private readonly IByteBuffer[] _delimiters = { Unpooled.CopiedBuffer(ChargerConst.StartChar) }; @@ -49,7 +54,9 @@ public class Decoder : ByteToMessageDecoder return; } - output.Add(Parse(buffer, totalFrameLength)); + ASDU asdu = Parse(buffer, totalFrameLength, out var data); + Log.Info($"receive {JsonConvert.SerializeObject(asdu)}:{data} from {ChannelUtils.GetAttr(context.Channel, ChargerConst.ChargerSn)}"); + output.Add(asdu); buffer.Clear(); } } @@ -92,9 +99,9 @@ public class Decoder : ByteToMessageDecoder return -1; } - public ASDU Parse(IByteBuffer byteBuffer, int totalFrameLength) + public ASDU Parse(IByteBuffer byteBuffer, int totalFrameLength, out byte[] data) { - byte[] data = new byte[totalFrameLength]; + data = new byte[totalFrameLength]; byteBuffer.ReadBytes(data); //TODO bug length取值不对 diff --git a/Service/Charger/Codec/Encoder.cs b/Service/Charger/Codec/Encoder.cs index cc3d81d..5599dca 100644 --- a/Service/Charger/Codec/Encoder.cs +++ b/Service/Charger/Codec/Encoder.cs @@ -1,16 +1,38 @@ using DotNetty.Buffers; using DotNetty.Codecs; using DotNetty.Transport.Channels; -using HybirdFrameworkDriver.Common; +using HybirdFrameworkCore.Utils; using HybirdFrameworkDriver.Session; +using log4net; +using Newtonsoft.Json; +using Service.Charger.Common; +using Service.Charger.Msg; namespace Service.Charger.Codec; -public class Encoder : MessageToByteEncoder +/// +/// +/// +public class Encoder : MessageToByteEncoder { - protected override void Encode(IChannelHandlerContext context, IToBytes obj, IByteBuffer output) + private static readonly ILog Log = LogManager.GetLogger(typeof(Encoder)); + /// + /// + /// + /// + /// + /// + protected override void Encode(IChannelHandlerContext context, APCI obj, IByteBuffer output) { - int sn = (int)SessionMgr.GetAttrByKey(context.Channel.Id.ToString(), "charger_sn"); - output.WriteBytes(obj.ToBytes()); + string? s = ChannelUtils.GetAttr(context.Channel, ChargerConst.DestAddr); + if (s != null) + { + byte[] destAddr = s.Split(",").Select(b => Convert.ToByte(b)).ToArray(); + obj.DestAddr = destAddr; + } + + byte[] bytes = obj.ToBytes(); + Log.Info($"send {JsonConvert.SerializeObject(obj)}:{BitUtls.BytesToHexStr(bytes)} to {ChannelUtils.GetAttr(context.Channel, ChargerConst.ChargerSn)}"); + output.WriteBytes(bytes); } } \ No newline at end of file diff --git a/Service/Charger/Handler/AuthResHandler.cs b/Service/Charger/Handler/AuthResHandler.cs index b277079..ce21d50 100644 --- a/Service/Charger/Handler/AuthResHandler.cs +++ b/Service/Charger/Handler/AuthResHandler.cs @@ -3,10 +3,9 @@ using HybirdFrameworkCore.Autofac.Attribute; using log4net; using Service.Charger.Client; using Service.Charger.Common; -using Service.Charger.Handler; using Service.Charger.Msg.Charger.Resp; -namespace HybirdFrameworkServices.Charger.Handler +namespace Service.Charger.Handler { /// /// 接收到鉴权帧 @@ -26,7 +25,6 @@ namespace HybirdFrameworkServices.Charger.Handler { if (ClientMgr.TryGetClient(ctx.Channel, out string sn, out var client)) { - Log.Info($"receive {msg} from {sn}"); if (msg.ConnSeq == client.AuthTimes) { if (msg.AuthResult == 0) diff --git a/Service/Charger/Msg/APCI.cs b/Service/Charger/Msg/APCI.cs index 9d02e84..56c9505 100644 --- a/Service/Charger/Msg/APCI.cs +++ b/Service/Charger/Msg/APCI.cs @@ -18,7 +18,7 @@ public abstract class APCI : IToBytes /// /// 目标地址 /// - public byte[] DestAddr { get; set; } + public byte[]? DestAddr { get; set; } /// /// 源地址 @@ -33,7 +33,10 @@ public abstract class APCI : IToBytes list.AddRange(ChargerConst.StartChar); list.AddRange(BitConverter.GetBytes(bodyBytes.Length + 12)); list.AddRange(BitConverter.GetBytes(CtlArea)); - list.AddRange(DestAddr); + if (DestAddr != null) + { + list.AddRange(DestAddr); + } list.AddRange(BitConverter.GetBytes(SrcAddr)); list.AddRange(bodyBytes); diff --git a/Service/Charger/Msg/Host/Req/RemoteStartCharging.cs b/Service/Charger/Msg/Host/Req/RemoteStartCharging.cs index e6c2a86..6d92313 100644 --- a/Service/Charger/Msg/Host/Req/RemoteStartCharging.cs +++ b/Service/Charger/Msg/Host/Req/RemoteStartCharging.cs @@ -5,7 +5,7 @@ namespace Service.Charger.Msg.Host.Req /// /// 3.3.5 监控平台远程启动充电 /// - public class RemoteStartCharging + public class RemoteStartCharging: ASDU { public RemoteStartCharging(byte socLimit, byte changePowerCmdType, float changePower, string chargeOrderNo) diff --git a/Service/Charger/Msg/Host/Req/RemoteStopCharging.cs b/Service/Charger/Msg/Host/Req/RemoteStopCharging.cs index 2882321..5300102 100644 --- a/Service/Charger/Msg/Host/Req/RemoteStopCharging.cs +++ b/Service/Charger/Msg/Host/Req/RemoteStopCharging.cs @@ -5,7 +5,7 @@ namespace Service.Charger.Msg.Host.Req /// /// 3.3.7 监控平台远程停止充电 /// - public class RemoteStopCharging + public class RemoteStopCharging: ASDU { /// ///停止原因 0 正常停机 1 服务器发现桩异常,强制停机 diff --git a/Service/Service.csproj b/Service/Service.csproj index 2a621c7..ce4df4b 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -6,6 +6,10 @@ enable + + bin\Debug\Service.xml + + diff --git a/WebStarter/Controllers/Test/WeatherForecastController.cs b/WebStarter/Controllers/Test/WeatherForecastController.cs index bd80138..8400c0f 100644 --- a/WebStarter/Controllers/Test/WeatherForecastController.cs +++ b/WebStarter/Controllers/Test/WeatherForecastController.cs @@ -1,4 +1,8 @@ +using System.Text; +using Autofac; +using HybirdFrameworkCore.Autofac; using Microsoft.AspNetCore.Mvc; +using Service.Charger.Client; using Service.System; namespace WebStarter.Controllers.Test; @@ -25,13 +29,19 @@ public class WeatherForecastController : ControllerBase [HttpGet(Name = "GetWeatherForecast")] public IEnumerable Get() { - var sysUsers = _sysUserServices.Query(); _logger.LogInformation("this is a hello world"); + + + ChargerClient client = AppInfo.Container.Resolve(); + client.InitBootstrap("127.0.0.1", 9998); + client.BaseConnect(); + client.SessionAttr("1", "3"); + client.Channel.WriteAndFlushAsync(Encoding.ASCII.GetBytes("ddddddddddd")); + _logger.LogInformation("this is two hello world"); return Enumerable.Range(1, 5).Select(index => new WeatherForecast { Date = DateTime.Now.AddDays(index), - TemperatureC = sysUsers.Count, Summary = Summaries[Random.Shared.Next(Summaries.Length)] }) .ToArray(); diff --git a/WebStarter/WebStarter.csproj b/WebStarter/WebStarter.csproj index 80beba0..00e10cf 100644 --- a/WebStarter/WebStarter.csproj +++ b/WebStarter/WebStarter.csproj @@ -7,6 +7,10 @@ True + + bin\Debug\WebStarter.xml + + diff --git a/WinFormStarter/Form2.Designer.cs b/WinFormStarter/Form2.Designer.cs index a7dba3b..d5a6326 100644 --- a/WinFormStarter/Form2.Designer.cs +++ b/WinFormStarter/Form2.Designer.cs @@ -31,11 +31,435 @@ partial class Form2 /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form2"; + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.grpData = new System.Windows.Forms.GroupBox(); + this.rTxtData = new System.Windows.Forms.RichTextBox(); + this.grpMsg = new System.Windows.Forms.GroupBox(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.rTxtSend = new System.Windows.Forms.RichTextBox(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.rTxtReceive = new System.Windows.Forms.RichTextBox(); + this.grpCmd = new System.Windows.Forms.GroupBox(); + this.btnReadBatteryInfo = new System.Windows.Forms.Button(); + this.btnChangeInOrOut = new System.Windows.Forms.Button(); + this.btnSetPrice = new System.Windows.Forms.Button(); + this.btnSendOutEnableCharge = new System.Windows.Forms.Button(); + this.btnOfflineStopCharge = new System.Windows.Forms.Button(); + this.btnSetChargeRate = new System.Windows.Forms.Button(); + this.btnChangePower = new System.Windows.Forms.Button(); + this.btnSendAuxiliaryPower = new System.Windows.Forms.Button(); + this.btnStopCharge = new System.Windows.Forms.Button(); + this.btnStartCharge = new System.Windows.Forms.Button(); + this.btnSendBinStatus = new System.Windows.Forms.Button(); + this.btnAuth = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.lblConnStatus = new System.Windows.Forms.Label(); + this.btnConn = new System.Windows.Forms.Button(); + this.txtDestAddr = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtPort = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtIp = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.grpData.SuspendLayout(); + this.grpMsg.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.groupBox7.SuspendLayout(); + this.grpCmd.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.grpData); + this.groupBox1.Controls.Add(this.grpMsg); + this.groupBox1.Controls.Add(this.grpCmd); + this.groupBox1.Controls.Add(this.groupBox2); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(1118, 1150); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "充电机测试程序"; + // + // grpData + // + this.grpData.Controls.Add(this.rTxtData); + this.grpData.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpData.Location = new System.Drawing.Point(3, 718); + this.grpData.Name = "grpData"; + this.grpData.Size = new System.Drawing.Size(1112, 429); + this.grpData.TabIndex = 3; + this.grpData.TabStop = false; + this.grpData.Text = "数据展示"; + // + // rTxtData + // + this.rTxtData.Dock = System.Windows.Forms.DockStyle.Fill; + this.rTxtData.Location = new System.Drawing.Point(3, 19); + this.rTxtData.Name = "rTxtData"; + this.rTxtData.Size = new System.Drawing.Size(1106, 407); + this.rTxtData.TabIndex = 0; + this.rTxtData.Text = ""; + // + // grpMsg + // + this.grpMsg.Controls.Add(this.splitContainer1); + this.grpMsg.Dock = System.Windows.Forms.DockStyle.Top; + this.grpMsg.Location = new System.Drawing.Point(3, 326); + this.grpMsg.Name = "grpMsg"; + this.grpMsg.Size = new System.Drawing.Size(1112, 392); + this.grpMsg.TabIndex = 2; + this.grpMsg.TabStop = false; + this.grpMsg.Text = "报文展示"; + // + // splitContainer1 + // + this.splitContainer1.Cursor = System.Windows.Forms.Cursors.VSplit; + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(3, 19); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.groupBox6); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.groupBox7); + this.splitContainer1.Size = new System.Drawing.Size(1106, 370); + this.splitContainer1.SplitterDistance = 563; + this.splitContainer1.TabIndex = 0; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.rTxtSend); + this.groupBox6.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox6.Location = new System.Drawing.Point(0, 0); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(563, 370); + this.groupBox6.TabIndex = 0; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "发送报文"; + // + // rTxtSend + // + this.rTxtSend.Dock = System.Windows.Forms.DockStyle.Fill; + this.rTxtSend.Location = new System.Drawing.Point(3, 19); + this.rTxtSend.Name = "rTxtSend"; + this.rTxtSend.Size = new System.Drawing.Size(557, 348); + this.rTxtSend.TabIndex = 1; + this.rTxtSend.Text = ""; + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.rTxtReceive); + this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox7.Location = new System.Drawing.Point(0, 0); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(539, 370); + this.groupBox7.TabIndex = 0; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "接收报文"; + // + // rTxtReceive + // + this.rTxtReceive.Dock = System.Windows.Forms.DockStyle.Fill; + this.rTxtReceive.Location = new System.Drawing.Point(3, 19); + this.rTxtReceive.Name = "rTxtReceive"; + this.rTxtReceive.Size = new System.Drawing.Size(533, 348); + this.rTxtReceive.TabIndex = 0; + this.rTxtReceive.Text = ""; + // + // grpCmd + // + this.grpCmd.Controls.Add(this.btnReadBatteryInfo); + this.grpCmd.Controls.Add(this.btnChangeInOrOut); + this.grpCmd.Controls.Add(this.btnSetPrice); + this.grpCmd.Controls.Add(this.btnSendOutEnableCharge); + this.grpCmd.Controls.Add(this.btnOfflineStopCharge); + this.grpCmd.Controls.Add(this.btnSetChargeRate); + this.grpCmd.Controls.Add(this.btnChangePower); + this.grpCmd.Controls.Add(this.btnSendAuxiliaryPower); + this.grpCmd.Controls.Add(this.btnStopCharge); + this.grpCmd.Controls.Add(this.btnStartCharge); + this.grpCmd.Controls.Add(this.btnSendBinStatus); + this.grpCmd.Controls.Add(this.btnAuth); + this.grpCmd.Dock = System.Windows.Forms.DockStyle.Top; + this.grpCmd.Location = new System.Drawing.Point(3, 115); + this.grpCmd.Name = "grpCmd"; + this.grpCmd.Size = new System.Drawing.Size(1112, 211); + this.grpCmd.TabIndex = 1; + this.grpCmd.TabStop = false; + this.grpCmd.Text = "操作指令"; + // + // btnReadBatteryInfo + // + this.btnReadBatteryInfo.Location = new System.Drawing.Point(379, 153); + this.btnReadBatteryInfo.Name = "btnReadBatteryInfo"; + this.btnReadBatteryInfo.Size = new System.Drawing.Size(130, 23); + this.btnReadBatteryInfo.TabIndex = 18; + this.btnReadBatteryInfo.Text = "读取电池信息"; + this.btnReadBatteryInfo.UseVisualStyleBackColor = true; + this.btnReadBatteryInfo.Click += new System.EventHandler(this.btnReadBatteryInfo_Click); + // + // btnChangeInOrOut + // + this.btnChangeInOrOut.Location = new System.Drawing.Point(218, 153); + this.btnChangeInOrOut.Name = "btnChangeInOrOut"; + this.btnChangeInOrOut.Size = new System.Drawing.Size(130, 23); + this.btnChangeInOrOut.TabIndex = 17; + this.btnChangeInOrOut.Text = "切换站内外充电"; + this.btnChangeInOrOut.UseVisualStyleBackColor = true; + this.btnChangeInOrOut.Click += new System.EventHandler(this.btnChangeInOrOut_Click); + // + // btnSetPrice + // + this.btnSetPrice.Location = new System.Drawing.Point(63, 153); + this.btnSetPrice.Name = "btnSetPrice"; + this.btnSetPrice.Size = new System.Drawing.Size(130, 23); + this.btnSetPrice.TabIndex = 16; + this.btnSetPrice.Text = "设置尖峰平谷"; + this.btnSetPrice.UseVisualStyleBackColor = true; + this.btnSetPrice.Click += new System.EventHandler(this.btnSetPrice_Click); + // + // btnSendOutEnableCharge + // + this.btnSendOutEnableCharge.Location = new System.Drawing.Point(526, 99); + this.btnSendOutEnableCharge.Name = "btnSendOutEnableCharge"; + this.btnSendOutEnableCharge.Size = new System.Drawing.Size(165, 23); + this.btnSendOutEnableCharge.TabIndex = 15; + this.btnSendOutEnableCharge.Text = "下发站外允许充电SOC"; + this.btnSendOutEnableCharge.UseVisualStyleBackColor = true; + this.btnSendOutEnableCharge.Click += new System.EventHandler(this.btnSendOutEnableCharge_Click); + // + // btnOfflineStopCharge + // + this.btnOfflineStopCharge.Location = new System.Drawing.Point(379, 99); + this.btnOfflineStopCharge.Name = "btnOfflineStopCharge"; + this.btnOfflineStopCharge.Size = new System.Drawing.Size(130, 23); + this.btnOfflineStopCharge.TabIndex = 14; + this.btnOfflineStopCharge.Text = "掉线停止充电"; + this.btnOfflineStopCharge.UseVisualStyleBackColor = true; + this.btnOfflineStopCharge.Click += new System.EventHandler(this.btnOfflineStopCharge_Click); + // + // btnSetChargeRate + // + this.btnSetChargeRate.Location = new System.Drawing.Point(218, 99); + this.btnSetChargeRate.Name = "btnSetChargeRate"; + this.btnSetChargeRate.Size = new System.Drawing.Size(130, 23); + this.btnSetChargeRate.TabIndex = 13; + this.btnSetChargeRate.Text = "充电速率设置"; + this.btnSetChargeRate.UseVisualStyleBackColor = true; + this.btnSetChargeRate.Click += new System.EventHandler(this.btnSetChargeRate_Click); + // + // btnChangePower + // + this.btnChangePower.Location = new System.Drawing.Point(63, 99); + this.btnChangePower.Name = "btnChangePower"; + this.btnChangePower.Size = new System.Drawing.Size(130, 23); + this.btnChangePower.TabIndex = 12; + this.btnChangePower.Text = "功率调节"; + this.btnChangePower.UseVisualStyleBackColor = true; + this.btnChangePower.Click += new System.EventHandler(this.btnChangePower_Click); + // + // btnSendAuxiliaryPower + // + this.btnSendAuxiliaryPower.Location = new System.Drawing.Point(316, 43); + this.btnSendAuxiliaryPower.Name = "btnSendAuxiliaryPower"; + this.btnSendAuxiliaryPower.Size = new System.Drawing.Size(130, 23); + this.btnSendAuxiliaryPower.TabIndex = 11; + this.btnSendAuxiliaryPower.Text = "下发辅助源控制"; + this.btnSendAuxiliaryPower.UseVisualStyleBackColor = true; + this.btnSendAuxiliaryPower.Click += new System.EventHandler(this.btnSendAuxiliaryPower_Click); + // + // btnStopCharge + // + this.btnStopCharge.Location = new System.Drawing.Point(633, 43); + this.btnStopCharge.Name = "btnStopCharge"; + this.btnStopCharge.Size = new System.Drawing.Size(130, 23); + this.btnStopCharge.TabIndex = 10; + this.btnStopCharge.Text = "停止充电"; + this.btnStopCharge.UseVisualStyleBackColor = true; + this.btnStopCharge.Click += new System.EventHandler(this.btnStopCharge_Click); + // + // btnStartCharge + // + this.btnStartCharge.Location = new System.Drawing.Point(479, 43); + this.btnStartCharge.Name = "btnStartCharge"; + this.btnStartCharge.Size = new System.Drawing.Size(130, 23); + this.btnStartCharge.TabIndex = 9; + this.btnStartCharge.Text = "开始充电"; + this.btnStartCharge.UseVisualStyleBackColor = true; + this.btnStartCharge.Click += new System.EventHandler(this.btnStartCharge_Click); + // + // btnSendBinStatus + // + this.btnSendBinStatus.Location = new System.Drawing.Point(159, 43); + this.btnSendBinStatus.Name = "btnSendBinStatus"; + this.btnSendBinStatus.Size = new System.Drawing.Size(130, 23); + this.btnSendBinStatus.TabIndex = 8; + this.btnSendBinStatus.Text = "下发电池仓状态"; + this.btnSendBinStatus.UseVisualStyleBackColor = true; + this.btnSendBinStatus.Click += new System.EventHandler(this.btnSendBinStatus_Click); + // + // btnAuth + // + this.btnAuth.Location = new System.Drawing.Point(63, 43); + this.btnAuth.Name = "btnAuth"; + this.btnAuth.Size = new System.Drawing.Size(75, 23); + this.btnAuth.TabIndex = 7; + this.btnAuth.Text = "鉴权"; + this.btnAuth.UseVisualStyleBackColor = true; + this.btnAuth.Click += new System.EventHandler(this.btnAuth_Click); + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.lblConnStatus); + this.groupBox2.Controls.Add(this.btnConn); + this.groupBox2.Controls.Add(this.txtDestAddr); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.txtPort); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.txtIp); + this.groupBox2.Controls.Add(this.label1); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top; + this.groupBox2.Location = new System.Drawing.Point(3, 19); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(1112, 96); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "充电机连接"; + // + // lblConnStatus + // + this.lblConnStatus.AutoSize = true; + this.lblConnStatus.Location = new System.Drawing.Point(1018, 32); + this.lblConnStatus.Name = "lblConnStatus"; + this.lblConnStatus.Size = new System.Drawing.Size(46, 15); + this.lblConnStatus.TabIndex = 7; + this.lblConnStatus.Text = "未连接"; + // + // btnConn + // + this.btnConn.Location = new System.Drawing.Point(908, 28); + this.btnConn.Name = "btnConn"; + this.btnConn.Size = new System.Drawing.Size(75, 23); + this.btnConn.TabIndex = 6; + this.btnConn.Text = "连接"; + this.btnConn.UseVisualStyleBackColor = true; + this.btnConn.Click += new System.EventHandler(this.btnConn_Click); + // + // txtDestAddr + // + this.txtDestAddr.Location = new System.Drawing.Point(657, 29); + this.txtDestAddr.Name = "txtDestAddr"; + this.txtDestAddr.Size = new System.Drawing.Size(202, 23); + this.txtDestAddr.TabIndex = 5; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(592, 32); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(59, 15); + this.label3.TabIndex = 4; + this.label3.Text = "DestAddr:"; + // + // txtPort + // + this.txtPort.Location = new System.Drawing.Point(354, 29); + this.txtPort.Name = "txtPort"; + this.txtPort.Size = new System.Drawing.Size(202, 23); + this.txtPort.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(300, 32); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(48, 15); + this.label2.TabIndex = 2; + this.label2.Text = "PORT:"; + // + // txtIp + // + this.txtIp.Location = new System.Drawing.Point(63, 29); + this.txtIp.Name = "txtIp"; + this.txtIp.Size = new System.Drawing.Size(202, 23); + this.txtIp.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(27, 32); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 15); + this.label1.TabIndex = 0; + this.label1.Text = "IP:"; + // + // Form2 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1118, 1150); + this.Controls.Add(this.groupBox1); + this.Name = "Form2"; + this.Text = "Form2"; + this.groupBox1.ResumeLayout(false); + this.grpData.ResumeLayout(false); + this.grpMsg.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.groupBox6.ResumeLayout(false); + this.groupBox7.ResumeLayout(false); + this.grpCmd.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + } #endregion + + private GroupBox groupBox1; + private GroupBox grpCmd; + private Button btnChangeInOrOut; + private Button btnSetPrice; + private Button btnSendOutEnableCharge; + private Button btnOfflineStopCharge; + private Button btnSetChargeRate; + private Button btnChangePower; + private Button btnSendAuxiliaryPower; + private Button btnStopCharge; + private Button btnStartCharge; + private Button btnSendBinStatus; + private Button btnAuth; + private GroupBox groupBox2; + private Label lblConnStatus; + private Button btnConn; + private TextBox txtDestAddr; + private Label label3; + private TextBox txtPort; + private Label label2; + private TextBox txtIp; + private Label label1; + private Button btnReadBatteryInfo; + private GroupBox grpMsg; + private SplitContainer splitContainer1; + private GroupBox groupBox6; + private GroupBox groupBox7; + private RichTextBox rTxtReceive; + private RichTextBox rTxtSend; + private GroupBox grpData; + private RichTextBox rTxtData; } \ No newline at end of file diff --git a/WinFormStarter/Form2.cs b/WinFormStarter/Form2.cs index ef85d94..05b6929 100644 --- a/WinFormStarter/Form2.cs +++ b/WinFormStarter/Form2.cs @@ -1,9 +1,215 @@ -namespace WinFormStarter; +using Autofac; +using DotNetty.Handlers.Logging; +using HybirdFrameworkCore.Autofac; +using Service.Charger.Client; + +namespace WinFormStarter; public partial class Form2 : Form { + private ChargerClient? _chargerClient; + public Form2() { InitializeComponent(); + Init(); + } + + private void Init() + { + this.txtIp.Text = @"127.0.0.1"; + this.txtPort.Text = @"9998"; + this.txtDestAddr.Text = @"03,01,01,02"; + + this.grpCmd.Enabled = false; + this.grpData.Enabled = false; + + this.rTxtSend.Enabled = false; + this.rTxtReceive.Enabled = false; + } + + #region ui invoke + + private void EnableUi(Control control, bool enabled) + { + if (control.InvokeRequired) + { + void Enable() + { + control.Enabled = enabled; + } + + control.Invoke((MethodInvoker)Enable); + } + else + { + control.Enabled = enabled; + } + } + + private void AppendText(RichTextBox rtxt, string t) + { + if (rtxt.InvokeRequired) + { + void Mi() + { + rtxt.AppendText(t); + } + + rtxt.Invoke((MethodInvoker)Mi); + } + else + { + rtxt.AppendText(t); + } + } + + private void SetText(TextBox textBox, string t) + { + if (textBox.InvokeRequired) + { + void Mi() + { + textBox.Text = t; + } + + textBox.Invoke((MethodInvoker)Mi); + } + else + { + textBox.Text = t; + } + } + + private void SetText(Button button, string t) + { + if (button.InvokeRequired) + { + void Mi() + { + button.Text = t; + } + + button.Invoke((MethodInvoker)Mi); + } + else + { + button.Text = t; + } + } + + private void SetText(Label label, string t) + { + if (label.InvokeRequired) + { + void Mi() + { + label.Text = t; + } + + label.Invoke((MethodInvoker)Mi); + } + else + { + label.Text = t; + } + } + + #endregion + + private void btnChangeInOrOut_Click(object sender, EventArgs e) + { + } + + private void btnConn_Click(object sender, EventArgs e) + { + string ip = txtIp.Text; + var port = int.Parse(txtPort.Text); + string destAddr = txtDestAddr.Text; + + + Task.Run(() => + { + if (_chargerClient is not { Connected: true }) + { + _chargerClient = AppInfo.Container.Resolve(); + _chargerClient.AutoReconnect = false; + _chargerClient.LogLevel = LogLevel.TRACE; + _chargerClient.InitBootstrap(ip, port); + _chargerClient.BaseConnect(); + if (_chargerClient.Connected) + { + _chargerClient.SessionAttr("1", destAddr); + SetText(lblConnStatus, @"连接成功"); + SetText(btnConn, @"断开连接"); + EnableUi(this.grpCmd, true); + EnableUi(this.grpData, true); + EnableUi(this.rTxtSend, true); + EnableUi(this.rTxtReceive, true); + ClientMgr.AddBySn("1", _chargerClient); + } + } + else + { + _chargerClient.Close(); + _chargerClient = null; + SetText(lblConnStatus, @"未连接"); + SetText(btnConn, @"连接"); + EnableUi(this.grpCmd, false); + EnableUi(this.grpData, false); + EnableUi(this.rTxtSend, false); + EnableUi(this.rTxtReceive, false); + } + }); + } + + private void btnAuth_Click(object sender, EventArgs e) + { + _chargerClient?.SendAuth(); + AppendText(this.rTxtSend, _chargerClient.CurrentCmd); + } + + private void btnSendBinStatus_Click(object sender, EventArgs e) + { + } + + private void btnSendAuxiliaryPower_Click(object sender, EventArgs e) + { + } + + private void btnStartCharge_Click(object sender, EventArgs e) + { + } + + private void btnStopCharge_Click(object sender, EventArgs e) + { + } + + private void btnChangePower_Click(object sender, EventArgs e) + { + } + + private void btnSetChargeRate_Click(object sender, EventArgs e) + { + } + + private void btnOfflineStopCharge_Click(object sender, EventArgs e) + { + } + + private void btnSendOutEnableCharge_Click(object sender, EventArgs e) + { + } + + private void btnSetPrice_Click(object sender, EventArgs e) + { + } + + private void button1_Click(object sender, EventArgs e) + { + } + + private void btnReadBatteryInfo_Click(object sender, EventArgs e) + { } } \ No newline at end of file diff --git a/WinFormStarter/WinFormStarter.csproj b/WinFormStarter/WinFormStarter.csproj index 9d65814..0bfa329 100644 --- a/WinFormStarter/WinFormStarter.csproj +++ b/WinFormStarter/WinFormStarter.csproj @@ -12,6 +12,7 @@ + @@ -40,6 +41,9 @@ Always + + Always + diff --git a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.DependencyInjection.dll b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.DependencyInjection.dll index 1034ee6..97525f7 100644 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.DependencyInjection.dll and b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.DependencyInjection.dll differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Logging.dll b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Logging.dll index 6df35e1..9e2d7f9 100644 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Logging.dll and b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Logging.dll differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Options.dll b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Options.dll index 8a2a8c8..604b602 100644 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Options.dll and b/WinFormStarter/bin/Debug/net6.0-windows/Microsoft.Extensions.Options.dll differ diff --git a/WinFormStarter/log4net.config b/WinFormStarter/log4net.config new file mode 100644 index 0000000..b022a3d --- /dev/null +++ b/WinFormStarter/log4net.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.deps.json b/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.deps.json index 44914b5..9113efb 100644 --- a/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.deps.json +++ b/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.deps.json @@ -8,7 +8,7 @@ ".NETCoreApp,Version=v6.0": { "Autofac/7.1.0": { "dependencies": { - "System.Diagnostics.DiagnosticSource": "4.7.1" + "System.Diagnostics.DiagnosticSource": "6.0.0" }, "runtime": { "lib/net6.0/Autofac.dll": { @@ -29,6 +29,17 @@ } } }, + "AutoMapper/12.0.1": { + "dependencies": { + "Microsoft.CSharp": "4.7.0" + }, + "runtime": { + "lib/netstandard2.1/AutoMapper.dll": { + "assemblyVersion": "12.0.0.0", + "fileVersion": "12.0.1.0" + } + } + }, "DotNetty.Buffers/0.7.5": { "dependencies": { "DotNetty.Common": "0.7.5", @@ -71,7 +82,7 @@ }, "DotNetty.Common/0.7.5": { "dependencies": { - "Microsoft.Extensions.Logging": "5.0.0", + "Microsoft.Extensions.Logging": "6.0.0", "System.Runtime.CompilerServices.Unsafe": "6.0.0" }, "runtime": { @@ -107,6 +118,18 @@ } } }, + "HslCommunication/11.1.1": { + "dependencies": { + "Newtonsoft.Json": "13.0.3", + "System.IO.Ports": "4.7.0" + }, + "runtime": { + "lib/netstandard2.1/HslCommunication.dll": { + "assemblyVersion": "11.1.1.0", + "fileVersion": "11.1.1.0" + } + } + }, "log4net/2.0.15": { "dependencies": { "System.Configuration.ConfigurationManager": "6.0.0" @@ -118,7 +141,7 @@ } } }, - "Microsoft.CSharp/4.5.0": {}, + "Microsoft.CSharp/4.7.0": {}, "Microsoft.Data.SqlClient/2.1.4": { "dependencies": { "Microsoft.Data.SqlClient.SNI.runtime": "2.1.1", @@ -127,7 +150,7 @@ "Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.8.0", "Microsoft.Win32.Registry": "4.7.0", "System.Configuration.ConfigurationManager": "6.0.0", - "System.Diagnostics.DiagnosticSource": "4.7.1", + "System.Diagnostics.DiagnosticSource": "6.0.0", "System.Runtime.Caching": "4.7.0", "System.Security.Principal.Windows": "4.7.0", "System.Text.Encoding.CodePages": "5.0.0" @@ -217,6 +240,17 @@ } } }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration.Abstractions": "7.0.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, "Microsoft.Extensions.Configuration.FileExtensions/7.0.0": { "dependencies": { "Microsoft.Extensions.Configuration": "7.0.0", @@ -247,14 +281,15 @@ } } }, - "Microsoft.Extensions.DependencyInjection/5.0.0": { + "Microsoft.Extensions.DependencyInjection/6.0.0": { "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0" + "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" }, "runtime": { - "lib/net5.0/Microsoft.Extensions.DependencyInjection.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" + "lib/net6.0/Microsoft.Extensions.DependencyInjection.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" } } }, @@ -298,37 +333,53 @@ } } }, - "Microsoft.Extensions.Logging/5.0.0": { + "Microsoft.Extensions.Logging/6.0.0": { "dependencies": { - "Microsoft.Extensions.DependencyInjection": "5.0.0", + "Microsoft.Extensions.DependencyInjection": "6.0.0", "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "5.0.0", - "Microsoft.Extensions.Options": "5.0.0" + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Microsoft.Extensions.Options": "6.0.0", + "System.Diagnostics.DiagnosticSource": "6.0.0" }, "runtime": { "lib/netstandard2.1/Microsoft.Extensions.Logging.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" } } }, - "Microsoft.Extensions.Logging.Abstractions/5.0.0": { + "Microsoft.Extensions.Logging.Abstractions/6.0.0": { "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" + "lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" + } + } + }, + "Microsoft.Extensions.Logging.Log4Net.AspNetCore/8.0.0": { + "dependencies": { + "Microsoft.Extensions.Configuration": "7.0.0", + "Microsoft.Extensions.Configuration.Abstractions": "7.0.0", + "Microsoft.Extensions.Configuration.Binder": "6.0.0", + "Microsoft.Extensions.Logging": "6.0.0", + "log4net": "2.0.15" + }, + "runtime": { + "lib/net6.0/Microsoft.Extensions.Logging.Log4Net.AspNetCore.dll": { + "assemblyVersion": "8.0.0.0", + "fileVersion": "8.0.0.0" } } }, - "Microsoft.Extensions.Options/5.0.0": { + "Microsoft.Extensions.Options/6.0.0": { "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", "Microsoft.Extensions.Primitives": "7.0.0" }, "runtime": { - "lib/net5.0/Microsoft.Extensions.Options.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" + "lib/netstandard2.1/Microsoft.Extensions.Options.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" } } }, @@ -396,7 +447,7 @@ }, "Microsoft.IdentityModel.Tokens/6.8.0": { "dependencies": { - "Microsoft.CSharp": "4.5.0", + "Microsoft.CSharp": "4.7.0", "Microsoft.IdentityModel.Logging": "6.8.0", "System.Security.Cryptography.Cng": "4.5.0" }, @@ -491,6 +542,61 @@ } } }, + "Pipelines.Sockets.Unofficial/2.2.8": { + "dependencies": { + "System.IO.Pipelines": "5.0.1" + }, + "runtime": { + "lib/net5.0/Pipelines.Sockets.Unofficial.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "2.2.8.1080" + } + } + }, + "runtime.linux-arm.runtime.native.System.IO.Ports/4.7.0": { + "runtimeTargets": { + "runtimes/linux-arm/native/System.IO.Ports.Native.so": { + "rid": "linux-arm", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "runtime.linux-arm64.runtime.native.System.IO.Ports/4.7.0": { + "runtimeTargets": { + "runtimes/linux-arm64/native/System.IO.Ports.Native.so": { + "rid": "linux-arm64", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "runtime.linux-x64.runtime.native.System.IO.Ports/4.7.0": { + "runtimeTargets": { + "runtimes/linux-x64/native/System.IO.Ports.Native.so": { + "rid": "linux-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, + "runtime.native.System.IO.Ports/4.7.0": { + "dependencies": { + "runtime.linux-arm.runtime.native.System.IO.Ports": "4.7.0", + "runtime.linux-arm64.runtime.native.System.IO.Ports": "4.7.0", + "runtime.linux-x64.runtime.native.System.IO.Ports": "4.7.0", + "runtime.osx-x64.runtime.native.System.IO.Ports": "4.7.0" + } + }, + "runtime.osx-x64.runtime.native.System.IO.Ports/4.7.0": { + "runtimeTargets": { + "runtimes/osx-x64/native/System.IO.Ports.Native.dylib": { + "rid": "osx-x64", + "assetType": "native", + "fileVersion": "0.0.0.0" + } + } + }, "SQLitePCLRaw.bundle_e_sqlite3/2.1.4": { "dependencies": { "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", @@ -656,7 +762,7 @@ } } }, - "SqlSugarCore/5.1.4.95": { + "SqlSugarCore/5.1.4.115": { "dependencies": { "Microsoft.Data.SqlClient": "2.1.4", "Microsoft.Data.Sqlite": "7.0.5", @@ -671,8 +777,8 @@ }, "runtime": { "lib/netstandard2.1/SqlSugar.dll": { - "assemblyVersion": "5.1.4.94", - "fileVersion": "5.1.4.94" + "assemblyVersion": "5.1.4.115", + "fileVersion": "5.1.4.115" } } }, @@ -695,6 +801,18 @@ } } }, + "StackExchange.Redis/2.7.33": { + "dependencies": { + "Microsoft.Extensions.Logging.Abstractions": "6.0.0", + "Pipelines.Sockets.Unofficial": "2.2.8" + }, + "runtime": { + "lib/net6.0/StackExchange.Redis.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.7.33.41805" + } + } + }, "System.Collections/4.3.0": { "dependencies": { "Microsoft.NETCore.Platforms": "5.0.0", @@ -740,11 +858,14 @@ } } }, - "System.Diagnostics.DiagnosticSource/4.7.1": { + "System.Diagnostics.DiagnosticSource/6.0.0": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, "runtime": { - "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { - "assemblyVersion": "4.0.5.0", - "fileVersion": "4.700.20.21406" + "lib/net6.0/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "6.0.0.0", + "fileVersion": "6.0.21.52210" } } }, @@ -868,6 +989,46 @@ "System.Threading.Tasks": "4.3.0" } }, + "System.IO.Pipelines/5.0.1": { + "runtime": { + "lib/netcoreapp3.0/System.IO.Pipelines.dll": { + "assemblyVersion": "5.0.0.1", + "fileVersion": "5.0.120.57516" + } + } + }, + "System.IO.Ports/4.7.0": { + "dependencies": { + "Microsoft.Win32.Registry": "4.7.0", + "runtime.native.System.IO.Ports": "4.7.0" + }, + "runtime": { + "lib/netstandard2.0/System.IO.Ports.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.700.19.56404" + } + }, + "runtimeTargets": { + "runtimes/linux/lib/netstandard2.0/System.IO.Ports.dll": { + "rid": "linux", + "assetType": "runtime", + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.700.19.56404" + }, + "runtimes/osx/lib/netstandard2.0/System.IO.Ports.dll": { + "rid": "osx", + "assetType": "runtime", + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.700.19.56404" + }, + "runtimes/win/lib/netstandard2.0/System.IO.Ports.dll": { + "rid": "win", + "assetType": "runtime", + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.700.19.56404" + } + } + }, "System.Memory/4.5.3": {}, "System.Reflection/4.3.0": { "dependencies": { @@ -1167,6 +1328,13 @@ "path": "autofac.extensions.dependencyinjection/8.0.0", "hashPath": "autofac.extensions.dependencyinjection.8.0.0.nupkg.sha512" }, + "AutoMapper/12.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hvV62vl6Hp/WfQ24yzo3Co9+OPl8wH8hApwVtgWpiAynVJkUcs7xvehnSftawL8Pe8FrPffBRM3hwzLQqWDNjA==", + "path": "automapper/12.0.1", + "hashPath": "automapper.12.0.1.nupkg.sha512" + }, "DotNetty.Buffers/0.7.5": { "type": "package", "serviceable": true, @@ -1209,6 +1377,13 @@ "path": "dotnetty.transport/0.7.5", "hashPath": "dotnetty.transport.0.7.5.nupkg.sha512" }, + "HslCommunication/11.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+HUfjin0STcIuiSsZ7ksohWBbeTFW7XbkDR+/jK19/ikmzCoRwwB8688dWc4szTruuF00URB998SU8snPxtIKQ==", + "path": "hslcommunication/11.1.1", + "hashPath": "hslcommunication.11.1.1.nupkg.sha512" + }, "log4net/2.0.15": { "type": "package", "serviceable": true, @@ -1216,12 +1391,12 @@ "path": "log4net/2.0.15", "hashPath": "log4net.2.0.15.nupkg.sha512" }, - "Microsoft.CSharp/4.5.0": { + "Microsoft.CSharp/4.7.0": { "type": "package", "serviceable": true, - "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", - "path": "microsoft.csharp/4.5.0", - "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + "sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==", + "path": "microsoft.csharp/4.7.0", + "hashPath": "microsoft.csharp.4.7.0.nupkg.sha512" }, "Microsoft.Data.SqlClient/2.1.4": { "type": "package", @@ -1265,6 +1440,13 @@ "path": "microsoft.extensions.configuration.abstractions/7.0.0", "hashPath": "microsoft.extensions.configuration.abstractions.7.0.0.nupkg.sha512" }, + "Microsoft.Extensions.Configuration.Binder/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3ErKzND8LIC7o08QAVlKfaEIYEvLJbtmVbFZVBRXeu9YkKfSSzLZfR1SUfQPBIy9mKLhEtJgGYImkcMNaKE0A==", + "path": "microsoft.extensions.configuration.binder/6.0.0", + "hashPath": "microsoft.extensions.configuration.binder.6.0.0.nupkg.sha512" + }, "Microsoft.Extensions.Configuration.FileExtensions/7.0.0": { "type": "package", "serviceable": true, @@ -1279,12 +1461,12 @@ "path": "microsoft.extensions.configuration.json/7.0.0", "hashPath": "microsoft.extensions.configuration.json.7.0.0.nupkg.sha512" }, - "Microsoft.Extensions.DependencyInjection/5.0.0": { + "Microsoft.Extensions.DependencyInjection/6.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-Rc2kb/p3Ze6cP6rhFC3PJRdWGbLvSHZc0ev7YlyeU6FmHciDMLrhoVoTUEzKPhN5ZjFgKF1Cf5fOz8mCMIkvpA==", - "path": "microsoft.extensions.dependencyinjection/5.0.0", - "hashPath": "microsoft.extensions.dependencyinjection.5.0.0.nupkg.sha512" + "sha512": "sha512-k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", + "path": "microsoft.extensions.dependencyinjection/6.0.0", + "hashPath": "microsoft.extensions.dependencyinjection.6.0.0.nupkg.sha512" }, "Microsoft.Extensions.DependencyInjection.Abstractions/6.0.0": { "type": "package", @@ -1314,26 +1496,33 @@ "path": "microsoft.extensions.filesystemglobbing/7.0.0", "hashPath": "microsoft.extensions.filesystemglobbing.7.0.0.nupkg.sha512" }, - "Microsoft.Extensions.Logging/5.0.0": { + "Microsoft.Extensions.Logging/6.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-MgOwK6tPzB6YNH21wssJcw/2MKwee8b2gI7SllYfn6rvTpIrVvVS5HAjSU2vqSku1fwqRvWP0MdIi14qjd93Aw==", - "path": "microsoft.extensions.logging/5.0.0", - "hashPath": "microsoft.extensions.logging.5.0.0.nupkg.sha512" + "sha512": "sha512-eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", + "path": "microsoft.extensions.logging/6.0.0", + "hashPath": "microsoft.extensions.logging.6.0.0.nupkg.sha512" }, - "Microsoft.Extensions.Logging.Abstractions/5.0.0": { + "Microsoft.Extensions.Logging.Abstractions/6.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-NxP6ahFcBnnSfwNBi2KH2Oz8Xl5Sm2krjId/jRR3I7teFphwiUoUeZPwTNA21EX+5PtjqmyAvKaOeBXcJjcH/w==", - "path": "microsoft.extensions.logging.abstractions/5.0.0", - "hashPath": "microsoft.extensions.logging.abstractions.5.0.0.nupkg.sha512" + "sha512": "sha512-/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==", + "path": "microsoft.extensions.logging.abstractions/6.0.0", + "hashPath": "microsoft.extensions.logging.abstractions.6.0.0.nupkg.sha512" }, - "Microsoft.Extensions.Options/5.0.0": { + "Microsoft.Extensions.Logging.Log4Net.AspNetCore/8.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-CBvR92TCJ5uBIdd9/HzDSrxYak+0W/3+yxrNg8Qm6Bmrkh5L+nu6m3WeazQehcZ5q1/6dDA7J5YdQjim0165zg==", - "path": "microsoft.extensions.options/5.0.0", - "hashPath": "microsoft.extensions.options.5.0.0.nupkg.sha512" + "sha512": "sha512-NShPLGSM/PBGJIOK/cmlh3a+QlrtCLcSpb+vfqwxRmZK38Cy4prsOjuODpAIvqWL93zt9PZOTcHOVqyaQRNuEg==", + "path": "microsoft.extensions.logging.log4net.aspnetcore/8.0.0", + "hashPath": "microsoft.extensions.logging.log4net.aspnetcore.8.0.0.nupkg.sha512" + }, + "Microsoft.Extensions.Options/6.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", + "path": "microsoft.extensions.options/6.0.0", + "hashPath": "microsoft.extensions.options.6.0.0.nupkg.sha512" }, "Microsoft.Extensions.Primitives/7.0.0": { "type": "package", @@ -1440,6 +1629,48 @@ "path": "oracle.manageddataaccess.core/3.21.100", "hashPath": "oracle.manageddataaccess.core.3.21.100.nupkg.sha512" }, + "Pipelines.Sockets.Unofficial/2.2.8": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zG2FApP5zxSx6OcdJQLbZDk2AVlN2BNQD6MorwIfV6gVj0RRxWPEp2LXAxqDGZqeNV1Zp0BNPcNaey/GXmTdvQ==", + "path": "pipelines.sockets.unofficial/2.2.8", + "hashPath": "pipelines.sockets.unofficial.2.2.8.nupkg.sha512" + }, + "runtime.linux-arm.runtime.native.System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-pCaX07mRrO11GfUb+whjn2AJgCofx26slw0sI3XC9v0pEZO8101iK6q4ymZOiI2M4a9sQxLr2LawAEDvF4RNXg==", + "path": "runtime.linux-arm.runtime.native.system.io.ports/4.7.0", + "hashPath": "runtime.linux-arm.runtime.native.system.io.ports.4.7.0.nupkg.sha512" + }, + "runtime.linux-arm64.runtime.native.System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/J6A4bexUUJciGUwrhtzrFW4tIHqoJYlCsz5RudRmqUaqvuG2tjrbn6bEopOFs7CU4gZqAKWcU9pkp180c3DkQ==", + "path": "runtime.linux-arm64.runtime.native.system.io.ports/4.7.0", + "hashPath": "runtime.linux-arm64.runtime.native.system.io.ports.4.7.0.nupkg.sha512" + }, + "runtime.linux-x64.runtime.native.System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-aaaiH4ttfkLizo0OKf++5kPN0yxKbgzcyAD3w52Y3YP96aB/M79fm0r06SedXJGv86Iou6ipj3wUQBMFaL8LnQ==", + "path": "runtime.linux-x64.runtime.native.system.io.ports/4.7.0", + "hashPath": "runtime.linux-x64.runtime.native.system.io.ports.4.7.0.nupkg.sha512" + }, + "runtime.native.System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yidiZEGEIOyGnRkZvoV6XbeqzEBg9L47PyZNBymLIsu9HHseF98wiOxR6RnHmMqQMTBlc/EONfw4NT3pw0S6YQ==", + "path": "runtime.native.system.io.ports/4.7.0", + "hashPath": "runtime.native.system.io.ports.4.7.0.nupkg.sha512" + }, + "runtime.osx-x64.runtime.native.System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c1h87v6gopjfeAu3WhVGguUhzCdpZFqX8oXrevO1ciuH4g/mFrxnzlo5POlp+TtZdQ1i8yu0ZzBMKbmX2bJJ0g==", + "path": "runtime.osx-x64.runtime.native.system.io.ports/4.7.0", + "hashPath": "runtime.osx-x64.runtime.native.system.io.ports.4.7.0.nupkg.sha512" + }, "SQLitePCLRaw.bundle_e_sqlite3/2.1.4": { "type": "package", "serviceable": true, @@ -1475,12 +1706,12 @@ "path": "sqlsugar.ioc/2.0.0", "hashPath": "sqlsugar.ioc.2.0.0.nupkg.sha512" }, - "SqlSugarCore/5.1.4.95": { + "SqlSugarCore/5.1.4.115": { "type": "package", "serviceable": true, - "sha512": "sha512-7+xQXOZhe0dHplO6AJC3V9VAcO7XPhprrgpjMsrj+LUUJ/k1yVrbag8vHVFZyPyC3PfvHTcpJsepuTJMruUPEw==", - "path": "sqlsugarcore/5.1.4.95", - "hashPath": "sqlsugarcore.5.1.4.95.nupkg.sha512" + "sha512": "sha512-D/1b4vxR0rECaRsIDqk3tkkAwf7wEEkO1+VAAnHLECu5mbPESS6T5o+l/DCDvdWDgD0koCHgKhlU1c/SYR9Sig==", + "path": "sqlsugarcore/5.1.4.115", + "hashPath": "sqlsugarcore.5.1.4.115.nupkg.sha512" }, "SqlSugarCore.Dm/1.2.0": { "type": "package", @@ -1496,6 +1727,13 @@ "path": "sqlsugarcore.kdbndp/7.4.0", "hashPath": "sqlsugarcore.kdbndp.7.4.0.nupkg.sha512" }, + "StackExchange.Redis/2.7.33": { + "type": "package", + "serviceable": true, + "sha512": "sha512-2kCX5fvhEE824a4Ab5Imyi8DRuGuTxyklXV01kegkRpsWJcPmO6+GAQ+HegKxvXAxlXZ8yaRspvWJ8t3mMClfQ==", + "path": "stackexchange.redis/2.7.33", + "hashPath": "stackexchange.redis.2.7.33.nupkg.sha512" + }, "System.Collections/4.3.0": { "type": "package", "serviceable": true, @@ -1524,12 +1762,12 @@ "path": "system.data.common/4.3.0", "hashPath": "system.data.common.4.3.0.nupkg.sha512" }, - "System.Diagnostics.DiagnosticSource/4.7.1": { + "System.Diagnostics.DiagnosticSource/6.0.0": { "type": "package", "serviceable": true, - "sha512": "sha512-j81Lovt90PDAq8kLpaJfJKV/rWdWuEk6jfV+MBkee33vzYLEUsy4gXK8laa9V2nZlLM9VM9yA/OOQxxPEJKAMw==", - "path": "system.diagnostics.diagnosticsource/4.7.1", - "hashPath": "system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512" + "sha512": "sha512-frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", + "path": "system.diagnostics.diagnosticsource/6.0.0", + "hashPath": "system.diagnostics.diagnosticsource.6.0.0.nupkg.sha512" }, "System.Diagnostics.PerformanceCounter/6.0.1": { "type": "package", @@ -1580,6 +1818,20 @@ "path": "system.io/4.3.0", "hashPath": "system.io.4.3.0.nupkg.sha512" }, + "System.IO.Pipelines/5.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-qEePWsaq9LoEEIqhbGe6D5J8c9IqQOUuTzzV6wn1POlfdLkJliZY3OlB0j0f17uMWlqZYjH7txj+2YbyrIA8Yg==", + "path": "system.io.pipelines/5.0.1", + "hashPath": "system.io.pipelines.5.0.1.nupkg.sha512" + }, + "System.IO.Ports/4.7.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-tNHiZcdskfRpxU7LBBlA69YYgBqWMBE/JDdmrEIDa4iw944VK1u4+B0FeSls1FUm+Pm4X/Fl0fSGqi8MDhb8/Q==", + "path": "system.io.ports/4.7.0", + "hashPath": "system.io.ports.4.7.0.nupkg.sha512" + }, "System.Memory/4.5.3": { "type": "package", "serviceable": true, diff --git a/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.runtimeconfig.json b/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.runtimeconfig.json index 1749421..5a350b4 100644 --- a/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.runtimeconfig.json +++ b/WinFormStarter/obj/Debug/net6.0-windows/WinFormStarter.designer.runtimeconfig.json @@ -12,9 +12,9 @@ } ], "additionalProbingPaths": [ - "C:\\Users\\CZ\\.dotnet\\store\\|arch|\\|tfm|", - "C:\\Users\\CZ\\.nuget\\packages", - "D:\\vs2019\\共享组件\\NuGetPackages" + "C:\\Users\\64558\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\64558\\.nuget\\packages", + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configProperties": { "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true diff --git a/WpfStarter/MainWindow.xaml b/WpfStarter/MainWindow.xaml index 22145df..71817b8 100644 --- a/WpfStarter/MainWindow.xaml +++ b/WpfStarter/MainWindow.xaml @@ -6,7 +6,10 @@ mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> -