TopView.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <UserControl x:Class="Venus_MainPages.Views.TopView"
  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:Venus_MainPages.Views"
  7. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  8. xmlns:prism="http://prismlibrary.com/"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. xmlns:unity="clr-namespace:Venus_MainPages.Unity"
  11. xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
  12. xmlns:converters="clr-namespace:Venus_Themes.Converters;assembly=Venus_Themes"
  13. xmlns:converters2="clr-namespace:Venus_MainPages.Converters"
  14. mc:Ignorable="d"
  15. d:DesignHeight="100" d:DesignWidth="1800" FontSize="20" x:Name="topView">
  16. <UserControl.Resources>
  17. <converters:StringToColorConverter x:Key="StringToColorConverter"/>
  18. <converters2:EventItemToStringConverter x:Key="EventItemToStringConverter"/>
  19. </UserControl.Resources>
  20. <StackPanel Background="{DynamicResource BottomFrame_BG}" Orientation="Horizontal">
  21. <TextBlock Style="{StaticResource textBlockStyle}" Text="{Binding Title}" FontSize="60" VerticalAlignment="Center" Margin="10,0,0,0" />
  22. <Grid Width="1500" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="White" Margin="100,1,0,0" >
  23. <Grid.RowDefinitions>
  24. <RowDefinition/>
  25. <RowDefinition/>
  26. </Grid.RowDefinitions>
  27. <Grid.ColumnDefinitions>
  28. <ColumnDefinition Width="100"/>
  29. <ColumnDefinition/>
  30. <ColumnDefinition Width="100"/>
  31. <ColumnDefinition/>
  32. <ColumnDefinition Width="100"/>
  33. <ColumnDefinition/>
  34. <ColumnDefinition/>
  35. <ColumnDefinition/>
  36. <ColumnDefinition Width="60"/>
  37. <!--<ColumnDefinition/>-->
  38. </Grid.ColumnDefinitions>
  39. <TextBlock Text="PMA" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  40. <TextBlock Text="{Binding RtDataValues[PMA.FsmState]}" Background="Yellow" Grid.Column="1" Grid.ColumnSpan="3" Margin="2" Padding="0,8,0,0" Block.TextAlignment="Center" FontSize="20"/>
  41. <TextBlock Text="Log" Grid.Row="1" Foreground="White" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  42. <ComboBox Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5"
  43. ItemsSource="{Binding EventLogList}"
  44. SelectedIndex="{Binding EventLogListSelectedIndex}"
  45. VerticalContentAlignment="Center" FontSize="20" >
  46. <ComboBox.ItemTemplate>
  47. <DataTemplate>
  48. <StackPanel Orientation="Horizontal">
  49. <TextBlock Text="{Binding ElementName=topView,Path=DataContext.CurrentEventItem,Converter={StaticResource EventItemToStringConverter}}" Foreground="{Binding ElementName=topView,Path=DataContext.CurrentEventItem.Level,Converter={StaticResource StringToColorConverter}}"/>
  50. </StackPanel>
  51. </DataTemplate>
  52. </ComboBox.ItemTemplate>
  53. <ComboBox.ItemContainerStyle>
  54. <Style TargetType="ComboBoxItem">
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="ComboBoxItem">
  58. <StackPanel Orientation="Horizontal">
  59. <TextBlock Text="{Binding .,Converter={StaticResource EventItemToStringConverter}}"
  60. Foreground="{Binding Level,Converter={StaticResource StringToColorConverter}}"/>
  61. </StackPanel>
  62. </ControlTemplate>
  63. </Setter.Value>
  64. </Setter>
  65. <Setter Property="Background" Value="{Binding Level,Converter={StaticResource StringToColorConverter}}"/>
  66. </Style>
  67. </ComboBox.ItemContainerStyle>
  68. </ComboBox>
  69. <StackPanel Orientation="Horizontal" Grid.Column="4" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  70. <TextBlock Text="版本号:" Foreground="White" FontSize="20" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  71. <TextBlock Text="{Binding SoftwareVersion}" Foreground="Black" FontSize="20" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  72. </StackPanel>
  73. <!--<Button Content="FA Enable" Grid.Column="6" Grid.Row="0" BorderThickness="0" />
  74. <Button Content="FA Disable" Grid.Column="7" Grid.Row="0" BorderThickness="0"/>-->
  75. <!--<TextBlock Grid.Column="6" Text="语言" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  76. <ToggleButton Grid.Column="7" Style="{StaticResource ToggleButtonStyle1}">
  77. <i:Interaction.Triggers>
  78. <i:EventTrigger EventName="Checked">
  79. <i:InvokeCommandAction Command="{Binding SwichLanguageCommand}"/>
  80. </i:EventTrigger>
  81. <i:EventTrigger EventName="Unchecked">
  82. <i:InvokeCommandAction Command="{Binding SwichLanguageCommand}"/>
  83. </i:EventTrigger>
  84. </i:Interaction.Triggers>
  85. </ToggleButton>-->
  86. <StackPanel Orientation="Horizontal" Grid.Column="6" Grid.ColumnSpan="2" HorizontalAlignment="Center">
  87. <TextBlock Text="语言切换: " Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  88. <ToggleButton Style="{StaticResource ToggleButtonStyle1}">
  89. <i:Interaction.Triggers>
  90. <i:EventTrigger EventName="Checked">
  91. <i:InvokeCommandAction Command="{Binding SwichLanguageCommand}"/>
  92. </i:EventTrigger>
  93. <i:EventTrigger EventName="Unchecked">
  94. <i:InvokeCommandAction Command="{Binding SwichLanguageCommand}"/>
  95. </i:EventTrigger>
  96. </i:Interaction.Triggers>
  97. </ToggleButton>
  98. </StackPanel>
  99. <Button Content="Reset" Grid.Column="6" Grid.Row="1" BorderThickness="0" />
  100. <Button Content="Buzzer Off" Grid.Column="7" Grid.Row="1" BorderThickness="0"/>
  101. <!--<Border BorderBrush="#FF0A1624" CornerRadius="6" Grid.Column="8" Grid.RowSpan="2">
  102. </Border>-->
  103. <Viewbox Width="50" Height="80" Grid.Column="8" Grid.RowSpan="2">
  104. <deviceControl:AITSignalTower
  105. IsRedLightOn="{Binding RtDataValues[PMA.SignalTower.IsRedLightOn]}"
  106. IsYellowLightOn="{Binding RtDataValues[PMA.SignalTower.IsYellowLightOn]}"
  107. IsGreenLightOn="{Binding RtDataValues[PMA.SignalTower.IsGreenLightOn]}"
  108. IsBlueLightOn="{Binding RtDataValues[PMA.SignalTower.IsBlueLightOn]}"
  109. IsBuzzerOn="{Binding RtDataValues[PMA.SignalTower.IsBuzzerOn]}"/>
  110. </Viewbox>
  111. </Grid>
  112. <!--<Grid Width="200" unity:GridOptions.ShowBorder="True" unity:GridOptions.LineBrush="White" Margin="20,1,0,0">
  113. <Grid.RowDefinitions>
  114. <RowDefinition/>
  115. <RowDefinition/>
  116. <RowDefinition/>
  117. </Grid.RowDefinitions>
  118. <Grid.ColumnDefinitions>
  119. <ColumnDefinition />
  120. <ColumnDefinition/>
  121. </Grid.ColumnDefinitions>
  122. </Grid>-->
  123. </StackPanel>
  124. </UserControl>