终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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