终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

340 linhas
19 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.Academy.View.HistoryChart50LView"
  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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:oxy="http://oxyplot.org/wpf" xmlns:vm="clr-namespace:BPASmartClient.Academy.ViewModel"
  9. d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d">
  10. <UserControl.DataContext>
  11. <vm:HistoryChart50LViewModel />
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <Style x:Key="setCheck" TargetType="{x:Type RadioButton}">
  15. <Setter Property="HorizontalContentAlignment" Value="Center" />
  16. <Setter Property="VerticalContentAlignment" Value="Center" />
  17. <Setter Property="HorizontalAlignment" Value="Center" />
  18. <Setter Property="VerticalAlignment" Value="Center" />
  19. <Setter Property="Background" Value="Transparent" />
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type RadioButton}">
  23. <Border Background="Transparent" BorderThickness="0">
  24. <ContentControl
  25. x:Name="check"
  26. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  27. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  28. Content="{TemplateBinding Content}"
  29. Foreground="#777777" />
  30. </Border>
  31. <ControlTemplate.Triggers>
  32. <Trigger Property="IsMouseOver" Value="True">
  33. <Setter TargetName="check" Property="Foreground" Value="White" />
  34. </Trigger>
  35. <Trigger Property="IsPressed" Value="True">
  36. <Setter TargetName="check" Property="Foreground" Value="White" />
  37. </Trigger>
  38. </ControlTemplate.Triggers>
  39. </ControlTemplate>
  40. </Setter.Value>
  41. </Setter>
  42. </Style>
  43. </UserControl.Resources>
  44. <Grid>
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="50" />
  47. <RowDefinition />
  48. </Grid.RowDefinitions>
  49. <StackPanel
  50. Margin="0,0,60,0" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
  51. <TextBlock
  52. VerticalAlignment="Center" FontSize="16" Foreground="DeepSkyBlue" Text="产品编号:" />
  53. <TextBox
  54. Width="200" Height="30" Margin="0,0,10,0" VerticalContentAlignment="Center"
  55. Background="Transparent" BorderBrush="DeepSkyBlue" CaretBrush="DeepSkyBlue" FontSize="16"
  56. Foreground="DeepSkyBlue"
  57. Style="{x:Null}"
  58. Text="{Binding ProductNum}" />
  59. <Button
  60. Width="120" Height="30"
  61. Command="{Binding FindProductCommand}"
  62. Content="查询编号"
  63. Style="{StaticResource ButtonStyle}" />
  64. <TextBlock
  65. Margin="30,0,0,0" VerticalAlignment="Center" FontSize="16" Foreground="DeepSkyBlue"
  66. Text="查询时间:" />
  67. <DatePicker
  68. Width="150" Margin="0,0,10,0" BorderBrush="DeepSkyBlue" FontSize="16"
  69. SelectedDate="{Binding SelectTime}"
  70. Style="{DynamicResource PickerStyle}" />
  71. <Button
  72. Width="120" Height="30"
  73. Command="{Binding Select}"
  74. Content="查询"
  75. Style="{StaticResource ButtonStyle}" />
  76. </StackPanel>
  77. <Grid Grid.Row="1">
  78. <Grid.ColumnDefinitions>
  79. <ColumnDefinition />
  80. <ColumnDefinition Width="2*" />
  81. </Grid.ColumnDefinitions>
  82. <!--#region 表格-->
  83. <Grid
  84. Grid.Column="0" Margin="20,20,20,300" Background="Transparent">
  85. <Grid.RowDefinitions>
  86. <RowDefinition Height="50" />
  87. <RowDefinition />
  88. </Grid.RowDefinitions>
  89. <!--#region 标题-->
  90. <Grid Background="#ff0C255F">
  91. <Grid.ColumnDefinitions>
  92. <ColumnDefinition Width="50" />
  93. <ColumnDefinition />
  94. <ColumnDefinition Width="200" />
  95. <ColumnDefinition Width="50" />
  96. </Grid.ColumnDefinitions>
  97. <Border
  98. Grid.ColumnSpan="1" BorderBrush="#777777" BorderThickness="0.8" />
  99. <Border
  100. Grid.ColumnSpan="2" BorderBrush="#777777" BorderThickness="0,0.8,0.8,0.8" />
  101. <Border
  102. Grid.ColumnSpan="3" BorderBrush="#777777" BorderThickness="0,0.8,0.8,0.8" />
  103. <Border
  104. Grid.ColumnSpan="4" BorderBrush="#777777" BorderThickness="0,0.8,0.8,0.8" />
  105. <TextBlock
  106. HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" Foreground="White"
  107. Text="序号" />
  108. <TextBlock
  109. Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
  110. Foreground="White" Text="配方名称" />
  111. <TextBlock
  112. Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
  113. Foreground="White" Text="创建时间" />
  114. <TextBlock
  115. Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
  116. Foreground="White" Text="操作" />
  117. </Grid>
  118. <!--#endregion-->
  119. <!--#region 表格内容-->
  120. <ScrollViewer
  121. Grid.Row="1" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  122. <ItemsControl ItemsSource="{Binding RecipeCharts}">
  123. <ItemsControl.ItemTemplate>
  124. <DataTemplate>
  125. <Grid>
  126. <Grid
  127. Height="30" Margin="0,1" Background="#163175">
  128. <Grid.ColumnDefinitions>
  129. <ColumnDefinition Width="50" />
  130. <ColumnDefinition />
  131. <ColumnDefinition Width="200" />
  132. <ColumnDefinition Width="50" />
  133. </Grid.ColumnDefinitions>
  134. <Border
  135. Grid.ColumnSpan="1" BorderBrush="#777777" BorderThickness="0.4" />
  136. <Border
  137. Grid.ColumnSpan="2" BorderBrush="#777777" BorderThickness="0,0.4,0.4,0.4" />
  138. <Border
  139. Grid.ColumnSpan="3" BorderBrush="#777777" BorderThickness="0,0.4,0.4,0.4" />
  140. <Border
  141. Grid.ColumnSpan="4" BorderBrush="#777777" BorderThickness="0,0.4,0.4,0.4" />
  142. <TextBlock
  143. x:Name="num" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
  144. Foreground="White"
  145. Text="{Binding Num}" />
  146. <TextBlock
  147. Grid.Column="1" Margin="5,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
  148. FontSize="16" Foreground="White"
  149. Text="{Binding Name}" />
  150. <TextBlock
  151. Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
  152. Foreground="White"
  153. Text="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />
  154. <RadioButton
  155. x:Name="ceshi" Grid.Column="3"
  156. Command="{Binding DataContext.InspectDataCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}}"
  157. CommandParameter="{Binding Id}"
  158. Content="查看" FontSize="16" Foreground="White" GroupName="sss"
  159. Style="{StaticResource setCheck}" />
  160. </Grid>
  161. <!--<Popup
  162. HorizontalAlignment="Center"
  163. VerticalAlignment="Center"
  164. AllowsTransparency="True"
  165. IsOpen="{Binding ElementName=ceshi, Path=IsChecked, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  166. MouseLeave="Popup_MouseLeave"
  167. Placement="Bottom"
  168. PlacementTarget="{Binding ElementName=ceshi}">
  169. <Grid
  170. Width="200"
  171. Height="200"
  172. Background="Transparent">
  173. <Path
  174. Fill="#ff0C255F"
  175. Stroke="White"
  176. StrokeThickness="1">
  177. <Path.Data>
  178. <GeometryGroup>
  179. <PathGeometry>
  180. <PathFigure StartPoint="0,10">
  181. <LineSegment Point="0,200" />
  182. <LineSegment Point="200,200" />
  183. <LineSegment Point="200,10" />
  184. <LineSegment Point="60,10" />
  185. <LineSegment Point="50,0" />
  186. <LineSegment Point="40,10" />
  187. <LineSegment Point="0,10" />
  188. </PathFigure>
  189. </PathGeometry>
  190. </GeometryGroup>
  191. </Path.Data>
  192. </Path>
  193. <StackPanel
  194. Margin="0,30,0,20"
  195. HorizontalAlignment="Center"
  196. VerticalAlignment="Center"
  197. Orientation="Vertical">
  198. <Border Margin="0,10">
  199. <Button
  200. Width="100"
  201. Height="35"
  202. Click="Button_Click"
  203. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  204. Content="温度曲线"
  205. Style="{StaticResource ButtonStyle}" />
  206. </Border>
  207. <Border Margin="0,10">
  208. <Button
  209. Width="100"
  210. Height="35"
  211. Click="Button_Click"
  212. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  213. Content="转速曲线"
  214. Style="{StaticResource ButtonStyle}" />
  215. </Border>
  216. <Border Margin="0,10">
  217. <Button
  218. Width="100"
  219. Height="35"
  220. Click="Button_Click"
  221. CommandParameter="{Binding ElementName=num, Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
  222. Content="重量曲线"
  223. Style="{StaticResource ButtonStyle}" />
  224. </Border>
  225. </StackPanel>
  226. </Grid>
  227. </Popup>-->
  228. </Grid>
  229. </DataTemplate>
  230. </ItemsControl.ItemTemplate>
  231. </ItemsControl>
  232. </ScrollViewer>
  233. <!--#endregion-->
  234. </Grid>
  235. <!--#endregion-->
  236. <!--#region 曲线-->
  237. <Grid Grid.Column="1">
  238. <Grid.RowDefinitions>
  239. <RowDefinition Height="30" />
  240. <RowDefinition />
  241. </Grid.RowDefinitions>
  242. <UniformGrid Columns="8">
  243. <CheckBox
  244. Command="{Binding CheckedCommand}"
  245. CommandParameter="0" Content="反应釜温度" FontSize="14"
  246. Foreground="{StaticResource 反应釜温度}"
  247. IsChecked="{Binding VisStatus[0]}"
  248. IsEnabled="{Binding IsEnable}" />
  249. <CheckBox
  250. Command="{Binding CheckedCommand}"
  251. CommandParameter="1" Content="反应釜蒸汽压力" FontSize="14"
  252. Foreground="{StaticResource 反应釜蒸汽压力}"
  253. IsChecked="{Binding VisStatus[1]}"
  254. IsEnabled="{Binding IsEnable}" />
  255. <CheckBox
  256. Command="{Binding CheckedCommand}"
  257. CommandParameter="2" Content="反应釜蒸汽流量" FontSize="14"
  258. Foreground="{StaticResource 反应釜蒸汽流量}"
  259. IsChecked="{Binding VisStatus[2]}"
  260. IsEnabled="{Binding IsEnable}" />
  261. <CheckBox
  262. Command="{Binding CheckedCommand}"
  263. CommandParameter="3" Content="冷凝水罐温度" FontSize="14"
  264. Foreground="{StaticResource 冷凝水罐温度}"
  265. IsChecked="{Binding VisStatus[3]}"
  266. IsEnabled="{Binding IsEnable}" />
  267. <CheckBox
  268. Command="{Binding CheckedCommand}"
  269. CommandParameter="4" Content="冷凝水罐湿度" FontSize="14"
  270. Foreground="{StaticResource 冷凝水罐湿度}"
  271. IsChecked="{Binding VisStatus[4]}"
  272. IsEnabled="{Binding IsEnable}" />
  273. <CheckBox
  274. Command="{Binding CheckedCommand}"
  275. CommandParameter="5" Content="负压流量" FontSize="14"
  276. Foreground="{StaticResource 负压流量}"
  277. IsChecked="{Binding VisStatus[5]}"
  278. IsEnabled="{Binding IsEnable}" />
  279. <CheckBox
  280. Command="{Binding CheckedCommand}"
  281. CommandParameter="6" Content="称重水罐重量" FontSize="14"
  282. Foreground="{StaticResource 称重水罐重量}"
  283. IsChecked="{Binding VisStatus[6]}"
  284. IsEnabled="{Binding IsEnable}" />
  285. <CheckBox
  286. Command="{Binding CheckedCommand}"
  287. CommandParameter="7" Content="反应釜编码器值" FontSize="14"
  288. Foreground="{StaticResource 反应釜编码器值}"
  289. IsChecked="{Binding VisStatus[7]}"
  290. IsEnabled="{Binding IsEnable}" />
  291. <CheckBox
  292. Command="{Binding CheckedCommand}"
  293. CommandParameter="8" Content="比例阀开度" FontSize="14"
  294. Foreground="{StaticResource 比例阀实际开度}"
  295. IsChecked="{Binding VisStatus[8]}"
  296. IsEnabled="{Binding IsEnable}" />
  297. <CheckBox
  298. Command="{Binding CheckedCommand}"
  299. CommandParameter="9" Content="卤水配制罐重量" FontSize="14"
  300. Foreground="{StaticResource 卤水配制罐重量}"
  301. IsChecked="{Binding VisStatus[9]}"
  302. IsEnabled="{Binding IsEnable}" />
  303. <CheckBox
  304. Command="{Binding CheckedCommand}"
  305. CommandParameter="10" Content="反应釜压力" FontSize="14"
  306. Foreground="{StaticResource 反应釜压力}"
  307. IsChecked="{Binding VisStatus[10]}"
  308. IsEnabled="{Binding IsEnable}" />
  309. </UniformGrid>
  310. <oxy:PlotView
  311. x:Name="chartView" Grid.Row="1" Margin="5" Background="White"
  312. Foreground="White"
  313. Model="{Binding OxyModel}"
  314. PanCursor="Hand" />
  315. <Border
  316. Grid.Row="1" Background="#dd727272"
  317. Visibility="{Binding LoadingVis}">
  318. <TextBlock
  319. HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Text="正在加载数据,请耐心等待..." />
  320. </Border>
  321. </Grid>
  322. <!--#endregion-->
  323. </Grid>
  324. </Grid>
  325. </UserControl>