diff --git a/BPASmartClient.Academy/App.xaml.cs b/BPASmartClient.Academy/App.xaml.cs
index 8da6032b..f22c92a9 100644
--- a/BPASmartClient.Academy/App.xaml.cs
+++ b/BPASmartClient.Academy/App.xaml.cs
@@ -47,7 +47,7 @@ namespace BPASmartClient.Academy
Environment.Exit(0);
}
base.OnStartup(e);
- SystemHelper.GetInstance.CreateDesktopShortcut();
+ //SystemHelper.GetInstance.CreateDesktopShortcut();
DataInit();
MenuInit();
MainView mv = new MainView();
diff --git a/BPASmartClient.Academy/BPASmartClient.Academy.csproj b/BPASmartClient.Academy/BPASmartClient.Academy.csproj
index a8400e6f..fffb170e 100644
--- a/BPASmartClient.Academy/BPASmartClient.Academy.csproj
+++ b/BPASmartClient.Academy/BPASmartClient.Academy.csproj
@@ -22,6 +22,7 @@
+
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/DeviceControlView.xaml b/BPASmartClient.Academy/View/DeviceControlView.xaml
new file mode 100644
index 00000000..2d784bcc
--- /dev/null
+++ b/BPASmartClient.Academy/View/DeviceControlView.xaml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BPASmartClient.Academy/View/DeviceControlView.xaml.cs b/BPASmartClient.Academy/View/DeviceControlView.xaml.cs
new file mode 100644
index 00000000..3a92c228
--- /dev/null
+++ b/BPASmartClient.Academy/View/DeviceControlView.xaml.cs
@@ -0,0 +1,133 @@
+using Opc.Ua;
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+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.View
+{
+ ///
+ /// DeviceControlView.xaml 的交互逻辑
+ ///
+ public partial class DeviceControlView : Window,INotifyPropertyChanged
+ {
+ private volatile static DeviceControlView _Instance;
+ private static DeviceControlView GetInstance => _Instance ?? (_Instance = new DeviceControlView());
+ private DeviceControlView()
+ {
+ InitializeComponent();
+
+ this.DataContext = this;
+
+ //this.ValveName = valveName;
+ //this.CommandState = commandState;
+ //this.DeviceState = deviceState;
+ //this.OpenHandler = openHandler;
+ //this.CloseHandler = closeHandler;
+
+ OpenCommand = new BPARelayCommand(() =>
+ {
+ OpenHandler?.Invoke();
+ this.Visibility = Visibility.Hidden;
+ });
+
+ CloseCommand = new(() =>
+ {
+ CloseHandler?.Invoke();
+ this.Visibility = Visibility.Hidden;
+ });
+
+ this.br.MouseLeftButtonDown += (o, e) => { if (e.LeftButton == MouseButtonState.Pressed) this.DragMove(); };
+ }
+
+ #region 属性变更通知
+ public event PropertyChangedEventHandler? PropertyChanged;
+
+ private void OnPropertyChanged([CallerMemberName] string paraName = "")
+ {
+ this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(paraName));
+ }
+ #endregion
+
+ #region Properties
+ ///
+ /// 界面标题
+ ///
+ public string ValveName { get { return _valveName; } set { _valveName = value; OnPropertyChanged(); } }
+ private string _valveName;
+
+ ///
+ /// 命令状态
+ ///
+ public string CommandState { get { return _commandState; } set { _commandState = value; OnPropertyChanged(); } }
+ private string _commandState;
+
+ ///
+ /// 设备状态
+ ///
+ public string DeviceState { get { return _deviceState; } set { _deviceState = value; OnPropertyChanged(); } }
+ private string _deviceState;
+ ///
+ /// 点击打开时的动作
+ ///
+ public Action OpenHandler { get; set; }
+ ///
+ /// 点击关闭时的动作
+ ///
+ public Action CloseHandler { get; set; }
+
+ #endregion
+
+ #region Commands
+ public BPARelayCommand OpenCommand { get; set; }
+ public BPARelayCommand CloseCommand { get; set; }
+ #endregion
+
+
+ ///
+ /// 打开对话框前事件处理
+ ///
+ public Action BeforeOpenHandler;
+
+ ///
+ /// 打开对话框后事件处理
+ ///
+ public Action AfterCloseHandler;
+
+ #region Events
+
+ #endregion
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ //this.Close();
+ this.Visibility = Visibility.Hidden;
+ }
+
+ public static void Show(string valveName, string commandState, string deviceState, Action openHandler, Action closeHandler)
+ {
+ DeviceControlView view = GetInstance;
+
+ view.ValveName = valveName;
+ view.CommandState = commandState;
+ view.DeviceState = deviceState;
+ view.OpenHandler = openHandler;
+ view.CloseHandler = closeHandler;
+ view.Visibility=Visibility.Visible;
+ //view.ShowDialog();
+ }
+ }
+}
diff --git a/BPASmartClient.Academy/View/ReactionKettle50LView.xaml b/BPASmartClient.Academy/View/ReactionKettle50LView.xaml
index 9853b507..bbde6228 100644
--- a/BPASmartClient.Academy/View/ReactionKettle50LView.xaml
+++ b/BPASmartClient.Academy/View/ReactionKettle50LView.xaml
@@ -3,7 +3,9 @@
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"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel"
@@ -139,7 +141,7 @@
-
+
@@ -238,7 +240,67 @@
-
+
+
+
+
+
+
+
+
@@ -292,25 +354,26 @@
-