231 lines
9.0 KiB
Plaintext
231 lines
9.0 KiB
Plaintext
|
|
<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>
|