终端一体化运控平台
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

451 строка
19 KiB

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