终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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