957157ae80
## 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
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.ComponentModel;
|
|
using System.Windows;
|
|
using XP.Hardware.PLC.ViewModels;
|
|
|
|
namespace XP.Hardware.PLC.Views
|
|
{
|
|
/// <summary>
|
|
/// PLC 信号地址定义编辑器窗口 Code-Behind | PLC Signal Address Config Editor Window Code-Behind
|
|
/// </summary>
|
|
public partial class PlcAddrConfigEditorWindow : Window
|
|
{
|
|
private readonly PlcAddrConfigEditorViewModel _viewModel;
|
|
|
|
/// <summary>
|
|
/// 构造函数 | Constructor
|
|
/// </summary>
|
|
/// <param name="viewModel">编辑器 ViewModel | Editor ViewModel</param>
|
|
public PlcAddrConfigEditorWindow(PlcAddrConfigEditorViewModel viewModel)
|
|
{
|
|
InitializeComponent();
|
|
_viewModel = viewModel;
|
|
DataContext = _viewModel;
|
|
|
|
// 绑定窗口关闭回调 | Bind window close action
|
|
_viewModel.CloseAction = () => Close();
|
|
|
|
// 继承主窗口图标 | Inherit main window icon
|
|
if (Application.Current?.MainWindow != null)
|
|
{
|
|
Icon = Application.Current.MainWindow.Icon;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 窗口关闭时执行取消命令 | Execute cancel command on window closing
|
|
/// </summary>
|
|
protected override void OnClosing(CancelEventArgs e)
|
|
{
|
|
base.OnClosing(e);
|
|
}
|
|
}
|
|
}
|