Переглянути джерело

Merge branch 'reconfiguration' of http://111.9.47.105:10244/bpa/BPASmartClient into reconfiguration

reconfiguration
ZhaoGang 2 тижднів тому
джерело
коміт
846a6de90c
9 змінених файлів з 645 додано та 138 видалено
  1. +1
    -1
      BPASmartClient.Academy/App.xaml.cs
  2. +1
    -0
      BPASmartClient.Academy/BPASmartClient.Academy.csproj
  3. +37
    -0
      BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml
  4. +70
    -0
      BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml.cs
  5. +91
    -0
      BPASmartClient.Academy/View/DeviceControlView.xaml
  6. +133
    -0
      BPASmartClient.Academy/View/DeviceControlView.xaml.cs
  7. +200
    -117
      BPASmartClient.Academy/View/ReactionKettle50LView.xaml
  8. +96
    -20
      BPASmartClient.Academy/View/ReactionKettle50LView.xaml.cs
  9. +16
    -0
      BPASmartClient.Academy/ViewModel/DeviceControlViewModel.cs

+ 1
- 1
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();


+ 1
- 0
BPASmartClient.Academy/BPASmartClient.Academy.csproj Переглянути файл

@@ -22,6 +22,7 @@
<ItemGroup>
<PackageReference Include="BPA.Communication" Version="1.0.183" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
<PackageReference Include="OxyPlot.Wpf" Version="2.1.2" />
</ItemGroup>



+ 37
- 0
BPASmartClient.Academy/CustomControls/ValveWithCommandState.xaml Переглянути файл

@@ -0,0 +1,37 @@
<UserControl
x:Class="BPASmartClient.Academy.CustomControls.ValveWithCommandState"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.Academy.CustomControls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="32"
d:DesignWidth="32" mc:Ignorable="d">
<UserControl.Resources>
<Style x:Key="BaseHandValveStyle" TargetType="bpa:HandValve">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="CommandStateStyle" TargetType="TextBlock">
<Setter Property="Height" Value="16" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Margin" Value="0,3,6,0" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Text" Value="⬛" />
</Style>
</UserControl.Resources>
<Grid>
<bpa:HandValve
EdgeColor="{Binding Path=EdgeColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
OpenEnable="{Binding Path=OpenEnable, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
Style="{StaticResource BaseHandValveStyle}" />
<TextBlock
d:Foreground="Red"
Foreground="{Binding Path=CommandColor, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:ValveWithCommandState}}}"
Style="{StaticResource CommandStateStyle}" />
</Grid>
</UserControl>

+ 70
- 0
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
{
/// <summary>
/// ValveWithCommandState.xaml 的交互逻辑
/// </summary>
public partial class ValveWithCommandState : UserControl
{
public ValveWithCommandState()
{
InitializeComponent();
}



public bool OpenEnable
{
get { return (bool)GetValue(OpenEnableProperty); }
set { SetValue(OpenEnableProperty, value); }
}
/// <summary>
/// 阀门开关状态
/// </summary>
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); }
}
/// <summary>
/// 阀门颜色
/// </summary>
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));


}
}

+ 91
- 0
BPASmartClient.Academy/View/DeviceControlView.xaml Переглянути файл

@@ -0,0 +1,91 @@
<Window
x:Class="BPASmartClient.Academy.View.DeviceControlView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cs="clr-namespace:BPASmartClient.CustomResource;assembly=BPASmartClient.CustomResource"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:BPASmartClient.Academy.View"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel" Width="400" Height="250"
d:Visibility="Visible" AllowsTransparency="True"
Background="{x:Null}"
Topmost="True" Visibility="Collapsed" WindowStartupLocation="CenterScreen" WindowStyle="None"
mc:Ignorable="d">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
<ResourceDictionary Source="/BPASmartClient.CustomResource;component/Recdictionarys/GlobalStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<!--<UserControl.DataContext>
<vm:DeviceControlViewModel />
</UserControl.DataContext>-->
<Border
Name="br" Background="#FF0B2F5F" BorderBrush="#0CADF5" BorderThickness="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="1*" />
<RowDefinition Height="1*" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>

<!--#region 窗体标题-->
<TextBlock
Grid.Row="0" Grid.Column="0" FontSize="28" Text="阀门/电机控制" />
<Button
Grid.Row="0" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center"
Click="Button_Click" Content="关闭窗体" FontSize="28"
Style="{StaticResource ControlButtonStyle}" />
<!--#endregion-->

<!--#region 阀门名称-->
<TextBlock
Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"
d:Text="反应釜旁通阀控制" FontSize="32"
Text="{Binding ValveName}"
TextAlignment="Center" />
<!--#endregion-->

<!--#region 指令状态显示-->
<TextBlock
Grid.Row="2" Grid.Column="0" FontSize="28" Text="当前指令状态:" />
<TextBlock
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
d:Text="打开" FontSize="28"
Text="{Binding CommandState}" />
<!--#endregion-->

<!--#region 设备状态显示-->
<TextBlock
Grid.Row="3" Grid.Column="0" FontSize="28" Text="当前设备状态:" />
<TextBlock
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
d:Text="关闭" FontSize="28"
Text="{Binding DeviceState}" />
<!--#endregion-->

<!--#region 按钮-->
<Button
Grid.Row="4"
Command="{Binding OpenCommand}"
Content="打开" FontSize="32"
Style="{StaticResource OKImageButtonStyle}" />
<Button
Grid.Row="4" Grid.Column="1"
Command="{Binding CloseCommand}"
Content="关闭" FontSize="32"
Style="{StaticResource CancelImageButtonStyle}" />
<!--#endregion-->
</Grid>
</Border>

</Window>

+ 133
- 0
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
{
/// <summary>
/// DeviceControlView.xaml 的交互逻辑
/// </summary>
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
/// <summary>
/// 界面标题
/// </summary>
public string ValveName { get { return _valveName; } set { _valveName = value; OnPropertyChanged(); } }
private string _valveName;

/// <summary>
/// 命令状态
/// </summary>
public string CommandState { get { return _commandState; } set { _commandState = value; OnPropertyChanged(); } }
private string _commandState;

/// <summary>
/// 设备状态
/// </summary>
public string DeviceState { get { return _deviceState; } set { _deviceState = value; OnPropertyChanged(); } }
private string _deviceState;
/// <summary>
/// 点击打开时的动作
/// </summary>
public Action OpenHandler { get; set; }
/// <summary>
/// 点击关闭时的动作
/// </summary>
public Action CloseHandler { get; set; }

#endregion

#region Commands
public BPARelayCommand OpenCommand { get; set; }
public BPARelayCommand CloseCommand { get; set; }
#endregion


/// <summary>
/// 打开对话框前事件处理
/// </summary>
public Action<DeviceControlView> BeforeOpenHandler;

/// <summary>
/// 打开对话框后事件处理
/// </summary>
public Action<DeviceControlView, object> 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();
}
}
}

+ 200
- 117
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 @@
<PathFigureCollection>
<PathFigure StartPoint="20,8">
<LineSegment Point="30,8" />
<LineSegment Point="30,10" />
<LineSegment Point="30,12" />
<LineSegment Point="26.7,10" />
<BezierSegment
Point1="26.7,10" Point2="24,8" Point3="20,8" />
@@ -238,7 +240,67 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NotchedSigalInArrow" TargetType="TextBlock" />
<Style x:Key="BaseHandValveStyle" TargetType="bpa:HandValve">
<Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="CommandStateStyle" TargetType="TextBlock">
<Setter Property="Height" Value="20" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Margin" Value="0,8,6,0" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Text" Value="⬛" />
</Style>
<Style x:Key="BasePipeLineHStyle" TargetType="bpa:PipeLineH">
<Setter Property="Height" Value="10" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
<Style x:Key="BasePipeLineVStyle" TargetType="bpa:PipeLineV">
<Setter Property="Width" Value="10" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
<Style x:Key="BasePipeLineBLStyle" TargetType="bpa:PipeLineBL">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
<Style x:Key="BasePipeLineBRStyle" TargetType="bpa:PipeLineBR">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
<Style x:Key="BasePipeLineTRStyle" TargetType="bpa:PipeLineTR">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
<Style x:Key="BasePipeLineTLStyle" TargetType="bpa:PipeLineTL">
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="LineWidth" Value="1" />
<Setter Property="Speed" Value="1" />
</Style>
</UserControl.Resources>
<Grid>
<!--#region 设备未连接时的遮罩-->
@@ -292,25 +354,26 @@
</StackPanel>
<Viewbox
Grid.Row="1" Margin="10" Stretch="Uniform">
<Canvas Width="1200" Height="490">
<Canvas
Width="1200" Height="490" MouseLeftButtonDown="Canvas_MouseDown">
<!--#region 开关控制按钮-->
<!--#region 压缩空气进气阀-->
<bpa:PipeLineTL
Canvas.Left="742" Canvas.Top="384" Canvas.Right="238.3" Width="20"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ReactInCleanWaterValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInCleanWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<!--#region 压缩空气进气阀-->
<bpa:PipeLineTL
Canvas.Left="746.5" Canvas.Top="410" Canvas.Right="277.3" Width="10"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Canvas.Left="746.5" Canvas.Top="410" Canvas.Right="277.3" Width="20"
Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<!--#region 开关控制按钮-->
<bpa:PipeLineV
Canvas.Left="744" Canvas.Top="31" Canvas.Right="250.9" Width="5"
Canvas.Left="744" Canvas.Top="31" Canvas.Right="250.9" Width="10"
Height="30" HorizontalAlignment="Center" VerticalAlignment="Center"
Direction="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
@@ -318,18 +381,18 @@
<!--#region 开关控制按钮-->
<bpa:PipeLineH
Canvas.Left="332" Canvas.Top="22" Canvas.Right="260.7" Width="100"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="25" />
<bpa:PipeLineV
Canvas.Left="242" Canvas.Top="59" Width="5" Height="140"
Canvas.Left="242" Canvas.Top="59" Width="10" Height="140"
HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="1" RenderTransformOrigin="0.5,0.5" />
<bpa:PipeLineH
Canvas.Left="133" Canvas.Top="69" Width="152" Height="5"
Canvas.Left="133" Canvas.Top="69" Width="152" Height="10"
HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ColdWaterTankVacuumValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankVacuumValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
@@ -337,28 +400,28 @@
<!--#region 开关控制按钮-->
<bpa:PipeLineH
Canvas.Left="115" Canvas.Top="456" Canvas.Right="257.5" Width="95"
Height="5" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Direction="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="10" />
<!--#region 开关控制按钮-->
<bpa:PipeLineBR
Canvas.Left="216" Canvas.Top="438" Canvas.Right="272.3" Width="11"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Canvas.Left="216" Canvas.Top="438" Canvas.Right="272.3" Width="20"
Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.BrinePumpState, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.BrinePumpState, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<!--#region 开关控制按钮-->
<bpa:PipeLineH
Canvas.Left="226" Canvas.Top="438" Canvas.Right="257.5" Width="366"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.BrinePumpState, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.BrinePumpState, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="10" />
<!--#region 开关控制按钮-->
<bpa:PipeLineTL
Canvas.Left="746.5" Canvas.Top="433" Canvas.Right="272.3" Width="10"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Canvas.Left="746.5" Canvas.Top="433" Canvas.Right="272.3" Width="20"
Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
@@ -382,12 +445,12 @@
Panel.ZIndex="99" Orientation="Vertical">
<RadioButton
Width="70" Height="20" Margin="0,0,0,2" BorderThickness="0"
Click="open_Click" Content="负压风机:开" FontSize="8" Foreground="White"
Click="open_Click" Content="真空泵:开" FontSize="8" Foreground="White"
Style="{StaticResource radiobutton}"
Tag="负压风机" />
<RadioButton
Width="70" Height="20" BorderThickness="0" Click="close_Click"
Content="负压风机:关" FontSize="8" Foreground="White" IsChecked="True"
Content="真空泵:关" FontSize="8" Foreground="White" IsChecked="True"
Style="{StaticResource radiobutton}"
Tag="负压风机" />
</StackPanel>
@@ -478,15 +541,12 @@
<StackPanel
Canvas.Left="921.095" Canvas.Top="264.326" HorizontalAlignment="Left" VerticalAlignment="Top"
Panel.ZIndex="99" Orientation="Vertical">
<RadioButton
Width="70" Height="20" Margin="0,0,0,2" BorderThickness="0"
Click="open_Click" Content="旋转电机点动:开" FontSize="8" Foreground="White"
Style="{StaticResource radiobutton}"
Tag="反应釜旋转电机点动" />
<RadioButton
Width="70" Height="20" BorderThickness="0" Click="close_Click"
Content="旋转电机点动:关" FontSize="8" Foreground="White" IsChecked="True"
Style="{StaticResource radiobutton}"
<Button
Width="70" Height="20" Margin="0,0,0,2" VerticalContentAlignment="Center"
BorderThickness="0" Content="旋转电机点动" FontSize="8" Foreground="White"
PreviewMouseLeftButtonDown="Button_PreviewMouseLeftButtonDown"
PreviewMouseLeftButtonUp="Button_PreviewMouseLeftButtonUp"
Style="{StaticResource ButtonStyle}"
Tag="反应釜旋转电机点动" />
</StackPanel>
<StackPanel
@@ -819,7 +879,7 @@

<!--#region 冷却水出水阀-->
<bpa:PipeLineV
Canvas.Left="735" Canvas.Top="224.571" Canvas.Right="260" Width="5"
Canvas.Left="735" Canvas.Top="224.571" Canvas.Right="260" Width="10"
Height="67" HorizontalAlignment="Center" VerticalAlignment="Top" LineWidth="1">
<bpa:PipeLineV.Fill>
<MultiBinding Converter="{StaticResource MultiBoolDeviceControl}" ConverterParameter="2">
@@ -836,34 +896,35 @@
</bpa:PipeLineV>
<!--#region 冷凝水罐进气阀-->
<bpa:PipeLineV
Canvas.Left="591" Canvas.Top="73" Canvas.Right="404.2" Width="5"
Canvas.Left="591" Canvas.Top="73" Canvas.Right="404.2" Width="10"
Height="137" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineBL
Canvas.Left="585.8" Canvas.Top="63.4" Canvas.Right="404.2" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Canvas.Left="585.8" Canvas.Top="63.4" Canvas.Right="404.2" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineH
Canvas.Left="349" Canvas.Top="63" Canvas.Right="413.9" Width="238"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineBR
Canvas.Left="339" Canvas.Top="63" Canvas.Right="480.2" Width="10"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Canvas.Left="339" Canvas.Top="63" Canvas.Right="480.2" Width="20"
Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:HandValve
Canvas.Left="603" Canvas.Top="114" Canvas.Right="380.8" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="603" Canvas.Top="114" Canvas.Right="380.8" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ColdWaterTankInAirValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ColdWaterTankInAirValve}">
OpenEnable="{Binding DeviceStatus.ColdWaterTankInAirValve}"
Tag="冷凝水进气阀">
<bpa:HandValve.RenderTransform>
<RotateTransform Angle="90" />
</bpa:HandValve.RenderTransform>
@@ -877,15 +938,16 @@
<!--#region 热气排空阀-->
<bpa:PipeLineH
Canvas.Left="601" Canvas.Top="215" Canvas.Right="339.4" Width="78"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center"
Direction="{Binding DeviceStatus.HotGasEmptyValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.HotGasEmptyValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="0.23" />
<bpa:HandValve
Canvas.Left="662" Canvas.Top="207" Canvas.Right="343.4" Width="16"
Height="16" HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="662" Canvas.Top="207" Canvas.Right="343.4" Width="32"
Height="32" HorizontalAlignment="Left" VerticalAlignment="Center"
EdgeColor="{Binding DeviceStatus.HotGasEmptyValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.HotGasEmptyValve}" />
OpenEnable="{Binding DeviceStatus.HotGasEmptyValve}"
Tag="热气排空阀" />
<TextBlock
Canvas.Left="639" Canvas.Top="192" Canvas.Right="312.8" HorizontalAlignment="Left"
VerticalAlignment="Center" FontSize="12" Foreground="White" Text="热气排空阀"
@@ -893,27 +955,28 @@
<!--#region 抽真空阀-->
<bpa:PipeLineH
Canvas.Left="600.3" Canvas.Top="295.5" Canvas.Right="269.7" Width="130"
Height="5" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineTR
Canvas.Left="591" Canvas.Top="290.5" Canvas.Right="399.2" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="591" Canvas.Top="290.5" Canvas.Right="399.2" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineV
Canvas.Left="591" Canvas.Top="210" Canvas.Right="404.2" Width="5"
Canvas.Left="591" Canvas.Top="210" Canvas.Right="404.2" Width="10"
Height="81" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:HandValve
Canvas.Left="635.883" Canvas.Top="288.036" Canvas.Right="380.8" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="635.883" Canvas.Top="288.036" Canvas.Right="380.8" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactOutHotGasValve}" />
OpenEnable="{Binding DeviceStatus.ReactOutHotGasValve}"
Tag="抽真空阀" />
<!-- 之前抽真空阀叫排热空气阀,后面改了 -->
<TextBlock
Canvas.Left="618" Canvas.Top="272" Canvas.Right="384.8" HorizontalAlignment="Left"
@@ -921,61 +984,63 @@
TextAlignment="Center" />
<!--#region 反应釜排水阀-->
<bpa:PipeLineV
Canvas.Left="735" Canvas.Top="292" Canvas.Right="260" Width="5"
Canvas.Left="735" Canvas.Top="292" Canvas.Right="260" Width="10"
Height="22" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineTL
Canvas.Left="725" Canvas.Top="313" Canvas.Right="255" Width="20"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineH
Canvas.Left="505" Canvas.Top="318" Canvas.Right="269" Width="226"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:HandValve
Canvas.Left="514" Canvas.Top="310" Canvas.Right="339" Width="16"
Height="16" HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="514" Canvas.Top="310" Canvas.Right="339" Width="32"
Height="32" HorizontalAlignment="Left" VerticalAlignment="Center"
EdgeColor="{Binding DeviceStatus.ReactDrainValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactDrainValve}" />
OpenEnable="{Binding DeviceStatus.ReactDrainValve}"
Tag="反应釜排水阀" />
<TextBlock
Canvas.Left="484" Canvas.Top="297" HorizontalAlignment="Left" VerticalAlignment="Center"
FontSize="12" Foreground="White" Text="反应釜排水阀" TextAlignment="Center" />
<!--#region 冷却水、疏水-->
<bpa:PipeLineV
Canvas.Left="744" Canvas.Top="225" Canvas.Right="250.9" Width="5"
Canvas.Left="744" Canvas.Top="225" Canvas.Right="250.9" Width="10"
Height="122" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=7, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineTL
Canvas.Left="734" Canvas.Top="347" Canvas.Right="245.9" Width="20"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=7, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineH
Canvas.Left="340" Canvas.Top="352" Canvas.Right="260.6" Width="399"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=7, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="16" />
<bpa:HandValve
Canvas.Left="406" Canvas.Top="345" Canvas.Right="360" Width="16"
Height="16" HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="406" Canvas.Top="336" Canvas.Right="360" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactOutColdValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactOutColdValve}" />
OpenEnable="{Binding DeviceStatus.ReactOutColdValve}"
Tag="反应釜出冷却水阀" />
<TextBlock
Canvas.Left="378" Canvas.Top="330" HorizontalAlignment="Left" VerticalAlignment="Center"
FontSize="12" Foreground="White" Text="冷却水、疏水" TextAlignment="Center" />
<!--#region 进清水阀、进卤水阀、压缩空气进气阀进连接处-->
<bpa:PipeLineV
Canvas.Left="751.7" Canvas.Top="224.571" Canvas.Right="243.3" Width="5"
Canvas.Left="751.7" Canvas.Top="224.571" Canvas.Right="243.3" Width="10"
Height="160" HorizontalAlignment="Center" VerticalAlignment="Top" LineWidth="1">
<bpa:PipeLineV.Fill>
<MultiBinding Converter="{StaticResource MultiBoolDeviceControl}" ConverterParameter="2">
@@ -995,20 +1060,21 @@
<!--#region 进清水阀-->
<bpa:PipeLineH
Canvas.Left="641" Canvas.Top="389" Canvas.Right="272.9" Width="106"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ReactInCleanWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInCleanWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:HandValve
Canvas.Left="644" Canvas.Top="382" Canvas.Right="384" Width="16"
Height="16" HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="646" Canvas.Top="373" Canvas.Right="384" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactInCleanWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactInCleanWaterValve}" />
OpenEnable="{Binding DeviceStatus.ReactInCleanWaterValve}"
Tag="反应釜进清水阀" />
<TextBlock
Canvas.Left="628" Canvas.Top="362" HorizontalAlignment="Center" VerticalAlignment="Top"
FontSize="12" Foreground="White" Text="进清水阀" TextAlignment="Center" />
<bpa:PipeLineV
Canvas.Left="751.5" Canvas.Top="385" Canvas.Right="277.3" Width="5"
Canvas.Left="751.5" Canvas.Top="385" Canvas.Right="277.3" Width="10"
Height="29" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
LineWidth="1" Speed="1.5">
<bpa:PipeLineV.Fill>
@@ -1026,7 +1092,7 @@
</bpa:PipeLineV>
<!--#region 进卤水阀-->
<bpa:PipeLineV
Canvas.Left="751.5" Canvas.Top="414" Canvas.Right="277.3" Width="5"
Canvas.Left="751.5" Canvas.Top="414" Canvas.Right="277.3" Width="10"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="2"
Direction="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
@@ -1044,24 +1110,40 @@
<TextBlock
Canvas.Left="205" Canvas.Top="465" Canvas.Right="206.5" HorizontalAlignment="Left"
VerticalAlignment="Top" Foreground="White" Text="卤水泵" />
<cc:ValveWithCommandState MouseLeftButtonDown="Canvas_MouseDown"
Canvas.Left="394" Canvas.Top="369"
CommandColor="{Binding DeviceStatus.IsSetReactPressureAirInValve, Converter={StaticResource BoolToColorConverter}}"
EdgeColor="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactPressureAirInValve}" />


<Grid
Canvas.Left="384" Canvas.Top="399" Panel.ZIndex="8">
<bpa:HandValve
Canvas.Right="400"
EdgeColor="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactPressureAirInValve}"
Style="{StaticResource BaseHandValveStyle}"
Tag="反应釜压缩空气进气阀" />
<TextBlock
d:Foreground="Red"
Foreground="{Binding DeviceStatus.IsSetReactPressureAirInValve, Converter={StaticResource BoolToColorConverter}}"
Style="{StaticResource CommandStateStyle}" />
</Grid>
<bpa:PipeLineH
Canvas.Left="379" Canvas.Top="415" Canvas.Right="286.9" Width="368"
Height="5" HorizontalAlignment="Center" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:HandValve
Canvas.Left="383.99" Canvas.Top="407.437" Canvas.Right="400" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactPressureAirInValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactPressureAirInValve}" />

<TextBlock
Canvas.Left="350" Canvas.Top="423" HorizontalAlignment="Left" VerticalAlignment="Top"
FontSize="12" Foreground="White" Text="压缩空气进气阀" TextAlignment="Center" />

<!--#region 冷却水进水阀-->
<bpa:PipeLineV
Canvas.Left="744" Canvas.Top="61" Canvas.Right="255.9" Width="5"
Canvas.Left="744" Canvas.Top="61" Canvas.Right="255.9" Width="10"
Height="140" HorizontalAlignment="Center" VerticalAlignment="Top" LineWidth="1">
<bpa:PipeLineV.Fill>
<MultiBinding Converter="{StaticResource MultiBoolToColorConverter}" ConverterParameter="Lime,Red">
@@ -1077,32 +1159,32 @@
</bpa:PipeLineV.Direction>
</bpa:PipeLineV>
<bpa:PipeLineBL
Canvas.Left="739.1" Canvas.Top="51.0" Canvas.Right="250.9" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="739.1" Canvas.Top="51.0" Canvas.Right="250.9" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactInColdValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInColdValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineH
Canvas.Left="220" Canvas.Top="51" Canvas.Right="260.7" Width="519"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ReactInColdValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInColdValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="1.55" />
<bpa:PipeLineH
Canvas.Left="252" Canvas.Top="203" Width="26" Height="5"
Canvas.Left="252" Canvas.Top="203" Width="26" Height="10"
HorizontalAlignment="Center" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineTR
Canvas.Left="242" Canvas.Top="198" Width="10" Height="10"
Canvas.Left="242" Canvas.Top="198" Width="20" Height="20"
HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="2"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1" />
<bpa:HandValve
Canvas.Left="670" Canvas.Top="44" Width="16" Height="16"
HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="670" Canvas.Top="36" Width="32" Height="32"
HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactInColdValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactInColdValve}" />
<TextBlock
@@ -1111,13 +1193,13 @@

<!--#region 风机-->
<bpa:PipeLineBL
Canvas.Left="285" Canvas.Top="69" Width="10" Height="10"
Canvas.Left="285" Canvas.Top="69" Width="20" Height="20"
HorizontalAlignment="Left" VerticalAlignment="Center"
Direction="{Binding DeviceStatus.ColdWaterTankVacuumValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankVacuumValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1" />
<bpa:PipeLineH
Canvas.Left="74" Canvas.Top="69" Width="54" Height="5"
Canvas.Left="74" Canvas.Top="69" Width="54" Height="10"
HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.Fans, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.Fans, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
@@ -1139,23 +1221,24 @@
TextAlignment="Center" />
<TextBlock
Canvas.Left="38" Canvas.Top="138" HorizontalAlignment="Center" VerticalAlignment="Top"
Foreground="White" Text="风机" />
Foreground="White" Text="真空泵" />
<bpa:HandValve
Canvas.Left="121.876" Canvas.Top="61.412" Canvas.Right="343.4" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="122" Canvas.Top="54" Canvas.Right="343.4" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ColdWaterTankVacuumValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ColdWaterTankVacuumValve}" />
OpenEnable="{Binding DeviceStatus.ColdWaterTankVacuumValve}"
Tag="冷凝水罐真空阀" />
<TextBlock
Canvas.Left="88" Canvas.Top="77" HorizontalAlignment="Left" VerticalAlignment="Top"
Canvas.Left="93" Canvas.Top="80" HorizontalAlignment="Left" VerticalAlignment="Center"
FontSize="12" Foreground="White" Text="冷凝水管负压阀" TextAlignment="Center" />
<bpa:PipeLineH
Canvas.Left="437" Canvas.Top="22" Canvas.Right="260.7" Width="303"
Height="5" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="25" />
<bpa:HandValve
Canvas.Left="360" Canvas.Top="14.331" Width="16" Height="16"
Canvas.Left="360" Canvas.Top="7" Width="32" Height="32"
HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactInSteamValue}" />
@@ -1163,34 +1246,34 @@
Canvas.Left="336" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="12"
Foreground="White" Text="蒸汽比例阀" TextAlignment="Center" />
<bpa:HandValve
Canvas.Left="429.972" Canvas.Top="14.331" Width="16" Height="16"
HorizontalAlignment="Left" VerticalAlignment="Center"
Canvas.Left="427" Canvas.Top="7" Width="32" Height="32"
HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactInSteamValue}" />
<TextBlock
Canvas.Left="417" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="12"
Foreground="White" Text="蒸汽阀" TextAlignment="Center" />
<bpa:PipeLineBL
Canvas.Left="739.1" Canvas.Top="21.963" Canvas.Right="250.9" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Center"
Canvas.Left="739.1" Canvas.Top="21.963" Canvas.Right="250.9" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Center"
Direction="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInSteamValue, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineV
Canvas.Left="366" Canvas.Top="111" Canvas.Right="404.2" Width="5"
Canvas.Left="366" Canvas.Top="111" Canvas.Right="404.2" Width="10"
Height="236" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="1" />
<bpa:PipeLineBL
Canvas.Left="361" Canvas.Top="101" Canvas.Right="404.2" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Canvas.Left="361" Canvas.Top="101" Canvas.Right="404.2" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineTL
Canvas.Left="356" Canvas.Top="347" Canvas.Right="238.3" Width="20"
Height="10" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Height="20" HorizontalAlignment="Left" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
@@ -1199,17 +1282,18 @@
VerticalAlignment="Center" FontSize="12" Foreground="White" Text="反应釜泄压阀"
TextAlignment="Center" />
<bpa:HandValve
Canvas.Left="234" Canvas.Top="175" Canvas.Right="343.4" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="226" Canvas.Top="175" Canvas.Right="343.4" Width="32"
Height="32" HorizontalAlignment="Left" VerticalAlignment="Center"
EdgeColor="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ColdWaterTankInWaterValve}">
OpenEnable="{Binding DeviceStatus.ColdWaterTankInWaterValve}"
Tag="冷凝水罐进水阀">
<bpa:HandValve.RenderTransform>
<RotateTransform Angle="270" />
</bpa:HandValve.RenderTransform>
</bpa:HandValve>
<bpa:PipeLineH
Canvas.Left="603" Canvas.Top="438" Canvas.Right="257.5" Width="144"
Height="5" HorizontalAlignment="Center" VerticalAlignment="Center" d:Direction="1"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Center" d:Direction="1"
Direction="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="1" Speed="10" />
@@ -1219,10 +1303,13 @@
Text="冷&#xA;凝&#xA;水&#xA;罐&#xA;进&#xA;水&#xA;阀"
TextAlignment="Center" />
<bpa:HandValve
Canvas.Left="590.8" Canvas.Top="430.945" Canvas.Right="253.9" Width="16"
Height="16" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="587" Canvas.Top="423" Canvas.Right="253.9" Width="32"
Height="32" HorizontalAlignment="Center" VerticalAlignment="Top"
EdgeColor="{Binding DeviceStatus.ReactInBrineWaterValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
OpenEnable="{Binding DeviceStatus.ReactInBrineWaterValve}" />
OpenEnable="{Binding DeviceStatus.ReactInBrineWaterValve}"
Tag="反应釜进卤水阀">

</bpa:HandValve>
<TextBlock
Canvas.Left="85" Canvas.Top="410" HorizontalAlignment="Center" VerticalAlignment="Top"
FontSize="12" Foreground="White" Text="卤水配制罐" />
@@ -1425,8 +1512,8 @@
</GroupBox>
<!--#endregion-->
<bpa:PipeLineTR
Canvas.Left="591" Canvas.Top="210" Canvas.Right="399.2" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Canvas.Left="591" Canvas.Top="210" Canvas.Right="399.2" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top" d:Direction="1"
Direction="{Binding DeviceStatus.HotGasEmptyValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.HotGasEmptyValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
@@ -1482,11 +1569,7 @@
Foreground="{Binding DeviceStatus.IsSetBrineTankZero, Converter={StaticResource BoolToColorConverter}}"
Text="⬛" TextAlignment="Center" />

<TextBlock
Canvas.Left="384" Canvas.Top="389" Canvas.Right="384.8" Height="20"
HorizontalAlignment="Center" VerticalAlignment="Top" d:Foreground="Red" FontSize="16"
Foreground="{Binding DeviceStatus.IsSetReactPressureAirInValve, Converter={StaticResource BoolToColorConverter}}"
Text="⬛" TextAlignment="Center" />

<TextBlock
Canvas.Left="618" Canvas.Top="379" Canvas.Right="384.8" Height="20"
HorizontalAlignment="Left" VerticalAlignment="Top" d:Foreground="Red" FontSize="16"
@@ -1534,8 +1617,8 @@
Foreground="{Binding DeviceStatus.IsSetReactReverse, Converter={StaticResource BoolToColorConverter}}"
Text="⬛" TextAlignment="Center" />
<TextBlock
Canvas.Left="996" Canvas.Top="274" Canvas.Right="384.8" Height="20"
HorizontalAlignment="Left" VerticalAlignment="Top" d:Foreground="Red" FontSize="16"
Canvas.Left="996" Canvas.Top="264" Canvas.Right="384.8" Height="20"
HorizontalAlignment="Center" VerticalAlignment="Top" d:Foreground="Red" FontSize="16"
Foreground="{Binding DeviceStatus.IsSetReactTurnMotorJogging, Converter={StaticResource BoolToColorConverter}}"
Text="⬛" TextAlignment="Center" />
<TextBlock
@@ -1550,13 +1633,13 @@
Foreground="{Binding DeviceStatus.IsSetReactPressureReliefValve, Converter={StaticResource BoolToColorConverter}}"
Text="⬛" TextAlignment="Center" />
<bpa:PipeLineTL
Canvas.Left="730" Canvas.Top="290.5" Canvas.Right="260" Width="10"
Height="10" HorizontalAlignment="Center" VerticalAlignment="Top"
Canvas.Left="730" Canvas.Top="290.5" Canvas.Right="260" Width="20"
Height="20" HorizontalAlignment="Center" VerticalAlignment="Top"
Direction="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=5, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ReactOutHotGasValve, ConverterParameter=2, Converter={StaticResource deviceConvert}}"
LineWidth="10" Speed="1.5" />
<bpa:PipeLineBL
Canvas.Left="237" Canvas.Top="51" Width="10" Height="10"
Canvas.Left="233" Canvas.Top="50" Width="20" Height="20"
HorizontalAlignment="Left" VerticalAlignment="Center"
Direction="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=1, Converter={StaticResource deviceConvert}}"
Fill="{Binding DeviceStatus.ColdWaterTankInWaterValve, ConverterParameter=6, Converter={StaticResource deviceConvert}}"


+ 96
- 20
BPASmartClient.Academy/View/ReactionKettle50LView.xaml.cs Переглянути файл

@@ -40,16 +40,18 @@ namespace BPASmartClient.Academy.View
if (PlcControl.GetInstance.IsConnect)
{
var tag = button.Tag.ToString().Trim();
BoolAddEnum addr=(BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tag);
var result= PlcControl.GetInstance.Write(addr, true);
if (result !=null && result.IsSuccess)
{
Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:True");
}
else
{
Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:True\n{result.Message}");
}
//BoolAddEnum addr = (BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tag);
//var result = PlcControl.GetInstance.Write(addr, true);
//if (result != null && result.IsSuccess)
//{
// Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:True");
//}
//else
//{
// Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:True\n{result.Message}");
//}

WriteBooleanAddr(tag,true);
}
else
{
@@ -65,16 +67,17 @@ namespace BPASmartClient.Academy.View
if (PlcControl.GetInstance.IsConnect)
{
var tag = button.Tag.ToString().Trim();
BoolAddEnum addr = (BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tag);
var result = PlcControl.GetInstance.Write(addr, false);
if (result != null && result.IsSuccess)
{
Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:False");
}
else
{
Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:False\n{result.Message}");
}
//BoolAddEnum addr = (BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tag);
//var result = PlcControl.GetInstance.Write(addr, false);
//if (result != null && result.IsSuccess)
//{
// Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:False");
//}
//else
//{
// Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:False\n{result.Message}");
//}
WriteBooleanAddr(tag, false);
}
else
{
@@ -265,5 +268,78 @@ namespace BPASmartClient.Academy.View
Notify(EnumPromptType.Error, "写入失败", "设备未连接");
}
}

private void Canvas_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.Source is HandValve valve)
{
if (PlcControl.GetInstance.IsConnect && valve.Tag != null && !string.IsNullOrWhiteSpace(valve.Tag.ToString().Trim()))
{
var tag = valve.Tag.ToString().Trim();
BoolAddEnum addr = (BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tag);
DeviceControlView.Show(tag, "未知", valve.OpenEnable ? "打开" : "关闭", new Action(() =>
{
var result = PlcControl.GetInstance.Write(addr, true);
if (result != null && result.IsSuccess)
{
Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:True");
}
else
{
Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:True\n{result.Message}");
}
}), new Action(() =>
{
var result = PlcControl.GetInstance.Write(addr, false);
if (result != null && result.IsSuccess)
{
Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tag}:False");
}
else
{
Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tag}:False\n{result.Message}");
}
}));
}
else
{
Notify(EnumPromptType.Error, "失败", "设备未连接,不可进行控制。");
}
}
}

private void WriteBooleanAddr(string tagName,bool value)
{
BoolAddEnum addr = BoolAddEnum.反应釜旋转电机;
try
{
addr = (BoolAddEnum)Enum.Parse(typeof(BoolAddEnum), tagName);
}
catch (Exception)
{
Notify(EnumPromptType.Error, "失败", $"未找到该地址[{tagName}]。");
return;
}
var result = PlcControl.GetInstance.Write(addr, value);
if (result != null && result.IsSuccess)
{
Notify(EnumPromptType.Success, $"写入成功", $"成功:写入{tagName}:{value}");
}
else
{
Notify(EnumPromptType.Error, $"写入失败", $"失败:写入{tagName}:{value}\n{result.Message}");
}
}


private void Button_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
open_Click(sender,e);
}

private void Button_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
close_Click(sender,e);
}
}
}

+ 16
- 0
BPASmartClient.Academy/ViewModel/DeviceControlViewModel.cs Переглянути файл

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPASmartClient.Academy.ViewModel
{
public class DeviceControlViewModel:NotifyBase
{
public DeviceControlViewModel()
{
}
}
}

Завантаження…
Відмінити
Зберегти