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

505 line
24 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.HardwareStatusView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  10. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  11. d:DesignHeight="1080"
  12. d:DesignWidth="1920"
  13. mc:Ignorable="d">
  14. <UserControl.DataContext>
  15. <vm:HardwareStatusViewModel />
  16. </UserControl.DataContext>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="0.8*" />
  20. <RowDefinition />
  21. <RowDefinition Height="0.8*" />
  22. </Grid.RowDefinitions>
  23. <!--#region 顶部料仓-->
  24. <Grid Name="TopGrid">
  25. <ListView
  26. Height="{Binding ElementName=TopGrid, Path=ActualHeight}"
  27. VerticalAlignment="Center"
  28. Background="Transparent"
  29. BorderThickness="0"
  30. ItemsSource="{Binding TopDeviceCurrentStatuses}"
  31. ScrollViewer.VerticalScrollBarVisibility="Disabled"
  32. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  33. <ListView.ItemsPanel>
  34. <ItemsPanelTemplate>
  35. <UniformGrid
  36. HorizontalAlignment="Left"
  37. VerticalAlignment="Top"
  38. Columns="{Binding StockNum}"
  39. Rows="1" />
  40. </ItemsPanelTemplate>
  41. </ListView.ItemsPanel>
  42. <ListView.ItemTemplate>
  43. <DataTemplate>
  44. <Border Margin="5" Background="Transparent">
  45. <Grid Background="Transparent">
  46. <Grid.RowDefinitions>
  47. <RowDefinition />
  48. <RowDefinition />
  49. <RowDefinition Height="0.6*" />
  50. </Grid.RowDefinitions>
  51. <StackPanel Grid.Row="1">
  52. <StackPanel
  53. Grid.Row="1"
  54. Margin="0,2,0,0"
  55. HorizontalAlignment="Center"
  56. Orientation="Horizontal">
  57. <TextBlock
  58. FontSize="20"
  59. Foreground="#FF0084FF"
  60. Text="{Binding Weight}" />
  61. <TextBlock
  62. FontSize="20"
  63. Foreground="#FF0084FF"
  64. Text=" kg" />
  65. </StackPanel>
  66. <StackPanel
  67. Grid.Row="1"
  68. Margin="0,2,0,0"
  69. HorizontalAlignment="Center"
  70. Orientation="Horizontal">
  71. <TextBlock
  72. FontSize="20"
  73. Foreground="#FF0084FF"
  74. Text="{Binding DeviceNum}" />
  75. <TextBlock
  76. FontSize="20"
  77. Foreground="#FF0084FF"
  78. Text=" 号仓" />
  79. </StackPanel>
  80. <TextBlock
  81. Grid.Row="1"
  82. Margin="0,2,0,0"
  83. HorizontalAlignment="Center"
  84. VerticalAlignment="Center"
  85. FontSize="20"
  86. Foreground="#FF0084FF"
  87. Text="{Binding DeviceName}" />
  88. </StackPanel>
  89. <Grid Grid.Row="2">
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition />
  92. <ColumnDefinition />
  93. </Grid.ColumnDefinitions>
  94. <StackPanel Background="Transparent">
  95. <Ellipse
  96. Width="30"
  97. Height="30"
  98. HorizontalAlignment="Center"
  99. VerticalAlignment="Center"
  100. Fill="{Binding BucketFlagbit, Converter={StaticResource BoolToFillColorConverter}}"
  101. RenderTransformOrigin="0.5,0.5">
  102. <Ellipse.OpacityMask>
  103. <RadialGradientBrush>
  104. <GradientStop Offset="0" Color="Transparent" />
  105. <GradientStop Offset="1" Color="#00c2f4" />
  106. </RadialGradientBrush>
  107. </Ellipse.OpacityMask>
  108. <!--<Ellipse.RenderTransform>
  109. <ScaleTransform x:Name="Scale" />
  110. </Ellipse.RenderTransform>-->
  111. </Ellipse>
  112. <TextBlock
  113. Margin="0,5,0,0"
  114. HorizontalAlignment="Center"
  115. FontSize="16"
  116. Foreground="#00c2f4"
  117. Text="到位检测" />
  118. </StackPanel>
  119. <StackPanel Name="skp" Grid.Column="1">
  120. <ToggleButton
  121. Width="80"
  122. Height="30"
  123. Margin="5,0,5,0"
  124. HorizontalAlignment="Center"
  125. VerticalAlignment="Center"
  126. Background="Transparent"
  127. Command="{Binding DataContext.RecipeControlCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  128. CommandParameter="{Binding}"
  129. FontSize="20"
  130. IsChecked="{Binding BaitingControl}"
  131. Style="{StaticResource SwitchToggleButtonStyle}" />
  132. <TextBlock
  133. Margin="0,5,0,0"
  134. HorizontalAlignment="Center"
  135. FontSize="16"
  136. Foreground="#00c2f4"
  137. Text="出料控制" />
  138. </StackPanel>
  139. </Grid>
  140. <Image
  141. Margin="20,30,20,0"
  142. Source="/BPASmartClient.CustomResource;component/Image/荧光/矩形发光.png"
  143. Stretch="Fill"
  144. Visibility="{Binding IsOpen, Converter={StaticResource BoolToVisibilityConvert}}" />
  145. <Image Source="/BPASmartClient.CustomResource;component/Image/荧光/29.png" Visibility="{Binding BaitingControl, Converter={StaticResource BoolToVisibilityConvert}}" />
  146. <Image
  147. Grid.RowSpan="2"
  148. Source="/BPASmartClient.CustomResource;component/Image/光柱.png"
  149. Stretch="Fill" />
  150. <Grid
  151. Name="WeightGr"
  152. Height="45"
  153. Margin="20,-30,20,0">
  154. <Grid.Background>
  155. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/荧光/蓝色提示框.png" />
  156. </Grid.Background>
  157. <TextBox
  158. Name="outName"
  159. Width="{Binding ElementName=WeightGr, Path=ActualWidth}"
  160. Height="{Binding ElementName=WeightGr, Path=ActualHeight}"
  161. Margin="0,-2,0,0"
  162. HorizontalContentAlignment="Center"
  163. VerticalContentAlignment="Center"
  164. Background="Transparent"
  165. BorderThickness="0"
  166. CaretBrush="#009dff"
  167. FontSize="20"
  168. Foreground="#009dff"
  169. Text="{Binding SetWeight}" />
  170. </Grid>
  171. </Grid>
  172. </Border>
  173. </DataTemplate>
  174. </ListView.ItemTemplate>
  175. </ListView>
  176. </Grid>
  177. <!--#endregion-->
  178. <!--#region 输送带-->
  179. <Grid
  180. x:Name="gr"
  181. Grid.Row="1"
  182. Background="Transparent">
  183. <!--<pry:ConveyorBelt
  184. Grid.Row="1"
  185. Width="{Binding ElementName=gr, Path=ActualWidth}"
  186. Height="{Binding ElementName=gr, Path=ActualHeight}"
  187. Margin="10,0,30,0"
  188. ConveyorBeltWidth="70"
  189. Direction="0"
  190. StrokeBrush="#00BEFA"
  191. StrokeDashArray="1.5 1.5"
  192. StrokeFillBrush="#00BEFA"
  193. StrokeThickness="2" />-->
  194. <Grid.RowDefinitions>
  195. <RowDefinition />
  196. <RowDefinition />
  197. <RowDefinition />
  198. <RowDefinition />
  199. </Grid.RowDefinitions>
  200. <Grid Grid.Row="2">
  201. <Grid.ColumnDefinitions>
  202. <ColumnDefinition />
  203. <ColumnDefinition />
  204. <ColumnDefinition />
  205. <ColumnDefinition />
  206. <ColumnDefinition />
  207. <ColumnDefinition />
  208. </Grid.ColumnDefinitions>
  209. <Ellipse
  210. Width="30"
  211. Height="30"
  212. HorizontalAlignment="Center"
  213. VerticalAlignment="Bottom"
  214. Fill="{Binding OnDetection, Converter={StaticResource BoolToFillColorConverter}}"
  215. RenderTransformOrigin="0.5,0.5">
  216. <Ellipse.OpacityMask>
  217. <RadialGradientBrush>
  218. <GradientStop Offset="0" Color="Transparent" />
  219. <GradientStop Offset="1" Color="#00c2f4" />
  220. </RadialGradientBrush>
  221. </Ellipse.OpacityMask>
  222. </Ellipse>
  223. <Ellipse
  224. Grid.Column="5"
  225. Width="30"
  226. Height="30"
  227. HorizontalAlignment="Center"
  228. VerticalAlignment="Bottom"
  229. Fill="{Binding UnderDetection, Converter={StaticResource BoolToFillColorConverter}}"
  230. RenderTransformOrigin="0.5,0.5">
  231. <Ellipse.OpacityMask>
  232. <RadialGradientBrush>
  233. <GradientStop Offset="0" Color="Transparent" />
  234. <GradientStop Offset="1" Color="#00c2f4" />
  235. </RadialGradientBrush>
  236. </Ellipse.OpacityMask>
  237. </Ellipse>
  238. </Grid>
  239. <Grid Grid.Row="3">
  240. <Grid.ColumnDefinitions>
  241. <ColumnDefinition />
  242. <ColumnDefinition />
  243. <ColumnDefinition />
  244. <ColumnDefinition />
  245. <ColumnDefinition />
  246. <ColumnDefinition />
  247. </Grid.ColumnDefinitions>
  248. <TextBlock
  249. Margin="0,5,0,0"
  250. HorizontalAlignment="Center"
  251. FontSize="16"
  252. Foreground="#00c2f4"
  253. Text="上桶工位检测" />
  254. <TextBlock
  255. Grid.Column="5"
  256. Margin="0,5,0,0"
  257. HorizontalAlignment="Center"
  258. FontSize="16"
  259. Foreground="#00c2f4"
  260. Text="下桶工位检测" />
  261. </Grid>
  262. <pry:ConveyBelt2
  263. Grid.RowSpan="4"
  264. Margin="-12,0,10,0"
  265. BeltDashThickess="50"
  266. BeltHeight="{Binding ElementName=gr, Path=ActualHeight}"
  267. BeltWidth="{Binding ElementName=gr, Path=ActualWidth}"
  268. IsRun="{Binding ConveyerBeltStatus}" />
  269. <!--<StackPanel
  270. Grid.Row="1"
  271. Margin="20,0,0,0"
  272. HorizontalAlignment="Left"
  273. VerticalAlignment="Top"
  274. Orientation="Horizontal">
  275. <TextBlock
  276. Margin="0,0,5,0"
  277. FontSize="20"
  278. Foreground="#00c2f4"
  279. Text="输送带控制" />
  280. <ToggleButton
  281. Width="80"
  282. Height="30"
  283. Margin="5,0,5,0"
  284. Background="Transparent"
  285. FontSize="20"
  286. IsChecked="{Binding ConveyerBeltWork}"
  287. Style="{StaticResource SwitchToggleButtonStyle}" />
  288. </StackPanel>-->
  289. </Grid>
  290. <!--#endregion-->
  291. <!--#region 底部料仓-->
  292. <Grid Grid.Row="2">
  293. <ListView
  294. VerticalAlignment="Center"
  295. Background="Transparent"
  296. BorderThickness="0"
  297. ItemsSource="{Binding BottomDeviceCurrentStatuses}"
  298. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  299. <ListView.ItemsPanel>
  300. <ItemsPanelTemplate>
  301. <UniformGrid
  302. HorizontalAlignment="Left"
  303. VerticalAlignment="Top"
  304. Columns="{Binding StockNum}"
  305. Rows="1" />
  306. </ItemsPanelTemplate>
  307. </ListView.ItemsPanel>
  308. <ListView.ItemTemplate>
  309. <DataTemplate>
  310. <Border Margin="5" Background="Transparent">
  311. <Grid Height="270" Background="Transparent">
  312. <Grid.RowDefinitions>
  313. <RowDefinition />
  314. <RowDefinition />
  315. <RowDefinition Height="0.6*" />
  316. </Grid.RowDefinitions>
  317. <StackPanel Grid.Row="1">
  318. <StackPanel
  319. Grid.Row="1"
  320. Margin="0,2,0,0"
  321. HorizontalAlignment="Center"
  322. Orientation="Horizontal">
  323. <TextBlock
  324. FontSize="20"
  325. Foreground="#FF0084FF"
  326. Text="{Binding Weight}" />
  327. <TextBlock
  328. FontSize="20"
  329. Foreground="#FF0084FF"
  330. Text=" kg" />
  331. </StackPanel>
  332. <StackPanel
  333. Grid.Row="1"
  334. Margin="0,2,0,0"
  335. HorizontalAlignment="Center"
  336. Orientation="Horizontal">
  337. <TextBlock
  338. FontSize="20"
  339. Foreground="#FF0084FF"
  340. Text="{Binding DeviceNum}" />
  341. <TextBlock
  342. FontSize="20"
  343. Foreground="#FF0084FF"
  344. Text=" 号仓" />
  345. </StackPanel>
  346. <TextBlock
  347. Grid.Row="1"
  348. Margin="0,2,0,0"
  349. HorizontalAlignment="Center"
  350. VerticalAlignment="Center"
  351. FontSize="20"
  352. Foreground="#FF0084FF"
  353. Text="{Binding DeviceName}" />
  354. </StackPanel>
  355. <!--<StackPanel Grid.Row="2" Orientation="Horizontal">-->
  356. <Grid Grid.Row="2">
  357. <Grid.ColumnDefinitions>
  358. <ColumnDefinition/>
  359. <ColumnDefinition/>
  360. </Grid.ColumnDefinitions>
  361. <StackPanel Background="Transparent">
  362. <Ellipse
  363. Width="30"
  364. Height="30"
  365. HorizontalAlignment="Center"
  366. VerticalAlignment="Center"
  367. Fill="{Binding BucketFlagbit, Converter={StaticResource BoolToFillColorConverter}}"
  368. RenderTransformOrigin="0.5,0.5">
  369. <Ellipse.OpacityMask>
  370. <RadialGradientBrush>
  371. <GradientStop Offset="0" Color="Transparent" />
  372. <GradientStop Offset="1" Color="#00c2f4" />
  373. </RadialGradientBrush>
  374. </Ellipse.OpacityMask>
  375. <!--<Ellipse.RenderTransform>
  376. <ScaleTransform x:Name="Scale" />
  377. </Ellipse.RenderTransform>-->
  378. </Ellipse>
  379. <TextBlock
  380. Margin="0,5,0,0"
  381. HorizontalAlignment="Center"
  382. FontSize="16"
  383. Foreground="#00c2f4"
  384. Text="到位检测" />
  385. </StackPanel>
  386. <StackPanel Grid.Column="1">
  387. <ToggleButton
  388. Width="80"
  389. Height="30"
  390. Margin="5,0,5,0"
  391. HorizontalAlignment="Right"
  392. VerticalAlignment="Center"
  393. Background="Transparent"
  394. FontSize="20"
  395. IsChecked="{Binding BaitingControl}"
  396. Style="{StaticResource SwitchToggleButtonStyle}" />
  397. <TextBlock
  398. Margin="0,5,0,0"
  399. HorizontalAlignment="Right"
  400. FontSize="16"
  401. Foreground="#00c2f4"
  402. Text="出料控制" />
  403. </StackPanel>
  404. <!--</StackPanel>-->
  405. </Grid>
  406. <Image
  407. Margin="20,30,20,0"
  408. Source="/BPASmartClient.CustomResource;component/Image/荧光/矩形发光.png"
  409. Stretch="Fill"
  410. Visibility="{Binding IsOpen, Converter={StaticResource BoolToVisibilityConvert}}" />
  411. <Image Source="/BPASmartClient.CustomResource;component/Image/荧光/29.png" Visibility="{Binding BaitingControl, Converter={StaticResource BoolToVisibilityConvert}}" />
  412. <Image
  413. Grid.RowSpan="2"
  414. Source="/BPASmartClient.CustomResource;component/Image/光柱.png"
  415. Stretch="Fill" />
  416. <Grid
  417. Name="WeightGr"
  418. Height="45"
  419. Margin="20,-30,20,0">
  420. <Grid.Background>
  421. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/荧光/蓝色提示框.png" />
  422. </Grid.Background>
  423. <TextBox
  424. Name="outName"
  425. Width="{Binding ElementName=WeightGr, Path=ActualWidth}"
  426. Height="{Binding ElementName=WeightGr, Path=ActualHeight}"
  427. Margin="0,-2,0,0"
  428. HorizontalContentAlignment="Center"
  429. VerticalContentAlignment="Center"
  430. Background="Transparent"
  431. BorderThickness="0"
  432. CaretBrush="#009dff"
  433. FontSize="20"
  434. Foreground="#009dff"
  435. Text="{Binding SetWeight}" />
  436. </Grid>
  437. </Grid>
  438. </Border>
  439. </DataTemplate>
  440. </ListView.ItemTemplate>
  441. </ListView>
  442. </Grid>
  443. <!--#endregion-->
  444. </Grid>
  445. </UserControl>