TopView.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <UserControl x:Class="CyberX8_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:CyberX8_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:CyberX8_MainPages.Unity"
  11. xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
  12. xmlns:converters="clr-namespace:CyberX8_Themes.Converters;assembly=CyberX8_Themes"
  13. xmlns:converters2="clr-namespace:CyberX8_MainPages.Converters"
  14. xmlns:userControls="clr-namespace:CyberX8_Themes.UserControls;assembly=CyberX8_Themes"
  15. xmlns:customControls="clr-namespace:CyberX8_Themes.CustomControls;assembly=CyberX8_Themes"
  16. mc:Ignorable="d"
  17. d:DesignHeight="110" d:DesignWidth="1800" FontSize="20" x:Name="topView">
  18. <UserControl.Resources>
  19. <converters:StringToColorConverter x:Key="StringToColorConverter"/>
  20. <converters:BoolToVisibility x:Key="boolToVisibility"/>
  21. <converters:BoolToVisibility2 x:Key="boolToVisibility2"/>
  22. <converters2:EventItemToStringConverter x:Key="EventItemToStringConverter"/>
  23. <converters2:SystemStateConverter x:Key="SystemStateConverter"/>
  24. <converters2:EFEMStateConverter x:Key="EFEMStateConverter"/>
  25. <converters2:PUFStateConverter x:Key="PUFStateConverter"/>
  26. <converters2:LoaderStateConverter x:Key="LoaderStateConverter"/>
  27. <converters2:TransporterStateConverter x:Key="TransporterStateConverter"/>
  28. <converters2:SRDStateConverter x:Key="SRDStateConverter"/>
  29. <converters2:IsOnlineToColorConverter x:Key="IsOnlineConverter"/>
  30. </UserControl.Resources>
  31. <Canvas Background="{StaticResource Login_BG}">
  32. <TextBox Style="{StaticResource textBoxStyle}" Text="{Binding Title}" FontSize="40" HorizontalContentAlignment="Center" Canvas.Left="5" Canvas.Top="0" Width="230" IsReadOnly="True"/>
  33. <TextBox Style="{StaticResource textBoxStyle}" Text="{Binding SoftwareVersion}" Foreground="White" FontSize="15" Canvas.Left="90" Canvas.Top="45" />
  34. <TextBlock Text="{Binding SystemControlIP,StringFormat='DeviceIP: {0}'}" Foreground="White" FontSize="15" Canvas.Left="25" Canvas.Top="85" />
  35. <TextBlock Text="{Binding ToolID,StringFormat='ToolID: {0}'}" Foreground="White" FontSize="15" Canvas.Left="25" Canvas.Top="67" />
  36. <Grid Canvas.Left="240" Width="1620" Height="104" x:Name="top">
  37. <Grid.RowDefinitions>
  38. <RowDefinition/>
  39. <RowDefinition/>
  40. <RowDefinition/>
  41. </Grid.RowDefinitions>
  42. <Grid.ColumnDefinitions>
  43. <ColumnDefinition/>
  44. <ColumnDefinition/>
  45. <ColumnDefinition/>
  46. <ColumnDefinition/>
  47. <ColumnDefinition/>
  48. <ColumnDefinition/>
  49. </Grid.ColumnDefinitions>
  50. <userControls:StateTitle Title="System" TextBoxValue="{Binding RtDataValues[SYSTEM.FsmState]}" TextBoxColor="{Binding RtDataValues[SYSTEM.FsmState],Converter={StaticResource SystemStateConverter}}" LabelColor="{Binding RtDataValues[System.IsAutoMode],Converter={StaticResource IsOnlineConverter}}"/>
  51. <userControls:StateTitle Title="EFEM" Grid.Column="1" TextBoxValue="{Binding RtDataValues[EFEM.FsmState]}"
  52. TextBoxColor="{Binding RtDataValues[EFEM.FsmState],Converter={StaticResource EFEMStateConverter}}"
  53. LabelColor="{Binding RtDataValues[EFEM.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  54. Visibility="{Binding EFEMIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  55. <userControls:StateTitle Title="PUF1" Grid.Column="2" TextBoxValue="{Binding RtDataValues[PUF1.FsmState]}"
  56. TextBoxColor="{Binding RtDataValues[PUF1.FsmState],Converter={StaticResource PUFStateConverter}}"
  57. LabelColor="{Binding RtDataValues[PUF1.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  58. Visibility="{Binding PUF1IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  59. <userControls:StateTitle Title="Loader1" Grid.Row="0" Grid.Column="3" TextBoxValue="{Binding RtDataValues[Loader1.FsmState]}"
  60. TextBoxColor="{Binding RtDataValues[Loader1.FsmState],Converter={StaticResource LoaderStateConverter}}"
  61. LabelColor="{Binding RtDataValues[Loader1.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  62. Visibility="{Binding Loader1IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  63. <userControls:StateTitle Title="Ldr" Grid.Row="1" Grid.Column="0" TextBoxValue="{Binding RtDataValues[Transporter2.FsmState]}"
  64. TextBoxColor="{Binding RtDataValues[Transporter2.FsmState],Converter={StaticResource TransporterStateConverter}}"
  65. LabelColor="{Binding RtDataValues[Transporter2.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  66. Visibility="{Binding Transporter2IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  67. <userControls:StateTitle Title="Pdr" Grid.Row="1" Grid.Column="1" TextBoxValue="{Binding RtDataValues[Transporter1.FsmState]}"
  68. TextBoxColor="{Binding RtDataValues[Transporter1.FsmState],Converter={StaticResource TransporterStateConverter}}"
  69. LabelColor="{Binding RtDataValues[Transporter1.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  70. Visibility="{Binding Transporter2IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  71. <userControls:StateTitle Title="SRD1" Grid.Row="1" Grid.Column="2" TextBoxValue="{Binding RtDataValues[SRD1.FsmState]}"
  72. TextBoxColor="{Binding RtDataValues[SRD1.FsmState],Converter={StaticResource SRDStateConverter}}"
  73. LabelColor="{Binding RtDataValues[SRD1.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  74. Visibility="{Binding SRD1IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  75. <userControls:StateTitle Title="SRD2" Grid.Row="1" Grid.Column="3" TextBoxValue="{Binding RtDataValues[SRD2.FsmState]}"
  76. TextBoxColor="{Binding RtDataValues[SRD2.FsmState],Converter={StaticResource SRDStateConverter}}"
  77. LabelColor="{Binding RtDataValues[SRD2.IsOnline],Converter={StaticResource IsOnlineConverter}}"
  78. Visibility="{Binding SRD2IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
  79. <StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="5">
  80. <Button Style="{StaticResource SysBtnStyle}" Visibility="{Binding IsControlPermission,Converter={StaticResource boolToVisibility}}" Background="{DynamicResource TopFrame_TableBG}" Content="Permission" Width="120" Height="30" Command="{Binding ControlPermissionCommand}"/>
  81. <Button Style="{StaticResource SysBtnStyle}" Visibility="{Binding IsControlPermission,Converter={StaticResource boolToVisibility2}}" Background="{DynamicResource TopFrame_TableBG}" Content="Release" Width="120" Height="30" Command="{Binding ControlReleaseCommand}" Margin="-120,0,0,0"/>
  82. <Label Content="Log" Style="{StaticResource TopLable_LeftTop}" Canvas.Left="520" Width="100" Canvas.Top="76" BorderThickness="1" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="30" FontWeight="Bold" Margin="2,0,0,0"/>
  83. <ComboBox Width="1050" Canvas.Left="620" Canvas.Top="74.2" Height="32"
  84. ItemsSource="{Binding EventLogList}"
  85. SelectedIndex="{Binding EventLogListSelectedIndex}"
  86. VerticalContentAlignment="Center" FontSize="15" >
  87. <ComboBox.ItemTemplate>
  88. <DataTemplate>
  89. <StackPanel Orientation="Horizontal">
  90. <TextBlock FontSize="20" Text="{Binding ElementName=topView,Path=DataContext.CurrentEventItem,Converter={StaticResource EventItemToStringConverter}}" Foreground="{Binding ElementName=topView,Path=DataContext.CurrentEventItem.Level,Converter={StaticResource StringToColorConverter}}"/>
  91. </StackPanel>
  92. </DataTemplate>
  93. </ComboBox.ItemTemplate>
  94. <ComboBox.ItemContainerStyle>
  95. <Style TargetType="ComboBoxItem">
  96. <Setter Property="Template">
  97. <Setter.Value>
  98. <ControlTemplate TargetType="ComboBoxItem">
  99. <TextBlock FontSize="20" Text="{Binding .,Converter={StaticResource EventItemToStringConverter}}" FontFamily="宋体"
  100. Foreground="{Binding Level,Converter={StaticResource StringToColorConverter}}">
  101. <TextBlock.Style>
  102. <Style>
  103. <Style.Triggers>
  104. <Trigger Property="TextBlock.IsMouseOver" Value="true">
  105. <Setter Property="TextBlock.Background" Value="Silver"/>
  106. </Trigger>
  107. </Style.Triggers>
  108. </Style>
  109. </TextBlock.Style>
  110. </TextBlock>
  111. </ControlTemplate>
  112. </Setter.Value>
  113. </Setter>
  114. <Setter Property="Background" Value="{Binding Level,Converter={StaticResource StringToColorConverter}}"/>
  115. </Style>
  116. </ComboBox.ItemContainerStyle>
  117. </ComboBox>
  118. <Button Content="Clear" BorderThickness="0" BorderBrush="Transparent" Style="{StaticResource SysBtnStyle}" Command="{Binding ClearCommand}" Width="70" FontSize="15" Canvas.Left="1376" Canvas.Top="76" Height="30"/>
  119. </StackPanel>
  120. <userControls:StateTitle Title="FA" Grid.Column="5" Grid.Row="0" TextBoxValue="{Binding HostCommunicationStatus}" TextBoxColor="{Binding HostBack}" Canvas.Left="520" Canvas.Top="40"/>
  121. <StackPanel Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
  122. <Button Style="{StaticResource SysBtnStyle}" Background="{DynamicResource TopFrame_TableBG}" Content="Host Enable" Width="100" Height="30" IsEnabled="{Binding IsEnableEnable}" Command="{Binding FAEnableCommand}" Margin="120,0,0,0"/>
  123. <Button Style="{StaticResource SysBtnStyle}" Content="Host Disable" Background="{DynamicResource TopFrame_TableBG}" Width="100" Height="30" IsEnabled="{Binding IsEnableDisable}" Command="{Binding FADisableCommand}" Margin="5,0,0,0"/>
  124. <Path Data="{StaticResource Icon_User}" Stretch="Fill" StrokeThickness="1" Fill="#333333" Width="20" Height="20" Margin="20,0,0,0"/>
  125. <TextBlock Text="{Binding UserName}" VerticalAlignment="Center" FontSize="18" Foreground="White" Padding="8 2 8 2">
  126. <TextBlock.InputBindings>
  127. <MouseBinding Command="{Binding LogoutCommand}" MouseAction="LeftClick"></MouseBinding>
  128. </TextBlock.InputBindings>
  129. <TextBlock.Triggers>
  130. <EventTrigger RoutedEvent="TextBlock.MouseEnter">
  131. <BeginStoryboard>
  132. <Storyboard>
  133. <ColorAnimation Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" To="LimeGreen" Duration="0:0:0.2" />
  134. </Storyboard>
  135. </BeginStoryboard>
  136. </EventTrigger>
  137. <EventTrigger RoutedEvent="TextBlock.MouseLeave">
  138. <BeginStoryboard>
  139. <Storyboard>
  140. <ColorAnimation Storyboard.TargetProperty="(TextBlock.Foreground).(SolidColorBrush.Color)" To="White" Duration="0:0:0.2" />
  141. </Storyboard>
  142. </BeginStoryboard>
  143. </EventTrigger>
  144. </TextBlock.Triggers>
  145. </TextBlock>
  146. </StackPanel>
  147. <StackPanel Grid.Column="5" Grid.Row="2" Orientation="Vertical">
  148. <Border Background="#376092" Margin="3" BorderBrush="White" BorderThickness="1" CornerRadius="3">
  149. <TextBlock Text="{Binding TimeTick}" Padding="3,1" Foreground="White" TextAlignment="Center"></TextBlock>
  150. </Border>
  151. </StackPanel>
  152. </Grid>
  153. <Viewbox Height="100" Width="40" Canvas.Right="10" Canvas.Top="6" >
  154. <deviceControl:AITSignalTower
  155. IsRedLightOn ="{Binding SignalTowerData.IsRedLightOn}"
  156. IsYellowLightOn="{Binding SignalTowerData.IsYellowLightOn}"
  157. IsGreenLightOn ="{Binding SignalTowerData.IsGreenLightOn}"
  158. IsBlueLightOn ="{Binding SignalTowerData.IsBlueLightOn}"
  159. IsBuzzerOn ="{Binding SignalTowerData.IsBuzzerOn}"/>
  160. </Viewbox>
  161. </Canvas>
  162. </UserControl>