From d54eb8816ecb8e6ed46ede1c81f455bc3eaa8e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Mon, 16 May 2022 09:47:49 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecDictionarys/GlobalStyle.xaml | 12 +- BPASmartClient/App.config | 14 +- BPASmartClient/App.xaml | 2 + .../Control/ShopDeviceConfigView.xaml | 1399 ++++++++--------- BPASmartClient/DeviceInfo.xml | 2 +- BPASmartClient/MainWindow.xaml | 2 +- 6 files changed, 686 insertions(+), 745 deletions(-) diff --git a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml index 2426ffba..8b6a4b0d 100644 --- a/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml +++ b/BPASmartClient.CustomResource/RecDictionarys/GlobalStyle.xaml @@ -4,5 +4,15 @@ xmlns:con="clr-namespace:BPASmartClient.CustomResource.Converters"> - + + + + + + + + + + + \ No newline at end of file diff --git a/BPASmartClient/App.config b/BPASmartClient/App.config index 2fb2713f..1caea14f 100644 --- a/BPASmartClient/App.config +++ b/BPASmartClient/App.config @@ -3,7 +3,7 @@ - + @@ -16,8 +16,10 @@ - - --> + --> + + + @@ -37,10 +39,10 @@ - - + + - + diff --git a/BPASmartClient/App.xaml b/BPASmartClient/App.xaml index 29cb2e65..a85b3559 100644 --- a/BPASmartClient/App.xaml +++ b/BPASmartClient/App.xaml @@ -13,6 +13,8 @@ + + diff --git a/BPASmartClient/Control/ShopDeviceConfigView.xaml b/BPASmartClient/Control/ShopDeviceConfigView.xaml index 358590c6..a242d89d 100644 --- a/BPASmartClient/Control/ShopDeviceConfigView.xaml +++ b/BPASmartClient/Control/ShopDeviceConfigView.xaml @@ -7,8 +7,8 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" xmlns:vm="clr-namespace:BPASmartClient.ViewModel;assembly=BPASmartClient.ViewModel" - d:DesignHeight="450" - d:DesignWidth="800" + d:DesignHeight="900" + d:DesignWidth="1200" mc:Ignorable="d"> @@ -19,6 +19,7 @@ + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -72,193 +323,204 @@ - - + - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + + + + + + + - - - + FontSize="20" + Foreground="#ff23caca" + IsEditable="False" + ItemsSource="{Binding ClientDevices}" + SelectedIndex="0" + Style="{StaticResource ComboBoxStyle}" + Text="{Binding ClientDeviceType}" /> - + - - + - - - - - + - - - - + - + - - @@ -54,7 +60,7 @@ - + diff --git a/BPASmartClient/MainWindow.xaml b/BPASmartClient/MainWindow.xaml index 52bd20cc..91442a31 100644 --- a/BPASmartClient/MainWindow.xaml +++ b/BPASmartClient/MainWindow.xaml @@ -102,17 +102,11 @@ Header="设备监视" Tag="DeviceMonitorView" /> - - + Tag="IOTView" /> From d3c53106717d7e63a1c65c4eb18d206f25cba2a5 Mon Sep 17 00:00:00 2001 From: fyf Date: Mon, 16 May 2022 15:50:16 +0800 Subject: [PATCH 04/13] 232 --- BPASmartClient.ViewModel/LogViewModel.cs | 4 ++-- BPASmartClient/Control/LogView.xaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BPASmartClient.ViewModel/LogViewModel.cs b/BPASmartClient.ViewModel/LogViewModel.cs index 09088d00..0d137903 100644 --- a/BPASmartClient.ViewModel/LogViewModel.cs +++ b/BPASmartClient.ViewModel/LogViewModel.cs @@ -142,7 +142,7 @@ namespace BPASmartClient.ViewModel BookExs.Add(new BookEx(new Book() { Name = "一般日志", Tag = "Info" }) { IsChecked = true }); BookExs.Add(new BookEx(new Book() { Name = "设备日志", Tag = "DeviceLog" }) { IsChecked = true }); BookExs.Add(new BookEx(new Book() { Name = "错误日志", Tag = "Error" }) { IsChecked = true }); - BookExs.Add(new BookEx(new Book() { Name = "设备告警", Tag = "DeviceAlarm" }) { IsChecked = true }); + BookExs.Add(new BookEx(new Book() { Name = "告警日志", Tag = "DeviceAlarm" }) { IsChecked = true }); SelectBookExs = new ObservableCollection(); ItemPropertyChanged(new BookEx(new Book()) { IsChecked = true }, new PropertyChangedEventArgs("IsChecked")); //一般日志 @@ -334,7 +334,7 @@ namespace BPASmartClient.ViewModel SelectBookExs.Clear(); foreach (BookEx item in bookExs) { - builder.Append(item.BookN.Name + ","); + builder.Append(item.BookN.Name.Replace("日志","") + ","); SelectBookExs.Add((BookEx)item); } SelectedText = builder == null ? string.Empty : builder.ToString(); diff --git a/BPASmartClient/Control/LogView.xaml b/BPASmartClient/Control/LogView.xaml index 28b1a173..b32fd271 100644 --- a/BPASmartClient/Control/LogView.xaml +++ b/BPASmartClient/Control/LogView.xaml @@ -26,10 +26,10 @@ - + - + From 1f4f46061efecc9b1567531729de39989d595b91 Mon Sep 17 00:00:00 2001 From: fyf Date: Tue, 17 May 2022 10:13:39 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=A7=A3=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Themes/GenricStyle.xaml | 46 +++++++++++ BPASmartClient.Helper/AESHelper.cs | 80 +++++++++++++++++++ BPASmartClient/App.config | 5 +- BPASmartClient/Control/DataVView.xaml | 12 ++- BPASmartClient/Control/DataVView.xaml.cs | 27 ++++++- 5 files changed, 166 insertions(+), 4 deletions(-) create mode 100644 BPASmartClient.Helper/AESHelper.cs diff --git a/BPASmartClient.CustomResource/Themes/GenricStyle.xaml b/BPASmartClient.CustomResource/Themes/GenricStyle.xaml index 8561efb6..f82209c3 100644 --- a/BPASmartClient.CustomResource/Themes/GenricStyle.xaml +++ b/BPASmartClient.CustomResource/Themes/GenricStyle.xaml @@ -123,6 +123,52 @@ + + + + + --> + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - @@ -511,6 +513,20 @@ + + + + + + Text="{Binding deviceConfig[0].ShopName}" /> + Text="{Binding deviceConfig[0].ShopId}" /> - + @@ -584,7 +600,7 @@ Margin="0" HorizontalAlignment="Left" Style="{StaticResource TextBoxStyle}" - Text="255.255.255.255" /> + Text="{Binding SelectedValue.DeviceName, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.DeviceId, ElementName=tv, Mode=TwoWay}" /> - + @@ -623,7 +639,7 @@ Width="170" HorizontalAlignment="Left" Style="{StaticResource TextBoxStyle}" - Text="{Binding Path=Device.IP}" /> + Text="{Binding SelectedValue.communicationPar.IPAddress, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.IPPort, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.StationNo, ElementName=tv, Mode=TwoWay}" /> @@ -657,7 +673,7 @@ + Visibility="{Binding SelectedValue.communicationPar.CommunicationType, ElementName=tv, Mode=TwoWay, Converter={StaticResource VisibleTypeConverter}, ConverterParameter=SerialPort}"> @@ -694,7 +710,7 @@ ItemsSource="{Binding Path=Device.Ports}" SelectedIndex="0" Style="{StaticResource ComboBoxStyle}" - Text="{Binding Path=Device.ComSerialPort}" /> + Text="{Binding SelectedValue.communicationPar.SerialPort, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.BaudRate, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.Parity, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.DataBits, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.StopBits, ElementName=tv, Mode=TwoWay}" /> + Text="{Binding SelectedValue.communicationPar.StationNo, ElementName=tv, Mode=TwoWay}" /> diff --git a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs index 2cb92a67..c30ebd46 100644 --- a/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs +++ b/BPASmartClient/Control/ShopDeviceConfigView.xaml.cs @@ -13,6 +13,8 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using BPASmartClient.DialogWindow; +using BPASmartClient.ViewModel; +using BPASmartClient.ViewModel.Model; namespace BPASmartClient.Control { @@ -31,5 +33,67 @@ namespace BPASmartClient.Control NewShopWindow newShopWindow = new NewShopWindow(); newShopWindow.ShowDialog(); } + + private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) + { + + Refresh(); + } + + private void tv_MouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + //if (e.ButtonState == MouseButtonState.Pressed) + //{ + // Refresh(); + //} + } + + private void Refresh() + { + if (this.tv.SelectedValue is DeviceConfigModel deviceConfigModel) + { + //ShopDeviceConfigViewModel.ShopName = deviceConfigModel.ShopName; + } + else if (this.tv.SelectedValue is DeviceModel deviceModel) + { + ShopDeviceConfigViewModel.DeviceParVisibility = Visibility.Visible; + ShopDeviceConfigViewModel.CommunicationVisibility = Visibility.Hidden; + //ShopDeviceConfigViewModel.DeviceName = deviceModel.DeviceName; + } + else if (this.tv.SelectedValue is CommunicationModel communicationModel) + { + ShopDeviceConfigViewModel.CommunicationVisibility = Visibility.Visible; + ShopDeviceConfigViewModel.DeviceParVisibility = Visibility.Hidden; + //ShopDeviceConfigViewModel.CommunicationName = communicationModel.CommunicationName; + //ShopDeviceConfigViewModel.DeviceModelId = communicationModel.DeviceModelId; + } + } + + private void tv_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) + { + + } + + private void DeviceInfo(object sender, MouseButtonEventArgs e) + { + var tb = sender as TextBlock; + if (tb != null) + { + //ShopDeviceConfigViewModel.DeviceName = tb.Text.Trim(); + //tb.Background = Brushes.Blue; + } + } + private void CommunicationInfo(object sender, MouseButtonEventArgs e) + { + //var tb = sender as TextBlock; + //if (tb != null) + //{ + // ShopDeviceConfigViewModel.CommunicationName = tb.Text.Trim(); + // ShopDeviceConfigViewModel.DeviceModelId = tb.Tag.ToString(); + // tb.Focus(); + // //tb.Background = Brushes.Blue; + + //} + } } } diff --git a/BPASmartClient/DeviceInfo.xml b/BPASmartClient/DeviceInfo.xml index 48d28f7c..89e636c8 100644 --- a/BPASmartClient/DeviceInfo.xml +++ b/BPASmartClient/DeviceInfo.xml @@ -38,7 +38,7 @@ --> - + diff --git a/HBLConsole.MORKIC/BPASmartClient.MORKIC.csproj b/HBLConsole.MORKIC/BPASmartClient.MORKIC.csproj index e444219e..0dcf2236 100644 --- a/HBLConsole.MORKIC/BPASmartClient.MORKIC.csproj +++ b/HBLConsole.MORKIC/BPASmartClient.MORKIC.csproj @@ -5,7 +5,7 @@ - + From 338de893cdcd5f8a590f0803cd11ecc9cdaac598 Mon Sep 17 00:00:00 2001 From: fyf Date: Wed, 18 May 2022 13:48:32 +0800 Subject: [PATCH 08/13] 6 --- BPASmartClient/Control/DataVView.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BPASmartClient/Control/DataVView.xaml.cs b/BPASmartClient/Control/DataVView.xaml.cs index 3ffd3018..d0067c42 100644 --- a/BPASmartClient/Control/DataVView.xaml.cs +++ b/BPASmartClient/Control/DataVView.xaml.cs @@ -44,7 +44,7 @@ namespace BPASmartClient.Control dispatcherTimer.Stop(); })); }; - dispatcherTimer.Interval = TimeSpan.FromSeconds(20); + dispatcherTimer.Interval = TimeSpan.FromSeconds(120); } From b27c0a2b45049024016bcafa5d3fc1a46dd2baf0 Mon Sep 17 00:00:00 2001 From: fyf Date: Wed, 18 May 2022 16:07:19 +0800 Subject: [PATCH 09/13] 3232 --- .../Themes/MyStyle.xaml | 64 ++++++++++++++++++- BPASmartClient/Control/DataVView.xaml | 12 ++-- BPASmartClient/MainWindow.xaml | 16 ++--- 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/BPASmartClient.CustomResource/Themes/MyStyle.xaml b/BPASmartClient.CustomResource/Themes/MyStyle.xaml index 5a02829c..eee7a413 100644 --- a/BPASmartClient.CustomResource/Themes/MyStyle.xaml +++ b/BPASmartClient.CustomResource/Themes/MyStyle.xaml @@ -957,7 +957,67 @@ - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +