Sic.Framework/SimulatorCore/Breakers/NSXBreakerView.xaml

136 lines
8.6 KiB
XML

<UserControl x:Class="MECF.Framework.Simulator.Core.Breakers.NSXBreakerView"
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:MECF.Framework.Simulator.Core.FFUs"
mc:Ignorable="d"
xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
Height="900" Width="900" Background="LightBlue" Initialized="UserControl_Initialized">
<UserControl.Resources>
<commons:ConnectionStatusBackgroundConverter x:Key="connectionStatusBackgroundConverter"/>
<Style TargetType="Label">
<Setter Property="FontSize" Value="16" />
<Setter Property="Padding" Value="10,0,10,0" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition Height="150"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="400"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="{Binding Title}" FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="50" Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}" ></Label>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<ComboBox Name="PortName" Text="{Binding PortSetPoint}" VerticalContentAlignment="Center" Width="120" Margin="20,0,0,0" Height="35" />
<Label Content="Listen port:"></Label>
<Label Content="{Binding LocalPort}"></Label>
<Label Content="{Binding ConnectionStatus}"></Label>
<Button Width="100" Height="35" Content="Enable" Command="{Binding EnableCommand}" IsEnabled="{Binding IsEnableEnable}"></Button>
<Button Width="100" Height="35" Content="Disable" Command="{Binding DisableCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
<Label Content="Connection:"></Label>
<Label Content="{Binding RemoteConnection}"></Label>
</StackPanel>
</Grid>
<Canvas Width="900" Margin="0,100,0,1" Grid.RowSpan="2">
<!--<CheckBox Content="Fail" IsChecked="{Binding IsFailed}" Canvas.Left="36" Canvas.Top="31"></CheckBox>
<CheckBox Content="Pump on" IsChecked="{Binding IsPumpOn}" Canvas.Left="36" Canvas.Top="86"></CheckBox>
<CheckBox Content="OverTemp" IsChecked="{Binding IsOverTemp}" Canvas.Left="172" Canvas.Top="86"></CheckBox>
<CheckBox Content="At Speed" IsChecked="{Binding IsAtSpeed}" Canvas.Left="324" Canvas.Top="90"></CheckBox>-->
<!-- <TextBlock Text="ActualTemp:" Canvas.Left="155" Canvas.Top="28" ></TextBlock>-->
<TextBox Text="{Binding APhaseCurrent, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="187" Canvas.Top="9" Margin="0" Width="94"></TextBox>
<CheckBox Content="APhaseCurrent" IsChecked="{Binding IsACurrent}" Canvas.Left="48" Canvas.Top="20" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<!--<TextBlock Text="SettingTemp:" Canvas.Left="151" Canvas.Top="88" ></TextBlock>-->
<TextBox Text="{Binding BPhaseCurrent, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="187" Canvas.Top="56" Margin="0" Width="94"></TextBox>
<CheckBox Content="BPhaseCurrent" IsChecked="{Binding IsBCurrent}" Canvas.Left="47" Canvas.Top="69" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<TextBox Text="{Binding CPhaseCurrent, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="187" Canvas.Top="104" Margin="0" Width="94"></TextBox>
<CheckBox Content="CPhaseCurrent" IsChecked="{Binding IsCCurrent}" Canvas.Left="52" Canvas.Top="116" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<!-- <TextBlock Text="ActualTemp:" Canvas.Left="155" Canvas.Top="28" ></TextBlock>-->
<TextBox Text="{Binding AActivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="454" Canvas.Top="10" Margin="0" Width="94"></TextBox>
<CheckBox Content="AActivePower" IsChecked="{Binding IsAActive}" Canvas.Left="320" Canvas.Top="22" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<!--<TextBlock Text="SettingTemp:" Canvas.Left="151" Canvas.Top="88" ></TextBlock>-->
<TextBox Text="{Binding BActivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="455" Canvas.Top="56" Margin="0" Width="94"></TextBox>
<CheckBox Content="BActivePower" IsChecked="{Binding IsBActive}" Canvas.Left="319" Canvas.Top="67" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<TextBox Text="{Binding CActivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="455" Canvas.Top="104" Margin="0" Width="94"></TextBox>
<CheckBox Content="CActivePower" IsChecked="{Binding IsCActive}" Canvas.Left="320" Canvas.Top="116" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<!-- <TextBlock Text="ActualTemp:" Canvas.Left="155" Canvas.Top="28" ></TextBlock>-->
<TextBox Text="{Binding AReactivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="722" Canvas.Top="10" Margin="0" Width="94" RenderTransformOrigin="0.552,0.109"></TextBox>
<CheckBox Content="AReactivePower" IsChecked="{Binding IsAReactive}" Canvas.Left="578" Canvas.Top="20" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<!--<TextBlock Text="SettingTemp:" Canvas.Left="151" Canvas.Top="88" ></TextBlock>-->
<TextBox Text="{Binding BReactivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="722" Canvas.Top="56" Margin="0" Width="94"></TextBox>
<CheckBox Content="BReactivePower" IsChecked="{Binding IsBReactive}" Canvas.Left="578" Canvas.Top="67" RenderTransformOrigin="1.288,-4.39"></CheckBox>
<TextBox Text="{Binding CReactivePower, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="722" Canvas.Top="104" Margin="0" Width="94"></TextBox>
<CheckBox Content="CReactivePower" IsChecked="{Binding IsCReactive}" Canvas.Left="580" Canvas.Top="117" RenderTransformOrigin="1.288,-4.39"></CheckBox>
</Canvas>
<StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
<Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
</StackPanel>
<DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
ScrollViewer.CanContentScroll="True"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
Width="900" Height="380" VerticalAlignment="Top">
<DataGrid.Columns>
<DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
<DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Height" Value="auto"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="Height" Value="auto"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</UserControl>