添加项目文件。
This commit is contained in:
230
SamplePreSystem.UI/Views/SOPManager/ActionManagerView.xaml
Normal file
230
SamplePreSystem.UI/Views/SOPManager/ActionManagerView.xaml
Normal file
@@ -0,0 +1,230 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ParamManager.ActionManagerView"
|
||||
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:local="clr-namespace:SamplePre.UIWpf.ParamManager"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#E6E6E6"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<!-- 动作列表 -->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel
|
||||
Grid.ColumnSpan="2"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="动作列表" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAddAction"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnAddActionClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
|
||||
<Button
|
||||
x:Name="btnDelAction"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnDelActionClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteOutline" />
|
||||
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_actions"
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SysActions}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<!-- 分组样式 -->
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Height="25" LastChildFill="True">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name}" />
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</GroupStyle.HeaderTemplate>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding action_name}"
|
||||
Header="动作名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding action_adress}"
|
||||
Header="设备地址" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding action_unitname}"
|
||||
Header="动作单元" />
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding remark}"
|
||||
Header="备注" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
<!-- 参数列表 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="5,0,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="动作参数:" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnSelectParam"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnSelectParamClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnDelParm"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0"
|
||||
Command="{Binding BtnDelParmClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteOutline" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding ActionParams}"
|
||||
SelectedItem="{Binding SelectParam}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,43 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.ParamManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace SamplePre.UIWpf.ParamManager
|
||||
{
|
||||
/// <summary>
|
||||
/// ParamManagerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ActionManagerView : UserControl
|
||||
{
|
||||
ActionManagerViewModel actionManagerViewModel = new ActionManagerViewModel();
|
||||
|
||||
|
||||
public ActionManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = actionManagerViewModel;
|
||||
|
||||
ListCollectionView view = (ListCollectionView)CollectionViewSource.GetDefaultView(actionManagerViewModel.SysActions);//获取数据视图
|
||||
|
||||
////分组
|
||||
view.GroupDescriptions.Clear();
|
||||
view.GroupDescriptions.Add(new PropertyGroupDescription("action_unitname"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
141
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml
Normal file
141
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml
Normal file
@@ -0,0 +1,141 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.ParamManager.ParamManagerView"
|
||||
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:local="clr-namespace:SamplePre.UIWpf.ParamManager"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#e6e6e6"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Border
|
||||
Margin="5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Width="100"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Text="参数列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
|
||||
<TextBlock
|
||||
Margin="15,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="0,0,10,0"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding DataTypes}"
|
||||
SelectedItem="{Binding FilterType}" />
|
||||
<Button
|
||||
x:Name="btnAddParam"
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnAddParamClickCommand}"
|
||||
Content="新增"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="PackageVariantClosedPlus" />
|
||||
<Button
|
||||
x:Name="btnEdit"
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnEditClickCommand}"
|
||||
Content="编辑"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="ContentSaveEditOutline" />
|
||||
<Button
|
||||
x:Name="btnDelParam"
|
||||
Width="80"
|
||||
Height="30"
|
||||
Margin="3"
|
||||
Command="{Binding BtnDelParamClickCommand}"
|
||||
Content="删除"
|
||||
Style="{StaticResource IconTextButtonStyle}"
|
||||
Tag="DeleteForeverOutline" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!-- 参数列表 -->
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SysParams}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="数据类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding param_type}"
|
||||
Header="参数类型" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</UserControl>
|
||||
37
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml.cs
Normal file
37
SamplePreSystem.UI/Views/SOPManager/ParamManagerView.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.ParamManager.chirld;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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;
|
||||
using System.Xml.XPath;
|
||||
|
||||
namespace SamplePre.UIWpf.ParamManager
|
||||
{
|
||||
/// <summary>
|
||||
/// ParamManagerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ParamManagerView : UserControl
|
||||
{
|
||||
ParamManagerViewModel paramManagerViewModel = new ParamManagerViewModel();
|
||||
public ParamManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = paramManagerViewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
385
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml
Normal file
385
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml
Normal file
@@ -0,0 +1,385 @@
|
||||
<UserControl
|
||||
x:Class="SamplePre.UIWpf.SopManagerView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:bh="clr-namespace:SamplePreSystem.UI.Behaviors"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:local="clr-namespace:SamplePre.UIWpf"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="#E6E6E6"
|
||||
mc:Ignorable="d">
|
||||
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*" />
|
||||
<ColumnDefinition Width="3*" />
|
||||
<ColumnDefinition Width="0.7*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- 标准列表 -->
|
||||
<Border
|
||||
Grid.Column="0"
|
||||
Margin="5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel
|
||||
Grid.Row="0"
|
||||
Height="30"
|
||||
VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
Padding="6"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="标准列表" />
|
||||
</StackPanel>
|
||||
|
||||
<TreeView
|
||||
x:Name="standardList"
|
||||
Grid.Row="1"
|
||||
FontSize="13"
|
||||
ItemsSource="{Binding StandardGroups}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectedItemChanged">
|
||||
<i:InvokeCommandAction Command="{Binding StandSelectedItemChangedCommand}" CommandParameter="{Binding Path=SelectedItem, RelativeSource={RelativeSource AncestorType=TreeView}}" />
|
||||
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignTreeViewItem}" TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding ListItems}">
|
||||
|
||||
<!-- 一级节点的显示内容 -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="Book" />
|
||||
<TextBlock Text="{Binding SopName}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 二级节点(子项)的模板 -->
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="TextBoxOutline" />
|
||||
<TextBlock Margin="10,0,0,0" Text="{Binding DisplayText}" />
|
||||
</StackPanel>
|
||||
|
||||
</DataTemplate>
|
||||
</HierarchicalDataTemplate.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 中间区域 -->
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="2*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- sop动作 -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="动作列表" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
|
||||
|
||||
<Button
|
||||
x:Name="btnUp"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnUp_Click"
|
||||
Content="{materialDesign:PackIcon MenuUpOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="上移" />
|
||||
<Button
|
||||
x:Name="btnDown"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnDown_Click"
|
||||
Content="{materialDesign:PackIcon MenuDownOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="下移" />
|
||||
<Button
|
||||
x:Name="btnDelAction"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnDelAction_Click"
|
||||
Content="{materialDesign:PackIcon DeleteOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除动作" />
|
||||
<Button
|
||||
x:Name="btnUpdateSeq"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="2,0"
|
||||
Click="btnUpdateSeq_Click"
|
||||
Content="{materialDesign:PackIcon ContentSave}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="更新顺序" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
x:Name="dg_soplist"
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AllowDrop="True"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding SopList}"
|
||||
SelectedItem="{Binding SelectItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<i:Interaction.Behaviors>
|
||||
<bh:DataGridDragBehavior DropCompletedCommand="{Binding AddDragSopActionCommand}" />
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
Binding="{Binding process_no}"
|
||||
Header="序号" />
|
||||
<DataGridTextColumn
|
||||
Width="auto"
|
||||
Binding="{Binding action_name}"
|
||||
Header="动作名称" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding all_param}"
|
||||
Header="动作参数" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding remark}"
|
||||
Header="说明" />
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- 参数 -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="0,0,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Width="100"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="参数列表:" />
|
||||
<StackPanel
|
||||
Grid.Column="1"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnAddParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnAddParam_Click"
|
||||
Content="{materialDesign:PackIcon Plus}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="新增参数" />
|
||||
<Button
|
||||
x:Name="btnEidtParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnEidtParam_Click"
|
||||
Content="{materialDesign:PackIcon ContentSaveEditOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="修改参数" />
|
||||
<Button
|
||||
x:Name="btnDelParam"
|
||||
Width="50"
|
||||
Height="25"
|
||||
Margin="1,0"
|
||||
Click="btnDelParam_Click"
|
||||
Content="{materialDesign:PackIcon DeleteOutline}"
|
||||
Style="{StaticResource MaterialDesignRaisedSecondaryButton}"
|
||||
ToolTip="删除参数" />
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
ItemsSource="{Binding ActionParamList}"
|
||||
SelectedItem="{Binding SelectParamItem}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="2*"
|
||||
Binding="{Binding title}"
|
||||
Header="参数名称"
|
||||
IsReadOnly="True" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="参数值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="单位"
|
||||
IsReadOnly="True" />
|
||||
|
||||
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- //动作字典 -->
|
||||
<Border
|
||||
Grid.Column="2"
|
||||
Margin="0,5,5,5"
|
||||
Background="White"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Text="动作字典:" />
|
||||
|
||||
<TreeView
|
||||
Grid.Row="1"
|
||||
AllowDrop="False"
|
||||
ItemsSource="{Binding ActionGroups}">
|
||||
|
||||
<i:Interaction.Behaviors>
|
||||
<bh:TreeViewDragBehavior />
|
||||
</i:Interaction.Behaviors>
|
||||
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource MaterialDesignTreeViewItem}" TargetType="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding ListItems}">
|
||||
<!-- 一级节点的显示内容 -->
|
||||
<!--<TextBlock Text="{Binding SopName}" />-->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="Collage" />
|
||||
<TextBlock Text="{Binding SopName}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- 二级节点(子项)的模板 -->
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialDesign:PackIcon Margin="5,0" Kind="TextBoxOutline" />
|
||||
<TextBlock Margin="10,0,0,0" Text="{Binding DisplayText}" />
|
||||
</StackPanel>
|
||||
|
||||
</DataTemplate>
|
||||
</HierarchicalDataTemplate.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Grid>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
</UserControl>
|
||||
102
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml.cs
Normal file
102
SamplePreSystem.UI/Views/SOPManager/SopManagerView.xaml.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
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 SamplePre.UIWpf
|
||||
{
|
||||
/// <summary>
|
||||
/// SopManagerView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SopManagerView : UserControl
|
||||
{
|
||||
|
||||
SopMangerViewModel sopMangerViewModel = new SopMangerViewModel();
|
||||
public SopManagerView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = sopMangerViewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 删除动作
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnDelAction_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.RemoveAction();
|
||||
}
|
||||
|
||||
private void btnUp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.UpMove();
|
||||
}
|
||||
|
||||
private void btnDown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.DownMove();
|
||||
}
|
||||
|
||||
private void btnUpdateSeq_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
sopMangerViewModel.UpdateSeqno();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnEidtParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.AddEidtParam();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 新增参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnAddParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.AddParamShow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除参数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void btnDelParam_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dataContext = this.DataContext as SopMangerViewModel;
|
||||
dataContext.RemoveParam();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
112
SamplePreSystem.UI/Views/SOPManager/chirld/NewActionWindow.xaml
Normal file
@@ -0,0 +1,112 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewActionWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="新增动作"
|
||||
Width="400"
|
||||
Height="300"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<!--<RowDefinition/>
|
||||
<RowDefinition/>-->
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.action_name}" />
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="备注:" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.remark}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="动作单元:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding ActionUnits}"
|
||||
SelectedItem="{Binding SelectSysDict}"
|
||||
SelectedValuePath="id" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysAction.plc_type}" />
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewActionWindow : BaseWindow
|
||||
{
|
||||
ActionManagerViewModel actionManagerVM;
|
||||
public NewActionWindow(ActionManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = new NewActionViewModel();
|
||||
|
||||
this.actionManagerVM = viewModel;
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var vm = this.DataContext as NewActionViewModel;
|
||||
|
||||
if (vm.SaveNewData() < 0) return;
|
||||
|
||||
this.DialogResult = true;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.DialogResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.NewStandParmWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="参数编辑"
|
||||
Width="400"
|
||||
Height="350"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Text="名称:" />
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.title}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Text="值:" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_value}" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Text="单位:" />
|
||||
<ComboBox
|
||||
x:Name="cmbUnit"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="data_type"
|
||||
ItemsSource="{Binding Units}"
|
||||
SelectedValuePath="id"
|
||||
Text="{Binding SysParm.unit}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="数据类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.data_type}">
|
||||
<ComboBoxItem Content="数值" />
|
||||
<ComboBoxItem Content="字符串" />
|
||||
</ComboBox>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Text="PLC映射:" />
|
||||
<TextBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.plc_type}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbParamType"
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Width="250"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Text="{Binding SysParm.param_type}">
|
||||
<ComboBoxItem Content="通用" />
|
||||
<ComboBoxItem Content="耗材" />
|
||||
<ComboBoxItem Content="液体" />
|
||||
</ComboBox>
|
||||
|
||||
|
||||
</Grid>
|
||||
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnOK_Click"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Click="btnCancel_Click"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,52 @@
|
||||
using Models.Models;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.SopManager;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// NewStandParmWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class NewStandParmWindow : BaseWindow
|
||||
{
|
||||
ParamManagerViewModel viewModel;
|
||||
public NewStandParmWindow(ParamManagerViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.DataContext = viewModel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var v= this.DataContext as ParamManagerViewModel;
|
||||
|
||||
if (!v.SaveParam()) return;
|
||||
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
<basewindows:BaseWindow
|
||||
x:Class="SamplePre.UIWpf.ParamManager.chirld.SelectParmListWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:basewindows="clr-namespace:SamplePre.UIWpf.BaseWindows"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="选择参数"
|
||||
Width="600"
|
||||
Height="450"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="10,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="参数类型:" />
|
||||
<ComboBox
|
||||
x:Name="cmbDataType"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding DataTypes}"
|
||||
SelectedItem="{Binding FilterType}" />
|
||||
</StackPanel>
|
||||
<DataGrid
|
||||
x:Name="dg_params"
|
||||
Grid.Row="1"
|
||||
AutoGenerateColumns="False"
|
||||
Background="White"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="True"
|
||||
FrozenColumnCount="1"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Parms}"
|
||||
SelectedItem="{Binding SelectParm}"
|
||||
SelectionMode="Extended"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding title}"
|
||||
Header="标题" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding unit}"
|
||||
Header="PLC单位" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_type}"
|
||||
Header="数据类型" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding data_value}"
|
||||
Header="值" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding plc_type}"
|
||||
Header="PLC映射" />
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnOK"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Command="{Binding BtnOKClickCommand}"
|
||||
Content="确定" />
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="80"
|
||||
Margin="5"
|
||||
Command="{Binding BtnCancelClickCommand}"
|
||||
Content="取消" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</basewindows:BaseWindow>
|
||||
@@ -0,0 +1,53 @@
|
||||
using Models.Models;
|
||||
using SamplePre.Models.Ext;
|
||||
using SamplePre.UIWpf.BaseWindows;
|
||||
using SamplePreSystem.UI.BaseControls;
|
||||
using SamplePreSystem.UI.ViewModel.Child;
|
||||
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 SamplePre.UIWpf.ParamManager.chirld
|
||||
{
|
||||
/// <summary>
|
||||
/// SelectParmListWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SelectParmListWindow : BaseWindow
|
||||
{
|
||||
public SelectParmListWindow(sys_standard_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
public SelectParmListWindow(sys_action_ext sysStandardAction)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var vm = new SelectParmListViewModel(sysStandardAction);
|
||||
|
||||
//关闭窗口委托
|
||||
vm.CloseAction = (val) => DialogResult = val;
|
||||
|
||||
this.DataContext = vm;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user