@@ -78,6 +78,8 @@ | |||||
<icon:PackIconModern Kind="Delete"/> | <icon:PackIconModern Kind="Delete"/> | ||||
</Button> | </Button> | ||||
<Button x:Name="RunBtn" Margin="16 0 0 0" Padding="0" Click="RunBtn_Click" Command="{Binding RunUiCommand}"> | <Button x:Name="RunBtn" Margin="16 0 0 0" Padding="0" Click="RunBtn_Click" Command="{Binding RunUiCommand}"> | ||||
<Button.Style> | <Button.Style> | ||||
<Style TargetType="Button"> | <Style TargetType="Button"> | ||||
@@ -107,6 +109,13 @@ | |||||
</Button.Style> | </Button.Style> | ||||
</Button> | </Button> | ||||
<Button x:Name="Run1Btn" Margin="16 0 0 0" Padding="0" Click="MNRunBtn_Click"> | |||||
<StackPanel Orientation="Horizontal" Margin="8 0"> | |||||
<icon:PackIconModern Kind="ControlPlay" VerticalAlignment="Center" Foreground="#28B60F" Width="8"/> | |||||
<TextBlock Text="模拟运行" Margin="4 0" VerticalAlignment="Center"/> | |||||
</StackPanel> | |||||
</Button> | |||||
<Button x:Name="SaveBtn" Margin="16 0 0 0" Padding="0" Click="SaveBtn_Click"> | <Button x:Name="SaveBtn" Margin="16 0 0 0" Padding="0" Click="SaveBtn_Click"> | ||||
<StackPanel Orientation="Horizontal" Margin="8 0"> | <StackPanel Orientation="Horizontal" Margin="8 0"> | ||||
<icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/> | <icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/> | ||||
@@ -1,4 +1,5 @@ | |||||
using BeDesignerSCADA.Common; | using BeDesignerSCADA.Common; | ||||
using BeDesignerSCADA.View; | |||||
using BeDesignerSCADA.ViewModel; | using BeDesignerSCADA.ViewModel; | ||||
using BeDesignerSCADA.ViewModel; | using BeDesignerSCADA.ViewModel; | ||||
using BPASmart.Model; | using BPASmart.Model; | ||||
@@ -157,6 +158,18 @@ namespace BeDesignerSCADA.Controls | |||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 模拟运行 | |||||
/// </summary> | |||||
/// <param name="sender"></param> | |||||
/// <param name="e"></param> | |||||
private void MNRunBtn_Click(object sender, RoutedEventArgs e) | |||||
{ | |||||
cav.ClearSelection(); | |||||
RunWindows runWindows=new RunWindows(); | |||||
runWindows.LoadingData(cav.Generator()); | |||||
runWindows.Show(); | |||||
} | |||||
/// <summary> | |||||
/// 加载 | /// 加载 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="sender"></param> | /// <param name="sender"></param> | ||||
@@ -574,6 +587,8 @@ namespace BeDesignerSCADA.Controls | |||||
// communication?.CommunicationDevices?.ToList().ForEach(x => { viewModel.DevNameList.Add(x.DeviceName); }); | // communication?.CommunicationDevices?.ToList().ForEach(x => { viewModel.DevNameList.Add(x.DeviceName); }); | ||||
//} | //} | ||||
#endregion | #endregion | ||||
} | } | ||||
@@ -0,0 +1,25 @@ | |||||
<Window x:Class="BeDesignerSCADA.View.RunWindows" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:local="clr-namespace:BeDesignerSCADA.View" | |||||
xmlns:ctl="clr-namespace:BeDesignerSCADA.Controls" | |||||
mc:Ignorable="d" | |||||
WindowState="Maximized" | |||||
Title="模拟运行器" Height="450" Width="800"> | |||||
<Window.Resources> | |||||
<ResourceDictionary> | |||||
<ResourceDictionary.MergedDictionaries> | |||||
<ResourceDictionary Source="/BeDesignerSCADA;component/Themes/Styles.xaml" /> | |||||
<ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" /> | |||||
</ResourceDictionary.MergedDictionaries> | |||||
</ResourceDictionary> | |||||
</Window.Resources> | |||||
<Grid> | |||||
<Grid.Background> | |||||
<ImageBrush ImageSource="../Images/bj.png"/> | |||||
</Grid.Background> | |||||
<ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding RunCanvasVisibility}" /> | |||||
</Grid> | |||||
</Window> |
@@ -0,0 +1,32 @@ | |||||
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.Shapes; | |||||
namespace BeDesignerSCADA.View | |||||
{ | |||||
/// <summary> | |||||
/// RunWindows.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class RunWindows : Window | |||||
{ | |||||
public RunWindows() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
public void LoadingData(List<FrameworkElement> frameworks) | |||||
{ | |||||
runCanvas.Run(frameworks); | |||||
} | |||||
} | |||||
} |