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

344 lines
16 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.StockControlView"
  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:define="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  7. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <Style x:Key="radioButtonStyle" TargetType="RadioButton">
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="RadioButton">
  18. <Grid Name="gr" Opacity="0.8">
  19. <ContentControl
  20. Margin="{TemplateBinding Margin}"
  21. HorizontalAlignment="Center"
  22. VerticalAlignment="Center"
  23. HorizontalContentAlignment="Center"
  24. VerticalContentAlignment="Center"
  25. Content="{TemplateBinding Content}"
  26. FontSize="{TemplateBinding FontSize}"
  27. Foreground="{TemplateBinding Foreground}" />
  28. <Image
  29. Name="image"
  30. Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
  31. Stretch="Fill" />
  32. </Grid>
  33. <ControlTemplate.Triggers>
  34. <Trigger Property="IsChecked" Value="False">
  35. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
  36. </Trigger>
  37. <Trigger Property="IsChecked" Value="True">
  38. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
  39. </Trigger>
  40. <Trigger Property="IsMouseOver" Value="True">
  41. <Setter TargetName="gr" Property="Opacity" Value="1" />
  42. </Trigger>
  43. </ControlTemplate.Triggers>
  44. </ControlTemplate>
  45. </Setter.Value>
  46. </Setter>
  47. </Style>
  48. <Style x:Key="textBoxStyle" TargetType="TextBox">
  49. <Setter Property="Background" Value="Transparent" />
  50. </Style>
  51. </UserControl.Resources>
  52. <UserControl.DataContext>
  53. <vm:StockControViewModel />
  54. </UserControl.DataContext>
  55. <Grid>
  56. <Grid.RowDefinitions>
  57. <RowDefinition />
  58. <RowDefinition />
  59. <RowDefinition />
  60. </Grid.RowDefinitions>
  61. <Grid x:Name="TopGrid">
  62. <Grid.RowDefinitions>
  63. <RowDefinition Height="0.2*" />
  64. <RowDefinition />
  65. </Grid.RowDefinitions>
  66. <ListView
  67. Grid.Row="1"
  68. VerticalAlignment="Center"
  69. Background="Transparent"
  70. BorderThickness="0"
  71. ItemsSource="{Binding statusTop}"
  72. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  73. ScrollViewer.VerticalScrollBarVisibility="Disabled">
  74. <ListView.ItemsPanel>
  75. <ItemsPanelTemplate>
  76. <UniformGrid
  77. HorizontalAlignment="Left"
  78. VerticalAlignment="Top"
  79. Columns="8"
  80. Rows="1" />
  81. </ItemsPanelTemplate>
  82. </ListView.ItemsPanel>
  83. <ListView.ItemTemplate>
  84. <DataTemplate>
  85. <Grid>
  86. <Grid.RowDefinitions>
  87. <RowDefinition Height="0.8*" />
  88. <RowDefinition Height="0.1*" />
  89. <RowDefinition Height="0.2*" />
  90. </Grid.RowDefinitions>
  91. <define:MaterialStock
  92. Grid.Row="0"
  93. Margin="35,0,35,0"
  94. IsFaultState="{Binding IsFault}"
  95. IsLayOffState="{Binding IsLayOff}"
  96. IsOpenState="{Binding IsOpen}"
  97. IsRunning="{Binding RunStatus}" />
  98. <StackPanel
  99. Grid.Row="1"
  100. Margin="0,0,0,0"
  101. HorizontalAlignment="Center"
  102. VerticalAlignment="Center"
  103. Orientation="Horizontal">
  104. <TextBlock Foreground="#00c2f4" Text="配料重量:" />
  105. <TextBox
  106. Grid.Row="0"
  107. Width="80"
  108. Padding="2"
  109. Background="Transparent"
  110. BorderBrush="#00c2f4"
  111. CaretBrush="#00c2f4"
  112. Foreground="#00c2f4"
  113. Text="{Binding Weight}" />
  114. </StackPanel>
  115. <Grid Grid.Row="2" VerticalAlignment="Bottom">
  116. <Grid.ColumnDefinitions>
  117. <ColumnDefinition />
  118. <ColumnDefinition />
  119. </Grid.ColumnDefinitions>
  120. <StackPanel>
  121. <ToggleButton
  122. Width="80"
  123. Height="30"
  124. Margin="5,0,5,0"
  125. HorizontalAlignment="Center"
  126. VerticalAlignment="Center"
  127. Background="Transparent"
  128. FontSize="20"
  129. IsChecked="{Binding IsOpen}"
  130. Style="{StaticResource SwitchToggleButtonStyle}" />
  131. <TextBlock
  132. Margin="0,5,0,0"
  133. HorizontalAlignment="Center"
  134. Foreground="AliceBlue"
  135. Text="仓盖控制" />
  136. </StackPanel>
  137. <StackPanel Grid.Column="1">
  138. <ToggleButton
  139. Width="80"
  140. Height="30"
  141. Margin="5,0,5,0"
  142. HorizontalAlignment="Center"
  143. VerticalAlignment="Center"
  144. Background="Transparent"
  145. FontSize="20"
  146. IsChecked="{Binding IsLayOff}"
  147. Style="{StaticResource SwitchToggleButtonStyle}" />
  148. <TextBlock
  149. Margin="0,5,0,0"
  150. HorizontalAlignment="Center"
  151. Foreground="AliceBlue"
  152. Text="出料控制" />
  153. </StackPanel>
  154. <!--<Button
  155. Height="30"
  156. Margin="5,0,5,0"
  157. Command="{Binding DataContext.GaicangControlCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  158. Content="开盖"
  159. FontSize="20"
  160. Style="{StaticResource ImageButtonStyle}" />-->
  161. <!--<Button
  162. Grid.Column="1"
  163. Height="30"
  164. Margin="5,0,5,0"
  165. Command="{Binding DataContext.BlowingControlCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  166. Content="出料"
  167. FontSize="20"
  168. Style="{StaticResource ImageButtonStyle}" />-->
  169. </Grid>
  170. </Grid>
  171. </DataTemplate>
  172. </ListView.ItemTemplate>
  173. </ListView>
  174. </Grid>
  175. <Grid
  176. x:Name="midGrid"
  177. Grid.Row="1"
  178. Margin="0,0,0,0"
  179. Background="Transparent">
  180. <Grid.RowDefinitions>
  181. <RowDefinition />
  182. <RowDefinition />
  183. </Grid.RowDefinitions>
  184. <define:ConveyBelt2
  185. Grid.RowSpan="2"
  186. Margin="-12,0,10,0"
  187. BeltDashThickess="50"
  188. BeltHeight="{Binding ElementName=midGrid, Path=ActualHeight}"
  189. BeltWidth="{Binding ElementName=midGrid, Path=ActualWidth}"
  190. IsRun="{Binding ConveyerBeltWork}" />
  191. <StackPanel
  192. Margin="10,0,0,0"
  193. VerticalAlignment="Center"
  194. Background="Transparent"
  195. Orientation="Horizontal">
  196. <TextBlock
  197. VerticalAlignment="Center"
  198. FontSize="18"
  199. Foreground="White"
  200. Text="输送带控制" />
  201. <ToggleButton
  202. Width="80"
  203. Height="30"
  204. Margin="5,0,0,0"
  205. HorizontalAlignment="Left"
  206. VerticalAlignment="Center"
  207. Background="Transparent"
  208. FontSize="20"
  209. IsChecked="{Binding ConveyerBeltWork}"
  210. Style="{StaticResource SwitchToggleButtonStyle}" />
  211. <!--<Button
  212. Grid.Column="1"
  213. Height="30"
  214. Margin="5,0,5,0"
  215. Command="{Binding DataContext.BlowingControlCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  216. Content="出料"
  217. FontSize="20"
  218. Style="{StaticResource ImageButtonStyle}" />-->
  219. <!--<RadioButton
  220. Width="130"
  221. Height="50"
  222. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  223. CommandParameter="{Binding Name}"
  224. Content="输送带启动"
  225. Foreground="Aqua"
  226. IsChecked="True"
  227. Style="{StaticResource radioButtonStyle}" />
  228. <RadioButton
  229. Width="130"
  230. Height="50"
  231. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  232. CommandParameter="{Binding Name}"
  233. Content="输送带停止"
  234. Foreground="Aqua"
  235. IsChecked="False"
  236. Style="{StaticResource radioButtonStyle}" />-->
  237. </StackPanel>
  238. </Grid>
  239. <Grid Grid.Row="2">
  240. <Grid.RowDefinitions>
  241. <RowDefinition />
  242. <RowDefinition Height="0.2*" />
  243. </Grid.RowDefinitions>
  244. <ListView
  245. Grid.Row="0"
  246. VerticalAlignment="Center"
  247. Background="Transparent"
  248. BorderThickness="0"
  249. ItemsSource="{Binding statusDown}"
  250. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  251. ScrollViewer.VerticalScrollBarVisibility="Disabled">
  252. <ListView.ItemsPanel>
  253. <ItemsPanelTemplate>
  254. <UniformGrid
  255. HorizontalAlignment="Left"
  256. VerticalAlignment="Top"
  257. Columns="8"
  258. Rows="1" />
  259. </ItemsPanelTemplate>
  260. </ListView.ItemsPanel>
  261. <ListView.ItemTemplate>
  262. <DataTemplate>
  263. <Grid>
  264. <Grid.RowDefinitions>
  265. <RowDefinition Height="0.8*" />
  266. <RowDefinition Height="0.2*" />
  267. </Grid.RowDefinitions>
  268. <define:MaterialStock
  269. Margin="35,0,35,0"
  270. IsFaultState="{Binding IsFault}"
  271. IsLayOffState="{Binding IsLayOff}"
  272. IsOpenState="{Binding IsOpen}"
  273. IsRunning="{Binding IsRunning}" />
  274. <Grid Grid.Row="1" VerticalAlignment="Bottom">
  275. <Grid.ColumnDefinitions>
  276. <ColumnDefinition />
  277. <ColumnDefinition />
  278. </Grid.ColumnDefinitions>
  279. <StackPanel>
  280. <ToggleButton
  281. Width="80"
  282. Height="30"
  283. Margin="5,0,5,0"
  284. HorizontalAlignment="Center"
  285. VerticalAlignment="Center"
  286. Background="Transparent"
  287. FontSize="20"
  288. IsChecked="{Binding IsOpen}"
  289. Style="{StaticResource SwitchToggleButtonStyle}" />
  290. <TextBlock
  291. Margin="0,5,0,0"
  292. HorizontalAlignment="Center"
  293. Foreground="AliceBlue"
  294. Text="仓盖控制" />
  295. </StackPanel>
  296. <StackPanel Grid.Column="1">
  297. <ToggleButton
  298. Width="80"
  299. Height="30"
  300. Margin="5,0,5,0"
  301. HorizontalAlignment="Center"
  302. VerticalAlignment="Center"
  303. Background="Transparent"
  304. FontSize="20"
  305. IsChecked="{Binding IsLayOff}"
  306. Style="{StaticResource SwitchToggleButtonStyle}" />
  307. <TextBlock
  308. Margin="0,5,0,0"
  309. HorizontalAlignment="Center"
  310. Foreground="AliceBlue"
  311. Text="出料控制" />
  312. </StackPanel>
  313. </Grid>
  314. </Grid>
  315. </DataTemplate>
  316. </ListView.ItemTemplate>
  317. </ListView>
  318. </Grid>
  319. </Grid>
  320. </UserControl>