From 795631fa9d84a22f6ca12a73b6c15ba14a136879 Mon Sep 17 00:00:00 2001 From: "zhengxuan.zhang" Date: Wed, 11 Mar 2026 15:58:27 +0800 Subject: [PATCH] =?UTF-8?q?#0002=20=E8=B0=83=E6=95=B4=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XplorePlane/ViewModels/MainViewModel.cs | 325 +----- XplorePlane/Views/MainWindow.xaml | 83 +- XplorePlane/XplorePlane.csproj | 12 - .../bin/Debug/net6.0-windows/DryIoc.dll | Bin 568832 -> 0 bytes .../Microsoft.Xaml.Behaviors.dll | Bin 145792 -> 0 bytes .../Debug/net6.0-windows/Prism.DryIoc.Wpf.dll | Bin 27232 -> 0 bytes .../bin/Debug/net6.0-windows/Prism.Wpf.dll | Bin 135264 -> 0 bytes .../bin/Debug/net6.0-windows/Prism.dll | Bin 91232 -> 0 bytes .../net6.0-windows/XplorePlane.deps.json | 109 -- .../bin/Debug/net6.0-windows/XplorePlane.dll | Bin 30720 -> 0 bytes .../bin/Debug/net6.0-windows/XplorePlane.exe | Bin 151040 -> 0 bytes .../bin/Debug/net6.0-windows/XplorePlane.pdb | Bin 20844 -> 0 bytes .../XplorePlane.runtimeconfig.json | 15 - ...CoreApp,Version=v6.0.AssemblyAttributes.cs | 4 - XplorePlane/obj/Debug/net6.0-windows/App.g.cs | 55 - .../GeneratedInternalTypeHelper.g.cs | 2 - .../net6.0-windows/Views/MainWindow.baml | Bin 6165 -> 0 bytes .../net6.0-windows/Views/MainWindow.g.cs | 75 -- .../net6.0-windows/XplorePl.321B731D.Up2Date | 0 .../XplorePlane.AssemblyInfo.cs | 24 - .../XplorePlane.AssemblyInfoInputs.cache | 1 - ....GeneratedMSBuildEditorConfig.editorconfig | 18 - .../net6.0-windows/XplorePlane.assets.cache | Bin 7155 -> 0 bytes ...XplorePlane.csproj.AssemblyReference.cache | Bin 2247 -> 0 bytes ...XplorePlane.csproj.CoreCompileInputs.cache | 1 - .../XplorePlane.csproj.FileListAbsolute.txt | 28 - .../obj/Debug/net6.0-windows/XplorePlane.dll | Bin 30720 -> 0 bytes .../net6.0-windows/XplorePlane.g.resources | Bin 6405 -> 0 bytes .../XplorePlane.genruntimeconfig.cache | 1 - .../obj/Debug/net6.0-windows/XplorePlane.pdb | Bin 20844 -> 0 bytes .../XplorePlane_MarkupCompile.cache | 20 - .../XplorePlane_MarkupCompile.lref | 4 - ...plorePlane_zezjgrb4_wpftmp.AssemblyInfo.cs | 24 - ...e_zezjgrb4_wpftmp.AssemblyInfoInputs.cache | 1 - ....GeneratedMSBuildEditorConfig.editorconfig | 18 - .../XplorePlane_zezjgrb4_wpftmp.assets.cache | Bin 7155 -> 0 bytes .../obj/Debug/net6.0-windows/apphost.exe | Bin 151040 -> 0 bytes .../Debug/net6.0-windows/ref/XplorePlane.dll | Bin 13312 -> 0 bytes .../net6.0-windows/refint/XplorePlane.dll | Bin 13312 -> 0 bytes .../obj/XplorePlane.csproj.nuget.dgspec.json | 82 -- .../obj/XplorePlane.csproj.nuget.g.props | 19 - .../obj/XplorePlane.csproj.nuget.g.targets | 2 - XplorePlane/obj/project.assets.json | 1010 ----------------- XplorePlane/obj/project.nuget.cache | 24 - XplorePlane/structure.txt | 44 - 45 files changed, 58 insertions(+), 1943 deletions(-) delete mode 100644 XplorePlane/XplorePlane.csproj delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/DryIoc.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/Microsoft.Xaml.Behaviors.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.DryIoc.Wpf.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.Wpf.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/Prism.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.deps.json delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.dll delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.exe delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.pdb delete mode 100644 XplorePlane/bin/Debug/net6.0-windows/XplorePlane.runtimeconfig.json delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/App.g.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/Views/MainWindow.baml delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/Views/MainWindow.g.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePl.321B731D.Up2Date delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.AssemblyInfo.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.AssemblyInfoInputs.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.GeneratedMSBuildEditorConfig.editorconfig delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.assets.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.AssemblyReference.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.CoreCompileInputs.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.csproj.FileListAbsolute.txt delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.dll delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.g.resources delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.genruntimeconfig.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane.pdb delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_MarkupCompile.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_MarkupCompile.lref delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.AssemblyInfo.cs delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.AssemblyInfoInputs.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.GeneratedMSBuildEditorConfig.editorconfig delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/XplorePlane_zezjgrb4_wpftmp.assets.cache delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/apphost.exe delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/ref/XplorePlane.dll delete mode 100644 XplorePlane/obj/Debug/net6.0-windows/refint/XplorePlane.dll delete mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.dgspec.json delete mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.g.props delete mode 100644 XplorePlane/obj/XplorePlane.csproj.nuget.g.targets delete mode 100644 XplorePlane/obj/project.assets.json delete mode 100644 XplorePlane/obj/project.nuget.cache delete mode 100644 XplorePlane/structure.txt diff --git a/XplorePlane/ViewModels/MainViewModel.cs b/XplorePlane/ViewModels/MainViewModel.cs index 49ffc96..d0632a4 100644 --- a/XplorePlane/ViewModels/MainViewModel.cs +++ b/XplorePlane/ViewModels/MainViewModel.cs @@ -1,312 +1,33 @@ -// MainViewModel.cs -using System; +using Prism.Commands; +using Prism.Mvvm; using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using System.Windows.Input; -using XplorePlane.Models; namespace XplorePlane.ViewModels { - /// - /// Root ViewModel for the MainWindow. - /// Implements INotifyPropertyChanged for two-way data binding. - /// - public class MainViewModel : INotifyPropertyChanged + public class MainViewModel : BindableBase { - // ── INotifyPropertyChanged ──────────────────────────────────── - public event PropertyChangedEventHandler PropertyChanged; - protected void OnPropertyChanged([CallerMemberName] string name = null) - => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + private string _licenseInfo = "ǰʱ"; + + + public ObservableCollection NavigationTree { get; set; } + + public DelegateCommand NavigateHomeCommand { get; set; } + public DelegateCommand NavigateInspectCommand { get; set; } + public DelegateCommand OpenFileCommand { get; set; } + public DelegateCommand ExportCommand { get; set; } + public DelegateCommand ClearCommand { get; set; } + public DelegateCommand EditPropertiesCommand { get; set; } - // ── Constructor ─────────────────────────────────────────────── public MainViewModel() { - // Seed navigation tree - NavigationTree = new ObservableCollection - { - new NavGroupNode("参考模型") - { - Children = new ObservableCollection - { - new NavGroupNode("007模型.stp") - { - Children = new ObservableCollection - { - new NavLeafNode("圆柱 2 -ref", IconColor: "#00AAFF"), - new NavLeafNode("圆柱 1 -ref", IconColor: "#00AAFF"), - new NavLeafNode("球 1 -ref", IconColor: "#FFAA00"), - new NavLeafNode("圆 1 -ref", IconColor: "#888888"), - new NavLeafNode("圆 2 -ref", IconColor: "#888888"), - new NavLeafNode("圆 3 -ref", IconColor: "#888888"), - new NavLeafNode("圆 4 -ref", IconColor: "#888888"), - } - } - } - }, - new NavGroupNode("目标模型") - { - Children = new ObservableCollection - { - new NavGroupNode("007数据.sti") - { - Children = new ObservableCollection - { - new NavLeafNode("圆柱 2 -tgt", IconColor: "#00AAFF"), - new NavLeafNode("圆柱 1 -tgt", IconColor: "#00AAFF", IsSelected: true), - new NavLeafNode("球 1 -tgt", IconColor: "#FFAA00"), - new NavLeafNode("圆 1 -tgt", IconColor: "#888888"), - new NavLeafNode("圆 2 -tgt", IconColor: "#888888"), - new NavLeafNode("圆 3 -tgt", IconColor: "#888888"), - new NavLeafNode("圆 4 -tgt", IconColor: "#888888"), - } - } - } - }, - new NavGroupNode("特征分类") - { - Children = new ObservableCollection - { - new NavLeafNode("默认特征分页", IconColor: "#888888") - } - } - }; - - // Seed inspection callouts - InspectionCallouts = new ObservableCollection - { - new InspectionCalloutVM("圆柱 1 -ref", 310, 270, - new[] - { - new CalloutRowVM("X", "20.0001", "19.7591", "±0.1000", "-0.2410", false), - new CalloutRowVM("Y", "79.9998", "79.2057", "±0.1000", "-0.7941", false), - new CalloutRowVM("Z", "12.0000", "12.6008", "±0.1000", "0.6008", false), - new CalloutRowVM("半径","5.0000", "4.9933", "±0.1000", "-0.0067", true), - new CalloutRowVM("圆3","300", "9.9866", "±0.1000", "-0.0134", true), - new CalloutRowVM("高度","15.0001","15.0028", "±0.1000", "0.0027", true), - }), - new InspectionCalloutVM("圆柱 2 -ref", 665, 270, - new[] - { - new CalloutRowVM("X", "180.0000","179.8487","±0.1000","-0.1513", false), - new CalloutRowVM("Y", "79.9999", "81.0710", "±0.1000", "1.0711", false), - new CalloutRowVM("Z", "35.0000", "27.3757", "±0.1000","-7.6243", false), - new CalloutRowVM("半径","5.0000", "4.9656", "±0.1000","-0.0344", true), - new CalloutRowVM("直径","10.0000","9.9311", "±0.1000","-0.0689", true), - new CalloutRowVM("高度","15.0001","15.0014", "±0.1000", "0.0013", true), - }), - new InspectionCalloutVM("球 1 -ref", 455, 415, - new[] - { - new CalloutRowVM("X", "60.0000","60.0000","±0.1000", "0.0000", true), - new CalloutRowVM("Y", "20.0000","20.0000","±0.1000","-0.0000",true), - new CalloutRowVM("Z", "20.0000","20.0000","±0.1000", "0.0000", true), - new CalloutRowVM("半径","12.0000","11.8959","±0.1000","-0.1041",false), - }), - }; - - // Selected feature (matches 圆柱 1) - SelectedFeature = new FeatureProperties - { - Name = "圆柱 1", - DatumLabel = "空", - X = 19.7591, - Y = 79.2067, - Z = 12.6008, - NrX = 0.0163, - NrY = 0.1049, - NrZ = 0.9943, - Height = 15.0028, - Radius = 4.9933, - Diameter = 9.9866, - }; - - // Status bar defaults - LicenseInfo = "软件购买类型: 通用;截止日期: 2025/6/30"; - ConnectionStatus = "Polyworks未连接"; - FpsInfo = "Fps = 0"; - TempInfo = "TempS = 0 ℃"; - CurrentTime = "AM 38%"; - ZoomLevel = 38; + NavigationTree = new ObservableCollection(); + + NavigateHomeCommand = new DelegateCommand(() => { }); + NavigateInspectCommand = new DelegateCommand(() => { }); + OpenFileCommand = new DelegateCommand(() => { }); + ExportCommand = new DelegateCommand(() => { }); + ClearCommand = new DelegateCommand(() => { }); + EditPropertiesCommand = new DelegateCommand(() => { }); } - - // ── Navigation Tree ─────────────────────────────────────────── - public ObservableCollection NavigationTree { get; } - - // ── Inspection Callouts ─────────────────────────────────────── - public ObservableCollection InspectionCallouts { get; } - - // ── Selected Feature Properties ─────────────────────────────── - private FeatureProperties _selectedFeature = new(); - public FeatureProperties SelectedFeature - { - get => _selectedFeature; - set { _selectedFeature = value; OnPropertyChanged(); } - } - - // ── Status Bar ──────────────────────────────────────────────── - private string _licenseInfo = string.Empty; - public string LicenseInfo - { - get => _licenseInfo; - set { _licenseInfo = value; OnPropertyChanged(); } - } - - private string _connectionStatus = string.Empty; - public string ConnectionStatus - { - get => _connectionStatus; - set { _connectionStatus = value; OnPropertyChanged(); } - } - - private string _fpsInfo = string.Empty; - public string FpsInfo - { - get => _fpsInfo; - set { _fpsInfo = value; OnPropertyChanged(); } - } - - private string _tempInfo = string.Empty; - public string TempInfo - { - get => _tempInfo; - set { _tempInfo = value; OnPropertyChanged(); } - } - - private string _currentTime = string.Empty; - public string CurrentTime - { - get => _currentTime; - set { _currentTime = value; OnPropertyChanged(); } - } - - private int _zoomLevel = 100; - public int ZoomLevel - { - get => _zoomLevel; - set { _zoomLevel = value; OnPropertyChanged(); } - } - - // ── Geometry Selection Flags ────────────────────────────────── - private bool _isPointSelected; - public bool IsPointSelected - { - get => _isPointSelected; - set { _isPointSelected = value; OnPropertyChanged(); } - } - - private bool _isPlaneSelected; - public bool IsPlaneSelected - { - get => _isPlaneSelected; - set { _isPlaneSelected = value; OnPropertyChanged(); } - } - - private bool _isCylinderSelected; - public bool IsCylinderSelected - { - get => _isCylinderSelected; - set { _isCylinderSelected = value; OnPropertyChanged(); } - } - - private bool _isSurfacePointSelected; - public bool IsSurfacePointSelected - { - get => _isSurfacePointSelected; - set { _isSurfacePointSelected = value; OnPropertyChanged(); } - } - - private bool _isCircleSelected; - public bool IsCircleSelected - { - get => _isCircleSelected; - set { _isCircleSelected = value; OnPropertyChanged(); } - } - - private bool _isSphereSelected; - public bool IsSphereSelected - { - get => _isSphereSelected; - set { _isSphereSelected = value; OnPropertyChanged(); } - } - - private bool _isLineSelected; - public bool IsLineSelected - { - get => _isLineSelected; - set { _isLineSelected = value; OnPropertyChanged(); } - } - - private bool _isSlotSelected; - public bool IsSlotSelected - { - get => _isSlotSelected; - set { _isSlotSelected = value; OnPropertyChanged(); } - } - - private bool _isFaceSelected; - public bool IsFaceSelected - { - get => _isFaceSelected; - set { _isFaceSelected = value; OnPropertyChanged(); } - } - - // ── Commands ────────────────────────────────────────────────── - public ICommand OpenFileCommand => new RelayCommand(_ => OpenFile()); - public ICommand ExportCommand => new RelayCommand(_ => Export()); - public ICommand ClearCommand => new RelayCommand(_ => Clear()); - public ICommand OpenTemplateCommand => new RelayCommand(_ => OpenTemplate()); - public ICommand SaveTemplateCommand => new RelayCommand(_ => SaveTemplate()); - public ICommand TemplateInspectCommand => new RelayCommand(_ => TemplateInspect()); - public ICommand GdtInspectCommand => new RelayCommand(_ => GdtInspect()); - public ICommand AutoAlignCommand => new RelayCommand(_ => AutoAlign()); - public ICommand NPointAlignCommand => new RelayCommand(_ => NPointAlign()); - public ICommand FeatureAlignCommand => new RelayCommand(_ => FeatureAlign()); - public ICommand RpsAlignCommand => new RelayCommand(_ => RpsAlign()); - public ICommand AxisAlignCommand => new RelayCommand(_ => AxisAlign()); - public ICommand ImportMatrixCommand => new RelayCommand(_ => ImportMatrix()); - public ICommand CalcColorDiffCommand => new RelayCommand(_ => CalcColorDiff()); - public ICommand AnnotateCommand => new RelayCommand(_ => Annotate()); - public ICommand ReportInfoCommand => new RelayCommand(_ => ReportInfo()); - public ICommand SavePdfCommand => new RelayCommand(_ => SavePdf()); - public ICommand SaveCsvCommand => new RelayCommand(_ => SaveCsv()); - public ICommand NavigateHomeCommand => new RelayCommand(_ => NavigateHome()); - public ICommand NavigateInspectCommand => new RelayCommand(_ => NavigateInspect()); - public ICommand ToggleFullScreenCommand=> new RelayCommand(_ => ToggleFullScreen()); - public ICommand OpenOptionsCommand => new RelayCommand(_ => OpenOptions()); - public ICommand CollapseNavCommand => new RelayCommand(_ => CollapseNav()); - public ICommand EditPropertiesCommand => new RelayCommand(_ => EditProperties()); - public ICommand ClosePropertiesCommand => new RelayCommand(_ => CloseProperties()); - public ICommand ClearAnnotationsCommand=> new RelayCommand(_ => ClearAnnotations()); - public ICommand DeleteSelectionCommand => new RelayCommand(_ => DeleteSelection()); - - // ── Command Handlers (stub — wire up your services here) ────── - private void OpenFile() { /* Open file dialog */ } - private void Export() { /* Export dialog */ } - private void Clear() { /* Clear scene */ } - private void OpenTemplate() { /* Load template project */ } - private void SaveTemplate() { /* Save template project */ } - private void TemplateInspect() { /* Run template inspection */ } - private void GdtInspect() { /* GD&T inspection dialog */ } - private void AutoAlign() { /* Auto alignment */ } - private void NPointAlign() { /* N-point alignment dialog */ } - private void FeatureAlign() { /* Feature alignment */ } - private void RpsAlign() { /* RPS alignment */ } - private void AxisAlign() { /* Axis alignment */ } - private void ImportMatrix() { /* Import alignment matrix */ } - private void CalcColorDiff() { /* Calculate color difference */ } - private void Annotate() { /* Add annotation */ } - private void ReportInfo() { /* Report info dialog */ } - private void SavePdf() { /* Save PDF report */ } - private void SaveCsv() { /* Save CSV report */ } - private void NavigateHome() { /* Switch to Home tab */ } - private void NavigateInspect() { /* Switch to Inspect tab */ } - private void ToggleFullScreen(){ /* Toggle fullscreen */ } - private void OpenOptions() { /* Open options dialog */ } - private void CollapseNav() { /* Collapse navigation panel */ } - private void EditProperties() { /* Edit selected feature props */ } - private void CloseProperties() { /* Close properties panel */ } - private void ClearAnnotations(){ /* Clear all viewport annotations */ } - private void DeleteSelection() { /* Delete selected item */ } } -} \ No newline at end of file +} diff --git a/XplorePlane/Views/MainWindow.xaml b/XplorePlane/Views/MainWindow.xaml index 39a8690..ee7cf48 100644 --- a/XplorePlane/Views/MainWindow.xaml +++ b/XplorePlane/Views/MainWindow.xaml @@ -4,9 +4,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="clr-namespace:XplorePlane.ViewModels" + xmlns:fluent="urn:fluent-ribbon" mc:Ignorable="d" - Title="检测系统" - Height="768" Width="1136" + Title="XplorePlane" + Height="768" Width="1080" Background="#F5F5F5" WindowStartupLocation="CenterScreen"> @@ -15,46 +16,42 @@ + + + - - + - - + + + + + + + + + + + + + + + + + + + + + + + - - - - -