终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

526 行
27 KiB

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