141 lines
8.3 KiB
XML
141 lines
8.3 KiB
XML
<UserControl x:Class="AuroraPLC.Views.UCPLCBitSmall"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:AuroraPLC.Views"
|
|
xmlns:uic="clr-namespace:AuroraUIComponent;assembly=AuroraUIComponent"
|
|
xmlns:aurora="clr-namespace:Aurora.View;assembly=Aurora"
|
|
xmlns:behavior="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=local:UCPLCBitViewModel}"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="450" d:DesignWidth="800"
|
|
Background="#121212" FontSize="12" Padding="2"
|
|
x:Name="uc">
|
|
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<aurora:SharedResourceDictionary Source="pack://application:,,,/AuroraUIComponent;component/Style/Generic.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<Style x:Key="StSignal" TargetType="Ellipse">
|
|
<Setter Property="Width" Value="15"/>
|
|
<Setter Property="Height" Value="15"/>
|
|
<Setter Property="StrokeThickness" Value="1"/>
|
|
<Setter Property="Stroke" Value="Black"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
</Style>
|
|
<aurora:BoolConverter
|
|
x:Key="convSignalConv"
|
|
FalseValue="Gray"
|
|
TrueValue="Lime"/>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<behavior:Interaction.Triggers>
|
|
<behavior:PropertyChangedTrigger Binding="{Binding IsVisible, ElementName=uc}">
|
|
<behavior:InvokeCommandAction Command="{Binding CMD_VisibleChanged}" CommandParameter="{Binding IsVisible, ElementName=uc}"/>
|
|
</behavior:PropertyChangedTrigger>
|
|
</behavior:Interaction.Triggers>
|
|
|
|
<Grid Margin="0 0 0 0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Border Grid.Row="0" Margin="0 0 0 0" Style="{StaticResource StGroupBorder}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
Foreground="#dddddd" Margin="0 10"
|
|
FontSize="15" FontWeight="Bold"
|
|
Text="{Binding [BitInputsTitle], Source={StaticResource langTokens}}"/>
|
|
</Grid>
|
|
<DataGrid Grid.Row="1" ItemsSource="{Binding DigitalInputs}" Margin="0 0 0 5"
|
|
SelectedItem="{Binding SelectedInputItem}"
|
|
AutoGenerateColumns="False" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
|
BorderThickness="1"
|
|
DataGrid.RowStyle ="{StaticResource RowStyle}" ColumnHeaderStyle="{StaticResource StDataGridHeaderStyle}"
|
|
CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True"
|
|
CanUserSortColumns="False"
|
|
HeadersVisibility="Column">
|
|
<!-- ScrollViewer.HorizontalScrollBarVisibility="Auto" -->
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Width="1*" Header="{Binding [Address], Source={StaticResource langTokens}}" Binding="{Binding Address}"
|
|
FontSize="12"/>
|
|
<DataGridTextColumn Width="5*" Header="{Binding [Description], Source={StaticResource langTokens}}" Binding="{Binding Description}"
|
|
FontSize="12"/>
|
|
<DataGridTemplateColumn Width="1*" Header="{Binding [Status], Source={StaticResource langTokens}}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Ellipse Fill="{Binding InPutStatus, Converter={StaticResource convSignalConv}}" Style="{StaticResource StSignal}"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="1" Margin="0 0 0 0" Style="{StaticResource StGroupBorder}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Grid>
|
|
<StackPanel Orientation="Horizontal" Margin="15 10 0 10">
|
|
<Border BorderBrush="Black" BorderThickness="1" Width="65">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
Foreground="White"
|
|
Text="{Binding SelectedBitAddress}"/>
|
|
</Border>
|
|
<Button HorizontalAlignment="Left" Margin="5 0"
|
|
Height="40" Padding="20 0"
|
|
Command="{Binding CMD_ChangeValue}"
|
|
Content="{Binding [Change], Source={StaticResource langTokens}}"
|
|
IsEnabled="{Binding ChangeButtonEnable}"
|
|
Style="{StaticResource StButtonAccent}"
|
|
FontSize="11"/>
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
Foreground="#dddddd" Margin="20 0"
|
|
FontSize="15" FontWeight="Bold"
|
|
Text="{Binding [BitOutputsTitle], Source={StaticResource langTokens}}"/>
|
|
</StackPanel>
|
|
<!--
|
|
<TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"
|
|
Foreground="#dddddd" Margin="0 10"
|
|
FontSize="15" FontWeight="Bold"
|
|
Text="Bit Output"/>
|
|
-->
|
|
</Grid>
|
|
<DataGrid Grid.Row="1" ItemsSource="{Binding DigitalOutputs}" Margin="0 0 0 0" SelectedItem="{Binding SelectedOutputItem}"
|
|
AutoGenerateColumns="False" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
|
BorderThickness="1"
|
|
DataGrid.RowStyle ="{StaticResource RowStyle}" ColumnHeaderStyle="{StaticResource StDataGridHeaderStyle}"
|
|
CanUserAddRows="False" CanUserDeleteRows="False" IsReadOnly="True"
|
|
CanUserSortColumns="False"
|
|
HeadersVisibility="Column">
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Width="1*" Header="{Binding [Address], Source={StaticResource langTokens}}" Binding="{Binding Address}"
|
|
FontSize="12"/>
|
|
<DataGridTextColumn Width="5*" Header="{Binding [Description], Source={StaticResource langTokens}}" Binding="{Binding Description}"
|
|
FontSize="12"/>
|
|
<DataGridTemplateColumn Width="1*" Header="{Binding [Status], Source={StaticResource langTokens}}">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<Ellipse Fill="{Binding OutPutStatus, Converter={StaticResource convSignalConv}}" Style="{StaticResource StSignal}"/>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
</UserControl>
|