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

增加模拟运行器

样式分支
fyf 2 роки тому
джерело
коміт
72cedb49f6
4 змінених файлів з 81 додано та 0 видалено
  1. +9
    -0
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml
  2. +15
    -0
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs
  3. +25
    -0
      BeDesignerSCADA/View/RunWindows.xaml
  4. +32
    -0
      BeDesignerSCADA/View/RunWindows.xaml.cs

+ 9
- 0
BeDesignerSCADA/Controls/MainCanvasPanel.xaml Переглянути файл

@@ -78,6 +78,8 @@
<icon:PackIconModern Kind="Delete"/>
</Button>

<Button x:Name="RunBtn" Margin="16 0 0 0" Padding="0" Click="RunBtn_Click" Command="{Binding RunUiCommand}">
<Button.Style>
<Style TargetType="Button">
@@ -107,6 +109,13 @@
</Button.Style>
</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">
<StackPanel Orientation="Horizontal" Margin="8 0">
<icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/>


+ 15
- 0
BeDesignerSCADA/Controls/MainCanvasPanel.xaml.cs Переглянути файл

@@ -1,4 +1,5 @@
using BeDesignerSCADA.Common;
using BeDesignerSCADA.View;
using BeDesignerSCADA.ViewModel;
using BeDesignerSCADA.ViewModel;
using BPASmart.Model;
@@ -157,6 +158,18 @@ namespace BeDesignerSCADA.Controls
}
}
/// <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>
/// <param name="sender"></param>
@@ -574,6 +587,8 @@ namespace BeDesignerSCADA.Controls
// communication?.CommunicationDevices?.ToList().ForEach(x => { viewModel.DevNameList.Add(x.DeviceName); });
//}
#endregion


}




+ 25
- 0
BeDesignerSCADA/View/RunWindows.xaml Переглянути файл

@@ -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>

+ 32
- 0
BeDesignerSCADA/View/RunWindows.xaml.cs Переглянути файл

@@ -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);
}
}
}

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