From 2ea526d0e3ff6423d7f5ebda11f095bf43da0a9d Mon Sep 17 00:00:00 2001 From: "David P.G" Date: Fri, 4 Jul 2025 14:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Entities/DbDevice.cs | 5 +++++ Models/Device.cs | 6 ++++++ Views/Dialogs/DeviceDialog.xaml | 2 +- Views/VariableTableView.xaml | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Data/Entities/DbDevice.cs b/Data/Entities/DbDevice.cs index 03e5865..d3745d4 100644 --- a/Data/Entities/DbDevice.cs +++ b/Data/Entities/DbDevice.cs @@ -49,6 +49,11 @@ public class DbDevice /// public string Name { get; set; } + /// + /// 设备的端口号。 + /// + public int Prot { get; set; } + /// /// 设备的通信协议类型。 /// diff --git a/Models/Device.cs b/Models/Device.cs index 3dd8ff6..edda0e3 100644 --- a/Models/Device.cs +++ b/Models/Device.cs @@ -58,6 +58,12 @@ public partial class Device : ObservableObject [ObservableProperty] private string name; + /// + /// 设备的端口号。 + /// + [ObservableProperty] + private int prot; + /// /// 设备的通信协议类型。 /// diff --git a/Views/Dialogs/DeviceDialog.xaml b/Views/Dialogs/DeviceDialog.xaml index 3dc7d61..9e01efc 100644 --- a/Views/Dialogs/DeviceDialog.xaml +++ b/Views/Dialogs/DeviceDialog.xaml @@ -82,7 +82,7 @@ HorizontalAlignment="Left" Style="{StaticResource TextBlockSubTitle}" /> + Text="{Binding Device.Prot, UpdateSourceTrigger=PropertyChanged}" /> diff --git a/Views/VariableTableView.xaml b/Views/VariableTableView.xaml index 7fd4054..56d4181 100644 --- a/Views/VariableTableView.xaml +++ b/Views/VariableTableView.xaml @@ -68,8 +68,9 @@ - + +