WindBlock.xaml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <UserControl x:Class="NEIntelligentControl2.Views.Matrix.WindBlock"
  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:NEIntelligentControl2.Views.Matrix"
  7. mc:Ignorable="d"
  8. d:DesignHeight="120" d:DesignWidth="300" SizeChanged="UserControl_SizeChanged" MinHeight="108" MouseRightButtonUp="UserControl_MouseRightButtonUp" MouseLeftButtonDown="UserControl_MouseLeftButtonDown" Loaded="UserControl_Loaded">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="/Res/Matrix.xaml"/>
  13. </ResourceDictionary.MergedDictionaries>
  14. <SolidColorBrush x:Key="StopedTextColor" Color="#FF7E7935"/>
  15. <SolidColorBrush x:Key="StandbyTextColor" Color="#FF69A953"/>
  16. <SolidColorBrush x:Key="GridConnectedTextColor" Color="#FF4B7F9E"/>
  17. <SolidColorBrush x:Key="WiteTextColor" Color="WhiteSmoke"/>
  18. <SolidColorBrush x:Key="OfflineTextColor" Color="#FF606C75"/>
  19. </ResourceDictionary>
  20. </UserControl.Resources>
  21. <UserControl.ContentTemplate>
  22. <DataTemplate>
  23. <Grid x:Name="_GDMain" Margin="5" ToolTip="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=ToolTipValue}">
  24. <Grid x:Name="_GDContent">
  25. <Grid.RowDefinitions>
  26. <RowDefinition/>
  27. <RowDefinition Height="Auto"/>
  28. </Grid.RowDefinitions>
  29. <Grid>
  30. <Grid.RowDefinitions>
  31. <RowDefinition/>
  32. <RowDefinition/>
  33. <RowDefinition/>
  34. </Grid.RowDefinitions>
  35. <TextBlock x:Name="_WindturbineName" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=WindturbineName}" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="17" Grid.RowSpan="3" FontWeight="Bold" Margin="17,0,0,0"/>
  36. <!--风速-->
  37. <TextBlock x:Name="_WindSpeed" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=WindSpeed}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" Margin="0,0,17,0" FontWeight="Bold"/>
  38. <!--功率-->
  39. <TextBlock x:Name="_Power" Grid.Row="1" Grid.Column="1" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Power}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" Margin="0,0,17,0" FontWeight="Bold"/>
  40. <!--转速-->
  41. <TextBlock x:Name="_RollSpeed" Grid.Row="2" Grid.Column="1" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=RotateSpeed}" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" Margin="0,0,17,0" FontWeight="Bold"/>
  42. </Grid>
  43. <Grid Grid.Row="1" x:Name="_GBottom" MinHeight="24">
  44. <StackPanel x:Name="_SPNormal" Visibility="Collapsed" Orientation="Horizontal">
  45. <ContentControl Width="17" Height="17" Template="{StaticResource time}" Margin="2,0"/>
  46. <ContentControl Visibility="Collapsed" Margin="2,0" x:Name="start1" Width="19" Height="17" Template="{StaticResource start1}"/>
  47. <ContentControl Visibility="Collapsed" Margin="2,0" x:Name="start2" Width="19" Height="17" Template="{StaticResource start2}"/>
  48. <ContentControl Margin="2,0" Visibility="Collapsed" x:Name="locked" Width="16" Height="16" Template="{StaticResource lock2}"/>
  49. </StackPanel>
  50. <StackPanel x:Name="_SPMouseOver" Visibility="Collapsed" Orientation="Horizontal">
  51. <StackPanel.Background>
  52. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  53. <GradientStop Color="#CC000000" Offset="1"/>
  54. <GradientStop Color="#7F000000" Offset="0.7"/>
  55. <GradientStop Color="Transparent" Offset="0"/>
  56. </LinearGradientBrush>
  57. </StackPanel.Background>
  58. <ContentControl MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown" Width="17" Height="17" Margin="2,0" ToolTip="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=ToolTipValue}" Template="{StaticResource time}" Tag="time"/>
  59. <ContentControl x:Name="start" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="启动" Tag="Start" Template="{StaticResource start}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  60. <ContentControl x:Name="stop" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="停机" Tag="Stop" Template="{StaticResource stop}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  61. <ContentControl x:Name="reset" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="复位" Tag="Reset" Template="{StaticResource reset}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  62. <ContentControl x:Name="maintain" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="维护" Tag="Maintain" Template="{StaticResource maintain}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  63. <ContentControl x:Name="unmaintain" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="取消维护" Tag="UnMaintain" Template="{StaticResource unmaintain}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  64. <ContentControl x:Name="send" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="发送" Tag="" Template="{StaticResource send}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  65. <ContentControl x:Name="lock" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="挂牌" Tag="Lock" Template="{StaticResource lock}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  66. <ContentControl x:Name="unlock" Width="17" Height="17" Visibility="Collapsed" Margin="2,0" ToolTip="取消挂牌" Tag="UnLock" Template="{StaticResource unlock}" MouseLeftButtonUp="ContentControl_MouseLeftButtonUp" MouseLeftButtonDown="ContentControl_MouseLeftButtonDown"/>
  67. </StackPanel>
  68. </Grid>
  69. <!--风机名称-->
  70. </Grid>
  71. <TextBlock x:Name="_WindturbineName2" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=WindturbineName}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Grid.RowSpan="3" FontWeight="Bold"/>
  72. </Grid>
  73. <!--卡片颜色-->
  74. <DataTemplate.Triggers>
  75. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsSelected}" Value="True">
  76. <Setter TargetName="_GDContent" Property="Visibility" Value="Collapsed"/>
  77. </DataTrigger>
  78. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsSelected}" Value="False">
  79. <Setter TargetName="_WindturbineName2" Property="Visibility" Value="Collapsed"/>
  80. </DataTrigger>
  81. <Trigger Property="IsMouseOver" Value="True">
  82. <Setter TargetName="_SPMouseOver" Property="Visibility" Value="Visible"/>
  83. </Trigger>
  84. <Trigger Property="IsMouseOver" Value="False">
  85. <Setter TargetName="_SPNormal" Property="Visibility" Value="Visible"/>
  86. </Trigger>
  87. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="Stoped">
  88. <Setter TargetName="_GDMain" Property="Background" Value="#FFB0973F"/>
  89. <Setter TargetName="_GBottom" Property="Background" Value="#FF7E7935"/>
  90. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource StopedTextColor}"/>
  91. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource StopedTextColor}"/>
  92. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource StopedTextColor}"/>
  93. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource StopedTextColor}"/>
  94. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource StopedTextColor}"/>
  95. <!--<Setter TargetName="start" Property="Visibility" Value="Visible"/>
  96. <Setter TargetName="maintain" Property="Visibility" Value="Visible"/>
  97. <Setter TargetName="lock" Property="Visibility" Value="Visible"/>-->
  98. </DataTrigger>
  99. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="PowerOn">
  100. <Setter TargetName="_GDMain" Property="Background" Value="#FFC8EAFF"/>
  101. <Setter TargetName="_GBottom" Property="Background" Value="#FF88CBE3"/>
  102. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  103. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  104. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  105. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  106. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  107. <Setter TargetName="start2" Property="Visibility" Value="Visible"/>
  108. <!--<Setter TargetName="stop" Property="Visibility" Value="Visible"/>
  109. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  110. </DataTrigger>
  111. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="Standby">
  112. <Setter TargetName="_GDMain" Property="Background" Value="#FFC8EAFF"/>
  113. <Setter TargetName="_GBottom" Property="Background" Value="#FF88CBE3"/>
  114. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  115. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  116. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  117. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  118. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  119. <!--<Setter TargetName="start" Property="Visibility" Value="Visible"/>
  120. <Setter TargetName="maintain" Property="Visibility" Value="Visible"/>
  121. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  122. </DataTrigger>
  123. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="StartUp">
  124. <Setter TargetName="_GDMain" Property="Background" Value="#FFC8EAFF"/>
  125. <Setter TargetName="_GBottom" Property="Background" Value="#FF88CBE3"/>
  126. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  127. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  128. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  129. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  130. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource GridConnectedTextColor}"/>
  131. <Setter TargetName="start1" Property="Visibility" Value="Visible"/>
  132. <!--<Setter TargetName="stop" Property="Visibility" Value="Visible"/>
  133. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  134. </DataTrigger>
  135. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="GridConnected">
  136. <Setter TargetName="_GDMain" Property="Background" Value="#FFCFF1E8"/>
  137. <Setter TargetName="_GBottom" Property="Background" Value="#FFA7E094"/>
  138. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource StandbyTextColor}"/>
  139. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource StandbyTextColor}"/>
  140. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource StandbyTextColor}"/>
  141. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource StandbyTextColor}"/>
  142. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource StandbyTextColor}"/>
  143. <!--<Setter TargetName="stop" Property="Visibility" Value="Visible"/>
  144. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  145. </DataTrigger>
  146. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="Malfunction">
  147. <Setter TargetName="_GDMain" Property="Background" Value="#FFDB3333"/>
  148. <Setter TargetName="_GBottom" Property="Background" Value="#FFBA2424"/>
  149. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  150. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  151. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  152. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  153. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  154. <!--<Setter TargetName="reset" Property="Visibility" Value="Visible"/>
  155. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  156. </DataTrigger>
  157. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="Maintain">
  158. <Setter TargetName="_GDMain" Property="Background" Value="#FFFF720E"/>
  159. <Setter TargetName="_GBottom" Property="Background" Value="#FFD35902"/>
  160. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  161. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  162. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  163. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  164. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource WiteTextColor}"/>
  165. <!--<Setter TargetName="unmaintain" Property="Visibility" Value="Visible"/>
  166. <Setter TargetName="lock" Property="Visibility" Value="Visible"/> -->
  167. </DataTrigger>
  168. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=CardState}" Value="Offline">
  169. <Setter TargetName="_GDMain" Property="Background" Value="#FFC7D3DD"/>
  170. <Setter TargetName="_GBottom" Property="Background" Value="#FFB6C3CE"/>
  171. <Setter TargetName="_WindturbineName" Property="Foreground" Value="{StaticResource OfflineTextColor}"/>
  172. <Setter TargetName="_WindSpeed" Property="Foreground" Value="{StaticResource OfflineTextColor}"/>
  173. <Setter TargetName="_Power" Property="Foreground" Value="{StaticResource OfflineTextColor}"/>
  174. <Setter TargetName="_RollSpeed" Property="Foreground" Value="{StaticResource OfflineTextColor}"/>
  175. <Setter TargetName="_WindturbineName2" Property="Foreground" Value="{StaticResource OfflineTextColor}"/>
  176. </DataTrigger>
  177. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsLocked}" Value="True">
  178. <Setter TargetName="locked" Property="Visibility" Value="Visible"/>
  179. <Setter TargetName="start" Property="Visibility" Value="Collapsed"/>
  180. <Setter TargetName="reset" Property="Visibility" Value="Collapsed"/>
  181. <Setter TargetName="maintain" Property="Visibility" Value="Collapsed"/>
  182. <Setter TargetName="unmaintain" Property="Visibility" Value="Collapsed"/>
  183. <Setter TargetName="send" Property="Visibility" Value="Collapsed"/>
  184. <Setter TargetName="lock" Property="Visibility" Value="Collapsed"/>
  185. <Setter TargetName="stop" Property="Visibility" Value="Collapsed"/>
  186. <Setter TargetName="unlock" Property="Visibility" Value="Visible"/>
  187. </DataTrigger>
  188. <!--2MW 没有维护操作-->
  189. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=ModelId}" Value="UP105-2000-S">
  190. <Setter TargetName="maintain" Property="Visibility" Value="Collapsed"/>
  191. <Setter TargetName="unmaintain" Property="Visibility" Value="Collapsed"/>
  192. </DataTrigger>
  193. </DataTemplate.Triggers>
  194. </DataTemplate>
  195. </UserControl.ContentTemplate>
  196. </UserControl>