From e9d9e67851a7723fcfae892687031e382d39cc65 Mon Sep 17 00:00:00 2001 From: YONGYE Date: Fri, 10 Oct 2025 15:58:01 +0800 Subject: [PATCH] =?UTF-8?q?UI=E8=BF=9B=E8=A1=8C=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.xaml.cs | 7 +- MainWindow.xaml | 368 +++++++++++++++++++++- MainWindow.xaml.cs | 351 +++++++++++++++++++++ WpfApp.csproj | 30 ++ src/components/SensorChart.xaml | 214 +++++++++++++ src/components/SensorChart.xaml.cs | 243 ++++++++++++++ src/public/Icons/main1-file-icon.png | Bin 0 -> 3768 bytes src/public/Icons/main2-config-icon.png | Bin 0 -> 4203 bytes src/public/Icons/main3-standard-icon.png | Bin 0 -> 5169 bytes src/public/Icons/main4-detection-icon.png | Bin 0 -> 6258 bytes src/public/Icons/main5-gauge-icon.png | Bin 0 -> 4589 bytes src/public/Icons/main6-cgCgk-icon.png | Bin 0 -> 4589 bytes src/public/Icons/main7-sysSet-icon.png | Bin 0 -> 9125 bytes src/public/Icons/main8-exit-icon.png | Bin 0 -> 5388 bytes src/view/CgCgkPage.xaml | 15 + src/view/CgCgkPage.xaml.cs | 28 ++ src/view/ConfigPage.xaml | 243 ++++++++++++++ src/view/ConfigPage.xaml.cs | 137 ++++++++ src/view/FilePage.xaml | 101 ++++++ src/view/FilePage.xaml.cs | 153 +++++++++ src/view/GaugePage.xaml | 267 ++++++++++++++++ src/view/GaugePage.xaml.cs | 28 ++ src/view/StandardPage.xaml | 259 +++++++++++++++ src/view/StandardPage.xaml.cs | 28 ++ src/view/SysSetPage.xaml | 283 +++++++++++++++++ src/view/SysSetPage.xaml.cs | 102 ++++++ 26 files changed, 2852 insertions(+), 5 deletions(-) create mode 100644 src/components/SensorChart.xaml create mode 100644 src/components/SensorChart.xaml.cs create mode 100644 src/public/Icons/main1-file-icon.png create mode 100644 src/public/Icons/main2-config-icon.png create mode 100644 src/public/Icons/main3-standard-icon.png create mode 100644 src/public/Icons/main4-detection-icon.png create mode 100644 src/public/Icons/main5-gauge-icon.png create mode 100644 src/public/Icons/main6-cgCgk-icon.png create mode 100644 src/public/Icons/main7-sysSet-icon.png create mode 100644 src/public/Icons/main8-exit-icon.png create mode 100644 src/view/CgCgkPage.xaml create mode 100644 src/view/CgCgkPage.xaml.cs create mode 100644 src/view/ConfigPage.xaml create mode 100644 src/view/ConfigPage.xaml.cs create mode 100644 src/view/FilePage.xaml create mode 100644 src/view/FilePage.xaml.cs create mode 100644 src/view/GaugePage.xaml create mode 100644 src/view/GaugePage.xaml.cs create mode 100644 src/view/StandardPage.xaml create mode 100644 src/view/StandardPage.xaml.cs create mode 100644 src/view/SysSetPage.xaml create mode 100644 src/view/SysSetPage.xaml.cs diff --git a/App.xaml.cs b/App.xaml.cs index 8861b7c..9b2d50d 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -22,7 +22,9 @@ namespace WpfApp /// 如果硬件已绑定且匹配返回true,否则返回false private static bool CheckHardwareBinding() { - string storedHardwareId = "8f07378cbfb5247c6481694a0ba0cb0b74739eddcc91f591623409a45803ee69"; + //string storedHardwareId = "8f07378cbfb5247c6481694a0ba0cb0b74739eddcc91f591623409a45803ee69"; + string storedHardwareId = "2703a031ecb416bd4ef9b91a5bd5f8698f745bb9efcbf7da35d251d0491b9cd8"; + return HardwareInfo.ValidateHardwareId(storedHardwareId); } /// @@ -59,6 +61,7 @@ namespace WpfApp if (!CheckHardwareBinding()) { MessageBox.Show("检测到硬件环境发生变化,应用程序无法启动!", "警告", MessageBoxButton.OK, MessageBoxImage.Warning); + Console.WriteLine($"硬件环境序列号:{HardwareInfo.GetHardwareId()}"); LogService.Log.Info($"硬件环境序列号:{HardwareInfo.GetHardwareId()}"); Shutdown(); // 退出应用程序 return; @@ -70,7 +73,7 @@ namespace WpfApp Shutdown(); // 退出应用程序 return; } - + try { // 获取主窗口实例并显示 diff --git a/MainWindow.xaml b/MainWindow.xaml index e1b0e8d..2f9a386 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -3,11 +3,373 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:WpfApp" + xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" + xmlns:local="clr-namespace:WpfApp.src.components" + mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> + Title="MainWindow" Height="800" Width="1200"> + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +