PalletManage.xaml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. <UserControl x:Class="TeamAAS_VP.Views.Product.PalletManage"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  6. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  8. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  9. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Product"
  13. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  14. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  16. lex:LocalizeDictionary.DesignCulture="zh-CN"
  17. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  18. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. mc:Ignorable="d"
  21. d:DataContext="{d:DesignInstance Type=vm:PalletManageViewModel}"
  22. d:Height="600"
  23. d:Width="1024"
  24. d:Background="White"
  25. FontFamily="{DynamicResource DefaultFont}">
  26. <prism:Dialog.WindowStyle>
  27. <Style TargetType="Window">
  28. <Setter Property="prism:Dialog.WindowStartupLocation"
  29. Value="CenterScreen" />
  30. <Setter Property="ShowInTaskbar"
  31. Value="True" />
  32. <Setter Property="WindowState"
  33. Value="Maximized" />
  34. <Setter Property="Topmost"
  35. Value="False" />
  36. </Style>
  37. </prism:Dialog.WindowStyle>
  38. <UserControl.Resources>
  39. <ObjectDataProvider x:Key="eRobotHand"
  40. MethodName="GetNames"
  41. ObjectType="{x:Type sys:Enum}">
  42. <ObjectDataProvider.MethodParameters>
  43. <x:Type TypeName="enums:RobotHand" />
  44. </ObjectDataProvider.MethodParameters>
  45. </ObjectDataProvider>
  46. <convert:JogConverter x:Key="JogConverter" />
  47. <convert:MultiParameterConverter x:Key="MultiParameterConverter" />
  48. </UserControl.Resources>
  49. <materialDesign:DialogHost DialogTheme="Inherit"
  50. Identifier="PalletCalculateDialog">
  51. <Grid>
  52. <Grid.RowDefinitions>
  53. <RowDefinition Height="*" />
  54. <RowDefinition Height="auto" />
  55. </Grid.RowDefinitions>
  56. <DockPanel LastChildFill="True">
  57. <!--列表-->
  58. <Border DockPanel.Dock="Left"
  59. Width="220"
  60. Margin="2"
  61. BorderBrush="#9e9e9e"
  62. BorderThickness="1"
  63. CornerRadius="0,10,10,0">
  64. <Grid>
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="Auto" />
  67. <RowDefinition Height="*" />
  68. </Grid.RowDefinitions>
  69. <!--头部-->
  70. <Grid Grid.Row="0">
  71. <Grid>
  72. <Grid.ColumnDefinitions>
  73. <ColumnDefinition Width="*" />
  74. <ColumnDefinition Width="Auto" />
  75. <ColumnDefinition Width="Auto" />
  76. <ColumnDefinition Width="Auto" />
  77. <ColumnDefinition Width="Auto" />
  78. </Grid.ColumnDefinitions>
  79. <StackPanel Grid.Column="0"
  80. Margin="10,10,0,0"
  81. Orientation="Horizontal">
  82. <materialDesign:PackIcon Kind="FormatListBulleted"
  83. VerticalAlignment="Top" />
  84. <TextBlock Text="{lex:Loc 托盘列表}"
  85. Margin="10,0,0,0"
  86. FontSize="12"
  87. VerticalAlignment="Top"
  88. TextAlignment="Center" />
  89. </StackPanel>
  90. <Button Height="35"
  91. Width="35"
  92. Grid.Column="1"
  93. Style="{StaticResource MaterialDesignIconButton}"
  94. Command="{Binding CreateCommand}">
  95. <StackPanel Orientation="Vertical">
  96. <materialDesign:PackIcon Kind="PlusCircle" />
  97. <TextBlock Text="{lex:Loc 增加}"
  98. FontSize="8"
  99. Foreground="Black"
  100. HorizontalAlignment="Center" />
  101. </StackPanel>
  102. </Button>
  103. <Button Height="35"
  104. Width="35"
  105. Grid.Column="2"
  106. Style="{StaticResource MaterialDesignIconButton}"
  107. Command="{Binding RemoveCommand}"
  108. CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}">
  109. <StackPanel Orientation="Vertical">
  110. <materialDesign:PackIcon Kind="DeleteForever" />
  111. <TextBlock Text="{lex:Loc 移除}"
  112. FontSize="8"
  113. Foreground="Black"
  114. HorizontalAlignment="Center" />
  115. </StackPanel>
  116. </Button>
  117. </Grid>
  118. </Grid>
  119. <!--托盘列表-->
  120. <ListBox x:Name="ModelsListBox"
  121. Grid.Row="1"
  122. Background="Transparent"
  123. ItemsSource="{Binding Pallets}"
  124. SelectedItem="{Binding SelectPallet}"
  125. BorderBrush="White"
  126. BorderThickness="1"
  127. Margin="2,2,2,10">
  128. <b:Interaction.Triggers>
  129. <b:EventTrigger EventName="SelectionChanged">
  130. <b:InvokeCommandAction Command="{Binding ProductSelectionChangedCommand}"
  131. CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}" />
  132. </b:EventTrigger>
  133. </b:Interaction.Triggers>
  134. <ListBox.ItemContainerStyle>
  135. <Style TargetType="ListBoxItem">
  136. <Setter Property="Background"
  137. Value="Transparent" />
  138. </Style>
  139. </ListBox.ItemContainerStyle>
  140. <ListBox.ItemTemplate>
  141. <DataTemplate>
  142. <Border x:Name="itemBorder"
  143. BorderThickness="1"
  144. CornerRadius="8"
  145. Opacity="1"
  146. BorderBrush="#CCCCCC">
  147. <StackPanel Orientation="Vertical"
  148. Width="200"
  149. Margin="5">
  150. <!--标题-->
  151. <StackPanel Orientation="Horizontal">
  152. <materialDesign:PackIcon Kind="TableLarge" />
  153. <TextBlock Text="{Binding Name}"
  154. FontSize="12"
  155. FontWeight="Bold"
  156. Margin="5,1"
  157. TextWrapping="Wrap"
  158. VerticalAlignment="Center" />
  159. </StackPanel>
  160. <!--详情-->
  161. <StackPanel Orientation="Horizontal"
  162. Margin="0,5">
  163. <materialDesign:PackIcon Kind="TableMultiple" />
  164. <TextBlock Text="{Binding Description}"
  165. FontSize="10"
  166. Margin="5,1"
  167. TextWrapping="Wrap" />
  168. <TextBlock FontSize="10"
  169. TextWrapping="Wrap">
  170. <TextBlock.Text>
  171. <MultiBinding StringFormat="{}{0}{1} X {2}">
  172. <lex:BLoc Key="行X列" />
  173. <Binding Path="Row" />
  174. <Binding Path="Column" />
  175. </MultiBinding>
  176. </TextBlock.Text>
  177. </TextBlock>
  178. </StackPanel>
  179. <StackPanel.ContextMenu>
  180. <ContextMenu>
  181. <MenuItem Header="{lex:Loc 新建}"
  182. Command="{Binding CreateCommand}"
  183. Icon="{materialDesign:PackIcon Kind=CreateNewFolderOutline}" />
  184. <MenuItem Header="{lex:Loc 移除}"
  185. Command="{Binding RemoveCommand}"
  186. CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
  187. Icon="{materialDesign:PackIcon Kind=Remove}" />
  188. <Separator />
  189. <MenuItem Header="{lex:Loc 复制}"
  190. Command="{Binding CopyCommand}"
  191. CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
  192. Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
  193. <Separator />
  194. <MenuItem Header="{lex:Loc 修改名称}"
  195. Command="{Binding EditNameCommand}"
  196. CommandParameter="{Binding ElementName=ModelsListBox,Path=SelectedItem}"
  197. Icon="{materialDesign:PackIcon Kind=ContentCopy}" />
  198. </ContextMenu>
  199. </StackPanel.ContextMenu>
  200. </StackPanel>
  201. </Border>
  202. <DataTemplate.Triggers>
  203. <Trigger SourceName="itemBorder"
  204. Property="IsMouseOver"
  205. Value="True">
  206. <Setter TargetName="itemBorder"
  207. Property="Background"
  208. Value="#3DB8B8" />
  209. </Trigger>
  210. </DataTemplate.Triggers>
  211. </DataTemplate>
  212. </ListBox.ItemTemplate>
  213. <ListBox.ContextMenu>
  214. <ContextMenu>
  215. <MenuItem Header="{lex:Loc 新建}"
  216. Command="{Binding CreateCommand}"
  217. Icon="{materialDesign:PackIcon Kind=CreateNewFolderOutline}" />
  218. </ContextMenu>
  219. </ListBox.ContextMenu>
  220. </ListBox>
  221. </Grid>
  222. </Border>
  223. <!--内容-->
  224. <Grid>
  225. <Grid.RowDefinitions>
  226. <RowDefinition Height="*" />
  227. <RowDefinition Height="auto" />
  228. </Grid.RowDefinitions>
  229. <Grid.ColumnDefinitions>
  230. <ColumnDefinition Width="*" />
  231. <ColumnDefinition Width="auto" />
  232. </Grid.ColumnDefinitions>
  233. <!--托盘表格-->
  234. <Border Grid.Row="0"
  235. Grid.Column="0"
  236. Margin="60"
  237. BorderThickness="1"
  238. BorderBrush="Black">
  239. <Grid x:Name="gridPalllet"
  240. ShowGridLines="True">
  241. </Grid>
  242. </Border>
  243. <TextBlock Text="{Binding SelectPallet.Name}"
  244. VerticalAlignment="Top"
  245. HorizontalAlignment="Center"
  246. Margin="0,20,0,0" />
  247. <TextBox Grid.Row="0"
  248. Grid.Column="0"
  249. HorizontalAlignment="Center"
  250. VerticalAlignment="Bottom"
  251. MinWidth="80"
  252. materialDesign:HintAssist.Hint="{lex:Loc 列数}"
  253. Text="{Binding Column}"
  254. TextAlignment="Center"
  255. materialDesign:HintAssist.HelperText="{lex:Loc 列数}"
  256. Style="{StaticResource MaterialDesignOutlinedTextBox}">
  257. </TextBox>
  258. <TextBox Grid.Row="0"
  259. Grid.Column="0"
  260. Margin="50"
  261. VerticalAlignment="Center"
  262. HorizontalAlignment="Left"
  263. MinWidth="80"
  264. materialDesign:HintAssist.Hint="{lex:Loc 行数}"
  265. Text="{Binding Row}"
  266. TextAlignment="Center"
  267. materialDesign:HintAssist.HelperText="{lex:Loc 行数}"
  268. Style="{StaticResource MaterialDesignOutlinedTextBox}">
  269. <TextBox.RenderTransform>
  270. <RotateTransform Angle="90" />
  271. </TextBox.RenderTransform>
  272. </TextBox>
  273. <StackPanel Grid.Row="0"
  274. Grid.Column="0"
  275. Margin="0,0,5,5"
  276. Orientation="Horizontal"
  277. HorizontalAlignment="Right"
  278. VerticalAlignment="Bottom">
  279. <TextBlock Text="{lex:Loc 排列方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  280. VerticalAlignment="Center" />
  281. <ComboBox Margin="5,0"
  282. Width="30"
  283. materialDesign:HintAssist.Hint="{lex:Loc 选择排列模式}"
  284. SelectedItem="{Binding Arrangement,Mode=TwoWay}"
  285. ItemsSource="{ext:EnumBindingSource EnumType=enums:PalletArrangement}" />
  286. <Button Content="{lex:Loc 保存布局图}"
  287. Command="{Binding SavePalletImage}"
  288. Margin="0,0,5,0" />
  289. </StackPanel>
  290. <Button Grid.Row="0"
  291. Grid.Column="1"
  292. Content="{materialDesign:PackIcon Kind=CalculatorVariant}"
  293. Style="{StaticResource MaterialDesignFloatingActionLightButton}"
  294. ToolTip="{lex:Loc 托盘计算器}"
  295. Margin="10"
  296. HorizontalAlignment="Right"
  297. VerticalAlignment="Bottom"
  298. Command="{Binding CalculatePalletCommand}" />
  299. <StackPanel Orientation="Vertical"
  300. Grid.Row="1"
  301. Grid.Column="0"
  302. Grid.ColumnSpan="2">
  303. <StackPanel Orientation="Horizontal"
  304. Margin="5"
  305. Visibility="{Binding SelectPallet.Extend,Converter={StaticResource ObjectToVisibilityConverter}}">
  306. <materialDesign:PopupBox ToolTip="{lex:Loc 帮助}"
  307. ToggleContent="{materialDesign:PackIcon Kind=HelpCircle}">
  308. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/Palletlayout.png"
  309. Width="400"
  310. Height="400"
  311. Stretch="Fill" />
  312. </materialDesign:PopupBox>
  313. <TextBlock Text="{lex:Loc 组合托盘,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  314. VerticalAlignment="Center" />
  315. <TextBlock Text="{lex:Loc 行数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(R): '}"
  316. VerticalAlignment="Center" />
  317. <TextBox Text="{Binding SelectPallet.Extend.Pallet_Row}"
  318. MinWidth="30" />
  319. <TextBlock Text="{lex:Loc 列数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(C): '}"
  320. VerticalAlignment="Center" />
  321. <TextBox Text="{Binding SelectPallet.Extend.Pallet_Column}"
  322. MinWidth="30" />
  323. <TextBlock Text="{lex:Loc 行间距,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(IR)(mm): '}"
  324. VerticalAlignment="Center" />
  325. <TextBox Text="{Binding SelectPallet.Extend.Pallet_X_Interval}"
  326. MinWidth="30" />
  327. <TextBlock Text="{lex:Loc 列间距,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(IC)(mm): '}"
  328. VerticalAlignment="Center" />
  329. <TextBox Text="{Binding SelectPallet.Extend.Pallet_Y_Interval}"
  330. MinWidth="30" />
  331. <TextBlock Text="{lex:Loc 坐标系,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}(C): '}"
  332. VerticalAlignment="Center" />
  333. <ComboBox Margin="5,0"
  334. SelectedItem="{Binding SelectPallet.Extend.CoordinateModel,Mode=TwoWay}"
  335. ItemsSource="{ext:EnumBindingSource EnumType=enums:CoordinateModel}" />
  336. </StackPanel>
  337. <!--点位表-->
  338. <DataGrid AutoGenerateColumns="False"
  339. CanUserAddRows="False"
  340. ColumnWidth="*"
  341. ItemsSource="{Binding Points}"
  342. HeadersVisibility="All">
  343. <DataGrid.Resources>
  344. <Style TargetType="DataGridCell">
  345. <Style.Resources>
  346. <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}"
  347. Color="#0078D7" />
  348. </Style.Resources>
  349. <Setter Property="MinHeight"
  350. Value="25" />
  351. <Setter Property="VerticalContentAlignment"
  352. Value="Center" />
  353. <Setter Property="HorizontalContentAlignment"
  354. Value="Center" />
  355. <Setter Property="VerticalAlignment"
  356. Value="Center" />
  357. <Style.Triggers>
  358. <Trigger Property="IsSelected"
  359. Value="True">
  360. <Setter Property="Foreground"
  361. Value="White" />
  362. </Trigger>
  363. </Style.Triggers>
  364. </Style>
  365. </DataGrid.Resources>
  366. <DataGrid.Columns>
  367. <DataGridTextColumn Header="{lex:Loc 编号}"
  368. IsReadOnly="True"
  369. Binding="{Binding Number, Mode=TwoWay}">
  370. </DataGridTextColumn>
  371. <DataGridTextColumn Header="{lex:Loc 标签}"
  372. Binding="{Binding Description, Mode=TwoWay}" />
  373. <DataGridTextColumn Header="X"
  374. Binding="{Binding X, Mode=TwoWay, StringFormat={}{0:F3}}" />
  375. <DataGridTextColumn Header="Y"
  376. Binding="{Binding Y, Mode=TwoWay, StringFormat={}{0:F3}}" />
  377. <DataGridTextColumn Header="Z"
  378. Binding="{Binding Z, Mode=TwoWay, StringFormat={}{0:F3}}" />
  379. <DataGridTextColumn Header="U"
  380. Binding="{Binding U, Mode=TwoWay, StringFormat={}{0:F3}}" />
  381. <DataGridTextColumn Header="V"
  382. Binding="{Binding V, Mode=TwoWay, StringFormat={}{0:F3}}" />
  383. <DataGridTextColumn Header="W"
  384. Binding="{Binding W, Mode=TwoWay, StringFormat={}{0:F3}}" />
  385. <materialDesign:DataGridComboBoxColumn Width="100"
  386. Header="Hand"
  387. IsEditable="True"
  388. ItemsSourceBinding="{Binding Source={StaticResource eRobotHand}}"
  389. SelectedValueBinding="{Binding Hand}">
  390. </materialDesign:DataGridComboBoxColumn>
  391. <DataGridTextColumn Header="Local"
  392. Binding="{Binding Local, Mode=TwoWay}" />
  393. <DataGridTextColumn Header="Tool"
  394. Binding="{Binding Tool, Mode=TwoWay}" />
  395. </DataGrid.Columns>
  396. </DataGrid>
  397. </StackPanel>
  398. <Grid Margin="20"
  399. Grid.Column="1"
  400. Grid.Row="0"
  401. VerticalAlignment="Center">
  402. <Grid.ColumnDefinitions>
  403. <ColumnDefinition Width="auto" />
  404. <ColumnDefinition Width="auto" />
  405. <ColumnDefinition Width="auto" />
  406. <ColumnDefinition Width="auto" />
  407. <ColumnDefinition Width="auto" />
  408. <ColumnDefinition Width="auto" />
  409. </Grid.ColumnDefinitions>
  410. <Grid.RowDefinitions>
  411. <RowDefinition Height="auto" />
  412. <RowDefinition Height="auto" />
  413. <RowDefinition Height="auto" />
  414. <RowDefinition Height="auto" />
  415. <RowDefinition Height="auto" />
  416. <RowDefinition Height="auto" />
  417. </Grid.RowDefinitions>
  418. <ComboBox Grid.Row="0"
  419. MinWidth="100"
  420. materialDesign:HintAssist.Hint="{lex:Loc 选择机器人}"
  421. materialDesign:HintAssist.HelperText="{lex:Loc 选择机器人}"
  422. HorizontalAlignment="Left"
  423. ItemsSource="{Binding Robots}"
  424. SelectedItem="{Binding SelectRobotInfo}">
  425. <ComboBox.ItemTemplate>
  426. <DataTemplate>
  427. <StackPanel Orientation="Horizontal">
  428. <materialDesign:PackIcon Kind="RobotIndustrialOutline" />
  429. <TextBlock Text="{Binding RobotName}" />
  430. </StackPanel>
  431. </DataTemplate>
  432. </ComboBox.ItemTemplate>
  433. </ComboBox>
  434. <ComboBox Grid.Row="0"
  435. Grid.Column="2"
  436. materialDesign:HintAssist.Hint="{lex:Loc 选择Tool}"
  437. materialDesign:HintAssist.HelperText="{lex:Loc 选择Tool}"
  438. SelectedItem="{Binding SelectTool,Mode=TwoWay}"
  439. ItemsSource="{Binding Tools}" />
  440. <Button Content="X-"
  441. Grid.Row="1"
  442. Grid.Column="0"
  443. Margin="10,10,10,10"
  444. materialDesign:ButtonAssist.CornerRadius="10"
  445. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  446. Command="{Binding JogCommand}"
  447. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X-}" />
  448. <Button Content="X+"
  449. Grid.Row="1"
  450. Grid.Column="2"
  451. Margin="10,10,10,10"
  452. materialDesign:ButtonAssist.CornerRadius="10"
  453. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  454. Command="{Binding JogCommand}"
  455. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=X+}" />
  456. <Button Content="Y+"
  457. Grid.Row="0"
  458. Grid.Column="1"
  459. Margin="10,10,10,10"
  460. materialDesign:ButtonAssist.CornerRadius="10"
  461. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  462. Command="{Binding JogCommand}"
  463. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y+}" />
  464. <Button Content="Y-"
  465. Grid.Row="2"
  466. Grid.Column="1"
  467. Margin="10,10,10,10"
  468. materialDesign:ButtonAssist.CornerRadius="10"
  469. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  470. Command="{Binding JogCommand}"
  471. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Y-}" />
  472. <Button Content="Z+"
  473. Grid.Row="0"
  474. Grid.Column="3"
  475. Margin="10,10,10,10"
  476. materialDesign:ButtonAssist.CornerRadius="10"
  477. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  478. Command="{Binding JogCommand}"
  479. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z+}" />
  480. <Button Content="Z-"
  481. Grid.Row="2"
  482. Grid.Column="3"
  483. Margin="10,10,10,10"
  484. materialDesign:ButtonAssist.CornerRadius="10"
  485. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  486. Command="{Binding JogCommand}"
  487. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=Z-}" />
  488. <Button Content="U+"
  489. Grid.Row="3"
  490. Grid.Column="0"
  491. Margin="10,10,10,10"
  492. materialDesign:ButtonAssist.CornerRadius="10"
  493. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  494. Command="{Binding JogCommand}"
  495. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U+}" />
  496. <Button Content="U-"
  497. Grid.Row="4"
  498. Grid.Column="0"
  499. Margin="10,10,10,10"
  500. materialDesign:ButtonAssist.CornerRadius="10"
  501. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  502. Command="{Binding JogCommand}"
  503. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=U-}" />
  504. <Button Content="V+"
  505. Grid.Row="3"
  506. Grid.Column="1"
  507. Grid.ColumnSpan="2"
  508. Margin="10,10,10,10"
  509. materialDesign:ButtonAssist.CornerRadius="10"
  510. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  511. Command="{Binding JogCommand}"
  512. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V+}" />
  513. <Button Content="V-"
  514. Grid.Row="4"
  515. Grid.Column="1"
  516. Grid.ColumnSpan="2"
  517. Margin="10,10,10,10"
  518. materialDesign:ButtonAssist.CornerRadius="10"
  519. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  520. Command="{Binding JogCommand}"
  521. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=V-}" />
  522. <Button Content="W+"
  523. Grid.Row="3"
  524. Grid.Column="3"
  525. Margin="10,10,10,10"
  526. materialDesign:ButtonAssist.CornerRadius="10"
  527. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  528. Command="{Binding JogCommand}"
  529. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W+}" />
  530. <Button Content="W-"
  531. Grid.Row="4"
  532. Grid.Column="3"
  533. Margin="10,10,10,10"
  534. materialDesign:ButtonAssist.CornerRadius="10"
  535. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  536. Command="{Binding JogCommand}"
  537. CommandParameter="{Binding ElementName=txtDistance,Path=Value,Converter={StaticResource JogConverter}, ConverterParameter=W-}" />
  538. <Grid Grid.Row="5"
  539. Grid.ColumnSpan="7"
  540. Margin="10">
  541. <Grid.RowDefinitions>
  542. <RowDefinition Height="auto" />
  543. <RowDefinition Height="auto" />
  544. <RowDefinition Height="auto" />
  545. <RowDefinition Height="auto" />
  546. </Grid.RowDefinitions>
  547. <Grid.ColumnDefinitions>
  548. <ColumnDefinition Width="auto" />
  549. <ColumnDefinition Width="auto" />
  550. <ColumnDefinition Width="auto" />
  551. </Grid.ColumnDefinitions>
  552. <TextBlock Grid.Row="0"
  553. Grid.Column="0"
  554. Text="{lex:Loc 步进距离,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  555. Margin="10"
  556. VerticalAlignment="Center"
  557. HorizontalAlignment="Right" />
  558. <uControl:myNumericUpDowm x:Name="txtDistance"
  559. Grid.Row="0"
  560. Grid.Column="1"
  561. MinWidth="100"
  562. Margin="10"
  563. Interval="0.1"
  564. Minimum="0"
  565. Maximum="100"
  566. Value="{Binding Distance,Mode=TwoWay}"
  567. StringFormat="{}{0:N3} mm"
  568. materialDesign:HintAssist.Hint="{lex:Loc 步进距离}" />
  569. <TextBlock Grid.Row="1"
  570. Grid.Column="0"
  571. Text="{lex:Loc 点编号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  572. Margin="10"
  573. VerticalAlignment="Center" />
  574. <ComboBox x:Name="cmbSelectPoint"
  575. Grid.Row="2"
  576. Grid.Column="0"
  577. MinWidth="80"
  578. materialDesign:HintAssist.Hint="{lex:Loc 选择点}"
  579. Margin="10,5"
  580. ItemsSource="{Binding Points}"
  581. SelectedItem="{Binding SelectPoint}">
  582. <ComboBox.ItemTemplate>
  583. <DataTemplate>
  584. <StackPanel HorizontalAlignment="Left"
  585. Orientation="Horizontal">
  586. <TextBlock Text="{Binding Number,StringFormat={}{0}:}" />
  587. <TextBlock Text="{Binding Description}" />
  588. </StackPanel>
  589. </DataTemplate>
  590. </ComboBox.ItemTemplate>
  591. </ComboBox>
  592. <TextBlock Grid.Row="1"
  593. Grid.Column="1"
  594. Text="{lex:Loc 动作指令,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  595. Margin="10"
  596. VerticalAlignment="Center" />
  597. <ComboBox x:Name="cmbSelectMotioncmd"
  598. Grid.Row="2"
  599. Grid.Column="1"
  600. MinWidth="80"
  601. Margin="10,5"
  602. materialDesign:HintAssist.Hint="{lex:Loc 动作指令}"
  603. ItemsSource="{ext:EnumBindingSource EnumType=enums:MotionCommand}"
  604. SelectedItem="{Binding SelectMotionCommand}" />
  605. <Button Grid.Row="2"
  606. Grid.Column="2"
  607. Content="{lex:Loc 执行动作}"
  608. Margin="10,5"
  609. Command="{Binding ExecuteMotion}">
  610. <Button.CommandParameter>
  611. <MultiBinding Converter="{StaticResource MultiParameterConverter}">
  612. <Binding ElementName="cmbSelectPoint"
  613. Path="SelectedItem" />
  614. <Binding ElementName="cmbSelectMotioncmd"
  615. Path="SelectedItem" />
  616. </MultiBinding>
  617. </Button.CommandParameter>
  618. </Button>
  619. <Button Grid.Row="3"
  620. Grid.Column="0"
  621. Content="{lex:Loc 示教}"
  622. Margin="10"
  623. HorizontalAlignment="Right"
  624. Command="{Binding TechPointCommand}"
  625. CommandParameter="{Binding ElementName=cmbSelectPoint,Path=SelectedItem}" />
  626. </Grid>
  627. <Grid Grid.Row="0"
  628. Grid.Column="4"
  629. Grid.RowSpan="5"
  630. VerticalAlignment="Center">
  631. <Grid.RowDefinitions>
  632. <RowDefinition Height="auto" />
  633. <RowDefinition Height="auto" />
  634. <RowDefinition Height="auto" />
  635. <RowDefinition Height="auto" />
  636. <RowDefinition Height="auto" />
  637. </Grid.RowDefinitions>
  638. <Button Content="{lex:Loc 上使能}"
  639. Grid.Row="0"
  640. materialDesign:ButtonAssist.CornerRadius="10"
  641. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  642. Command="{Binding MotorCommand}"
  643. CommandParameter="True" />
  644. <Button Content="{lex:Loc 下使能}"
  645. Grid.Row="1"
  646. Margin="0,10,0,10"
  647. materialDesign:ButtonAssist.CornerRadius="10"
  648. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  649. Command="{Binding MotorCommand}"
  650. CommandParameter="False" />
  651. <Button Content="{lex:Loc 复位错误}"
  652. Grid.Row="2"
  653. materialDesign:ButtonAssist.CornerRadius="10"
  654. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  655. Command="{Binding ResetCommand}" />
  656. <Button Content="{lex:Loc 释放刹车}"
  657. Grid.Row="3"
  658. Margin="0,10,0,10"
  659. materialDesign:ButtonAssist.CornerRadius="10"
  660. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  661. Command="{Binding sFreeCommand}" />
  662. <Button Content="{lex:Loc 锁定刹车}"
  663. Grid.Row="4"
  664. materialDesign:ButtonAssist.CornerRadius="10"
  665. Style="{StaticResource MaterialDesignRaisedDarkButton}"
  666. Command="{Binding SLockCommand}" />
  667. </Grid>
  668. </Grid>
  669. </Grid>
  670. </DockPanel>
  671. <StackPanel Grid.Row="1"
  672. Orientation="Horizontal"
  673. HorizontalAlignment="Right">
  674. <Button Height="30"
  675. materialDesign:ButtonAssist.CornerRadius="10"
  676. ToolTip="{lex:Loc 确定}"
  677. Style="{StaticResource MaterialDesignRaisedButton}"
  678. Command="{Binding ConfirmCommand}">
  679. <TextBlock Text="{lex:Loc 确定}" />
  680. </Button>
  681. <Button Height="30"
  682. Margin="20,0"
  683. materialDesign:ButtonAssist.CornerRadius="10"
  684. Style="{StaticResource MaterialDesignRaisedButton}"
  685. ToolTip="{lex:Loc 取消}"
  686. Command="{Binding CancelCommand}">
  687. <TextBlock Text="{lex:Loc 取消}" />
  688. </Button>
  689. </StackPanel>
  690. </Grid>
  691. </materialDesign:DialogHost>
  692. </UserControl>