Files
XplorePlane/XP.Scan/ScanModule.cs
T
XplorePlane Developer 957157ae80 fix: 修复编译错误、BGA向导预览、算子重复插入及状态栏消息
## Compilation fixes
- Fix XAML namespace reference XplorePlane.Converters → XplorePlane.Helpers (EventLogView, StateDisplayView)
- Add missing using for ISampleTypeRepository / JsonSampleTypeRepository in App.xaml.cs
- Fix ILoggerService.Warn() calls using Exception as first arg instead of message string
- Serialize CncProgram to JSON when passing to MatrixLayout (expects string, not CncProgram object)
- Suppress CS8632 nullable annotation warnings project-wide

## BGA wizard fixes
- Fix preview not showing on step 3: force RefreshBgaPreview() when entering final step
- Add step validation in CanNext() to prevent skipping to preview with invalid inputs
- Notify NextCommand.CanExecuteChanged when inputs change
- Fix RunProgress runtime binding error: set Mode=OneWay for ProgressBar.Value

## Operator toolbox: prevent duplicate insertion
- Add static OperatorTarget property for direct dispatch to active pipeline
- PipelineEditorView registers as toolbox target on load (floating window only)
- CNC page sets initial target; PipelineEditorWindow resets to CNC pipeline on close
- '+' button inserts only to the active pipeline instead of broadcasting to all subscribers

## Pipeline editor status bar messages
- Add StatusBarMessageEvent / StatusBarMessagePayload to CommonEvents.cs
- PipelineEditorViewModel publishes status on all ops (add/remove/reorder/save/execute)
- MainViewModel subscribes and displays on main window bottom status bar
- Auto-clear after timeout (3s info, 5s error)

## docs
- Merge three architecture docs into consolidated XplorePlane-架构与结构说明.md
2026-07-24 15:59:16 +08:00

50 lines
2.1 KiB
C#

using System.Resources;
using Prism.Ioc;
using Prism.Modularity;
using XP.Common.Localization;
using XP.Common.Localization.Interfaces;
using XP.Scan.Services;
using XP.Scan.ViewModels;
using XP.Scan.Views;
namespace XP.Scan
{
/// <summary>
/// 3D 扫描模块 | 3D Scan Module
/// Prism 模块入口,注册扫描相关服务和视图
/// </summary>
[Module(ModuleName = "ScanModule")]
public class ScanModule : IModule
{
public void OnInitialized(IContainerProvider containerProvider)
{
// 注册模块级多语言资源 | Register module-level localization resources
var localizationService = containerProvider.Resolve<ILocalizationService>();
var resourceManager = new ResourceManager(
"XP.Scan.Resources.Resources",
typeof(ScanModule).Assembly);
localizationService.RegisterResourceSource("XP.Scan", resourceManager);
System.Console.WriteLine("[ScanModule] 模块已初始化 | Module initialized");
}
public void RegisterTypes(IContainerRegistry containerRegistry)
{
// 核心服务(单例,供主界面和其他模块共享)
containerRegistry.RegisterSingleton<IFovTrackingService, FovTrackingService>();
containerRegistry.RegisterSingleton<IVirtualRotationService, VirtualRotationService>();
containerRegistry.RegisterSingleton<IScanConfigSerializer, ScanConfigSerializer>();
containerRegistry.RegisterSingleton<IScanFileManager, ScanFileManager>();
containerRegistry.RegisterSingleton<ITraySignalService, TraySignalService>();
// Runner + ViewModel + Views
containerRegistry.Register<ScanRunner>();
containerRegistry.Register<XPScanViewModel>();
containerRegistry.Register<ScanWindow>();
containerRegistry.RegisterForNavigation<XPScanView>();
System.Console.WriteLine("[ScanModule] 类型注册完成 | Type registration completed");
}
}
}