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

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