From 598b052daeb30f3608bdce46806b9a4e1c44c0cd Mon Sep 17 00:00:00 2001 From: ZhaoGang <15196688790@163.com> Date: Fri, 22 Nov 2024 11:19:14 +0800 Subject: [PATCH] =?UTF-8?q?add:=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=8F=8D=E5=BA=94=E9=87=9C=E9=A1=B9=E7=9B=AE=E4=B8=93?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=B9=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BA=86=E4=B8=8B=E8=83=BD=E4=B8=8D=E8=83=BD=E7=94=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CustomControls/ValveWithCommandState.xaml | 37 +++ .../ValveWithCommandState.xaml.cs | 70 +++++ .../View/ReactionKettle50LView.xaml | 260 +++++++++++------- 3 files changed, 273 insertions(+), 94 deletions(-) create mode 100644 BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml create mode 100644 BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml.cs diff --git a/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml b/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml new file mode 100644 index 00000000..014010d0 --- /dev/null +++ b/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + diff --git a/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml.cs b/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml.cs new file mode 100644 index 00000000..3ca8b70d --- /dev/null +++ b/BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.Academy.CustomControls +{ + /// + /// ValveWithCommandState.xaml 的交互逻辑 + /// + public partial class ValveWithCommandState : UserControl + { + public ValveWithCommandState() + { + InitializeComponent(); + } + + + + public bool OpenEnable + { + get { return (bool)GetValue(OpenEnableProperty); } + set { SetValue(OpenEnableProperty, value); } + } + /// + /// 阀门开关状态 + /// + public static readonly DependencyProperty OpenEnableProperty = + DependencyProperty.Register("OpenEnable", typeof(bool), typeof(ValveWithCommandState), new PropertyMetadata(false)); + + + + public Color EdgeColor + { + get { return (Color)GetValue(EdgeColorProperty); } + set { SetValue(EdgeColorProperty, value); } + } + /// + /// 阀门颜色 + /// + public static readonly DependencyProperty EdgeColorProperty = + DependencyProperty.Register("EdgeColor", typeof(Color), typeof(ValveWithCommandState), new PropertyMetadata(Color.FromArgb(byte.MaxValue, 91, 92, 95))); + + + + + + public Brush CommandColor + { + get { return (Brush)GetValue(CommandColorProperty); } + set { SetValue(CommandColorProperty, value); } + } + + // Using a DependencyProperty as the backing store for CommandColor. This enables animation, styling, binding, etc... + public static readonly DependencyProperty CommandColorProperty = + DependencyProperty.Register("CommandColor", typeof(Brush), typeof(ValveWithCommandState), new PropertyMetadata(Brushes.Red)); + + + } +} diff --git a/BPASmartClient.Academy/View/ReactionKettle50LView.xaml b/BPASmartClient.Academy/View/ReactionKettle50LView.xaml index de78762a..21bca591 100644 --- a/BPASmartClient.Academy/View/ReactionKettle50LView.xaml +++ b/BPASmartClient.Academy/View/ReactionKettle50LView.xaml @@ -3,6 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:bpa="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource" + xmlns:cc="clr-namespace:BPASmartClient.Academy.CustomControls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:local="clr-namespace:BPASmartClient.Academy.View" @@ -140,7 +141,7 @@ - + @@ -239,7 +240,67 @@ - + + + + + + + @@ -299,20 +360,20 @@ @@ -818,7 +879,7 @@ @@ -835,32 +896,32 @@ @@ -877,13 +938,13 @@ @@ -894,25 +955,25 @@ @@ -923,26 +984,26 @@ TextAlignment="Center" /> @@ -951,26 +1012,26 @@ FontSize="12" Foreground="White" Text="反应釜排水阀" TextAlignment="Center" /> @@ -979,7 +1040,7 @@ FontSize="12" Foreground="White" Text="冷却水、疏水" TextAlignment="Center" /> @@ -999,13 +1060,13 @@ @@ -1013,7 +1074,7 @@ Canvas.Left="628" Canvas.Top="362" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="12" Foreground="White" Text="进清水阀" TextAlignment="Center" /> @@ -1031,7 +1092,7 @@ + + + + + + + - + @@ -1083,32 +1159,32 @@ @@ -1170,34 +1246,34 @@ Canvas.Left="336" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="12" Foreground="White" Text="蒸汽比例阀" TextAlignment="Center" /> @@ -1206,8 +1282,8 @@ VerticalAlignment="Center" FontSize="12" Foreground="White" Text="反应釜泄压阀" TextAlignment="Center" /> @@ -1217,7 +1293,7 @@ @@ -1227,8 +1303,8 @@ Text="冷 凝 水 罐 进 水 阀" TextAlignment="Center" /> @@ -1423,8 +1499,8 @@ @@ -1480,11 +1556,7 @@ Foreground="{Binding DeviceStatus.IsSetBrineTankZero, Converter={StaticResource BoolToColorConverter}}" Text="⬛" TextAlignment="Center" /> - +