终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

348 行
15 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.Academy.View.DeviceChartView"
  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.Academy.View"
  7. xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:oxy="http://oxyplot.org/wpf"
  10. xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:DeviceChartViewModel />
  16. </UserControl.DataContext>
  17. <Grid>
  18. <UniformGrid
  19. x:Name="ooo"
  20. Grid.Row="1"
  21. Columns="3"
  22. Rows="2">
  23. <!--#region 温度曲线-->
  24. <StackPanel Orientation="Vertical">
  25. <lvc:CartesianChart
  26. x:Name="ppp"
  27. Height="270"
  28. HorizontalAlignment="Stretch"
  29. VerticalAlignment="Top"
  30. AnimationsSpeed="0:0:1"
  31. DataTooltip="{x:Null}"
  32. Hoverable="False"
  33. MouseDoubleClick="DataView_CLick"
  34. ToolTip="温度曲线">
  35. <lvc:CartesianChart.Series>
  36. <lvc:LineSeries
  37. Fill="Transparent"
  38. LineSmoothness="1"
  39. PointGeometry="{x:Null}"
  40. Stroke="Red"
  41. StrokeThickness="2"
  42. Values="{Binding DataFeedback.TempWok}" />
  43. <lvc:LineSeries
  44. Fill="Transparent"
  45. LineSmoothness="1"
  46. PointGeometry="{x:Null}"
  47. Stroke="Blue"
  48. StrokeThickness="2"
  49. Values="{Binding DataFeedback.TempMaterial}" />
  50. <lvc:LineSeries
  51. Fill="Transparent"
  52. LineSmoothness="1"
  53. PointGeometry="{x:Null}"
  54. Stroke="Green"
  55. StrokeThickness="2"
  56. Values="{Binding DataFeedback.TempVent}" />
  57. </lvc:CartesianChart.Series>
  58. <lvc:CartesianChart.AxisY>
  59. <lvc:Axis MaxValue="200" MinValue="0">
  60. <lvc:Axis.Separator>
  61. <lvc:Separator IsEnabled="False" />
  62. </lvc:Axis.Separator>
  63. </lvc:Axis>
  64. </lvc:CartesianChart.AxisY>
  65. <lvc:CartesianChart.AxisX>
  66. <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
  67. <lvc:Axis.Separator>
  68. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  69. </lvc:Axis.Separator>
  70. </lvc:Axis>
  71. </lvc:CartesianChart.AxisX>
  72. </lvc:CartesianChart>
  73. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  74. <TextBlock Foreground="White" Text="温度曲线/℃" />
  75. <Rectangle
  76. Width="20"
  77. Height="2"
  78. Margin="10,0,0,2"
  79. Fill="Blue" />
  80. <TextBlock Foreground="White" Text="物料罐温度" />
  81. <Rectangle
  82. Width="20"
  83. Height="2"
  84. Margin="10,0,0,2"
  85. Fill="Red" />
  86. <TextBlock Foreground="White" Text="反应釜温度" />
  87. <Rectangle
  88. Width="20"
  89. Height="2"
  90. Margin="10,0,0,2"
  91. Fill="Green" />
  92. <TextBlock Foreground="White" Text="排气温度" />
  93. </StackPanel>
  94. </StackPanel>
  95. <!--#endregion-->
  96. <!--#region 转速曲线-->
  97. <StackPanel Margin="20,0,0,0" Orientation="Vertical">
  98. <lvc:CartesianChart
  99. Height="270"
  100. HorizontalAlignment="Stretch"
  101. VerticalAlignment="Top"
  102. AnimationsSpeed="0:0:1"
  103. DataTooltip="{x:Null}"
  104. Hoverable="False"
  105. MouseDoubleClick="DataView_CLick"
  106. ToolTip="转速曲线">
  107. <lvc:CartesianChart.Series>
  108. <lvc:LineSeries
  109. Fill="Transparent"
  110. LineSmoothness="1"
  111. PointGeometry="{x:Null}"
  112. Stroke="#F44F15"
  113. StrokeThickness="2"
  114. Values="{Binding DataFeedback.M101_Speed}" />
  115. <lvc:LineSeries
  116. Fill="Transparent"
  117. LineSmoothness="1"
  118. PointGeometry="{x:Null}"
  119. Stroke="#423FFD"
  120. StrokeThickness="2"
  121. Values="{Binding DataFeedback.M102_Speed}" />
  122. </lvc:CartesianChart.Series>
  123. <lvc:CartesianChart.AxisY>
  124. <lvc:Axis MinValue="0" MaxValue="100">
  125. <lvc:Axis.Separator>
  126. <lvc:Separator IsEnabled="False" />
  127. </lvc:Axis.Separator>
  128. </lvc:Axis>
  129. </lvc:CartesianChart.AxisY>
  130. <lvc:CartesianChart.AxisX>
  131. <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
  132. <lvc:Axis.Separator>
  133. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  134. </lvc:Axis.Separator>
  135. </lvc:Axis>
  136. </lvc:CartesianChart.AxisX>
  137. </lvc:CartesianChart>
  138. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  139. <TextBlock Foreground="White" Text="转速曲线/%" />
  140. <Rectangle
  141. Width="20"
  142. Height="2"
  143. Margin="10,0,0,2"
  144. Fill="#423FFD" />
  145. <TextBlock Foreground="White" Text="物料罐转速" />
  146. <Rectangle
  147. Width="20"
  148. Height="2"
  149. Margin="10,0,0,2"
  150. Fill="#F44F15" />
  151. <TextBlock Foreground="White" Text="反应釜转速" />
  152. </StackPanel>
  153. </StackPanel>
  154. <!--#endregion-->
  155. <!--#region 比例阀开度曲线 -->
  156. <StackPanel Orientation="Vertical">
  157. <lvc:CartesianChart
  158. Height="270"
  159. HorizontalAlignment="Stretch"
  160. VerticalAlignment="Top"
  161. AnimationsSpeed="0:0:1"
  162. DataTooltip="{x:Null}"
  163. Hoverable="False"
  164. MouseDoubleClick="DataView_CLick"
  165. ToolTip="比例阀开度曲线">
  166. <lvc:CartesianChart.Series>
  167. <lvc:LineSeries
  168. Fill="Transparent"
  169. LineSmoothness="1"
  170. PointGeometry="{x:Null}"
  171. Stroke="White"
  172. StrokeThickness="2"
  173. Values="{Binding DataFeedback.OpenValve}" />
  174. </lvc:CartesianChart.Series>
  175. <lvc:CartesianChart.AxisY>
  176. <lvc:Axis MaxValue="100" MinValue="0">
  177. <lvc:Axis.Separator>
  178. <lvc:Separator IsEnabled="False" />
  179. </lvc:Axis.Separator>
  180. </lvc:Axis>
  181. </lvc:CartesianChart.AxisY>
  182. <lvc:CartesianChart.AxisX>
  183. <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
  184. <lvc:Axis.Separator>
  185. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  186. </lvc:Axis.Separator>
  187. </lvc:Axis>
  188. </lvc:CartesianChart.AxisX>
  189. </lvc:CartesianChart>
  190. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  191. <TextBlock Foreground="White" Text="比例阀开度曲线/%" />
  192. <Rectangle
  193. Width="20"
  194. Height="2"
  195. Margin="20,0,0,2"
  196. Fill="White" />
  197. <TextBlock Foreground="White" Text="比例阀开度" />
  198. </StackPanel>
  199. </StackPanel>
  200. <!--#endregion-->
  201. <!--#region 压力曲线 -->
  202. <StackPanel Orientation="Vertical">
  203. <lvc:CartesianChart
  204. Height="270"
  205. HorizontalAlignment="Stretch"
  206. VerticalAlignment="Top"
  207. AnimationsSpeed="0:0:1"
  208. DataTooltip="{x:Null}"
  209. Hoverable="False"
  210. MouseDoubleClick="DataView_CLick"
  211. ToolTip="压力曲线">
  212. <lvc:CartesianChart.Series>
  213. <lvc:LineSeries
  214. Fill="Transparent"
  215. LineSmoothness="1"
  216. PointGeometry="{x:Null}"
  217. Stroke="#F1C74B"
  218. StrokeThickness="2"
  219. Values="{Binding DataFeedback.PressureWok}" />
  220. <lvc:LineSeries
  221. Fill="Transparent"
  222. LineSmoothness="1"
  223. PointGeometry="{x:Null}"
  224. Stroke="#FF1FFF"
  225. StrokeThickness="2"
  226. Values="{Binding DataFeedback.PressureWok_Week}" />
  227. </lvc:CartesianChart.Series>
  228. <lvc:CartesianChart.AxisY>
  229. <lvc:Axis
  230. LabelFormatter="{Binding doubleFormatter}"
  231. MaxValue="0.6"
  232. MinValue="-0.1">
  233. <lvc:Axis.Separator>
  234. <lvc:Separator IsEnabled="False" />
  235. </lvc:Axis.Separator>
  236. </lvc:Axis>
  237. </lvc:CartesianChart.AxisY>
  238. <lvc:CartesianChart.AxisX>
  239. <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
  240. <lvc:Axis.Separator>
  241. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  242. </lvc:Axis.Separator>
  243. </lvc:Axis>
  244. </lvc:CartesianChart.AxisX>
  245. </lvc:CartesianChart>
  246. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  247. <TextBlock Foreground="White" Text="压力曲线/Mpa" />
  248. <Rectangle
  249. Width="20"
  250. Height="2"
  251. Margin="20,0,0,2"
  252. Fill="#F1C74B" />
  253. <TextBlock Foreground="White" Text="反应釜压力" />
  254. <Rectangle
  255. Width="20"
  256. Height="2"
  257. Margin="20,0,0,2"
  258. Fill="#FF1FFF" />
  259. <TextBlock Foreground="White" Text="反应釜蒸汽压力" />
  260. </StackPanel>
  261. </StackPanel>
  262. <!--#endregion-->
  263. <!--#region 重量曲线 -->
  264. <StackPanel Margin="0,20,0,0" Orientation="Vertical">
  265. <lvc:CartesianChart
  266. Height="270"
  267. HorizontalAlignment="Stretch"
  268. VerticalAlignment="Top"
  269. AnimationsSpeed="0:0:1"
  270. DataTooltip="{x:Null}"
  271. Hoverable="False"
  272. MouseDoubleClick="DataView_CLick"
  273. ToolTip="重量曲线">
  274. <lvc:CartesianChart.Series>
  275. <lvc:LineSeries
  276. Fill="Transparent"
  277. LineSmoothness="1"
  278. PointGeometry="{x:Null}"
  279. Stroke="#fe43fe"
  280. StrokeThickness="2"
  281. Values="{Binding DataFeedback.WeightWok}" />
  282. </lvc:CartesianChart.Series>
  283. <lvc:CartesianChart.AxisY>
  284. <lvc:Axis>
  285. <lvc:Axis.Separator>
  286. <lvc:Separator IsEnabled="False" />
  287. </lvc:Axis.Separator>
  288. </lvc:Axis>
  289. </lvc:CartesianChart.AxisY>
  290. <lvc:CartesianChart.AxisX>
  291. <lvc:Axis LabelFormatter="{Binding DateTimeFormatter}" Unit="{Binding AxisUnit}">
  292. <lvc:Axis.Separator>
  293. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  294. </lvc:Axis.Separator>
  295. </lvc:Axis>
  296. </lvc:CartesianChart.AxisX>
  297. </lvc:CartesianChart>
  298. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  299. <TextBlock Foreground="White" Text="重量曲线/kg" />
  300. <Rectangle
  301. Width="20"
  302. Height="2"
  303. Margin="20,0,0,2"
  304. Fill="#fe43fe" />
  305. <TextBlock Foreground="White" Text="冷却水罐重量" />
  306. </StackPanel>
  307. </StackPanel>
  308. <!--#endregion-->
  309. </UniformGrid>
  310. <!--#region 总曲线 -->
  311. <Grid
  312. x:Name="chartGrid"
  313. HorizontalAlignment="Stretch"
  314. VerticalAlignment="Stretch"
  315. Background="White"
  316. Visibility="Collapsed">
  317. <Grid.ColumnDefinitions>
  318. <ColumnDefinition />
  319. <ColumnDefinition Width="200" />
  320. </Grid.ColumnDefinitions>
  321. <oxy:PlotView
  322. x:Name="chartView"
  323. Margin="5"
  324. Background="Transparent"
  325. Foreground="Black"
  326. PanCursor="Hand" />
  327. <Button
  328. Grid.Column="1"
  329. Width="120"
  330. Height=" 40"
  331. HorizontalAlignment="Center"
  332. VerticalAlignment="Center"
  333. Click="Button_Click"
  334. Content="退出" />
  335. </Grid>
  336. <!--#endregion-->
  337. </Grid>
  338. </UserControl>