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

469 lines
24 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.ManualControlView"
  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.DosingSystem.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  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. </UserControl.Resources>
  49. <UserControl.DataContext>
  50. <vm:ManualControlViewModel />
  51. </UserControl.DataContext>
  52. <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
  53. <StackPanel Margin="8">
  54. <!--#region 升降气缸-->
  55. <Grid
  56. Name="cy"
  57. Grid.Row="0"
  58. Margin="5"
  59. Visibility="{Binding cylinderModels, Converter={StaticResource CountIsVisiableConvert}}">
  60. <pry:ImageBorder
  61. Grid.RowSpan="2"
  62. Width="{Binding ElementName=cy, Path=ActualWidth}"
  63. Height="{Binding ElementName=cy, Path=ActualHeight}" />
  64. <StackPanel Background="Transparent">
  65. <Grid Height="40">
  66. <Image
  67. Margin="2,3,0,0"
  68. HorizontalAlignment="Left"
  69. VerticalAlignment="Top"
  70. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  71. <TextBlock
  72. Margin="10,10,0,0"
  73. VerticalAlignment="Top"
  74. FontSize="16"
  75. Foreground="Aqua"
  76. Text="升降气缸控制" />
  77. </Grid>
  78. <ListView
  79. Name="list1"
  80. Grid.Row="1"
  81. Margin="0,0,0,20"
  82. Background="Transparent"
  83. BorderBrush="#00BEFA"
  84. BorderThickness="0"
  85. ItemsSource="{Binding cylinderModels}"
  86. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  87. <ListView.ItemsPanel>
  88. <ItemsPanelTemplate>
  89. <WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
  90. </ItemsPanelTemplate>
  91. </ListView.ItemsPanel>
  92. <ListView.ItemTemplate>
  93. <DataTemplate>
  94. <Grid
  95. Width="200"
  96. Height="100"
  97. Margin="0,0,0,15"
  98. Background="Transparent">
  99. <Grid.RowDefinitions>
  100. <RowDefinition Height="30" />
  101. <RowDefinition />
  102. <RowDefinition Height="30" />
  103. </Grid.RowDefinitions>
  104. <Grid.ColumnDefinitions>
  105. <ColumnDefinition Width="0.5*" />
  106. <ColumnDefinition />
  107. <ColumnDefinition />
  108. </Grid.ColumnDefinitions>
  109. <TextBlock
  110. Grid.Column="1"
  111. Grid.ColumnSpan="2"
  112. HorizontalAlignment="Center"
  113. VerticalAlignment="Center"
  114. Foreground="Aqua"
  115. Text="{Binding Name}" />
  116. <pry:Cylinder
  117. Grid.Row="1"
  118. Grid.ColumnSpan="3"
  119. Width="200"
  120. Height="50"
  121. HorizontalAlignment="Center"
  122. VerticalAlignment="Center"
  123. LeftTogIsChecked="{Binding LeftTog}"
  124. RightTogIsChecked="{Binding RightTog}" />
  125. <RadioButton
  126. Grid.Row="2"
  127. Grid.Column="1"
  128. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  129. CommandParameter="{Binding Name}"
  130. Content="伸出"
  131. Foreground="Aqua"
  132. IsChecked="True"
  133. Style="{StaticResource radioButtonStyle}" />
  134. <RadioButton
  135. Grid.Row="2"
  136. Grid.Column="2"
  137. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  138. CommandParameter="{Binding Name}"
  139. Content="缩回"
  140. Foreground="Aqua"
  141. IsChecked="False"
  142. Style="{StaticResource radioButtonStyle}" />
  143. </Grid>
  144. </DataTemplate>
  145. </ListView.ItemTemplate>
  146. </ListView>
  147. </StackPanel>
  148. </Grid>
  149. <!--#endregion-->
  150. <!--#region 阻挡气缸-->
  151. <Grid
  152. Name="zd"
  153. Grid.Row="1"
  154. Margin="5"
  155. Visibility="{Binding BlockCylinders, Converter={StaticResource CountIsVisiableConvert}}">
  156. <pry:ImageBorder Width="{Binding ElementName=zd, Path=ActualWidth}" Height="{Binding ElementName=zd, Path=ActualHeight}" />
  157. <StackPanel>
  158. <Grid Height="40">
  159. <Image
  160. Margin="2,3,0,0"
  161. HorizontalAlignment="Left"
  162. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  163. <TextBlock
  164. Margin="10,0,0,0"
  165. VerticalAlignment="Center"
  166. FontSize="16"
  167. Foreground="Aqua"
  168. Text="阻挡气缸控制" />
  169. </Grid>
  170. <ListView
  171. Name="list2"
  172. Grid.Row="1"
  173. Margin="0,0,0,20"
  174. Background="Transparent"
  175. BorderBrush="#00BEFA"
  176. BorderThickness="0"
  177. ItemsSource="{Binding BlockCylinders}"
  178. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  179. <ListView.ItemsPanel>
  180. <ItemsPanelTemplate>
  181. <WrapPanel Orientation="Horizontal" />
  182. </ItemsPanelTemplate>
  183. </ListView.ItemsPanel>
  184. <ListView.ItemTemplate>
  185. <DataTemplate>
  186. <Grid
  187. Width="200"
  188. Height="100"
  189. Margin="0,0,0,15"
  190. Background="Transparent">
  191. <Grid.RowDefinitions>
  192. <RowDefinition Height="30" />
  193. <RowDefinition />
  194. <RowDefinition Height="30" />
  195. </Grid.RowDefinitions>
  196. <Grid.ColumnDefinitions>
  197. <ColumnDefinition Width="0.5*" />
  198. <ColumnDefinition />
  199. <ColumnDefinition />
  200. </Grid.ColumnDefinitions>
  201. <TextBlock
  202. Grid.Column="1"
  203. Grid.ColumnSpan="2"
  204. HorizontalAlignment="Center"
  205. VerticalAlignment="Center"
  206. Foreground="Aqua"
  207. Text="{Binding Name}" />
  208. <pry:Cylinder
  209. Grid.Row="1"
  210. Grid.ColumnSpan="3"
  211. Width="200"
  212. Height="50"
  213. HorizontalAlignment="Center"
  214. VerticalAlignment="Center"
  215. LeftTogIsChecked="{Binding LeftTog}"
  216. RightTogIsChecked="{Binding RightTog}" />
  217. <RadioButton
  218. Grid.Row="2"
  219. Grid.Column="1"
  220. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  221. CommandParameter="{Binding Name}"
  222. Content="伸出"
  223. Foreground="Aqua"
  224. IsChecked="True"
  225. Style="{StaticResource radioButtonStyle}" />
  226. <RadioButton
  227. Grid.Row="2"
  228. Grid.Column="2"
  229. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  230. CommandParameter="{Binding Name}"
  231. Content="缩回"
  232. Foreground="Aqua"
  233. IsChecked="False"
  234. Style="{StaticResource radioButtonStyle}" />
  235. </Grid>
  236. </DataTemplate>
  237. </ListView.ItemTemplate>
  238. </ListView>
  239. </StackPanel>
  240. </Grid>
  241. <!--#endregion-->
  242. <!--#region 托盘气缸-->
  243. <Grid
  244. Name="tp"
  245. Grid.Row="2"
  246. Margin="5"
  247. Visibility="{Binding PalletCylinders, Converter={StaticResource CountIsVisiableConvert}}">
  248. <pry:ImageBorder
  249. Grid.RowSpan="2"
  250. Width="{Binding ElementName=tp, Path=ActualWidth}"
  251. Height="{Binding ElementName=tp, Path=ActualHeight}" />
  252. <StackPanel>
  253. <Grid Height="40">
  254. <Image
  255. Margin="2,3,0,0"
  256. HorizontalAlignment="Left"
  257. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  258. <TextBlock
  259. Margin="10,0,0,0"
  260. VerticalAlignment="Center"
  261. FontSize="16"
  262. Foreground="Aqua"
  263. Text="托盘气缸控制" />
  264. </Grid>
  265. <ListView
  266. Name="list3"
  267. Grid.Row="2"
  268. Margin="0,0,0,20"
  269. Background="Transparent"
  270. BorderBrush="#00BEFA"
  271. BorderThickness="0"
  272. ItemsSource="{Binding PalletCylinders}"
  273. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  274. <ListView.ItemsPanel>
  275. <ItemsPanelTemplate>
  276. <WrapPanel Orientation="Horizontal" />
  277. </ItemsPanelTemplate>
  278. </ListView.ItemsPanel>
  279. <ListView.ItemTemplate>
  280. <DataTemplate>
  281. <Grid
  282. Width="200"
  283. Height="100"
  284. Margin="0,0,0,15"
  285. Background="Transparent">
  286. <Grid.RowDefinitions>
  287. <RowDefinition Height="30" />
  288. <RowDefinition />
  289. <RowDefinition Height="30" />
  290. </Grid.RowDefinitions>
  291. <Grid.ColumnDefinitions>
  292. <ColumnDefinition Width="0.5*" />
  293. <ColumnDefinition />
  294. <ColumnDefinition />
  295. </Grid.ColumnDefinitions>
  296. <TextBlock
  297. Grid.Column="1"
  298. Grid.ColumnSpan="2"
  299. HorizontalAlignment="Center"
  300. VerticalAlignment="Center"
  301. Foreground="Aqua"
  302. Text="{Binding Name}" />
  303. <pry:Cylinder
  304. Grid.Row="1"
  305. Grid.ColumnSpan="3"
  306. Width="200"
  307. Height="50"
  308. HorizontalAlignment="Center"
  309. VerticalAlignment="Center"
  310. LeftTogIsChecked="{Binding LeftTog}"
  311. RightTogIsChecked="{Binding RightTog}" />
  312. <RadioButton
  313. Grid.Row="2"
  314. Grid.Column="1"
  315. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  316. CommandParameter="{Binding Name}"
  317. Content="伸出"
  318. Foreground="Aqua"
  319. IsChecked="True"
  320. Style="{StaticResource radioButtonStyle}" />
  321. <RadioButton
  322. Grid.Row="2"
  323. Grid.Column="2"
  324. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  325. CommandParameter="{Binding Name}"
  326. Content="缩回"
  327. Foreground="Aqua"
  328. IsChecked="False"
  329. Style="{StaticResource radioButtonStyle}" />
  330. </Grid>
  331. </DataTemplate>
  332. </ListView.ItemTemplate>
  333. </ListView>
  334. </StackPanel>
  335. </Grid>
  336. <!--#endregion-->
  337. <!--#region 上下桶工位气缸-->
  338. <Grid
  339. Name="onGrid"
  340. Grid.Row="2"
  341. Margin="5"
  342. Visibility="{Binding OtherHandCylinders, Converter={StaticResource CountIsVisiableConvert}}">
  343. <pry:ImageBorder
  344. Grid.RowSpan="2"
  345. Width="{Binding ElementName=onGrid, Path=ActualWidth}"
  346. Height="{Binding ElementName=onGrid, Path=ActualHeight}" />
  347. <StackPanel>
  348. <Grid Height="40">
  349. <Image
  350. Margin="2,3,0,0"
  351. HorizontalAlignment="Left"
  352. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  353. <TextBlock
  354. Margin="10,0,0,0"
  355. VerticalAlignment="Center"
  356. FontSize="16"
  357. Foreground="Aqua"
  358. Text="上下桶工位气缸控制" />
  359. </Grid>
  360. <ListView
  361. Name="list4"
  362. Grid.Row="2"
  363. Margin="0,0,0,20"
  364. Background="Transparent"
  365. BorderBrush="#00BEFA"
  366. BorderThickness="0"
  367. ItemsSource="{Binding OtherHandCylinders}"
  368. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  369. <ListView.ItemsPanel>
  370. <ItemsPanelTemplate>
  371. <WrapPanel Orientation="Horizontal" />
  372. </ItemsPanelTemplate>
  373. </ListView.ItemsPanel>
  374. <ListView.ItemTemplate>
  375. <DataTemplate>
  376. <Grid
  377. Width="200"
  378. Height="100"
  379. Margin="0,0,0,15"
  380. Background="Transparent">
  381. <Grid.RowDefinitions>
  382. <RowDefinition Height="30" />
  383. <RowDefinition />
  384. <RowDefinition Height="30" />
  385. </Grid.RowDefinitions>
  386. <Grid.ColumnDefinitions>
  387. <ColumnDefinition Width="0.5*" />
  388. <ColumnDefinition />
  389. <ColumnDefinition />
  390. </Grid.ColumnDefinitions>
  391. <TextBlock
  392. Grid.Column="1"
  393. Grid.ColumnSpan="2"
  394. HorizontalAlignment="Center"
  395. VerticalAlignment="Center"
  396. Foreground="Aqua"
  397. Text="{Binding Name}" />
  398. <pry:Cylinder
  399. Grid.Row="1"
  400. Grid.ColumnSpan="3"
  401. Width="200"
  402. Height="50"
  403. HorizontalAlignment="Center"
  404. VerticalAlignment="Center"
  405. LeftTogIsChecked="{Binding LeftTog}"
  406. RightTogIsChecked="{Binding RightTog}" />
  407. <RadioButton
  408. Grid.Row="2"
  409. Grid.Column="1"
  410. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  411. CommandParameter="{Binding Name}"
  412. Content="伸出"
  413. Foreground="Aqua"
  414. IsChecked="True"
  415. Style="{StaticResource radioButtonStyle}" />
  416. <RadioButton
  417. Grid.Row="2"
  418. Grid.Column="2"
  419. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  420. CommandParameter="{Binding Name}"
  421. Content="缩回"
  422. Foreground="Aqua"
  423. IsChecked="False"
  424. Style="{StaticResource radioButtonStyle}" />
  425. </Grid>
  426. </DataTemplate>
  427. </ListView.ItemTemplate>
  428. </ListView>
  429. </StackPanel>
  430. </Grid>
  431. <!--#endregion-->
  432. </StackPanel>
  433. </ScrollViewer>
  434. </UserControl>