FfuView.xaml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <UserControl x:Class="MECF.Framework.Simulator.Core.FFUs.FfuView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MECF.Framework.Simulator.Core.FFUs"
  7. mc:Ignorable="d"
  8. xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons"
  9. Height="900" Width="900" Background="LightBlue" Initialized="UserControl_Initialized">
  10. <UserControl.Resources>
  11. <commons:ConnectionStatusBackgroundConverter x:Key="connectionStatusBackgroundConverter"/>
  12. <Style TargetType="Label">
  13. <Setter Property="FontSize" Value="16" />
  14. <Setter Property="Padding" Value="10,0,10,0" />
  15. <Setter Property="VerticalContentAlignment" Value="Center" />
  16. </Style>
  17. </UserControl.Resources>
  18. <Grid>
  19. <Grid.RowDefinitions>
  20. <RowDefinition Height="100"></RowDefinition>
  21. <RowDefinition Height="150"></RowDefinition>
  22. <RowDefinition Height="50"></RowDefinition>
  23. <RowDefinition Height="400"></RowDefinition>
  24. </Grid.RowDefinitions>
  25. <Grid Grid.Row="0" Grid.Column="0">
  26. <Grid.RowDefinitions>
  27. <RowDefinition Height="50"></RowDefinition>
  28. <RowDefinition Height="50"></RowDefinition>
  29. </Grid.RowDefinitions>
  30. <Label Grid.Row="0" Content="{Binding Title}" FontSize="20" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Height="50" Background="{Binding IsConnected, Converter={StaticResource connectionStatusBackgroundConverter}}" ></Label>
  31. <StackPanel Grid.Row="1" Orientation="Horizontal">
  32. <ComboBox Name="PortName" Text="{Binding PortSetPoint}" VerticalContentAlignment="Center" Width="120" Margin="20,0,0,0" Height="35" />
  33. <Label Content="Listen port:"></Label>
  34. <Label Content="{Binding LocalPort}"></Label>
  35. <Label Content="{Binding ConnectionStatus}"></Label>
  36. <Button Width="100" Height="35" Content="Enable" Command="{Binding EnableCommand}" IsEnabled="{Binding IsEnableEnable}"></Button>
  37. <Button Width="100" Height="35" Content="Disable" Command="{Binding DisableCommand}" IsEnabled="{Binding IsEnableDisable}"></Button>
  38. <Label Content="Connection:"></Label>
  39. <Label Content="{Binding RemoteConnection}"></Label>
  40. </StackPanel>
  41. </Grid>
  42. <Canvas Grid.Row="1" Width="900">
  43. <CheckBox Content="Fail" IsChecked="{Binding IsFailed}" Canvas.Left="36" Canvas.Top="31"></CheckBox>
  44. <CheckBox Content="Pump on" IsChecked="{Binding IsPumpOn}" Canvas.Left="36" Canvas.Top="86"></CheckBox>
  45. <CheckBox Content="OverTemp" IsChecked="{Binding IsOverTemp}" Canvas.Left="172" Canvas.Top="86"></CheckBox>
  46. <CheckBox Content="At Speed" IsChecked="{Binding IsAtSpeed}" Canvas.Left="324" Canvas.Top="90"></CheckBox>
  47. <TextBlock Text="Result:" Canvas.Left="155" Canvas.Top="42"></TextBlock>
  48. <TextBox Text="{Binding ResultValue, UpdateSourceTrigger=PropertyChanged }" Canvas.Left="212" Canvas.Top="31" Margin="0" Width="284"></TextBox>
  49. </Canvas>
  50. <StackPanel Grid.Row="2" Orientation="Horizontal" Width="900">
  51. <Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
  52. </StackPanel>
  53. <DataGrid Grid.Row="3" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False" ItemsSource="{Binding TransactionLogItems}"
  54. ScrollViewer.CanContentScroll="True"
  55. ScrollViewer.VerticalScrollBarVisibility="Auto"
  56. ScrollViewer.HorizontalScrollBarVisibility="Auto"
  57. Width="900" Height="380" VerticalAlignment="Top">
  58. <DataGrid.Columns>
  59. <DataGridTextColumn Header="Time" Width="160" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}"/>
  60. <DataGridTextColumn Header="Incoming" Width="350" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
  61. <DataGridTextColumn.ElementStyle>
  62. <Style TargetType="TextBlock">
  63. <Setter Property="TextWrapping" Value="Wrap"/>
  64. <Setter Property="Height" Value="auto"/>
  65. </Style>
  66. </DataGridTextColumn.ElementStyle>
  67. </DataGridTextColumn>
  68. <DataGridTextColumn Header="Outgoing" Width="350" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
  69. <DataGridTextColumn.ElementStyle>
  70. <Style TargetType="TextBlock">
  71. <Setter Property="TextWrapping" Value="Wrap"/>
  72. <Setter Property="Height" Value="auto"/>
  73. </Style>
  74. </DataGridTextColumn.ElementStyle>
  75. </DataGridTextColumn>
  76. </DataGrid.Columns>
  77. </DataGrid>
  78. </Grid>
  79. </UserControl>