#0007 更新ignore文件和RADEM.md

This commit is contained in:
zhengxuan.zhang
2026-03-13 18:10:12 +08:00
parent 59fc0d64d7
commit 27e89282d7
8 changed files with 47 additions and 425 deletions
+17 -12
View File
@@ -1,15 +1,20 @@
.vs/ProjectEvaluation/xploreplane.metadata.v10.bin # .gitignore 文件内容
.vs/ProjectEvaluation/xploreplane.projects.v10.bin # 忽略编译输出
.vs/ProjectEvaluation/xploreplane.strings.v10.bin **/bin/
.vs/XplorePlane/DesignTimeBuild/.dtbcache.v2 **/obj/
.vs/XplorePlane/FileContentIndex/241be4f9-f3c1-44c3-a625-51f3a7efa276.vsidx **/Debug/
.vs/XplorePlane/FileContentIndex/a28e3b89-b000-44c7-aab5-785c933af59b.vsidx **/Release/
.vs/XplorePlane/FileContentIndex/a475b41e-8352-4745-8040-08886d83ddf4.vsidx
.vs/XplorePlane/FileContentIndex/bdb864e9-e54b-49df-bf87-9b121265e567.vsidx # 忽略用户配置文件
.vs/XplorePlane/v18/.futdcache.v2 .vs/
.vs/XplorePlane/v18/.suo .vscode/
.vs/XplorePlane/v18/DocumentLayout.backup.json *.user
.vs/XplorePlane/v18/DocumentLayout.json *.suo
# 忽略Nuget包
packages/
*.nupkg
**/.vs
XplorePlane/obj/project.assets.json XplorePlane/obj/project.assets.json
XplorePlane/obj/* XplorePlane/obj/*
-70
View File
@@ -62,70 +62,6 @@ XplorePlane/
### 日志系统
项目通过引用 **XplorePlane.Common.dll** 库使用统一的日志功能,无需在本项目中重复实现。
- **日志框架**: Serilog 4.3.1(来自 XplorePlane.Common.dll
- **日志输出**: 控制台、文件(按天滚动)、调试输出
- **日志路径**: `logs/xploreplane-YYYYMMDD.log`
- **配置文件**: `App.config`
- **服务接口**: `XplorePlane.Common.Logging.Interfaces.ILoggerService`
**使用方式 1 - 使用 Serilog ILogger(推荐)**:
```csharp
using Serilog;
public class MyViewModel
{
private readonly ILogger _logger;
public MyViewModel(ILogger logger)
{
_logger = logger.ForContext<MyViewModel>();
}
public void DoSomething()
{
_logger.Information("执行操作");
_logger.Debug("调试信息:参数={Value}", someValue);
}
}
```
**使用方式 2 - 使用 XplorePlane.Common.ILoggerService**:
```csharp
using XplorePlane.Common.Logging.Interfaces;
public class MyService
{
private readonly ILoggerService _logger;
public MyService(ILoggerService logger)
{
_logger = logger.ForModule<MyService>();
}
public void DoWork()
{
_logger.Info("开始工作");
_logger.Debug("调试信息:参数={Value}", someValue);
}
}
```
详细使用指南请参考:
- [快速开始指南](QUICK_START.md)
- [日志集成说明](Doc/LOGGING_INTEGRATION.md)
- [日志使用示例](Services/LoggingUsageExample.cs)
### TO-DO List ### TO-DO List
- [x] 软件基于 WPF + Prism 基础的框架 - [x] 软件基于 WPF + Prism 基础的框架
@@ -136,10 +72,4 @@ public class MyService
- [ ] 打通与硬件层的调用流程 - [ ] 打通与硬件层的调用流程
- [ ] 打通与图像层的调用流程 - [ ] 打通与图像层的调用流程
### 文档
- [快速开始指南](QUICK_START.md) - 快速上手指南
- [DLL 集成方案](Doc/DLL_INTEGRATION.md) - 硬件库 DLL 集成方案
- [日志集成说明](Doc/LOGGING_INTEGRATION.md) - 日志系统集成说明
- [项目架构](Doc/PROJECT_ARCHITECTURE.md) - 项目整体架构
- [硬件集成技术方案](Doc/HARDWARE_INTEGRATION_TECHNICAL_SCHEME.md) - 硬件集成技术方案
+19 -3
View File
@@ -5,7 +5,6 @@ using XplorePlane.ViewModels;
using Prism.Ioc; using Prism.Ioc;
using Prism.DryIoc; using Prism.DryIoc;
using Serilog; using Serilog;
using XplorePlane.Common.Logging;
namespace XplorePlane namespace XplorePlane
{ {
@@ -16,8 +15,8 @@ namespace XplorePlane
{ {
protected override void OnStartup(StartupEventArgs e) protected override void OnStartup(StartupEventArgs e)
{ {
// 使用 XplorePlane.Common.dll 中的日志配置 // 配置 Serilog 日志系统
LoggerConfig.Initialize("XplorePlane"); ConfigureLogging();
// 捕获未处理的异常 // 捕获未处理的异常
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
@@ -30,10 +29,27 @@ namespace XplorePlane
bootstrapper.Run(); bootstrapper.Run();
} }
private void ConfigureLogging()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File("logs/xploreplane-.log",
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: 30)
.CreateLogger();
Log.Information("========================================");
Log.Information("XplorePlane 应用程序启动");
Log.Information("========================================");
}
protected override void OnExit(ExitEventArgs e) protected override void OnExit(ExitEventArgs e)
{ {
// 关闭并刷新日志 // 关闭并刷新日志
Log.Information("========================================");
Log.Information("XplorePlane 应用程序退出"); Log.Information("XplorePlane 应用程序退出");
Log.Information("========================================");
Log.CloseAndFlush(); Log.CloseAndFlush();
base.OnExit(e); base.OnExit(e);
} }
+11 -11
View File
@@ -1,13 +1,13 @@
using Prism.Commands; using Prism.Commands;
using Prism.Mvvm; using Prism.Mvvm;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using XplorePlane.Services; using Serilog;
namespace XplorePlane.ViewModels namespace XplorePlane.ViewModels
{ {
public class MainViewModel : BindableBase public class MainViewModel : BindableBase
{ {
private readonly ILoggerService _logger; private readonly ILogger _logger;
private string _licenseInfo = "当前时间"; private string _licenseInfo = "当前时间";
public string LicenseInfo public string LicenseInfo
@@ -25,9 +25,9 @@ namespace XplorePlane.ViewModels
public DelegateCommand ClearCommand { get; set; } public DelegateCommand ClearCommand { get; set; }
public DelegateCommand EditPropertiesCommand { get; set; } public DelegateCommand EditPropertiesCommand { get; set; }
public MainViewModel(ILoggerService logger) public MainViewModel(ILogger logger)
{ {
_logger = logger?.ForModule<MainViewModel>() ?? throw new System.ArgumentNullException(nameof(logger)); _logger = logger?.ForContext<MainViewModel>() ?? throw new System.ArgumentNullException(nameof(logger));
NavigationTree = new ObservableCollection<object>(); NavigationTree = new ObservableCollection<object>();
@@ -38,42 +38,42 @@ namespace XplorePlane.ViewModels
ClearCommand = new DelegateCommand(OnClear); ClearCommand = new DelegateCommand(OnClear);
EditPropertiesCommand = new DelegateCommand(OnEditProperties); EditPropertiesCommand = new DelegateCommand(OnEditProperties);
_logger.Info("MainViewModel 已初始化"); _logger.Information("MainViewModel 已初始化");
} }
private void OnNavigateHome() private void OnNavigateHome()
{ {
_logger.Info("导航到主页"); _logger.Information("导航到主页");
LicenseInfo = "主页"; LicenseInfo = "主页";
} }
private void OnNavigateInspect() private void OnNavigateInspect()
{ {
_logger.Info("导航到检测页面"); _logger.Information("导航到检测页面");
LicenseInfo = "检测页面"; LicenseInfo = "检测页面";
} }
private void OnOpenFile() private void OnOpenFile()
{ {
_logger.Info("打开文件"); _logger.Information("打开文件");
LicenseInfo = "打开文件"; LicenseInfo = "打开文件";
} }
private void OnExport() private void OnExport()
{ {
_logger.Info("导出数据"); _logger.Information("导出数据");
LicenseInfo = "导出数据"; LicenseInfo = "导出数据";
} }
private void OnClear() private void OnClear()
{ {
_logger.Info("清除数据"); _logger.Information("清除数据");
LicenseInfo = "清除数据"; LicenseInfo = "清除数据";
} }
private void OnEditProperties() private void OnEditProperties()
{ {
_logger.Info("编辑属性"); _logger.Information("编辑属性");
LicenseInfo = "编辑属性"; LicenseInfo = "编辑属性";
} }
} }
@@ -1,329 +0,0 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"XplorePlane/1.0.0": {
"dependencies": {
"Fluent.Ribbon": "9.0.0",
"Prism.DryIoc": "9.0.537",
"Serilog": "4.3.1",
"Serilog.Sinks.Console": "6.1.1",
"Serilog.Sinks.Debug": "3.0.0",
"Serilog.Sinks.File": "7.0.0",
"System.Configuration.ConfigurationManager": "8.0.0"
},
"runtime": {
"XplorePlane.dll": {}
}
},
"ControlzEx/5.0.1": {
"dependencies": {
"Microsoft.Xaml.Behaviors.Wpf": "1.1.122",
"System.Text.Json": "5.0.1"
},
"runtime": {
"lib/net5.0-windows7.0/ControlzEx.dll": {
"assemblyVersion": "5.0.0.0",
"fileVersion": "5.0.1.15"
}
}
},
"DryIoc.dll/5.4.3": {
"runtime": {
"lib/net7.0/DryIoc.dll": {
"assemblyVersion": "5.4.3.0",
"fileVersion": "5.4.3.0"
}
}
},
"Fluent.Ribbon/9.0.0": {
"dependencies": {
"ControlzEx": "5.0.1"
},
"runtime": {
"lib/net5.0-windows7.0/Fluent.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.0.0"
}
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.1": {
"runtime": {
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
"assemblyVersion": "8.0.0.0",
"fileVersion": "8.0.324.11423"
}
}
},
"Microsoft.Xaml.Behaviors.Wpf/1.1.122": {
"runtime": {
"lib/net6.0-windows7.0/Microsoft.Xaml.Behaviors.dll": {
"assemblyVersion": "1.1.0.0",
"fileVersion": "1.1.122.28819"
}
}
},
"Prism.Container.Abstractions/9.0.106": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.1"
},
"runtime": {
"lib/net8.0/Prism.Container.Abstractions.dll": {
"assemblyVersion": "9.0.106.9543",
"fileVersion": "9.0.106.9543"
}
}
},
"Prism.Container.DryIoc/9.0.106": {
"dependencies": {
"DryIoc.dll": "5.4.3",
"Prism.Container.Abstractions": "9.0.106"
},
"runtime": {
"lib/net8.0/Prism.Container.DryIoc.dll": {
"assemblyVersion": "9.0.106.9543",
"fileVersion": "9.0.106.9543"
}
}
},
"Prism.Core/9.0.537": {
"dependencies": {
"Prism.Container.Abstractions": "9.0.106",
"Prism.Events": "9.0.537"
},
"runtime": {
"lib/net6.0/Prism.dll": {
"assemblyVersion": "9.0.537.60525",
"fileVersion": "9.0.537.60525"
}
}
},
"Prism.DryIoc/9.0.537": {
"dependencies": {
"Prism.Container.DryIoc": "9.0.106",
"Prism.Wpf": "9.0.537"
},
"runtime": {
"lib/net6.0-windows7.0/Prism.DryIoc.Wpf.dll": {
"assemblyVersion": "9.0.537.60525",
"fileVersion": "9.0.537.60525"
}
}
},
"Prism.Events/9.0.537": {
"runtime": {
"lib/net6.0/Prism.Events.dll": {
"assemblyVersion": "9.0.537.60525",
"fileVersion": "9.0.537.60525"
}
}
},
"Prism.Wpf/9.0.537": {
"dependencies": {
"Microsoft.Xaml.Behaviors.Wpf": "1.1.122",
"Prism.Core": "9.0.537"
},
"runtime": {
"lib/net6.0-windows7.0/Prism.Wpf.dll": {
"assemblyVersion": "9.0.537.60525",
"fileVersion": "9.0.537.60525"
}
}
},
"Serilog/4.3.1": {
"runtime": {
"lib/net8.0/Serilog.dll": {
"assemblyVersion": "4.3.0.0",
"fileVersion": "4.3.0.0"
}
}
},
"Serilog.Sinks.Console/6.1.1": {
"dependencies": {
"Serilog": "4.3.1"
},
"runtime": {
"lib/net8.0/Serilog.Sinks.Console.dll": {
"assemblyVersion": "6.1.1.0",
"fileVersion": "6.1.1.0"
}
}
},
"Serilog.Sinks.Debug/3.0.0": {
"dependencies": {
"Serilog": "4.3.1"
},
"runtime": {
"lib/net8.0/Serilog.Sinks.Debug.dll": {
"assemblyVersion": "3.0.0.0",
"fileVersion": "3.0.0.0"
}
}
},
"Serilog.Sinks.File/7.0.0": {
"dependencies": {
"Serilog": "4.3.1"
},
"runtime": {
"lib/net8.0/Serilog.Sinks.File.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.0.0"
}
}
},
"System.Configuration.ConfigurationManager/8.0.0": {
"dependencies": {
"System.Diagnostics.EventLog": "8.0.0",
"System.Security.Cryptography.ProtectedData": "8.0.0"
}
},
"System.Diagnostics.EventLog/8.0.0": {},
"System.Security.Cryptography.ProtectedData/8.0.0": {},
"System.Text.Json/5.0.1": {}
}
},
"libraries": {
"XplorePlane/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"ControlzEx/5.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-DVJJmmnKXcVh3Bs2gKpAdPCT8HrkYTagSbFg0P9xHjp8dox9bKeaoVj9VGhPRzP9+LHs5MUXxN07/oGqeXNNcg==",
"path": "controlzex/5.0.1",
"hashPath": "controlzex.5.0.1.nupkg.sha512"
},
"DryIoc.dll/5.4.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-yhXOG3SOxeWYxBAWskNRDD8fzw5hriEawv4VN4WKaFHOuubiop4kxe2rkWTEyCnTgRVgxVUSQCDBBkZqwPm1iQ==",
"path": "dryioc.dll/5.4.3",
"hashPath": "dryioc.dll.5.4.3.nupkg.sha512"
},
"Fluent.Ribbon/9.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-29N3G7EM1WFgNofj4wEaufFaB8Iakjn/CZskq3kHKR93myxJ2iV0k6xLH3rhg9l/QATboPExV0WONT/ZfQcOVg==",
"path": "fluent.ribbon/9.0.0",
"hashPath": "fluent.ribbon.9.0.0.nupkg.sha512"
},
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fGLiCRLMYd00JYpClraLjJTNKLmMJPnqxMaiRzEBIIvevlzxz33mXy39Lkd48hu1G+N21S7QpaO5ZzKsI6FRuA==",
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.1",
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.1.nupkg.sha512"
},
"Microsoft.Xaml.Behaviors.Wpf/1.1.122": {
"type": "package",
"serviceable": true,
"sha512": "sha512-SgcafT189u4qX++vSCV9FLQ4BsRXU9J2esnHA9IF8GOSgnPBulFw1CW4X/FYoOXvZwdDZxlSObJUGUg1U1wSyg==",
"path": "microsoft.xaml.behaviors.wpf/1.1.122",
"hashPath": "microsoft.xaml.behaviors.wpf.1.1.122.nupkg.sha512"
},
"Prism.Container.Abstractions/9.0.106": {
"type": "package",
"serviceable": true,
"sha512": "sha512-QNOERNOqsxvAa8pbWjqFB872DkvYK/cVRrcFO5vJYgWTIKBd8xfaI/jaZ0qeXLYVDz0nrvgJTZVVnip6+68dCw==",
"path": "prism.container.abstractions/9.0.106",
"hashPath": "prism.container.abstractions.9.0.106.nupkg.sha512"
},
"Prism.Container.DryIoc/9.0.106": {
"type": "package",
"serviceable": true,
"sha512": "sha512-g7UzyK4oRPmEGgz2CV976KTBFk+QPdfktyrL91kvI4YbHciQATO6/r1KFnyRnBE73il5v+SeXXKWIrvlMnsMdg==",
"path": "prism.container.dryioc/9.0.106",
"hashPath": "prism.container.dryioc.9.0.106.nupkg.sha512"
},
"Prism.Core/9.0.537": {
"type": "package",
"serviceable": true,
"sha512": "sha512-D7mEqPKLVNrD0g2WHCpC/MOKwn8h7X1liCWyjqjL7NCuxgwuhVLTG85E/ZPBkISrXdwvOQZ+bSY31bvP79FQlg==",
"path": "prism.core/9.0.537",
"hashPath": "prism.core.9.0.537.nupkg.sha512"
},
"Prism.DryIoc/9.0.537": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tnKifVxlKeSbNP2gZi+nMcjsi/w0lm3aLhBh92gWO6uCoa44ACM9gVJeO77ew4aHYZuoHUd6wHyeozfN7QKWuA==",
"path": "prism.dryioc/9.0.537",
"hashPath": "prism.dryioc.9.0.537.nupkg.sha512"
},
"Prism.Events/9.0.537": {
"type": "package",
"serviceable": true,
"sha512": "sha512-Pzp5MGUuhAyKXZUbHVYNWLGF/eA3sScqDN6VrzbWlKj85R0IS0q+JXe99umynso2xhXAe+1jrQCCkgqmEFCBng==",
"path": "prism.events/9.0.537",
"hashPath": "prism.events.9.0.537.nupkg.sha512"
},
"Prism.Wpf/9.0.537": {
"type": "package",
"serviceable": true,
"sha512": "sha512-srsXhi7FRUFawsNoRkY67duMEGjZo3ff0FpqpkjeWkkAuLazlH1UmNVrvwnpaLQCBboexH/z6oGrLvpeocxgdw==",
"path": "prism.wpf/9.0.537",
"hashPath": "prism.wpf.9.0.537.nupkg.sha512"
},
"Serilog/4.3.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-savYe7h5yRlkqBVOwP8cIRDOdqKiPmYCU4W87JH38sBmcKD5EBoXvQIw6bNEvZ/pTe1gsiye3VFCzBsoppGkXQ==",
"path": "serilog/4.3.1",
"hashPath": "serilog.4.3.1.nupkg.sha512"
},
"Serilog.Sinks.Console/6.1.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-8jbqgjUyZlfCuSTaJk6lOca465OndqOz3KZP6Cryt/IqZYybyBu7GP0fE/AXBzrrQB3EBmQntBFAvMVz1COvAA==",
"path": "serilog.sinks.console/6.1.1",
"hashPath": "serilog.sinks.console.6.1.1.nupkg.sha512"
},
"Serilog.Sinks.Debug/3.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-4BzXcdrgRX7wde9PmHuYd9U6YqycCC28hhpKonK7hx0wb19eiuRj16fPcPSVp0o/Y1ipJuNLYQ00R3q2Zs8FDA==",
"path": "serilog.sinks.debug/3.0.0",
"hashPath": "serilog.sinks.debug.3.0.0.nupkg.sha512"
},
"Serilog.Sinks.File/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fKL7mXv7qaiNBUC71ssvn/dU0k9t0o45+qm2XgKAlSt19xF+ijjxyA3R6HmCgfKEKwfcfkwWjayuQtRueZFkYw==",
"path": "serilog.sinks.file/7.0.0",
"hashPath": "serilog.sinks.file.7.0.0.nupkg.sha512"
},
"System.Configuration.ConfigurationManager/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-JlYi9XVvIREURRUlGMr1F6vOFLk7YSY4p1vHo4kX3tQ0AGrjqlRWHDi66ImHhy6qwXBG3BJ6Y1QlYQ+Qz6Xgww==",
"path": "system.configuration.configurationmanager/8.0.0",
"hashPath": "system.configuration.configurationmanager.8.0.0.nupkg.sha512"
},
"System.Diagnostics.EventLog/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-fdYxcRjQqTTacKId/2IECojlDSFvp7LP5N78+0z/xH7v/Tuw5ZAxu23Y6PTCRinqyu2ePx+Gn1098NC6jM6d+A==",
"path": "system.diagnostics.eventlog/8.0.0",
"hashPath": "system.diagnostics.eventlog.8.0.0.nupkg.sha512"
},
"System.Security.Cryptography.ProtectedData/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-+TUFINV2q2ifyXauQXRwy4CiBhqvDEDZeVJU7qfxya4aRYOKzVBpN+4acx25VcPB9ywUN6C0n8drWl110PhZEg==",
"path": "system.security.cryptography.protecteddata/8.0.0",
"hashPath": "system.security.cryptography.protecteddata.8.0.0.nupkg.sha512"
},
"System.Text.Json/5.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/UM3UK1dXKl8Ybysg/21gM4S8DJgkR+yLU8JwqCVbuNqQNImelntgYFAN5QxR8sJJ1kMx//hOUdf0lltosi8cQ==",
"path": "system.text.json/5.0.1",
"hashPath": "system.text.json.5.0.1.nupkg.sha512"
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.