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

332 lines
14 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 x:Name="ooo"
  19. Grid.Row="1"
  20. Rows="2"
  21. Columns="2">
  22. <StackPanel Orientation="Vertical">
  23. <lvc:CartesianChart
  24. x:Name="ppp"
  25. Height="270"
  26. HorizontalAlignment="Stretch"
  27. VerticalAlignment="Top"
  28. AnimationsSpeed="0:0:1"
  29. DataTooltip="{x:Null}"
  30. Hoverable="False"
  31. MouseDoubleClick="DataView_CLick"
  32. ToolTip="温度曲线">
  33. <lvc:CartesianChart.Series>
  34. <lvc:LineSeries
  35. Fill="Transparent"
  36. LineSmoothness="1"
  37. PointGeometry="{x:Null}"
  38. Stroke="Red"
  39. StrokeThickness="2"
  40. Values="{Binding DataFeedback.TempWok}" />
  41. <lvc:LineSeries
  42. Fill="Transparent"
  43. LineSmoothness="1"
  44. PointGeometry="{x:Null}"
  45. Stroke="Blue"
  46. StrokeThickness="2"
  47. Values="{Binding DataFeedback.TempMaterial}" />
  48. <lvc:LineSeries
  49. Fill="Transparent"
  50. LineSmoothness="1"
  51. PointGeometry="{x:Null}"
  52. Stroke="Green"
  53. StrokeThickness="2"
  54. Values="{Binding DataFeedback.TempVent}" />
  55. </lvc:CartesianChart.Series>
  56. <lvc:CartesianChart.AxisY>
  57. <lvc:Axis >
  58. <lvc:Axis.Separator>
  59. <lvc:Separator IsEnabled="False" />
  60. </lvc:Axis.Separator>
  61. </lvc:Axis>
  62. </lvc:CartesianChart.AxisY>
  63. <lvc:CartesianChart.AxisX>
  64. <lvc:Axis
  65. LabelFormatter="{Binding DateTimeFormatter}"
  66. 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. <StackPanel Margin="20,0,0,0" Orientation="Vertical">
  96. <lvc:CartesianChart
  97. Height="270"
  98. HorizontalAlignment="Stretch"
  99. VerticalAlignment="Top"
  100. AnimationsSpeed="0:0:1"
  101. DataTooltip="{x:Null}"
  102. Hoverable="False"
  103. MouseDoubleClick="DataView_CLick"
  104. ToolTip="转速曲线">
  105. <lvc:CartesianChart.Series>
  106. <lvc:LineSeries
  107. Fill="Transparent"
  108. LineSmoothness="1"
  109. PointGeometry="{x:Null}"
  110. Stroke="#F44F15"
  111. StrokeThickness="2"
  112. Values="{Binding DataFeedback.M101_Speed}" />
  113. <lvc:LineSeries
  114. Fill="Transparent"
  115. LineSmoothness="1"
  116. PointGeometry="{x:Null}"
  117. Stroke="#423FFD"
  118. StrokeThickness="2"
  119. Values="{Binding DataFeedback.M102_Speed}" />
  120. </lvc:CartesianChart.Series>
  121. <lvc:CartesianChart.AxisY>
  122. <lvc:Axis>
  123. <lvc:Axis.Separator>
  124. <lvc:Separator IsEnabled="False" />
  125. </lvc:Axis.Separator>
  126. </lvc:Axis>
  127. </lvc:CartesianChart.AxisY>
  128. <lvc:CartesianChart.AxisX>
  129. <lvc:Axis
  130. LabelFormatter="{Binding DateTimeFormatter}"
  131. 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="转速曲线/rpm" />
  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. <!--<StackPanel Orientation="Vertical">
  155. <lvc:CartesianChart
  156. Height="270"
  157. HorizontalAlignment="Stretch"
  158. VerticalAlignment="Top"
  159. AnimationsSpeed="0:0:1"
  160. DataTooltip="{x:Null}"
  161. Hoverable="False"
  162. MouseDoubleClick="DataView_CLick"
  163. ToolTip="比例阀开度曲线">
  164. <lvc:CartesianChart.Series>
  165. <lvc:LineSeries
  166. Fill="Transparent"
  167. LineSmoothness="1"
  168. PointGeometry="{x:Null}"
  169. Stroke="White"
  170. StrokeThickness="2"
  171. Values="{Binding DataFeedback.OpenValve}" />
  172. </lvc:CartesianChart.Series>
  173. <lvc:CartesianChart.AxisY>
  174. <lvc:Axis>
  175. <lvc:Axis.Separator>
  176. <lvc:Separator IsEnabled="False" />
  177. </lvc:Axis.Separator>
  178. </lvc:Axis>
  179. </lvc:CartesianChart.AxisY>
  180. <lvc:CartesianChart.AxisX>
  181. <lvc:Axis
  182. LabelFormatter="{Binding DateTimeFormatter}"
  183. 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. <!--<StackPanel Orientation="Vertical">
  201. <lvc:CartesianChart
  202. Height="270"
  203. HorizontalAlignment="Stretch"
  204. VerticalAlignment="Top"
  205. AnimationsSpeed="0:0:1"
  206. DataTooltip="{x:Null}"
  207. Hoverable="False"
  208. MouseDoubleClick="DataView_CLick"
  209. ToolTip="压力曲线">
  210. <lvc:CartesianChart.Series>
  211. <lvc:LineSeries
  212. Fill="Transparent"
  213. LineSmoothness="1"
  214. PointGeometry="{x:Null}"
  215. Stroke="#F1C74B"
  216. StrokeThickness="2"
  217. Values="{Binding DataFeedback.PressureWok}" />
  218. </lvc:CartesianChart.Series>
  219. <lvc:CartesianChart.AxisY>
  220. <lvc:Axis
  221. LabelFormatter="{Binding doubleFormatter}"
  222. MaxValue="1.0"
  223. MinValue="0">
  224. <lvc:Axis.Separator>
  225. <lvc:Separator IsEnabled="False" />
  226. </lvc:Axis.Separator>
  227. </lvc:Axis>
  228. </lvc:CartesianChart.AxisY>
  229. <lvc:CartesianChart.AxisX>
  230. <lvc:Axis
  231. LabelFormatter="{Binding DateTimeFormatter}"
  232. Unit="{Binding AxisUnit}">
  233. <lvc:Axis.Separator>
  234. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  235. </lvc:Axis.Separator>
  236. </lvc:Axis>
  237. </lvc:CartesianChart.AxisX>
  238. </lvc:CartesianChart>
  239. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  240. <TextBlock Foreground="White" Text="压力曲线/Mpa" />
  241. <Rectangle
  242. Width="20"
  243. Height="2"
  244. Margin="20,0,0,2"
  245. Fill="#F1C74B" />
  246. <TextBlock Foreground="White" Text="反应釜压力" />
  247. </StackPanel>
  248. </StackPanel>-->
  249. <StackPanel Margin="0,20,0,0" Orientation="Vertical">
  250. <lvc:CartesianChart
  251. Height="270"
  252. HorizontalAlignment="Stretch"
  253. VerticalAlignment="Top"
  254. AnimationsSpeed="0:0:1"
  255. DataTooltip="{x:Null}"
  256. Hoverable="False"
  257. MouseDoubleClick="DataView_CLick"
  258. ToolTip="重量曲线">
  259. <lvc:CartesianChart.Series>
  260. <lvc:LineSeries
  261. Fill="Transparent"
  262. LineSmoothness="1"
  263. PointGeometry="{x:Null}"
  264. Stroke="Purple"
  265. StrokeThickness="2"
  266. Values="{Binding DataFeedback.WeightWok}" />
  267. </lvc:CartesianChart.Series>
  268. <lvc:CartesianChart.AxisY>
  269. <lvc:Axis>
  270. <lvc:Axis.Separator>
  271. <lvc:Separator IsEnabled="False" />
  272. </lvc:Axis.Separator>
  273. </lvc:Axis>
  274. </lvc:CartesianChart.AxisY>
  275. <lvc:CartesianChart.AxisX>
  276. <lvc:Axis
  277. LabelFormatter="{Binding DateTimeFormatter}"
  278. Unit="{Binding AxisUnit}">
  279. <lvc:Axis.Separator>
  280. <lvc:Separator IsEnabled="False" Step="{Binding AxisStep}" />
  281. </lvc:Axis.Separator>
  282. </lvc:Axis>
  283. </lvc:CartesianChart.AxisX>
  284. </lvc:CartesianChart>
  285. <StackPanel Margin="0,10,0,0" Orientation="Horizontal">
  286. <TextBlock Foreground="White" Text="重量曲线/kg" />
  287. <Rectangle
  288. Width="20"
  289. Height="2"
  290. Margin="20,0,0,2"
  291. Fill="Purple" />
  292. <TextBlock Foreground="White" Text="冷却水罐重量" />
  293. </StackPanel>
  294. </StackPanel>
  295. </UniformGrid>
  296. <Grid
  297. x:Name="chartGrid"
  298. HorizontalAlignment="Stretch"
  299. VerticalAlignment="Stretch"
  300. Background="White"
  301. Visibility="Collapsed">
  302. <Grid.ColumnDefinitions>
  303. <ColumnDefinition />
  304. <ColumnDefinition Width="200" />
  305. </Grid.ColumnDefinitions>
  306. <oxy:PlotView
  307. x:Name="chartView"
  308. Margin="5"
  309. Background="Transparent"
  310. Foreground="Black"
  311. PanCursor="Hand" />
  312. <Button
  313. Grid.Column="1"
  314. Width="120"
  315. Height=" 40"
  316. HorizontalAlignment="Center"
  317. VerticalAlignment="Center"
  318. Click="Button_Click"
  319. Content="退出" />
  320. </Grid>
  321. </Grid>
  322. </UserControl>