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

562 lines
25 KiB

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