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

380 lines
16 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 Margin="8">
  53. <Grid.RowDefinitions>
  54. <RowDefinition />
  55. <RowDefinition />
  56. <RowDefinition />
  57. </Grid.RowDefinitions>
  58. <!--#region 升降气缸-->
  59. <Grid
  60. Name="cy"
  61. Grid.Row="0"
  62. Margin="5">
  63. <Grid.RowDefinitions>
  64. <RowDefinition Height="40" />
  65. <RowDefinition />
  66. </Grid.RowDefinitions>
  67. <pry:ImageBorder
  68. Grid.RowSpan="2"
  69. Width="{Binding ElementName=cy, Path=ActualWidth}"
  70. Height="{Binding ElementName=cy, 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. <ListView
  82. Grid.Row="1"
  83. Background="Transparent"
  84. BorderBrush="#00BEFA"
  85. BorderThickness="0"
  86. ItemsSource="{Binding cylinderModels}"
  87. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  88. <ListView.ItemsPanel>
  89. <ItemsPanelTemplate>
  90. <UniformGrid
  91. HorizontalAlignment="Left"
  92. VerticalAlignment="Top"
  93. Columns="8" />
  94. </ItemsPanelTemplate>
  95. </ListView.ItemsPanel>
  96. <ListView.ItemTemplate>
  97. <DataTemplate>
  98. <Grid
  99. Width="200"
  100. Height="100"
  101. Margin="0,0,0,15"
  102. Background="Transparent">
  103. <Grid.RowDefinitions>
  104. <RowDefinition Height="30" />
  105. <RowDefinition />
  106. <RowDefinition Height="30" />
  107. </Grid.RowDefinitions>
  108. <Grid.ColumnDefinitions>
  109. <ColumnDefinition Width="0.5*" />
  110. <ColumnDefinition />
  111. <ColumnDefinition />
  112. </Grid.ColumnDefinitions>
  113. <TextBlock
  114. Grid.Column="1"
  115. Grid.ColumnSpan="2"
  116. HorizontalAlignment="Center"
  117. VerticalAlignment="Center"
  118. Foreground="Aqua"
  119. Text="{Binding Name}" />
  120. <pry:Cylinder
  121. Grid.Row="1"
  122. Grid.ColumnSpan="3"
  123. Width="200"
  124. Height="50"
  125. HorizontalAlignment="Center"
  126. VerticalAlignment="Center"
  127. LeftTogIsChecked="{Binding LeftTog}"
  128. RightTogIsChecked="{Binding RightTog}" />
  129. <RadioButton
  130. Grid.Row="2"
  131. Grid.Column="1"
  132. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  133. CommandParameter="{Binding Name}"
  134. Content="伸出"
  135. Foreground="Aqua"
  136. IsChecked="True"
  137. Style="{StaticResource radioButtonStyle}" />
  138. <RadioButton
  139. Grid.Row="2"
  140. Grid.Column="2"
  141. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  142. CommandParameter="{Binding Name}"
  143. Content="缩回"
  144. Foreground="Aqua"
  145. IsChecked="False"
  146. Style="{StaticResource radioButtonStyle}" />
  147. </Grid>
  148. </DataTemplate>
  149. </ListView.ItemTemplate>
  150. </ListView>
  151. </Grid>
  152. <!--#endregion-->
  153. <!--#region 阻挡气缸-->
  154. <Grid
  155. Name="zd"
  156. Grid.Row="1"
  157. Margin="5">
  158. <Grid.RowDefinitions>
  159. <RowDefinition Height="40" />
  160. <RowDefinition />
  161. </Grid.RowDefinitions>
  162. <pry:ImageBorder
  163. Grid.RowSpan="2"
  164. Width="{Binding ElementName=zd, Path=ActualWidth}"
  165. Height="{Binding ElementName=zd, Path=ActualHeight}" />
  166. <Image
  167. Margin="2,3,0,0"
  168. HorizontalAlignment="Left"
  169. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  170. <TextBlock
  171. Margin="10,0,0,0"
  172. VerticalAlignment="Center"
  173. FontSize="16"
  174. Foreground="Aqua"
  175. Text="阻挡气缸控制" />
  176. <ListView
  177. Grid.Row="1"
  178. Margin="10"
  179. Background="Transparent"
  180. BorderBrush="#00BEFA"
  181. BorderThickness="0"
  182. ItemsSource="{Binding BlockCylinders}"
  183. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  184. <ListView.ItemsPanel>
  185. <ItemsPanelTemplate>
  186. <UniformGrid
  187. HorizontalAlignment="Left"
  188. VerticalAlignment="Top"
  189. Columns="8" />
  190. </ItemsPanelTemplate>
  191. </ListView.ItemsPanel>
  192. <ListView.ItemTemplate>
  193. <DataTemplate>
  194. <Grid
  195. Width="200"
  196. Height="100"
  197. Margin="0,0,0,15"
  198. Background="Transparent">
  199. <Grid.RowDefinitions>
  200. <RowDefinition Height="30" />
  201. <RowDefinition />
  202. <RowDefinition Height="30" />
  203. </Grid.RowDefinitions>
  204. <Grid.ColumnDefinitions>
  205. <ColumnDefinition Width="0.5*" />
  206. <ColumnDefinition />
  207. <ColumnDefinition />
  208. </Grid.ColumnDefinitions>
  209. <TextBlock
  210. Grid.Column="1"
  211. Grid.ColumnSpan="2"
  212. HorizontalAlignment="Center"
  213. VerticalAlignment="Center"
  214. Foreground="Aqua"
  215. Text="{Binding Name}" />
  216. <pry:Cylinder
  217. Grid.Row="1"
  218. Grid.ColumnSpan="3"
  219. Width="200"
  220. Height="50"
  221. HorizontalAlignment="Center"
  222. VerticalAlignment="Center"
  223. LeftTogIsChecked="{Binding LeftTog}"
  224. RightTogIsChecked="{Binding RightTog}" />
  225. <RadioButton
  226. Grid.Row="2"
  227. Grid.Column="1"
  228. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  229. CommandParameter="{Binding Name}"
  230. Content="伸出"
  231. Foreground="Aqua"
  232. IsChecked="True"
  233. Style="{StaticResource radioButtonStyle}" />
  234. <RadioButton
  235. Grid.Row="2"
  236. Grid.Column="2"
  237. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  238. CommandParameter="{Binding Name}"
  239. Content="缩回"
  240. Foreground="Aqua"
  241. IsChecked="False"
  242. Style="{StaticResource radioButtonStyle}" />
  243. </Grid>
  244. </DataTemplate>
  245. </ListView.ItemTemplate>
  246. </ListView>
  247. </Grid>
  248. <!--#endregion-->
  249. <!--#region 托盘气缸-->
  250. <Grid
  251. Name="tp"
  252. Grid.Row="2"
  253. Margin="5">
  254. <Grid.RowDefinitions>
  255. <RowDefinition Height="40" />
  256. <RowDefinition />
  257. </Grid.RowDefinitions>
  258. <pry:ImageBorder
  259. Grid.RowSpan="2"
  260. Width="{Binding ElementName=tp, Path=ActualWidth}"
  261. Height="{Binding ElementName=tp, Path=ActualHeight}" />
  262. <Image
  263. Margin="2,3,0,0"
  264. HorizontalAlignment="Left"
  265. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  266. <TextBlock
  267. Margin="10,0,0,0"
  268. VerticalAlignment="Center"
  269. FontSize="16"
  270. Foreground="Aqua"
  271. Text="托盘气缸控制" />
  272. <ListView
  273. Grid.Row="2"
  274. Margin="10"
  275. Background="Transparent"
  276. BorderBrush="#00BEFA"
  277. BorderThickness="0"
  278. ItemsSource="{Binding PalletCylinders}"
  279. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  280. <ListView.ItemsPanel>
  281. <ItemsPanelTemplate>
  282. <UniformGrid
  283. HorizontalAlignment="Left"
  284. VerticalAlignment="Top"
  285. Columns="8" />
  286. </ItemsPanelTemplate>
  287. </ListView.ItemsPanel>
  288. <ListView.ItemTemplate>
  289. <DataTemplate>
  290. <Grid
  291. Width="200"
  292. Height="100"
  293. Margin="0,0,0,15"
  294. Background="Transparent">
  295. <Grid.RowDefinitions>
  296. <RowDefinition Height="30" />
  297. <RowDefinition />
  298. <RowDefinition Height="30" />
  299. </Grid.RowDefinitions>
  300. <Grid.ColumnDefinitions>
  301. <ColumnDefinition Width="0.5*" />
  302. <ColumnDefinition />
  303. <ColumnDefinition />
  304. </Grid.ColumnDefinitions>
  305. <TextBlock
  306. Grid.Column="1"
  307. Grid.ColumnSpan="2"
  308. HorizontalAlignment="Center"
  309. VerticalAlignment="Center"
  310. Foreground="Aqua"
  311. Text="{Binding Name}" />
  312. <pry:Cylinder
  313. Grid.Row="1"
  314. Grid.ColumnSpan="3"
  315. Width="200"
  316. Height="50"
  317. HorizontalAlignment="Center"
  318. VerticalAlignment="Center"
  319. LeftTogIsChecked="{Binding LeftTog}"
  320. RightTogIsChecked="{Binding RightTog}" />
  321. <RadioButton
  322. Grid.Row="2"
  323. Grid.Column="1"
  324. Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  325. CommandParameter="{Binding Name}"
  326. Content="伸出"
  327. Foreground="Aqua"
  328. IsChecked="True"
  329. Style="{StaticResource radioButtonStyle}" />
  330. <RadioButton
  331. Grid.Row="2"
  332. Grid.Column="2"
  333. Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  334. CommandParameter="{Binding Name}"
  335. Content="缩回"
  336. Foreground="Aqua"
  337. IsChecked="False"
  338. Style="{StaticResource radioButtonStyle}" />
  339. </Grid>
  340. </DataTemplate>
  341. </ListView.ItemTemplate>
  342. </ListView>
  343. </Grid>
  344. <!--#endregion-->
  345. </Grid>
  346. </UserControl>