终端一体化运控平台
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.
 
 
 

243 lines
10 KiB

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