WagoView.xaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <UserControl x:Class="CyberX8_Simulator.Views.WagoView"
  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:CyberX8_Simulator.Views"
  7. xmlns:commons="clr-namespace:MECF.Framework.Simulator.Core.Commons;assembly=MECF.Framework.Simulator.Core"
  8. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  9. mc:Ignorable="d"
  10. d:DesignHeight="900" d:DesignWidth="1200">
  11. <Grid>
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="100"></RowDefinition>
  14. <RowDefinition Height="100"></RowDefinition>
  15. <RowDefinition />
  16. <RowDefinition Height="10"></RowDefinition>
  17. </Grid.RowDefinitions>
  18. <commons:SocketTitleView Grid.Row="0"></commons:SocketTitleView>
  19. <Canvas Grid.Row="1" Width="1200">
  20. <StackPanel Orientation="Horizontal" Width="1200">
  21. <Button Content="Clear Log" Width="100" Height="35" Command="{Binding ClearLogCommand}"></Button>
  22. </StackPanel>
  23. <StackPanel Orientation="Horizontal" Width="600" Height="50" Canvas.Left="120">
  24. <Label Content="DO:" VerticalAlignment="Center"></Label>
  25. <ComboBox Width="250" Height="30" VerticalContentAlignment="Center" ItemsSource="{Binding DONameItems}" SelectedItem="{Binding DOSelectedItem}" >
  26. <i:Interaction.Triggers>
  27. <i:EventTrigger EventName="SelectionChanged">
  28. <i:InvokeCommandAction Command="{Binding DOSelectionChangedCommand}"/>
  29. </i:EventTrigger>
  30. </i:Interaction.Triggers>
  31. </ComboBox>
  32. <ComboBox Width="100" Height="30" Margin="5,0,0,0" VerticalContentAlignment="Center" ItemsSource="{Binding DigitalInputSelected}" SelectedItem="{Binding DOInputValue}" HorizontalContentAlignment="Center"></ComboBox>
  33. <Button Content="DOInput" Height="30" Width="100" Margin="5,10,0,0" Command="{Binding SetDOCommand}"/>
  34. <Border Margin="5,0,0,0" Background="Black" Height="30" Width="80">
  35. <TextBlock Text="{Binding DOCurrentValue}" Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  36. </Border>
  37. </StackPanel>
  38. <StackPanel Orientation="Horizontal" Width="600" Height="50" Canvas.Left="740">
  39. <Label Content="DI:" VerticalAlignment="Center"></Label>
  40. <ComboBox Width="250" Height="30" VerticalContentAlignment="Center" ItemsSource="{Binding DINameItems}" SelectedItem="{Binding DISelectedItem}" >
  41. <i:Interaction.Triggers>
  42. <i:EventTrigger EventName="SelectionChanged">
  43. <i:InvokeCommandAction Command="{Binding DISelectionChangedCommand}"/>
  44. </i:EventTrigger>
  45. </i:Interaction.Triggers>
  46. </ComboBox>
  47. <ComboBox Width="100" Height="30" Margin="5,0,0,0" VerticalContentAlignment="Center" ItemsSource="{Binding DigitalInputSelected}" SelectedItem="{Binding DIInputValue}" HorizontalContentAlignment="Center"></ComboBox>
  48. <Button Content="DIInput" Height="30" Width="100" Margin="5,10,0,0" Command="{Binding SetDICommand}"/>
  49. <Border Margin="5,0,0,0" Background="Black" Height="30" Width="80">
  50. <TextBlock Text="{Binding DICurrentValue}" Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  51. </Border>
  52. </StackPanel>
  53. <StackPanel Orientation="Horizontal" Width="600" Height="50" Canvas.Top="50" Canvas.Left="120">
  54. <Label Content="AO:" VerticalAlignment="Center"></Label>
  55. <ComboBox Width="250" Height="30" VerticalContentAlignment="Center" ItemsSource="{Binding AONameItems}" SelectedItem="{Binding AOSelectedItem}" >
  56. <i:Interaction.Triggers>
  57. <i:EventTrigger EventName="SelectionChanged">
  58. <i:InvokeCommandAction Command="{Binding AOSelectionChangedCommand}"/>
  59. </i:EventTrigger>
  60. </i:Interaction.Triggers>
  61. </ComboBox>
  62. <TextBox Text="{Binding AOInputValue,Mode=OneWayToSource}" Width="100" Height="30" Margin="5,0,0,0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"></TextBox>
  63. <Button Content="AOInput" Height="30" Width="100" Margin="5,10,0,0" Command="{Binding SetAOCommand}"/>
  64. <Border Margin="5,0,0,0" Background="Black" Height="30" Width="80">
  65. <TextBlock Text="{Binding AOCurrentValue}" Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  66. </Border>
  67. </StackPanel>
  68. <StackPanel Orientation="Horizontal" Width="600" Height="50" Canvas.Top="50" Canvas.Left="740">
  69. <Label Content="AI:" VerticalAlignment="Center"></Label>
  70. <ComboBox Width="250" Height="30" VerticalContentAlignment="Center" ItemsSource="{Binding AINameItems}" SelectedItem="{Binding AISelectedItem}" >
  71. <i:Interaction.Triggers>
  72. <i:EventTrigger EventName="SelectionChanged">
  73. <i:InvokeCommandAction Command="{Binding AISelectionChangedCommand}"/>
  74. </i:EventTrigger>
  75. </i:Interaction.Triggers>
  76. </ComboBox>
  77. <TextBox Text="{Binding AIInputValue,Mode=OneWayToSource}" Width="100" Height="30" Margin="5,0,0,0" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"></TextBox>
  78. <Button Content="AIInput" Height="30" Width="100" Margin="5,10,0,0" Command="{Binding SetAICommand}"/>
  79. <Border Margin="5,0,0,0" Background="Black" Height="30" Width="80">
  80. <TextBlock Text="{Binding AICurrentValue}" Foreground="Lime" FontSize="16" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  81. </Border>
  82. </StackPanel>
  83. </Canvas>
  84. <DataGrid Grid.Row="2" FontSize="16" AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserSortColumns="False"
  85. ItemsSource="{Binding TransactionLogItems}"
  86. Width="1200" VerticalAlignment="Top" MaxHeight="780">
  87. <DataGrid.Columns>
  88. <DataGridTextColumn Header="Time" Width="200" IsReadOnly="True" Binding="{Binding OccurTime, UpdateSourceTrigger=PropertyChanged}" />
  89. <DataGridTextColumn Header="Incoming" Width="500" IsReadOnly="True" Binding="{Binding Incoming, UpdateSourceTrigger=PropertyChanged}">
  90. <DataGridTextColumn.ElementStyle>
  91. <Style TargetType="TextBlock">
  92. <Setter Property="TextWrapping" Value="Wrap" />
  93. <Setter Property="Height" Value="auto" />
  94. </Style>
  95. </DataGridTextColumn.ElementStyle>
  96. </DataGridTextColumn>
  97. <DataGridTextColumn Header="Outgoing" Width="500" IsReadOnly="True" Binding="{Binding Outgoing, UpdateSourceTrigger=PropertyChanged}">
  98. <DataGridTextColumn.ElementStyle>
  99. <Style TargetType="TextBlock">
  100. <Setter Property="TextWrapping" Value="Wrap" />
  101. <Setter Property="Height" Value="auto" />
  102. </Style>
  103. </DataGridTextColumn.ElementStyle>
  104. </DataGridTextColumn>
  105. </DataGrid.Columns>
  106. </DataGrid>
  107. </Grid>
  108. </UserControl>