终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

229 rivejä
10 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.MorkCL.View.Monitor"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.MorkCL.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
  9. Name="监控画面"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:MonitorViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/GenricStyle.xaml" />
  20. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Themes/MyStyle.xaml" />
  21. <ResourceDictionary Source="/BPASmartClient.CustomResource;component/Recdictionarys/GlobalStyle.xaml" />
  22. <ResourceDictionary>
  23. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  24. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  25. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  26. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  27. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  28. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  29. <Setter Property="FontFamily" Value="楷体" />
  30. <Setter Property="FontSize" Value="18" />
  31. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  32. <Setter Property="VerticalAlignment" Value="Center" />
  33. <Setter Property="HorizontalAlignment" Value="Center" />
  34. </Style>
  35. <Style x:Key="TextBoxStyle" TargetType="TextBox">
  36. <Setter Property="FontFamily" Value="楷体" />
  37. <Setter Property="FontSize" Value="22" />
  38. <Setter Property="Background" Value="Transparent" />
  39. <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
  40. <Setter Property="BorderBrush" Value="#FF23CACA" />
  41. <Setter Property="CaretBrush" Value="Aqua" />
  42. <Setter Property="VerticalAlignment" Value="Center" />
  43. </Style>
  44. </ResourceDictionary>
  45. </ResourceDictionary.MergedDictionaries>
  46. </ResourceDictionary>
  47. </UserControl.Resources>
  48. <Grid Margin="10">
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="30" />
  51. <RowDefinition />
  52. </Grid.RowDefinitions>
  53. <!--#region 表格标题栏设置-->
  54. <Grid Background="#dd2AB2E7">
  55. <Grid.ColumnDefinitions>
  56. <ColumnDefinition Width="0.3*" />
  57. <ColumnDefinition />
  58. <ColumnDefinition />
  59. <ColumnDefinition />
  60. <ColumnDefinition Width="0.7*" />
  61. <ColumnDefinition Width="0.7*" />
  62. </Grid.ColumnDefinitions>
  63. <TextBlock
  64. Grid.Column="0"
  65. HorizontalAlignment="Center"
  66. VerticalAlignment="Center"
  67. FontSize="16"
  68. Foreground="{StaticResource TitleFontColor}"
  69. Text="ID" />
  70. <Grid Grid.Column="1">
  71. <TextBlock
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. FontSize="16"
  75. Foreground="{StaticResource TitleFontColor}"
  76. Text="变量名" />
  77. <Border
  78. BorderBrush="{StaticResource TitleBorderColor}"
  79. BorderThickness="1,0,1,0"
  80. Cursor="SizeWE" />
  81. </Grid>
  82. <TextBlock
  83. Grid.Column="2"
  84. HorizontalAlignment="Center"
  85. VerticalAlignment="Center"
  86. FontSize="16"
  87. Foreground="{StaticResource TitleFontColor}"
  88. Text="PLC 地址" />
  89. <Grid Grid.Column="3">
  90. <TextBlock
  91. HorizontalAlignment="Center"
  92. VerticalAlignment="Center"
  93. FontSize="16"
  94. Foreground="{StaticResource TitleFontColor}"
  95. Text="注释" />
  96. <Border
  97. BorderBrush="{StaticResource TitleBorderColor}"
  98. BorderThickness="1,0,0,0"
  99. Cursor="SizeWE" />
  100. </Grid>
  101. <Grid Grid.Column="4">
  102. <TextBlock
  103. HorizontalAlignment="Center"
  104. VerticalAlignment="Center"
  105. FontSize="16"
  106. Foreground="{StaticResource TitleFontColor}"
  107. Text="Modbus TCP 地址" />
  108. <Border
  109. BorderBrush="{StaticResource TitleBorderColor}"
  110. BorderThickness="1,0,1,0"
  111. Cursor="SizeWE" />
  112. </Grid>
  113. <TextBlock
  114. Grid.Column="5"
  115. HorizontalAlignment="Center"
  116. VerticalAlignment="Center"
  117. FontSize="16"
  118. Foreground="{StaticResource TitleFontColor}"
  119. Text="当前值" />
  120. </Grid>
  121. <!--#endregion-->
  122. <!--#region 表格数据显示-->
  123. <ScrollViewer
  124. Grid.Row="1"
  125. HorizontalScrollBarVisibility="Hidden"
  126. VerticalScrollBarVisibility="Auto">
  127. <ItemsControl ItemsSource="{Binding VariableMonitors}">
  128. <ItemsControl.ItemTemplate>
  129. <DataTemplate>
  130. <Grid x:Name="gr" Height="30">
  131. <Grid.ColumnDefinitions>
  132. <ColumnDefinition Width="0.3*" />
  133. <ColumnDefinition />
  134. <ColumnDefinition />
  135. <ColumnDefinition />
  136. <ColumnDefinition Width="0.7*" />
  137. <ColumnDefinition Width="0.7*" />
  138. </Grid.ColumnDefinitions>
  139. <TextBlock
  140. Grid.Column="0"
  141. HorizontalAlignment="Center"
  142. VerticalAlignment="Center"
  143. Background="Transparent"
  144. FontSize="14"
  145. Foreground="{StaticResource FontColor}"
  146. Text="{Binding Id}" />
  147. <Grid Grid.Column="1">
  148. <TextBlock
  149. Margin="5,0,0,0"
  150. VerticalAlignment="Center"
  151. Background="Transparent"
  152. FontSize="14"
  153. Foreground="{StaticResource FontColor}"
  154. Text="{Binding VarName}" />
  155. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  156. </Grid>
  157. <TextBlock
  158. Grid.Column="2"
  159. Margin="5,0,0,0"
  160. VerticalAlignment="Center"
  161. Background="Transparent"
  162. FontSize="14"
  163. Foreground="{StaticResource FontColor}"
  164. Text="{Binding PLCAddress}" />
  165. <Grid Grid.Column="3">
  166. <TextBlock
  167. Margin="5,0,0,0"
  168. VerticalAlignment="Center"
  169. Background="Transparent"
  170. FontSize="14"
  171. Foreground="{StaticResource FontColor}"
  172. Text="{Binding Notes}" />
  173. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,0,0" />
  174. </Grid>
  175. <Grid Grid.Column="4">
  176. <TextBlock
  177. Margin="5,0,0,0"
  178. VerticalAlignment="Center"
  179. Background="Transparent"
  180. FontSize="14"
  181. Foreground="{StaticResource FontColor}"
  182. Text="{Binding ModbusTcpAddress}" />
  183. <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
  184. </Grid>
  185. <TextBlock
  186. Grid.Column="5"
  187. Margin="5,0,0,0"
  188. VerticalAlignment="Center"
  189. Background="Transparent"
  190. FontSize="14"
  191. Foreground="{StaticResource FontColor}"
  192. Text="{Binding CurrentValue}" />
  193. <Border
  194. Grid.ColumnSpan="8"
  195. BorderBrush="{StaticResource BorderSolid}"
  196. BorderThickness="1" />
  197. </Grid>
  198. <DataTemplate.Triggers>
  199. <Trigger Property="IsMouseOver" Value="true">
  200. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  201. </Trigger>
  202. </DataTemplate.Triggers>
  203. </DataTemplate>
  204. </ItemsControl.ItemTemplate>
  205. </ItemsControl>
  206. </ScrollViewer>
  207. <!--#endregion-->
  208. </Grid>
  209. </UserControl>