179 lines
11 KiB
XML
179 lines
11 KiB
XML
<UserControl x:Class="AuroraPLC.Views.UCPLCDevice"
|
|
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:behavior="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:local="clr-namespace:AuroraPLC.Views"
|
|
xmlns:auroraview="clr-namespace:Aurora.View;assembly=Aurora"
|
|
xmlns:usercontrols="clr-namespace:AuroraUIComponent.UserControls;assembly=AuroraUIComponent"
|
|
d:DataContext="{d:DesignInstance Type=local:UCPLCDeviceViewModel}"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="500" d:DesignWidth="800"
|
|
x:Name="uc">
|
|
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<auroraview:BoolConverter x:Key="convFalseVisible" TrueValue="Hidden" FalseValue="Visible"/>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<auroraview:SharedResourceDictionary Source="pack://application:,,,/AuroraUIComponent;component/Style/Generic.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</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>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="300"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="3*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<GroupBox Header="PLC Info." FontSize="11" Margin="0 0 3 3">
|
|
<UniformGrid Columns="2">
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of B Device Input</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumBitInput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of B Device Output</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumBitOutput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of M Device Input</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumMBitInput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of M Device Output</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumMBitOutput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of W Device Input</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumWordInput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of W Device Output</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumWordOutput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of D Device Input</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumDWordInput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">No. of D Device Output</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumDWordOutput}"/>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">Network Type</TextBlock>
|
|
<TextBox FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NetworkType}"/>
|
|
</UniformGrid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Grid.Column="1"
|
|
Header="PLC Status" FontSize="11" Margin="0 0 3 3">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Margin="5 0" Style="{StaticResource StKeyTB}">B/W Update rate</TextBlock>
|
|
<TextBox Grid.Row="0" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding UpdateRate, StringFormat={}{0:0.000}}"/>
|
|
<TextBlock Text="Hz" FontSize="11" Grid.Column="1" HorizontalAlignment="Right" Margin="0 0 6 0" Foreground="#c0c0c0"/>
|
|
|
|
<TextBlock Grid.Row="1" Margin="5 0" Style="{StaticResource StKeyTB}">Elapsed Time</TextBlock>
|
|
<TextBox Grid.Row="1" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding ElapsedTime}"/>
|
|
|
|
<TextBlock Grid.Row="2" Margin="5 0" Style="{StaticResource StKeyTB}">Operation Mode</TextBlock>
|
|
<TextBox Grid.Row="2" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding OperationMode}"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
|
|
<GroupBox Grid.Column="2" Grid.RowSpan="2"
|
|
Header="PLC Statistics" FontSize="11" Margin="0 0 3 3">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<StackPanel Orientation="Horizontal" Margin="10 0 0 0">
|
|
<TextBlock Margin="5 0 0 0" Text="R/W Rate [Hz]:"/>
|
|
|
|
<usercontrols:UCKeyValue KeyText="No. of samples:" Value="{Binding NumOfMaxRateSample}"
|
|
DecimalPlaces="0" KeyTextWidth="Auto"
|
|
ShowKeypad="False"
|
|
IsEnabled="{Binding IsStatPauseChecked}"/>
|
|
|
|
<ToggleButton Margin="5 0 0 0"
|
|
IsChecked="{Binding IsStatPauseChecked}">
|
|
<ToggleButton.Style>
|
|
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource StToggleButtonAccentPurple}">
|
|
<Setter Property="Content" Value="Pause"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter Property="Content" Value="Resume"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ToggleButton.Style>
|
|
</ToggleButton>
|
|
|
|
<TextBlock Margin="10 0 0 0" Visibility="{Binding IsStatPauseChecked, Converter={StaticResource convFalseVisible}}"
|
|
Text="{Binding RateQueueStatus}"/>
|
|
<Button FontSize="12" Content="Save (CSV)" Margin="5 0 0 0" Padding="5" Style="{StaticResource StButtonAccent}"
|
|
Visibility="{Binding IsSaveAsCSVVisible, Converter={StaticResource convVisibleCollapsed}}"
|
|
Command="{Binding CMD_SaveAsCSV}"/>
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition Height="10*"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Margin="5 0" Style="{StaticResource StKeyTB}">Mean Rate [Hz]</TextBlock>
|
|
<TextBox Grid.Row="0" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding MeanRateHz, StringFormat={}{0:0.000}}"/>
|
|
|
|
<TextBlock Grid.Row="1" Margin="5 0" Style="{StaticResource StKeyTB}">Min Rate [Hz]</TextBlock>
|
|
<TextBox Grid.Row="1" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding MinRateHz, StringFormat={}{0:0.000}}"/>
|
|
|
|
<TextBlock Grid.Row="2" Margin="5 0" Style="{StaticResource StKeyTB}">Std Dev.</TextBlock>
|
|
<TextBox Grid.Row="2" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding StdRateHz, StringFormat={}{0:0.0000000}}"/>
|
|
</Grid>
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<GroupBox Grid.Row="1" Grid.Column="1"
|
|
Header="Data Updator Status" FontSize="11" Margin="0 0 3 3">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Margin="5 0" Style="{StaticResource StKeyTB}">No. of ReadBit Fail</TextBlock>
|
|
<TextBlock Grid.Row="1" Margin="5 0" Style="{StaticResource StKeyTB}">No. of WriteBit Fail</TextBlock>
|
|
<TextBlock Grid.Row="2" Margin="5 0" Style="{StaticResource StKeyTB}">No. of ReadWord Fail</TextBlock>
|
|
<TextBlock Grid.Row="3" Margin="5 0" Style="{StaticResource StKeyTB}">No. of WriteWord Fail</TextBlock>
|
|
<TextBox Grid.Row="0" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumReadBitFail, Mode=OneWay}"/>
|
|
<TextBox Grid.Row="1" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumWriteBitFail, Mode=OneWay}"/>
|
|
<TextBox Grid.Row="2" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumReadWordFail, Mode=OneWay}"/>
|
|
<TextBox Grid.Row="3" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumWriteWordFail, Mode=OneWay}"/>
|
|
|
|
<TextBlock Grid.Row="4" Margin="5 0" Style="{StaticResource StKeyTB}">No. of Reconnection</TextBlock>
|
|
<TextBox Grid.Row="4" Grid.Column="1" FontSize="12" IsReadOnly="True" TextAlignment="Center" Text="{Binding NumReconnection, Mode=OneWay}"/>
|
|
</Grid>
|
|
</GroupBox>
|
|
</Grid>
|
|
</UserControl>
|