diff --git a/Common/lib/HybirdFrameworkCore.dll b/Common/lib/HybirdFrameworkCore.dll index b3f2f85..36f9605 100644 Binary files a/Common/lib/HybirdFrameworkCore.dll and b/Common/lib/HybirdFrameworkCore.dll differ diff --git a/Common/lib/HybirdFrameworkDriver.dll b/Common/lib/HybirdFrameworkDriver.dll index 66c5b7a..9b51aae 100644 Binary files a/Common/lib/HybirdFrameworkDriver.dll and b/Common/lib/HybirdFrameworkDriver.dll differ diff --git a/ConsoleStarter/ConsoleStarter.csproj b/ConsoleStarter/ConsoleStarter.csproj index cf3347c..dae4541 100644 --- a/ConsoleStarter/ConsoleStarter.csproj +++ b/ConsoleStarter/ConsoleStarter.csproj @@ -26,7 +26,7 @@ - + Always diff --git a/ConsoleStarter/Program.cs b/ConsoleStarter/Program.cs index 19fc46a..4893745 100644 --- a/ConsoleStarter/Program.cs +++ b/ConsoleStarter/Program.cs @@ -7,8 +7,8 @@ internal class Program { public static void Main(string[] args) { - XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.xml")); + XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.config")); var exportDb = new ExportDb(); exportDb.Export(); } -} \ No newline at end of file +} diff --git a/ConsoleStarter/log4net.xml b/ConsoleStarter/log4net.config similarity index 100% rename from ConsoleStarter/log4net.xml rename to ConsoleStarter/log4net.config diff --git a/Service/Car/Handler/ElecMsgHandler.cs b/Service/Car/Handler/ElecMsgHandler.cs index 15a4b34..0e54d2d 100644 --- a/Service/Car/Handler/ElecMsgHandler.cs +++ b/Service/Car/Handler/ElecMsgHandler.cs @@ -4,6 +4,7 @@ using HybirdFrameworkDriver.Session; using log4net; using Service.Car.Msg.Car.Req; using Service.Car.Msg.Host.Resp; +using Service.Car.Server; namespace Service.Car.Handler; @@ -24,7 +25,7 @@ public class ElecMsgHandler : SimpleChannelInboundHandler, IBaseHandler protected override void ChannelRead0(IChannelHandlerContext ctx, ElecMsg msg) { Log.Info($"receive ElecMsg = {msg}"); - IoSession? ioSession = SessionMgr.GetSession(msg.CarNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(msg.CarNo); ioSession?.BusinessMap.AddOrUpdate("ElecMsg", msg, ((s, o) => msg)); ioSession?.BusinessMap.AddOrUpdate("Connected", true, ((s, o) => true)); diff --git a/Service/Car/Handler/HeartBeatMsgHandler.cs b/Service/Car/Handler/HeartBeatMsgHandler.cs index 03eb7d4..1f3f0f8 100644 --- a/Service/Car/Handler/HeartBeatMsgHandler.cs +++ b/Service/Car/Handler/HeartBeatMsgHandler.cs @@ -27,15 +27,15 @@ public class HeartBeatMsgHandler : SimpleChannelInboundHandler, IB { Log.Info($"receive HeartBeatMsg = {msg}"); - IoSession? ioSession = SessionMgr.GetSession(ctx.Channel.Id.ToString()); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(ctx.Channel.Id.ToString()); if (ioSession != null && ioSession.Key != msg.CarNo) { - SessionMgr.ChangeSessionKey(ioSession, msg.CarNo); + CarServerMgr.CarServer?.SessionMgr.ChangeSessionKey(ioSession, msg.CarNo); } if (ioSession == null) { - ioSession = SessionMgr.GetSession(msg.CarNo); + ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(msg.CarNo); } ioSession.BusinessMap.AddOrUpdate("HeartBeatMsg", msg, ((s, o) => msg)); diff --git a/Service/TBox/Codec/Decoder.cs b/Service/TBox/Codec/Decoder.cs new file mode 100644 index 0000000..f96dfc3 --- /dev/null +++ b/Service/TBox/Codec/Decoder.cs @@ -0,0 +1,49 @@ +using DotNetty.Buffers; +using DotNetty.Codecs; +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Utils; +using log4net; +using Service.TBox.Msg; +using Service.TBox.Msg.TBox; + +namespace Service.TBox.Codec; + +public class Decoder : ByteToMessageDecoder +{ + //TODO 实际开发时去掉 + public static Queue Msgs { get; set; } = new(); + //TODO 实际开发时去掉 + public static Queue BytesQueue { get; set; } = new(); + + private static readonly ILog Log = LogManager.GetLogger(typeof(Decoder)); + + private readonly int _fixedLength = 18; + + protected override void Decode(IChannelHandlerContext context, IByteBuffer input, List output) + { + if (_fixedLength <= input.ReadableBytes) + { + byte[] bytes = new byte[_fixedLength]; + input.ReadBytes(bytes); + + //TODO 实际开发时去掉 + BytesQueue.Enqueue(bytes); + + Log.Info($"receive {BitUtls.BytesToHexStr(bytes)}"); + + int id = BitConverter.ToInt32(new byte[] { bytes[3], bytes[2], bytes[1], bytes[0] }, 0); + Log.Info( + $"receive id={id} {BitUtls.BytesToHexStr(BitConverter.GetBytes(0x1882D0F3))} {BitUtls.BytesToHexStr(BitConverter.GetBytes(4090528280))}"); + BaseMsg baseMsg = id switch + { + 0x1882D0F3 => ModelConvert.Decode(bytes), + 0x18FF48A8 => ModelConvert.Decode(bytes), + _ => ModelConvert.Decode(bytes), + }; + + //TODO 实际开发时去掉 + Msgs.Enqueue(baseMsg); + output.Add(baseMsg); + } + } +} diff --git a/Service/TBox/Codec/Encoder.cs b/Service/TBox/Codec/Encoder.cs new file mode 100644 index 0000000..c30d6b3 --- /dev/null +++ b/Service/TBox/Codec/Encoder.cs @@ -0,0 +1,24 @@ +using DotNetty.Buffers; +using DotNetty.Codecs; +using DotNetty.Transport.Channels; +using log4net; +using Service.TBox.Msg; + +namespace Service.TBox.Codec; + +public class Encoder : MessageToByteEncoder +{ + private static readonly ILog Log = LogManager.GetLogger(typeof(Encoder)); + + /// + /// + /// + /// + /// + /// + protected override void Encode(IChannelHandlerContext context, BaseMsg obj, IByteBuffer output) + { + byte[] bytes = obj.ToBytes(); + output.WriteBytes(bytes); + } +} diff --git a/Service/TBox/Handler/IBaseHandler.cs b/Service/TBox/Handler/IBaseHandler.cs new file mode 100644 index 0000000..c678ece --- /dev/null +++ b/Service/TBox/Handler/IBaseHandler.cs @@ -0,0 +1,8 @@ +using DotNetty.Transport.Channels; + +namespace Service.TBox.Handler; + +public interface IBaseHandler: IChannelHandler +{ + +} diff --git a/Service/TBox/Handler/OtherMsgHandler.cs b/Service/TBox/Handler/OtherMsgHandler.cs new file mode 100644 index 0000000..b7e4eb9 --- /dev/null +++ b/Service/TBox/Handler/OtherMsgHandler.cs @@ -0,0 +1,18 @@ +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; +using log4net; +using Service.TBox.Msg.TBox; + +namespace Service.TBox.Handler; + +[Order(8)] +[Scope("InstancePerDependency")] +public class OtherMsgHandler : SimpleChannelInboundHandler, IBaseHandler +{ + private static readonly ILog Log = LogManager.GetLogger(typeof(OtherMsgHandler)); + + protected override void ChannelRead0(IChannelHandlerContext ctx, OtherMsg msg) + { + Log.Info($"receive OtherMsg={msg}"); + } +} diff --git a/Service/TBox/Handler/SocMsgHandler.cs b/Service/TBox/Handler/SocMsgHandler.cs new file mode 100644 index 0000000..54fc968 --- /dev/null +++ b/Service/TBox/Handler/SocMsgHandler.cs @@ -0,0 +1,19 @@ +using DotNetty.Transport.Channels; +using HybirdFrameworkCore.Autofac.Attribute; +using log4net; +using Newtonsoft.Json; +using Service.TBox.Msg.TBox; + +namespace Service.TBox.Handler; + +[Order(8)] +[Scope("InstancePerDependency")] +public class SocMsgHandler : SimpleChannelInboundHandler, IBaseHandler +{ + private static readonly ILog Log = LogManager.GetLogger(typeof(SocMsgHandler)); + + protected override void ChannelRead0(IChannelHandlerContext ctx, SocMsg msg) + { + Log.Info($"receive SocMsg={JsonConvert.SerializeObject(msg)}"); + } +} diff --git a/Service/TBox/Msg/BaseMsg.cs b/Service/TBox/Msg/BaseMsg.cs new file mode 100644 index 0000000..ac49199 --- /dev/null +++ b/Service/TBox/Msg/BaseMsg.cs @@ -0,0 +1,22 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkCore.Utils; +using HybirdFrameworkDriver.Common; + +namespace Service.TBox.Msg; + +public class BaseMsg : IToBytes +{ + [Property(0, 32)] public UInt32 Id { get; set; } + + [Property(32, 8)] public byte P { get; set; } + [Property(40, 8)] public byte R { get; set; } + [Property(48, 8)] public byte Dp { get; set; } + [Property(56, 8)] public byte Pf { get; set; } + [Property(64, 8)] public byte Ps { get; set; } + [Property(72, 8)] public byte Sa { get; set; } + + public byte[] ToBytes() + { + return ModelConvert.Encode(this); + } +} diff --git a/Service/TBox/Msg/Host/LockMsg.cs b/Service/TBox/Msg/Host/LockMsg.cs new file mode 100644 index 0000000..cb13d41 --- /dev/null +++ b/Service/TBox/Msg/Host/LockMsg.cs @@ -0,0 +1,18 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.Host; + +public class LockMsg : BaseMsg +{ + /// + /// 0:断开连接 1:加锁 2:解锁 3:无效 + /// + [Property(80, 2)] + public byte Lock { get; set; } + + public LockMsg(byte @lock) + { + Id = 0x1880D0F3; + Lock = @lock; + } +} diff --git a/Service/TBox/Msg/Host/RestartMsg.cs b/Service/TBox/Msg/Host/RestartMsg.cs new file mode 100644 index 0000000..44558f2 --- /dev/null +++ b/Service/TBox/Msg/Host/RestartMsg.cs @@ -0,0 +1,18 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.Host; + +public class RestartMsg : BaseMsg +{ + /// + /// "0:无指令 1:重启指令" + /// + [Property(80, 2)] + public byte Restart { get; set; } + + public RestartMsg(byte restart) + { + Id = 0x18FFF8A8; + Restart = restart; + } +} diff --git a/Service/TBox/Msg/Host/VinMsg.cs b/Service/TBox/Msg/Host/VinMsg.cs new file mode 100644 index 0000000..c4e07b1 --- /dev/null +++ b/Service/TBox/Msg/Host/VinMsg.cs @@ -0,0 +1,20 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.Host; + +public class VinMsg : BaseMsg +{ + [Property(80, 8)] public byte Seq { get; set; } + [Property(88, 8)] public byte B2 { get; set; } + [Property(96, 8)] public byte B3 { get; set; } + [Property(104, 8)] public byte B4 { get; set; } + [Property(112, 8)] public byte B5 { get; set; } + [Property(120, 8)] public byte B6 { get; set; } + [Property(128, 8)] public byte B7 { get; set; } + [Property(136, 8)] public byte B8 { get; set; } + + public VinMsg() + { + Id = 0x18E1F3D1; + } +} diff --git a/Service/TBox/Msg/TBox/BatteryFourSn.cs b/Service/TBox/Msg/TBox/BatteryFourSn.cs new file mode 100644 index 0000000..6af208f --- /dev/null +++ b/Service/TBox/Msg/TBox/BatteryFourSn.cs @@ -0,0 +1,16 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class BatteryFourSn : BaseMsg +{ + [Property(80, 8)] public byte CheckSum { get; set; } + [Property(91, 5)] public byte Length { get; set; } + [Property(88, 3)] public byte Factory { get; set; } + [Property(96, 8)] public byte Sn1 { get; set; } + [Property(104, 8)] public byte Sn2 { get; set; } + [Property(112, 8)] public byte Sn3 { get; set; } + [Property(120, 8)] public byte Sn4 { get; set; } + [Property(128, 8)] public byte Sn5 { get; set; } + [Property(136, 8)] public byte Sn6 { get; set; } +} diff --git a/Service/TBox/Msg/TBox/BatteryInfo1.cs b/Service/TBox/Msg/TBox/BatteryInfo1.cs new file mode 100644 index 0000000..c178c30 --- /dev/null +++ b/Service/TBox/Msg/TBox/BatteryInfo1.cs @@ -0,0 +1,13 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class BatteryInfo1 : BaseMsg +{ + [Property(80, 4)] public byte TypeCode { get; set; } + + [Property(84, 8)] public byte Reserved1 { get; set; } + + [Property(88, 16, scale: 0.1, round: 1)] + public float Soe { get; set; } +} diff --git a/Service/TBox/Msg/TBox/BatteryOneSn.cs b/Service/TBox/Msg/TBox/BatteryOneSn.cs new file mode 100644 index 0000000..2de584e --- /dev/null +++ b/Service/TBox/Msg/TBox/BatteryOneSn.cs @@ -0,0 +1,16 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class BatteryOneSn : BaseMsg +{ + [Property(80, 8)] public byte CheckSum { get; set; } + [Property(91, 5)] public byte Length { get; set; } + [Property(88, 3)] public byte Factory { get; set; } + [Property(96, 8)] public byte Sn1 { get; set; } + [Property(104, 8)] public byte Sn2 { get; set; } + [Property(112, 8)] public byte Sn3 { get; set; } + [Property(120, 8)] public byte Sn4 { get; set; } + [Property(128, 8)] public byte Sn5 { get; set; } + [Property(136, 8)] public byte Sn6 { get; set; } +} diff --git a/Service/TBox/Msg/TBox/BatteryThreeSn.cs b/Service/TBox/Msg/TBox/BatteryThreeSn.cs new file mode 100644 index 0000000..71888b0 --- /dev/null +++ b/Service/TBox/Msg/TBox/BatteryThreeSn.cs @@ -0,0 +1,16 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class BatteryThreeSn : BaseMsg +{ + [Property(80, 8)] public byte CheckSum { get; set; } + [Property(91, 5)] public byte Length { get; set; } + [Property(88, 3)] public byte Factory { get; set; } + [Property(96, 8)] public byte Sn1 { get; set; } + [Property(104, 8)] public byte Sn2 { get; set; } + [Property(112, 8)] public byte Sn3 { get; set; } + [Property(120, 8)] public byte Sn4 { get; set; } + [Property(128, 8)] public byte Sn5 { get; set; } + [Property(136, 8)] public byte Sn6 { get; set; } +} diff --git a/Service/TBox/Msg/TBox/BatteryTwoSn.cs b/Service/TBox/Msg/TBox/BatteryTwoSn.cs new file mode 100644 index 0000000..f5e0a05 --- /dev/null +++ b/Service/TBox/Msg/TBox/BatteryTwoSn.cs @@ -0,0 +1,16 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class BatteryTwoSn : BaseMsg +{ + [Property(80, 8)] public byte CheckSum { get; set; } + [Property(91, 5)] public byte Length { get; set; } + [Property(88, 3)] public byte Factory { get; set; } + [Property(96, 8)] public byte Sn1 { get; set; } + [Property(104, 8)] public byte Sn2 { get; set; } + [Property(112, 8)] public byte Sn3 { get; set; } + [Property(120, 8)] public byte Sn4 { get; set; } + [Property(128, 8)] public byte Sn5 { get; set; } + [Property(136, 8)] public byte Sn6 { get; set; } +} diff --git a/Service/TBox/Msg/TBox/LockStatusMsg.cs b/Service/TBox/Msg/TBox/LockStatusMsg.cs new file mode 100644 index 0000000..ae18a14 --- /dev/null +++ b/Service/TBox/Msg/TBox/LockStatusMsg.cs @@ -0,0 +1,8 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class LockStatusMsg : BaseMsg +{ + [Property(80, 2)] public byte LockStatus { get; set; } +} diff --git a/Service/TBox/Msg/TBox/OtherMsg.cs b/Service/TBox/Msg/TBox/OtherMsg.cs new file mode 100644 index 0000000..c401ebb --- /dev/null +++ b/Service/TBox/Msg/TBox/OtherMsg.cs @@ -0,0 +1,9 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class OtherMsg : BaseMsg +{ + [Property(80, 64)] + public byte[] Data { get; set; } +} diff --git a/Service/TBox/Msg/TBox/SocMsg.cs b/Service/TBox/Msg/TBox/SocMsg.cs new file mode 100644 index 0000000..ad509d1 --- /dev/null +++ b/Service/TBox/Msg/TBox/SocMsg.cs @@ -0,0 +1,8 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class SocMsg : BaseMsg +{ + [Property(80, 8)] public ushort Soc { get; set; } +} diff --git a/Service/TBox/Msg/TBox/SohMsg.cs b/Service/TBox/Msg/TBox/SohMsg.cs new file mode 100644 index 0000000..4685f8d --- /dev/null +++ b/Service/TBox/Msg/TBox/SohMsg.cs @@ -0,0 +1,8 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class SohMsg : BaseMsg +{ + [Property(80, 16)] public float Soh { get; set; } +} diff --git a/Service/TBox/Msg/TBox/StatusMsg.cs b/Service/TBox/Msg/TBox/StatusMsg.cs new file mode 100644 index 0000000..d7cb319 --- /dev/null +++ b/Service/TBox/Msg/TBox/StatusMsg.cs @@ -0,0 +1,23 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class StatusMsg : BaseMsg +{ + [Property(80,4)] + public byte Gear { get; set; } + [Property(84,2)] + public byte Break { get; set; } + [Property(86,2)] + public byte Keys { get; set; } + [Property(88,2)] + public byte MainRelay { get; set; } + [Property(90,2)] + public byte CarType { get; set; } + [Property(92,2)] + public byte Solenoid { get; set; } + [Property(94,2)] + public byte Online { get; set; } + [Property(96,2)] + public byte WifiError { get; set; } +} diff --git a/Service/TBox/Msg/TBox/SubMileMsg.cs b/Service/TBox/Msg/TBox/SubMileMsg.cs new file mode 100644 index 0000000..6a7e520 --- /dev/null +++ b/Service/TBox/Msg/TBox/SubMileMsg.cs @@ -0,0 +1,8 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class SubMileMsg : BaseMsg +{ + [Property(80, 32)] public double SubMile { get; set; } +} diff --git a/Service/TBox/Msg/TBox/TotalMileMsg.cs b/Service/TBox/Msg/TBox/TotalMileMsg.cs new file mode 100644 index 0000000..48595f8 --- /dev/null +++ b/Service/TBox/Msg/TBox/TotalMileMsg.cs @@ -0,0 +1,8 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class TotalMileMsg : BaseMsg +{ + [Property(80, 32)] public double TotalMile { get; set; } +} diff --git a/Service/TBox/Msg/TBox/VersionMsg.cs b/Service/TBox/Msg/TBox/VersionMsg.cs new file mode 100644 index 0000000..593a2af --- /dev/null +++ b/Service/TBox/Msg/TBox/VersionMsg.cs @@ -0,0 +1,11 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class VersionMsg : BaseMsg +{ + [Property(80, 8)] public byte SoftR { get; set; } + [Property(88, 8)] public byte SoftB { get; set; } + [Property(96, 8)] public byte HardV { get; set; } + [Property(104, 8)] public byte HardB { get; set; } +} diff --git a/Service/TBox/Msg/TBox/VinMsg.cs b/Service/TBox/Msg/TBox/VinMsg.cs new file mode 100644 index 0000000..d7ddb85 --- /dev/null +++ b/Service/TBox/Msg/TBox/VinMsg.cs @@ -0,0 +1,15 @@ +using HybirdFrameworkCore.Autofac.Attribute; + +namespace Service.TBox.Msg.TBox; + +public class VinMsg : BaseMsg +{ + [Property(80, 8)] public byte Seq { get; set; } + [Property(88, 8)] public byte B2 { get; set; } + [Property(96, 8)] public byte B3 { get; set; } + [Property(104, 8)] public byte B4 { get; set; } + [Property(112, 8)] public byte B5 { get; set; } + [Property(120, 8)] public byte B6 { get; set; } + [Property(128, 8)] public byte B7 { get; set; } + [Property(136, 8)] public byte B8 { get; set; } +} diff --git a/Service/TBox/MyTask/LockTask.cs b/Service/TBox/MyTask/LockTask.cs new file mode 100644 index 0000000..4573772 --- /dev/null +++ b/Service/TBox/MyTask/LockTask.cs @@ -0,0 +1,42 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkCore.AutoTask; +using Service.TBox.Server; + +namespace Service.TBox.MyTask; + +[Scope] +public class LockTask : ITask +{ + public static readonly string TaskName = "LockTask"; + private volatile bool _stop; + + public string Name() + { + return TaskName; + } + + public int Interval() + { + return 500; + } + + public void Handle() + { + TBoxServerMgr.Server?.SessionMgr.Broadcast(TBoxServerMgr.Server?.LockMsg); + } + + public bool Stoped() + { + return _stop; + } + + public void Stop() + { + _stop = true; + } + + public void ResetStop() + { + _stop = false; + } +} diff --git a/Service/TBox/MyTask/VinTask.cs b/Service/TBox/MyTask/VinTask.cs new file mode 100644 index 0000000..b911e0e --- /dev/null +++ b/Service/TBox/MyTask/VinTask.cs @@ -0,0 +1,48 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkCore.AutoTask; +using Service.TBox.Server; + +namespace Service.TBox.MyTask; + +[Scope] +public class VinTask : ITask +{ + public static readonly string TaskName = "VinTask"; + private volatile bool _stop = true; + + public string Name() + { + return TaskName; + } + + public int Interval() + { + return 100; + } + + public void Handle() + { + foreach (var vinMsg in TBoxServerMgr.Server?.SendVinMsg) + { + if (vinMsg != null) + { + TBoxServerMgr.Server?.SessionMgr.Broadcast(vinMsg); + } + } + } + + public bool Stoped() + { + return _stop; + } + + public void Stop() + { + _stop = true; + } + + public void ResetStop() + { + _stop = false; + } +} diff --git a/Service/TBox/Server/TBoxServer.cs b/Service/TBox/Server/TBoxServer.cs new file mode 100644 index 0000000..fd657ff --- /dev/null +++ b/Service/TBox/Server/TBoxServer.cs @@ -0,0 +1,150 @@ +using HybirdFrameworkCore.Autofac.Attribute; +using HybirdFrameworkCore.AutoTask; +using HybirdFrameworkDriver.TcpServer; +using log4net; +using Service.TBox.Codec; +using Service.TBox.Handler; +using Service.TBox.Msg.Host; +using Service.TBox.Msg.TBox; +using Service.TBox.MyTask; +using VinMsg = Service.TBox.Msg.Host.VinMsg; + +namespace Service.TBox.Server; + +[Scope] +public class TBoxServer : TcpServer +{ + private static readonly ILog Log = LogManager.GetLogger(typeof(TBoxServer)); + + #region HostMsg + + public LockMsg LockMsg = new LockMsg(3); + public VinMsg[] SendVinMsg = new VinMsg[3]; + public string SendVin { get; set; } + + #endregion + + #region TBoxMsg + + public BatteryOneSn? BatteryOneSn { get; set; } + public BatteryTwoSn? BatteryTwoSn { get; set; } + public BatteryThreeSn BatteryThreeSn { get; set; } + public BatteryFourSn BatteryFourSn { get; set; } + public BatteryInfo1 BatteryInfo1 { get; set; } + public LockStatusMsg LockStatusMsg { get; set; } + public SocMsg SocMsg { get; set; } + public SohMsg SohMsg { get; set; } + public StatusMsg StatusMsg { get; set; } + public SubMileMsg SubMileMsg { get; set; } + public TotalMileMsg TotalMileMsg { get; set; } + public VersionMsg VersionMsg { get; set; } + public Msg.TBox.VinMsg VinMsg { get; set; } + + #endregion + + #region func + + /// + /// + /// + /// 0:断开连接 1:加锁 2:解锁 3:无效 + public void StartSendLock(byte @lock) + { + LockMsg.Lock = @lock; + if (TaskInit.TaskMap.TryGetValue(LockTask.TaskName, out var task)) + { + task.Start(); + } + } + + /// + /// + /// + public void StopSendLock() + { + if (TaskInit.TaskMap.TryGetValue(LockTask.TaskName, out var task)) + { + task.Stop(); + } + } + + /// + /// + /// + /// + public void StartSendVin(string vin) + { + SendVin = vin; + EncodeVin(vin); + if (TaskInit.TaskMap.TryGetValue(VinTask.TaskName, out var task)) + { + task.Start(); + } + } + + /// + /// + /// + /// + private void EncodeVin(string vin) + { + if (vin.Length != 17) + { + Log.Info("vin length is not 17"); + return; + } + + SendVinMsg[0] = new VinMsg() + { + Seq = 1, + B2 = (byte)vin[0], + B3 = (byte)vin[1], + B4 = (byte)vin[2], + B5 = (byte)vin[3], + B6 = (byte)vin[4], + B7 = (byte)vin[5], + B8 = (byte)vin[6], + }; + + SendVinMsg[1] = new VinMsg() + { + Seq = 2, + B2 = (byte)vin[7+0], + B3 = (byte)vin[7+1], + B4 = (byte)vin[7+2], + B5 = (byte)vin[7+3], + B6 = (byte)vin[7+4], + B7 = (byte)vin[7+5], + B8 = (byte)vin[7+6], + }; + SendVinMsg[2] = new VinMsg() + { + Seq = 3, + B2 = (byte)vin[14+0], + B3 = (byte)vin[14+1], + B4 = (byte)vin[14+2], + }; + + } + + /// + /// + /// + public void StopSendVin() + { + if (TaskInit.TaskMap.TryGetValue(VinTask.TaskName, out var task)) + { + task.Stop(); + } + } + + /// + /// "0:无指令 1:重启指令" + /// + /// + public void SendRestart(byte restart) + { + TBoxServerMgr.Server?.SessionMgr.Broadcast(new RestartMsg(restart)); + } + #endregion +} diff --git a/Service/TBox/Server/TBoxServerMgr.cs b/Service/TBox/Server/TBoxServerMgr.cs new file mode 100644 index 0000000..ef39fbc --- /dev/null +++ b/Service/TBox/Server/TBoxServerMgr.cs @@ -0,0 +1,18 @@ +using Autofac; +using HybirdFrameworkCore.Autofac; + +namespace Service.TBox.Server; + +public class TBoxServerMgr +{ + public static TBoxServer? Server { get; private set; } + + public static void InitTBoxServer(int port) + { + if (Server == null) + { + Server = AppInfo.Container.Resolve(); + Server.Start(port); + } + } +} diff --git a/WebStarter/Controllers/CarController.cs b/WebStarter/Controllers/CarController.cs index 6752523..e22061f 100644 --- a/WebStarter/Controllers/CarController.cs +++ b/WebStarter/Controllers/CarController.cs @@ -26,7 +26,7 @@ public class CarController : ControllerBase{ [HttpGet("/getCarInfo/{carNo}")] public CarInfoResp? GetCarInfo(string carNo) { - IoSession? ioSession = SessionMgr.GetSession(carNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); CarInfoResp carInfoResp = new CarInfoResp() { Connected = CarServerMgr.CarServer != null && ioSession != null, @@ -61,7 +61,7 @@ public class CarController : ControllerBase{ public List GetCarInfoList() { List result = new List(); - List sessionList = SessionMgr.GetSessionList(); + List sessionList = CarServerMgr.CarServer?.SessionMgr.GetSessionList(); foreach (var ioSession in sessionList) { @@ -99,7 +99,7 @@ public class CarController : ControllerBase{ { Log.Info($"Lock {carNo}"); - IoSession? ioSession = SessionMgr.GetSession(carNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); if (CarServerMgr.CarServer == null || ioSession?.Channel == null) { Log.Info("ioSession is null return false"); @@ -111,7 +111,7 @@ public class CarController : ControllerBase{ CarNo = carNo }; CarServerMgr.CarServer.LockMsgPair.Req = lockMsg; - ioSession.Channel.WriteAndFlushAsync(lockMsg); + ioSession.Send(lockMsg); return CarServerMgr.CarServer.LockMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result == 0; } @@ -125,7 +125,7 @@ public class CarController : ControllerBase{ public bool UnLock(string carNo) { Log.Info($"UnLock {carNo} "); - IoSession? ioSession = SessionMgr.GetSession(carNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); if (CarServerMgr.CarServer == null || ioSession?.Channel == null) { Log.Info("ioSession is null return false"); @@ -138,7 +138,7 @@ public class CarController : ControllerBase{ }; CarServerMgr.CarServer.UnLockMsgPair.Req = unLockMsg; - ioSession.Channel.WriteAndFlushAsync(unLockMsg); + ioSession.Send(unLockMsg); return CarServerMgr.CarServer.UnLockMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result == 0; } @@ -152,7 +152,7 @@ public class CarController : ControllerBase{ public bool SettleConfirm(string carNo) { Log.Info($"SettleConfirm {carNo}"); - IoSession? ioSession = SessionMgr.GetSession(carNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); if (CarServerMgr.CarServer == null || ioSession?.Channel == null) { Log.Info("ioSession is null return false"); @@ -161,7 +161,7 @@ public class CarController : ControllerBase{ var settleConfirmMsg = new SettleConfirmMsg() { CarNo = carNo }; CarServerMgr.CarServer.SettleConfirmMsgPair.Req = settleConfirmMsg; - ioSession.Channel.WriteAndFlushAsync(settleConfirmMsg); + ioSession.Send(settleConfirmMsg); return CarServerMgr.CarServer.SettleConfirmMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result == 0; } @@ -174,7 +174,7 @@ public class CarController : ControllerBase{ public bool SetParam(SetParam setParam) { Log.Info($"SetParam {JsonConvert.SerializeObject(setParam)}"); - IoSession? ioSession = SessionMgr.GetSession(setParam.CarNo); + IoSession? ioSession = CarServerMgr.CarServer?.SessionMgr.GetSession(setParam.CarNo); if (CarServerMgr.CarServer == null || ioSession?.Channel == null) { Log.Info("ioSession is null return false"); @@ -198,7 +198,7 @@ public class CarController : ControllerBase{ ElectricityToBeSettled = setParam.ElectricityToBeSettled, }; CarServerMgr.CarServer.SetParamMsgPair.Req = setParamMsg; - SessionMgr.Broadcast(setParamMsg); + ioSession.Send(setParamMsg); return CarServerMgr.CarServer.SetParamMsgPair.GetResp(TimeSpan.FromSeconds(5))?.Result ==0; } @@ -216,7 +216,7 @@ public class CarController : ControllerBase{ return true; } - IoSession? session = SessionMgr.GetSession(carNo); + IoSession? session = CarServerMgr.CarServer?.SessionMgr.GetSession(carNo); if (session == null) { CarServerMgr.CarServer.Clean(); diff --git a/WinFormStarter/Form2.Designer.cs b/WinFormStarter/Form2.Designer.cs index a7dba3b..e9af23e 100644 --- a/WinFormStarter/Form2.Designer.cs +++ b/WinFormStarter/Form2.Designer.cs @@ -31,11 +31,174 @@ 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"; + groupBox1 = new GroupBox(); + btnConn = new Button(); + txtPort = new TextBox(); + label2 = new Label(); + groupBox2 = new GroupBox(); + splitContainer1 = new SplitContainer(); + rTxtOriginal = new RichTextBox(); + label3 = new Label(); + rTxtParsed = new RichTextBox(); + label5 = new Label(); + label4 = new Label(); + groupBox1.SuspendLayout(); + groupBox2.SuspendLayout(); + ((ISupportInitialize)splitContainer1).BeginInit(); + splitContainer1.Panel1.SuspendLayout(); + splitContainer1.Panel2.SuspendLayout(); + splitContainer1.SuspendLayout(); + SuspendLayout(); + // + // groupBox1 + // + groupBox1.Controls.Add(btnConn); + groupBox1.Controls.Add(txtPort); + groupBox1.Controls.Add(label2); + groupBox1.Dock = DockStyle.Top; + groupBox1.Location = new Point(0, 0); + groupBox1.Name = "groupBox1"; + groupBox1.Size = new Size(800, 100); + groupBox1.TabIndex = 0; + groupBox1.TabStop = false; + groupBox1.Text = "连接参数"; + // + // btnConn + // + btnConn.Location = new Point(502, 26); + btnConn.Name = "btnConn"; + btnConn.Size = new Size(75, 23); + btnConn.TabIndex = 4; + btnConn.Text = "连接"; + btnConn.UseVisualStyleBackColor = true; + btnConn.Click += btnConn_Click; + // + // txtPort + // + txtPort.Location = new Point(232, 26); + txtPort.Name = "txtPort"; + txtPort.Size = new Size(100, 23); + txtPort.TabIndex = 3; + // + // label2 + // + label2.AutoSize = true; + label2.Location = new Point(186, 26); + label2.Name = "label2"; + label2.Size = new Size(40, 17); + label2.TabIndex = 2; + label2.Text = "PORT"; + // + // groupBox2 + // + groupBox2.Controls.Add(splitContainer1); + groupBox2.Dock = DockStyle.Fill; + groupBox2.Location = new Point(0, 100); + groupBox2.Name = "groupBox2"; + groupBox2.Size = new Size(800, 187); + groupBox2.TabIndex = 1; + groupBox2.TabStop = false; + groupBox2.Text = "报文展示"; + // + // splitContainer1 + // + splitContainer1.Dock = DockStyle.Fill; + splitContainer1.Location = new Point(3, 19); + splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + splitContainer1.Panel1.Controls.Add(rTxtOriginal); + splitContainer1.Panel1.Controls.Add(label3); + // + // splitContainer1.Panel2 + // + splitContainer1.Panel2.Controls.Add(rTxtParsed); + splitContainer1.Panel2.Controls.Add(label5); + splitContainer1.Panel2.Controls.Add(label4); + splitContainer1.Size = new Size(794, 165); + splitContainer1.SplitterDistance = 381; + splitContainer1.TabIndex = 0; + // + // rTxtOriginal + // + rTxtOriginal.Dock = DockStyle.Fill; + rTxtOriginal.Location = new Point(0, 17); + rTxtOriginal.Name = "rTxtOriginal"; + rTxtOriginal.Size = new Size(381, 148); + rTxtOriginal.TabIndex = 1; + rTxtOriginal.Text = ""; + // + // label3 + // + label3.AutoSize = true; + label3.Dock = DockStyle.Top; + label3.Location = new Point(0, 0); + label3.Name = "label3"; + label3.Size = new Size(56, 17); + label3.TabIndex = 0; + label3.Text = "原始报文"; + // + // rTxtParsed + // + rTxtParsed.Dock = DockStyle.Fill; + rTxtParsed.Location = new Point(0, 17); + rTxtParsed.Name = "rTxtParsed"; + rTxtParsed.Size = new Size(409, 148); + rTxtParsed.TabIndex = 3; + rTxtParsed.Text = ""; + // + // label5 + // + label5.AutoSize = true; + label5.Dock = DockStyle.Top; + label5.Location = new Point(0, 0); + label5.Name = "label5"; + label5.Size = new Size(56, 17); + label5.TabIndex = 2; + label5.Text = "解析数据"; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new Point(146, 56); + label4.Name = "label4"; + label4.Size = new Size(43, 17); + label4.TabIndex = 0; + label4.Text = "label4"; + // + // Form2 + // + AutoScaleDimensions = new SizeF(7F, 17F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(groupBox2); + Controls.Add(groupBox1); + Name = "Form2"; + Text = "Form2"; + groupBox1.ResumeLayout(false); + groupBox1.PerformLayout(); + groupBox2.ResumeLayout(false); + splitContainer1.Panel1.ResumeLayout(false); + splitContainer1.Panel1.PerformLayout(); + splitContainer1.Panel2.ResumeLayout(false); + splitContainer1.Panel2.PerformLayout(); + ((ISupportInitialize)splitContainer1).EndInit(); + splitContainer1.ResumeLayout(false); + ResumeLayout(false); } #endregion -} \ No newline at end of file + + private GroupBox groupBox1; + private Button btnConn; + private TextBox txtPort; + private Label label2; + private GroupBox groupBox2; + private SplitContainer splitContainer1; + private RichTextBox rTxtOriginal; + private Label label3; + private RichTextBox rTxtParsed; + private Label label5; + private Label label4; +} diff --git a/WinFormStarter/Form2.cs b/WinFormStarter/Form2.cs index ef85d94..0d0ae6f 100644 --- a/WinFormStarter/Form2.cs +++ b/WinFormStarter/Form2.cs @@ -1,9 +1,83 @@ -namespace WinFormStarter; +using Autofac; +using Autofac.Core; +using DotNetty.Handlers.Logging; +using HybirdFrameworkCore.Autofac; +using HybirdFrameworkCore.Utils; +using log4net; +using Newtonsoft.Json; +using Service.TBox; +using Service.TBox.Codec; +using Service.TBox.Server; + +namespace WinFormStarter; public partial class Form2 : Form { + + private static readonly ILog Log = LogManager.GetLogger(typeof(Form2)); + + + private TBoxServer? server = null; public Form2() { InitializeComponent(); + this.txtPort.Text = "9000"; + Task.Run(() => + { + while (true) + { + if (Decoder.Msgs.TryDequeue(out var msg)) + { + + AppendText(rTxtParsed, JsonConvert.SerializeObject(msg) + "\r\n"); + } + if (Decoder.BytesQueue.TryDequeue(out var bytes)) + { + AppendText(rTxtOriginal, BitUtls.BytesToHexStr(bytes) + "\r\n"); + } + Thread.Sleep(50); + } + }); + } + + private void AppendText(RichTextBox r, string msg) + { + if (r.InvokeRequired) + { + r.Invoke(() => + { + r.AppendText(msg); + }); + } + else + { + r.AppendText(msg); + } + } + + private void btnConn_Click(object sender, EventArgs e) + { + string portTxt = txtPort.Text; + if (!int.TryParse(portTxt, out var port)) + { + MessageBox.Show("请输入端口号"); + return; + } + + if (server == null) + { + + foreach (var reg in AppInfo.Container.ComponentRegistry.Registrations) + foreach (var service in reg.Services) + if (service is TypedService ts) + Log.Info(ts.ServiceType); + + + server = AppInfo.Container.Resolve(); + server.LogLevel = LogLevel.TRACE; + server.Start(port); + } + + MessageBox.Show($"启动成功, 监听{port}"); } -} \ No newline at end of file +} diff --git a/WinFormStarter/Form2.resx b/WinFormStarter/Form2.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/WinFormStarter/Form2.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WinFormStarter/Program.cs b/WinFormStarter/Program.cs index 124c974..7b9e2b8 100644 --- a/WinFormStarter/Program.cs +++ b/WinFormStarter/Program.cs @@ -23,7 +23,7 @@ internal static class Program // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. ApplicationConfiguration.Initialize(); - XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.xml")); + XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.config")); Application.ThreadException += Application_ThreadException; // 创建容器 var builder = new ContainerBuilder(); diff --git a/WinFormStarter/WinFormStarter.csproj b/WinFormStarter/WinFormStarter.csproj index 33c2d9a..e9f3842 100644 --- a/WinFormStarter/WinFormStarter.csproj +++ b/WinFormStarter/WinFormStarter.csproj @@ -12,6 +12,7 @@ + @@ -35,8 +36,8 @@ Always - - 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/SwapBatteryMaersai.Core.dll b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Core.dll deleted file mode 100644 index 5c700a8..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Core.dll and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Core.pdb b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Core.pdb deleted file mode 100644 index bf3840b..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Core.pdb and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.dll b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.dll deleted file mode 100644 index 0376cc5..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.dll and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.pdb b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.pdb deleted file mode 100644 index f859224..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Models.pdb and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.dll b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.dll deleted file mode 100644 index c7b427b..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.dll and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.pdb b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.pdb deleted file mode 100644 index 8e49a48..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Repository.pdb and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.dll b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.dll deleted file mode 100644 index 32b44fa..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.dll and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.pdb b/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.pdb deleted file mode 100644 index 9cb7891..0000000 Binary files a/WinFormStarter/bin/Debug/net6.0-windows/SwapBatteryMaersai.Services.pdb and /dev/null differ diff --git a/WinFormStarter/bin/Debug/net6.0-windows/logs/WinForm.log.2024-04-01 b/WinFormStarter/bin/Debug/net6.0-windows/logs/WinForm.log.2024-04-01 deleted file mode 100644 index ddca16e..0000000 --- a/WinFormStarter/bin/Debug/net6.0-windows/logs/WinForm.log.2024-04-01 +++ /dev/null @@ -1,6 +0,0 @@ -2024-04-01 15:25:31,520 INFO 1 WinFormStarter.Form1 - this is a test -2024-04-01 15:26:58,070 INFO 1 WinFormStarter.Form1 - this is a test -2024-04-01 15:27:48,840 INFO 1 WinFormStarter.Form1 - this is a test -2024-04-01 15:28:25,776 INFO 1 WinFormStarter.Form1 - this is a test -2024-04-01 15:41:18,104 INFO 1 WinFormStarter.Form1 - this is a test -2024-04-01 15:46:44,052 INFO 1 WinFormStarter.Form1 - this is a test diff --git a/WinFormStarter/bin/Debug/net6.0-windows/log4net.xml b/WinFormStarter/log4net.config similarity index 100% rename from WinFormStarter/bin/Debug/net6.0-windows/log4net.xml rename to WinFormStarter/log4net.config diff --git a/WinFormStarter/log4net.xml b/WinFormStarter/log4net.xml deleted file mode 100644 index b022a3d..0000000 --- a/WinFormStarter/log4net.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ 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..85ab60d 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/13.0.1": { + "dependencies": { + "Microsoft.Extensions.Options": "6.0.0" + }, + "runtime": { + "lib/net6.0/AutoMapper.dll": { + "assemblyVersion": "13.0.0.0", + "fileVersion": "13.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": { @@ -127,7 +138,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 +228,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 +269,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 +321,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.Options/5.0.0": { + "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/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" } } }, @@ -459,11 +498,11 @@ } } }, - "Newtonsoft.Json/13.0.3": { + "Newtonsoft.Json/13.0.2": { "runtime": { "lib/net6.0/Newtonsoft.Json.dll": { "assemblyVersion": "13.0.0.0", - "fileVersion": "13.0.3.27908" + "fileVersion": "13.0.2.27524" } } }, @@ -491,6 +530,17 @@ } } }, + "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" + } + } + }, "SQLitePCLRaw.bundle_e_sqlite3/2.1.4": { "dependencies": { "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", @@ -656,12 +706,12 @@ } } }, - "SqlSugarCore/5.1.4.95": { + "SqlSugarCore/5.1.4.115": { "dependencies": { "Microsoft.Data.SqlClient": "2.1.4", "Microsoft.Data.Sqlite": "7.0.5", "MySqlConnector": "2.2.5", - "Newtonsoft.Json": "13.0.3", + "Newtonsoft.Json": "13.0.2", "Npgsql": "5.0.7", "Oracle.ManagedDataAccess.Core": "3.21.100", "SqlSugarCore.Dm": "1.2.0", @@ -671,8 +721,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 +745,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 +802,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 +933,14 @@ "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.Memory/4.5.3": {}, "System.Reflection/4.3.0": { "dependencies": { @@ -1167,6 +1240,13 @@ "path": "autofac.extensions.dependencyinjection/8.0.0", "hashPath": "autofac.extensions.dependencyinjection.8.0.0.nupkg.sha512" }, + "AutoMapper/13.0.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/Fx1SbJ16qS7dU4i604Sle+U9VLX+WSNVJggk6MupKVkYvvBm4XqYaeFuf67diHefHKHs50uQIS2YEDFhPCakQ==", + "path": "automapper/13.0.1", + "hashPath": "automapper.13.0.1.nupkg.sha512" + }, "DotNetty.Buffers/0.7.5": { "type": "package", "serviceable": true, @@ -1265,6 +1345,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 +1366,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 +1401,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", @@ -1419,12 +1513,12 @@ "path": "mysqlconnector/2.2.5", "hashPath": "mysqlconnector.2.2.5.nupkg.sha512" }, - "Newtonsoft.Json/13.0.3": { + "Newtonsoft.Json/13.0.2": { "type": "package", "serviceable": true, - "sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", - "path": "newtonsoft.json/13.0.3", - "hashPath": "newtonsoft.json.13.0.3.nupkg.sha512" + "sha512": "sha512-R2pZ3B0UjeyHShm9vG+Tu0EBb2lC8b0dFzV9gVn50ofHXh9Smjk6kTn7A/FdAsC8B5cKib1OnGYOXxRBz5XQDg==", + "path": "newtonsoft.json/13.0.2", + "hashPath": "newtonsoft.json.13.0.2.nupkg.sha512" }, "Npgsql/5.0.7": { "type": "package", @@ -1440,6 +1534,13 @@ "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" + }, "SQLitePCLRaw.bundle_e_sqlite3/2.1.4": { "type": "package", "serviceable": true, @@ -1475,12 +1576,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 +1597,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 +1632,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 +1688,13 @@ "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.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..6018414 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\\Administrator\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\Administrator\\.nuget\\packages", + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configProperties": { "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true diff --git a/WpfStarter/App.xaml.cs b/WpfStarter/App.xaml.cs index 2e55232..851d176 100644 --- a/WpfStarter/App.xaml.cs +++ b/WpfStarter/App.xaml.cs @@ -1,7 +1,10 @@ -using System.Windows; +using System; +using System.IO; +using System.Windows; using Autofac; using HybirdFrameworkCore.Autofac; using HybirdFrameworkCore.Configuration; +using log4net.Config; using SqlSugar; using SqlSugar.IOC; @@ -14,6 +17,7 @@ public partial class App : Application { public App() { + XmlConfigurator.ConfigureAndWatch(new FileInfo(AppDomain.CurrentDomain.BaseDirectory + @"\log4net.config")); var cb = new ContainerBuilder(); cb.Register(c => { @@ -50,4 +54,4 @@ public partial class App : Application var mainWindow = AppInfo.Container.Resolve(); mainWindow.Show(); } -} \ No newline at end of file +} diff --git a/WpfStarter/WpfStarter.csproj b/WpfStarter/WpfStarter.csproj index 65f8c60..d43af5b 100644 --- a/WpfStarter/WpfStarter.csproj +++ b/WpfStarter/WpfStarter.csproj @@ -16,7 +16,7 @@ - + Always diff --git a/WpfStarter/log4net.xml b/WpfStarter/log4net.config similarity index 100% rename from WpfStarter/log4net.xml rename to WpfStarter/log4net.config