PlcRobotManual.xaml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. <UserControl x:Class="TeamAAS_VP.Controls.PlcRobotManual"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:TeamAAS_VP.Controls"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  9. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  11. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  12. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. lex:LocalizeDictionary.DesignCulture="zh-CN"
  15. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  16. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  17. mc:Ignorable="d"
  18. d:Background="White"
  19. d:DataContext="{d:DesignInstance Type=local:PlcRobotManual}"
  20. FontFamily="{DynamicResource DefaultFont}">
  21. <UserControl.Resources>
  22. <convert:JogConverter x:Key="JogConverter" />
  23. </UserControl.Resources>
  24. <ScrollViewer HorizontalAlignment="Stretch"
  25. VerticalAlignment="Stretch">
  26. <Grid HorizontalAlignment="Stretch"
  27. VerticalAlignment="Top">
  28. <Grid.RowDefinitions>
  29. <RowDefinition Height="auto" />
  30. <RowDefinition Height="auto" />
  31. <RowDefinition Height="auto" />
  32. </Grid.RowDefinitions>
  33. <Grid Grid.Row="0"
  34. Margin="10"
  35. HorizontalAlignment="Center">
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="auto" />
  38. <ColumnDefinition Width="auto" />
  39. <ColumnDefinition Width="auto" />
  40. <ColumnDefinition Width="auto" />
  41. </Grid.ColumnDefinitions>
  42. <Grid.RowDefinitions>
  43. <RowDefinition Height="auto" />
  44. <RowDefinition Height="auto" />
  45. <RowDefinition Height="auto" />
  46. <RowDefinition Height="auto" />
  47. <RowDefinition Height="auto" />
  48. <RowDefinition Height="auto" />
  49. <RowDefinition Height="auto" />
  50. </Grid.RowDefinitions>
  51. <Grid.Resources>
  52. <Style TargetType="Button"
  53. BasedOn="{StaticResource MaterialDesignRaisedDarkButton}">
  54. <Setter Property="Width"
  55. Value="60" />
  56. <Setter Property="Height"
  57. Value="60" />
  58. <Setter Property="FontSize"
  59. Value="13" />
  60. <Setter Property="Padding"
  61. Value="0" />
  62. <Setter Property="HorizontalAlignment"
  63. Value="Center" />
  64. <Setter Property="VerticalAlignment"
  65. Value="Center" />
  66. <Setter Property="Margin"
  67. Value="2" />
  68. <Setter Property="materialDesign:ButtonAssist.CornerRadius"
  69. Value="10" />
  70. </Style>
  71. </Grid.Resources>
  72. <StackPanel Grid.ColumnSpan="4"
  73. Grid.Row="0"
  74. Grid.Column="0"
  75. VerticalAlignment="Center"
  76. Orientation="Horizontal">
  77. <Button Content="{lex:Loc 上使能}"
  78. Grid.Row="2"
  79. materialDesign:ButtonAssist.CornerRadius="10"
  80. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  81. Command="{Binding MotorCommand}"
  82. CommandParameter="True" />
  83. <Button Content="{lex:Loc 下使能}"
  84. Grid.Row="3"
  85. Margin="10"
  86. materialDesign:ButtonAssist.CornerRadius="10"
  87. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  88. Command="{Binding MotorCommand}"
  89. CommandParameter="False" />
  90. <Button Content="{lex:Loc 复位错误}"
  91. Grid.Row="4"
  92. materialDesign:ButtonAssist.CornerRadius="10"
  93. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  94. Command="{Binding ResetCommand}" />
  95. </StackPanel>
  96. <Button Grid.Row="2"
  97. Grid.Column="0"
  98. Command="{Binding JogCommand}"
  99. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X-}">
  100. <StackPanel Orientation="Vertical">
  101. <materialDesign:PackIcon Kind="ArrowLeftBold"
  102. Width="26"
  103. Height="26" />
  104. <TextBlock Text="-X"
  105. HorizontalAlignment="Center" />
  106. </StackPanel>
  107. </Button>
  108. <Button Grid.Row="2"
  109. Grid.Column="2"
  110. Command="{Binding JogCommand}"
  111. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}">
  112. <StackPanel Orientation="Vertical">
  113. <materialDesign:PackIcon Kind="ArrowRightBold"
  114. Width="26"
  115. Height="26" />
  116. <TextBlock Text="+X"
  117. HorizontalAlignment="Center" />
  118. </StackPanel>
  119. </Button>
  120. <Button Grid.Row="1"
  121. Grid.Column="1"
  122. Command="{Binding JogCommand}"
  123. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}">
  124. <StackPanel Orientation="Vertical">
  125. <materialDesign:PackIcon Kind="ArrowTopBold"
  126. Width="26"
  127. Height="26" />
  128. <TextBlock Text="+Y"
  129. HorizontalAlignment="Center" />
  130. </StackPanel>
  131. </Button>
  132. <Button Grid.Row="3"
  133. Grid.Column="1"
  134. Command="{Binding JogCommand}"
  135. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}">
  136. <StackPanel Orientation="Vertical">
  137. <materialDesign:PackIcon Kind="ArrowBottomBold"
  138. Width="26"
  139. Height="26" />
  140. <TextBlock Text="-Y"
  141. HorizontalAlignment="Center" />
  142. </StackPanel>
  143. </Button>
  144. <Button Grid.Row="1"
  145. Grid.Column="3"
  146. Command="{Binding JogCommand}"
  147. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}">
  148. <StackPanel Orientation="Vertical">
  149. <materialDesign:PackIcon Kind="ArrowTopBold"
  150. Width="26"
  151. Height="26" />
  152. <TextBlock Text="+Z"
  153. HorizontalAlignment="Center" />
  154. </StackPanel>
  155. </Button>
  156. <Button Grid.Row="3"
  157. Grid.Column="3"
  158. Command="{Binding JogCommand}"
  159. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}">
  160. <StackPanel Orientation="Vertical">
  161. <materialDesign:PackIcon Kind="ArrowBottomBold"
  162. Width="26"
  163. Height="26" />
  164. <TextBlock Text="-Z"
  165. HorizontalAlignment="Center" />
  166. </StackPanel>
  167. </Button>
  168. <Button Grid.Row="4"
  169. Grid.Column="3"
  170. Command="{Binding JogCommand}"
  171. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U+}">
  172. <StackPanel Orientation="Vertical">
  173. <materialDesign:PackIcon Kind="AxisZRotateCounterclockwise"
  174. Width="26"
  175. Height="26" />
  176. <TextBlock Text="+U"
  177. HorizontalAlignment="Center" />
  178. </StackPanel>
  179. </Button>
  180. <Button Grid.Row="4"
  181. Grid.Column="0"
  182. Command="{Binding JogCommand}"
  183. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}">
  184. <StackPanel Orientation="Vertical">
  185. <materialDesign:PackIcon Kind="AxisZRotateClockwise"
  186. Width="26"
  187. Height="26" />
  188. <TextBlock Text="-U"
  189. HorizontalAlignment="Center" />
  190. </StackPanel>
  191. </Button>
  192. <!--<Button Grid.Row="4"
  193. Grid.Column="1"
  194. Grid.ColumnSpan="2"
  195. Command="{Binding JogCommand}"
  196. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}">
  197. <StackPanel Orientation="Vertical">
  198. <materialDesign:PackIcon Kind="AxisYRotateCounterclockwise"
  199. Width="26"
  200. Height="26" />
  201. <TextBlock Text="+V"
  202. HorizontalAlignment="Center" />
  203. </StackPanel>
  204. </Button>
  205. <Button Grid.Row="5"
  206. Grid.Column="1"
  207. Grid.ColumnSpan="2"
  208. Command="{Binding JogCommand}"
  209. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}">
  210. <StackPanel Orientation="Vertical">
  211. <materialDesign:PackIcon Kind="AxisYRotateClockwise"
  212. Width="26"
  213. Height="26" />
  214. <TextBlock Text="-V"
  215. HorizontalAlignment="Center" />
  216. </StackPanel>
  217. </Button>
  218. <Button Grid.Row="4"
  219. Grid.Column="3"
  220. Command="{Binding JogCommand}"
  221. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}">
  222. <StackPanel Orientation="Vertical">
  223. <materialDesign:PackIcon Kind="AxisXRotateCounterclockwise"
  224. Width="26"
  225. Height="26" />
  226. <TextBlock Text="+W"
  227. HorizontalAlignment="Center" />
  228. </StackPanel>
  229. </Button>
  230. <Button Grid.Row="5"
  231. Grid.Column="3"
  232. Command="{Binding JogCommand}"
  233. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}">
  234. <StackPanel Orientation="Vertical">
  235. <materialDesign:PackIcon Kind="AxisXRotateClockwise"
  236. Width="26"
  237. Height="26" />
  238. <TextBlock Text="-W"
  239. HorizontalAlignment="Center" />
  240. </StackPanel>
  241. </Button>-->
  242. <StackPanel Grid.Row="5"
  243. Grid.ColumnSpan="7"
  244. Margin="10,10,0,10"
  245. Grid.Column="0"
  246. VerticalAlignment="Center"
  247. Orientation="Horizontal">
  248. <TextBlock Text="{lex:Loc 步进距离}"
  249. VerticalAlignment="Center" />
  250. <uControl:myNumericUpDowm x:Name="txtDistance"
  251. MinWidth="100"
  252. Interval="0.1"
  253. Minimum="0"
  254. Maximum="100"
  255. StringFormat="{}{0:N3} mm"
  256. Value="{Binding Distance,Mode=TwoWay}"
  257. Margin="10,0" />
  258. </StackPanel>
  259. <TextBlock Grid.Row="6"
  260. Grid.ColumnSpan="7"
  261. VerticalAlignment="Center"
  262. Margin="10,0">
  263. <TextBlock.Text>
  264. <MultiBinding StringFormat="{}CurPos X: {0:F3} mm Y: {1:F3} mm Z: {2:F3} mm U: {3:F3} mm">
  265. <Binding Path="Robot.CurrentPosition.X" />
  266. <Binding Path="Robot.CurrentPosition.Y" />
  267. <Binding Path="Robot.CurrentPosition.Z" />
  268. <Binding Path="Robot.CurrentPosition.U" />
  269. </MultiBinding>
  270. </TextBlock.Text>
  271. </TextBlock>
  272. </Grid>
  273. <!--相机轴控制区域-->
  274. <Grid Grid.Row="1"
  275. Margin="10,0,10,10">
  276. <Grid.RowDefinitions>
  277. <RowDefinition Height="*" />
  278. <RowDefinition Height="*" />
  279. </Grid.RowDefinitions>
  280. <Grid.ColumnDefinitions>
  281. <ColumnDefinition Width="*" />
  282. <ColumnDefinition Width="*" />
  283. </Grid.ColumnDefinitions>
  284. <Grid.Resources>
  285. <Style TargetType="Button"
  286. BasedOn="{StaticResource MaterialDesignRaisedDarkButton}">
  287. <Setter Property="MinWidth"
  288. Value="50" />
  289. <Setter Property="MinHeight"
  290. Value="30" />
  291. <Setter Property="FontSize"
  292. Value="13" />
  293. <Setter Property="Padding"
  294. Value="0" />
  295. <Setter Property="HorizontalAlignment"
  296. Value="Center" />
  297. <Setter Property="VerticalAlignment"
  298. Value="Center" />
  299. <Setter Property="materialDesign:ButtonAssist.CornerRadius"
  300. Value="10" />
  301. </Style>
  302. </Grid.Resources>
  303. <!--相机2-->
  304. <Border Grid.Row="0"
  305. Grid.Column="0"
  306. HorizontalAlignment="Stretch"
  307. BorderBrush="LightGray"
  308. BorderThickness="1"
  309. CornerRadius="10"
  310. Margin="2">
  311. <Grid>
  312. <Grid.RowDefinitions>
  313. <RowDefinition Height="auto" />
  314. <RowDefinition Height="auto" />
  315. <RowDefinition Height="auto" />
  316. <RowDefinition Height="auto" />
  317. <RowDefinition Height="auto" />
  318. <RowDefinition Height="auto" />
  319. </Grid.RowDefinitions>
  320. <Grid.ColumnDefinitions>
  321. <ColumnDefinition Width="*" />
  322. <ColumnDefinition Width="*" />
  323. <ColumnDefinition Width="*" />
  324. </Grid.ColumnDefinitions>
  325. <TextBlock Grid.Row="0"
  326. Grid.ColumnSpan="3"
  327. Text="相机2轴控制"
  328. FontWeight="Bold"
  329. FontSize="14"
  330. HorizontalAlignment="Center" />
  331. <TextBlock Grid.Row="1"
  332. Grid.ColumnSpan="3"
  333. VerticalAlignment="Center"
  334. Margin="10,0">
  335. <TextBlock.Text>
  336. <MultiBinding StringFormat="{}X: {0:F3} mm Y: {1:F3} mm">
  337. <Binding Path="Robot.Camera2CurrentPosition.X" />
  338. <Binding Path="Robot.Camera2CurrentPosition.Y" />
  339. </MultiBinding>
  340. </TextBlock.Text>
  341. </TextBlock>
  342. <StackPanel Grid.Row="2"
  343. Grid.ColumnSpan="3"
  344. Orientation="Horizontal"
  345. HorizontalAlignment="Center">
  346. <Button Content="{lex:Loc 上使能}"
  347. Command="{Binding CameraAxisModerOnCommand}"
  348. CommandParameter="2"
  349. Margin="2,0" />
  350. <Button Content="{lex:Loc 下使能}"
  351. Margin="2,0"
  352. Command="{Binding CameraAxisModerOffCommand}"
  353. CommandParameter="2" />
  354. </StackPanel>
  355. <Button Grid.Row="4"
  356. Grid.Column="0"
  357. MinHeight="30"
  358. MinWidth="40"
  359. Width="40"
  360. Height="30"
  361. Content="{materialDesign:PackIcon ArrowLeftBold}"
  362. Command="{Binding CameraAxisJogCommand}"
  363. CommandParameter="2,X-" />
  364. <Button Grid.Row="4"
  365. Grid.Column="2"
  366. MinHeight="30"
  367. MinWidth="40"
  368. Width="40"
  369. Height="30"
  370. Content="{materialDesign:PackIcon ArrowRightBold}"
  371. Command="{Binding CameraAxisJogCommand}"
  372. CommandParameter="2,X+" />
  373. <Button Grid.Row="3"
  374. Grid.Column="1"
  375. MinHeight="30"
  376. MinWidth="40"
  377. Width="40"
  378. Height="30"
  379. Content="{materialDesign:PackIcon ArrowTopBold}"
  380. Command="{Binding CameraAxisJogCommand}"
  381. CommandParameter="2,Y+" />
  382. <Button Grid.Row="5"
  383. Grid.Column="1"
  384. MinHeight="30"
  385. MinWidth="40"
  386. Width="40"
  387. Height="30"
  388. Content="{materialDesign:PackIcon ArrowBottomBold}"
  389. Command="{Binding CameraAxisJogCommand}"
  390. CommandParameter="2,Y-" />
  391. </Grid>
  392. </Border>
  393. <!--相机4-->
  394. <Border Grid.Row="0"
  395. Grid.Column="1"
  396. HorizontalAlignment="Stretch"
  397. BorderBrush="LightGray"
  398. BorderThickness="1"
  399. CornerRadius="10"
  400. Margin="2">
  401. <Grid>
  402. <Grid.RowDefinitions>
  403. <RowDefinition Height="auto" />
  404. <RowDefinition Height="auto" />
  405. <RowDefinition Height="auto" />
  406. <RowDefinition Height="auto" />
  407. <RowDefinition Height="auto" />
  408. <RowDefinition Height="auto" />
  409. </Grid.RowDefinitions>
  410. <Grid.ColumnDefinitions>
  411. <ColumnDefinition Width="*" />
  412. <ColumnDefinition Width="*" />
  413. <ColumnDefinition Width="*" />
  414. </Grid.ColumnDefinitions>
  415. <TextBlock Grid.Row="0"
  416. Grid.ColumnSpan="3"
  417. Text="相机4轴控制"
  418. FontWeight="Bold"
  419. FontSize="14"
  420. HorizontalAlignment="Center" />
  421. <TextBlock Grid.Row="1"
  422. Grid.ColumnSpan="3"
  423. VerticalAlignment="Center"
  424. Margin="10,0">
  425. <TextBlock.Text>
  426. <MultiBinding StringFormat="{}X: {0:F3} mm Y: {1:F3} mm">
  427. <Binding Path="Robot.Camera4CurrentPosition.X" />
  428. <Binding Path="Robot.Camera4CurrentPosition.Y" />
  429. </MultiBinding>
  430. </TextBlock.Text>
  431. </TextBlock>
  432. <StackPanel Grid.Row="2"
  433. Grid.ColumnSpan="3"
  434. Orientation="Horizontal"
  435. HorizontalAlignment="Center">
  436. <Button Content="{lex:Loc 上使能}"
  437. Command="{Binding CameraAxisModerOnCommand}"
  438. CommandParameter="4"
  439. Margin="2,0" />
  440. <Button Content="{lex:Loc 下使能}"
  441. Command="{Binding CameraAxisModerOffCommand}"
  442. CommandParameter="4"
  443. Margin="2,0" />
  444. </StackPanel>
  445. <Button Grid.Row="4"
  446. Grid.Column="0"
  447. MinHeight="30"
  448. MinWidth="40"
  449. Width="40"
  450. Height="30"
  451. Content="{materialDesign:PackIcon ArrowLeftBold}"
  452. Command="{Binding CameraAxisJogCommand}"
  453. CommandParameter="4,X-" />
  454. <Button Grid.Row="4"
  455. Grid.Column="2"
  456. MinHeight="30"
  457. MinWidth="40"
  458. Width="40"
  459. Height="30"
  460. Content="{materialDesign:PackIcon ArrowRightBold}"
  461. Command="{Binding CameraAxisJogCommand}"
  462. CommandParameter="4,X+" />
  463. <Button Grid.Row="3"
  464. Grid.Column="1"
  465. MinHeight="30"
  466. MinWidth="40"
  467. Width="40"
  468. Height="30"
  469. Content="{materialDesign:PackIcon ArrowTopBold}"
  470. Command="{Binding CameraAxisJogCommand}"
  471. CommandParameter="4,Y+" />
  472. <Button Grid.Row="5"
  473. Grid.Column="1"
  474. MinHeight="30"
  475. MinWidth="40"
  476. Width="40"
  477. Height="30"
  478. Content="{materialDesign:PackIcon ArrowBottomBold}"
  479. Command="{Binding CameraAxisJogCommand}"
  480. CommandParameter="4,Y-" />
  481. </Grid>
  482. </Border>
  483. <!--相机1-->
  484. <Border Grid.Row="1"
  485. Grid.Column="0"
  486. HorizontalAlignment="Stretch"
  487. BorderBrush="LightGray"
  488. BorderThickness="1"
  489. CornerRadius="10"
  490. Margin="2">
  491. <Grid>
  492. <Grid.RowDefinitions>
  493. <RowDefinition Height="auto" />
  494. <RowDefinition Height="auto" />
  495. <RowDefinition Height="auto" />
  496. <RowDefinition Height="auto" />
  497. <RowDefinition Height="auto" />
  498. <RowDefinition Height="auto" />
  499. </Grid.RowDefinitions>
  500. <Grid.ColumnDefinitions>
  501. <ColumnDefinition Width="*" />
  502. <ColumnDefinition Width="*" />
  503. <ColumnDefinition Width="*" />
  504. </Grid.ColumnDefinitions>
  505. <TextBlock Grid.Row="0"
  506. Grid.ColumnSpan="3"
  507. Text="相机1轴控制"
  508. FontWeight="Bold"
  509. FontSize="14"
  510. HorizontalAlignment="Center" />
  511. <TextBlock Grid.Row="1"
  512. Grid.ColumnSpan="3"
  513. VerticalAlignment="Center"
  514. Margin="10,0">
  515. <TextBlock.Text>
  516. <MultiBinding StringFormat="{}X: {0:F3} mm Y: {1:F3} mm">
  517. <Binding Path="Robot.Camera1CurrentPosition.X" />
  518. <Binding Path="Robot.Camera1CurrentPosition.Y" />
  519. </MultiBinding>
  520. </TextBlock.Text>
  521. </TextBlock>
  522. <StackPanel Grid.Row="2"
  523. Grid.ColumnSpan="3"
  524. Orientation="Horizontal"
  525. HorizontalAlignment="Center">
  526. <Button Content="{lex:Loc 上使能}"
  527. Command="{Binding CameraAxisModerOnCommand}"
  528. CommandParameter="1"
  529. Margin="2,0" />
  530. <Button Content="{lex:Loc 下使能}"
  531. Command="{Binding CameraAxisModerOffCommand}"
  532. CommandParameter="1"
  533. Margin="2,0" />
  534. </StackPanel>
  535. <Button Grid.Row="4"
  536. Grid.Column="0"
  537. MinHeight="30"
  538. MinWidth="40"
  539. Width="40"
  540. Height="30"
  541. Content="{materialDesign:PackIcon ArrowLeftBold}"
  542. Command="{Binding CameraAxisJogCommand}"
  543. CommandParameter="1,X-" />
  544. <Button Grid.Row="4"
  545. Grid.Column="2"
  546. MinHeight="30"
  547. MinWidth="40"
  548. Width="40"
  549. Height="30"
  550. Content="{materialDesign:PackIcon ArrowRightBold}"
  551. Command="{Binding CameraAxisJogCommand}"
  552. CommandParameter="1,X+" />
  553. </Grid>
  554. </Border>
  555. <!--相机3-->
  556. <Border Grid.Row="1"
  557. Grid.Column="1"
  558. HorizontalAlignment="Stretch"
  559. BorderBrush="LightGray"
  560. BorderThickness="1"
  561. CornerRadius="10"
  562. Margin="2">
  563. <Grid>
  564. <Grid.RowDefinitions>
  565. <RowDefinition Height="auto" />
  566. <RowDefinition Height="auto" />
  567. <RowDefinition Height="auto" />
  568. <RowDefinition Height="auto" />
  569. <RowDefinition Height="auto" />
  570. <RowDefinition Height="auto" />
  571. </Grid.RowDefinitions>
  572. <Grid.ColumnDefinitions>
  573. <ColumnDefinition Width="*" />
  574. <ColumnDefinition Width="*" />
  575. <ColumnDefinition Width="*" />
  576. </Grid.ColumnDefinitions>
  577. <TextBlock Grid.Row="0"
  578. Grid.ColumnSpan="3"
  579. Text="相机3轴控制"
  580. FontWeight="Bold"
  581. FontSize="14"
  582. HorizontalAlignment="Center" />
  583. <TextBlock Grid.Row="1"
  584. Grid.ColumnSpan="3"
  585. VerticalAlignment="Center"
  586. Margin="10,0">
  587. <TextBlock.Text>
  588. <MultiBinding StringFormat="{}X: {0:F3} mm Y: {1:F3} mm">
  589. <Binding Path="Robot.Camera3CurrentPosition.X" />
  590. <Binding Path="Robot.Camera3CurrentPosition.Y" />
  591. </MultiBinding>
  592. </TextBlock.Text>
  593. </TextBlock>
  594. <StackPanel Grid.Row="2"
  595. Grid.ColumnSpan="3"
  596. Orientation="Horizontal"
  597. HorizontalAlignment="Center">
  598. <Button Content="{lex:Loc 上使能}"
  599. Command="{Binding CameraAxisModerOnCommand}"
  600. CommandParameter="3"
  601. Margin="2,0" />
  602. <Button Content="{lex:Loc 下使能}"
  603. Command="{Binding CameraAxisModerOffCommand}"
  604. CommandParameter="3"
  605. Margin="2,0" />
  606. </StackPanel>
  607. <Button Grid.Row="4"
  608. Grid.Column="0"
  609. MinHeight="30"
  610. MinWidth="40"
  611. Width="40"
  612. Height="30"
  613. Content="{materialDesign:PackIcon ArrowLeftBold}"
  614. Command="{Binding CameraAxisJogCommand}"
  615. CommandParameter="3,X-" />
  616. <Button Grid.Row="4"
  617. Grid.Column="2"
  618. MinHeight="30"
  619. MinWidth="40"
  620. Width="40"
  621. Height="30"
  622. Content="{materialDesign:PackIcon ArrowRightBold}"
  623. Command="{Binding CameraAxisJogCommand}"
  624. CommandParameter="3,X+" />
  625. </Grid>
  626. </Border>
  627. </Grid>
  628. <!-- 附加轴列表:绑定到视图模型中的 ExtraAxes 集合(每项假定有 Name、Position) -->
  629. <ItemsControl Grid.Row="2"
  630. ItemsSource="{Binding AdditionalAxisList}">
  631. <ItemsControl.ItemTemplate>
  632. <DataTemplate>
  633. <Border Padding="6"
  634. Margin="0,2"
  635. Background="{DynamicResource MaterialDesignPaper}">
  636. <DockPanel LastChildFill="False"
  637. VerticalAlignment="Center">
  638. <StackPanel Orientation="Horizontal"
  639. DockPanel.Dock="Left"
  640. VerticalAlignment="Center">
  641. <TextBlock Text="{Binding Name}"
  642. Width="140"
  643. VerticalAlignment="Center" />
  644. <TextBlock Text="{Binding CurrentPosition, StringFormat='{}{0:F3} mm'}"
  645. Width="140"
  646. Margin="10,0"
  647. VerticalAlignment="Center" />
  648. </StackPanel>
  649. <StackPanel Orientation="Horizontal"
  650. HorizontalAlignment="Right"
  651. DockPanel.Dock="Right">
  652. <Button Width="60"
  653. Height="36"
  654. Margin="6,0"
  655. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  656. Command="{Binding DataContext.AdditionalAxisJogMinusCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
  657. CommandParameter="{Binding}">
  658. <StackPanel Orientation="Vertical">
  659. <materialDesign:PackIcon Kind="ArrowLeftBold"
  660. Width="26"
  661. Height="26" />
  662. <TextBlock Text="-"
  663. HorizontalAlignment="Center" />
  664. </StackPanel>
  665. </Button>
  666. <Button Width="60"
  667. Height="36"
  668. Margin="6,0"
  669. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  670. Command="{Binding DataContext.AdditionalAxisJogPlusCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
  671. CommandParameter="{Binding}">
  672. <StackPanel Orientation="Vertical">
  673. <materialDesign:PackIcon Kind="ArrowRightBold"
  674. Width="26"
  675. Height="26" />
  676. <TextBlock Text="+"
  677. HorizontalAlignment="Center" />
  678. </StackPanel>
  679. </Button>
  680. <Button Content="上使能"
  681. Width="60"
  682. Height="36"
  683. Margin="6,0"
  684. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  685. Command="{Binding DataContext.AdditionalAxisMotorOnCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
  686. CommandParameter="{Binding}" />
  687. <Button Content="下使能"
  688. Width="60"
  689. Height="36"
  690. Margin="6,0"
  691. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  692. Command="{Binding DataContext.AdditionalAxisMotorOffCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
  693. CommandParameter="{Binding}" />
  694. </StackPanel>
  695. </DockPanel>
  696. </Border>
  697. </DataTemplate>
  698. </ItemsControl.ItemTemplate>
  699. </ItemsControl>
  700. <materialDesign:Snackbar Grid.RowSpan="2"
  701. x:Name="snackbar"
  702. Opacity="0.9"
  703. HorizontalContentAlignment="Center"
  704. VerticalAlignment="Top" />
  705. </Grid>
  706. </ScrollViewer>
  707. </UserControl>