CalibrationTeachCenterPoint.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <UserControl x:Class="TeamAAS_VP.Views.Calibration.CalibrationTeachCenterPoint"
  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:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  10. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Calibration"
  11. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  12. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  13. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  14. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  15. xmlns:valueConvert="clr-namespace:TeamAAS_VP.ValueConverter"
  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:CalibrationTeachCenterPointViewModel}"
  22. d:Height="600"
  23. d:Width="1024"
  24. d:Background="White"
  25. FontFamily="{DynamicResource DefaultFont}">
  26. <UserControl.Resources>
  27. <valueConvert:RobotIdToVisibiltyConverter x:Key="RobotIdToVisibiltyConverter" />
  28. <valueConvert:RobotIdToVisibiltyConverter x:Key="RobotIdToVisibiltyConverterInverse"
  29. Inverse="True" />
  30. </UserControl.Resources>
  31. <b:Interaction.Triggers>
  32. <b:EventTrigger EventName="Loaded">
  33. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  34. </b:EventTrigger>
  35. </b:Interaction.Triggers>
  36. <Grid>
  37. <Grid.RowDefinitions>
  38. <RowDefinition Height="auto" />
  39. <RowDefinition Height="*" />
  40. <RowDefinition Height="auto" />
  41. </Grid.RowDefinitions>
  42. <Button Grid.Row="0"
  43. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  44. Width="50"
  45. HorizontalAlignment="Left"
  46. VerticalAlignment="Top"
  47. ToolTip="{lex:Loc 返回}"
  48. Style="{StaticResource MaterialDesignIconButton}"
  49. Command="{Binding BackCommand}" />
  50. <StackPanel Grid.Row="0"
  51. Orientation="Horizontal"
  52. Margin="50,0"
  53. VerticalAlignment="Center">
  54. <materialDesign:PackIcon Kind="CrosshairsGps"
  55. Width="30"
  56. Height="30" />
  57. <TextBlock Text="{Binding SelectCalibration.Name,Converter={StaticResource StringFormatConverter},ConverterParameter=' [{0}] '}"
  58. VerticalAlignment="Center" />
  59. <TextBlock Text="{lex:Loc 示教中心点,Converter={StaticResource StringFormatConverter},ConverterParameter='- {0}'}"
  60. VerticalAlignment="Center" />
  61. </StackPanel>
  62. <materialDesign:DrawerHost Grid.Row="1"
  63. IsEnabled="{Binding IsAllowEdit}"
  64. OpenMode="Modal"
  65. x:Name="DrawerHost">
  66. <materialDesign:DrawerHost.RightDrawerContent>
  67. <uControl:RobotManual x:Name="robotManual" />
  68. </materialDesign:DrawerHost.RightDrawerContent>
  69. <Grid VerticalAlignment="Center"
  70. Width="350">
  71. <Grid.RowDefinitions>
  72. <RowDefinition Height="auto" />
  73. <RowDefinition Height="auto" />
  74. <RowDefinition Height="auto" />
  75. <RowDefinition Height="auto" />
  76. <RowDefinition Height="auto" />
  77. <RowDefinition Height="auto" />
  78. <RowDefinition Height="auto" />
  79. <RowDefinition Height="auto" />
  80. </Grid.RowDefinitions>
  81. <Grid.ColumnDefinitions>
  82. <ColumnDefinition Width="auto"
  83. MinWidth="100" />
  84. <ColumnDefinition Width="*" />
  85. </Grid.ColumnDefinitions>
  86. <Grid.Resources>
  87. <Style TargetType="TextBlock">
  88. <Setter Property="HorizontalAlignment"
  89. Value="Left" />
  90. <Setter Property="VerticalAlignment"
  91. Value="Center" />
  92. </Style>
  93. </Grid.Resources>
  94. <TextBlock Text="{lex:Loc 示教中心点,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  95. FontWeight="Bold"
  96. Grid.Row="0"
  97. Grid.Column="0" />
  98. <Button Content="{lex:Loc 示教}"
  99. Grid.Row="0"
  100. Grid.Column="1"
  101. MinWidth="150"
  102. Margin="10,0"
  103. HorizontalAlignment="Center"
  104. VerticalAlignment="Center"
  105. materialDesign:ButtonAssist.CornerRadius="10"
  106. Style="{StaticResource MaterialDesignRaisedButton}"
  107. Command="{Binding TechCenterCommand}">
  108. <Button.ToolTip>
  109. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/FeederCenterPoint.png" />
  110. </Button.ToolTip>
  111. </Button>
  112. <TextBlock Text="{lex:Loc 示教避让点,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  113. FontWeight="Bold"
  114. Grid.Row="1"
  115. Grid.Column="0"
  116. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}" />
  117. <Button Content="{lex:Loc 示教}"
  118. Grid.Row="1"
  119. Grid.Column="1"
  120. MinWidth="150"
  121. Margin="10,10"
  122. HorizontalAlignment="Center"
  123. VerticalAlignment="Center"
  124. materialDesign:ButtonAssist.CornerRadius="10"
  125. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}"
  126. Style="{StaticResource MaterialDesignRaisedButton}"
  127. Command="{Binding TechHomeCommand}">
  128. </Button>
  129. <TextBlock Text="{lex:Loc 选择模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  130. Grid.Row="2"
  131. Grid.Column="0"
  132. Visibility="{Binding SelectCalibration.RobotId,Converter={StaticResource RobotIdToVisibiltyConverterInverse}}" />
  133. <ComboBox x:Name="myComboBox"
  134. Grid.Row="2"
  135. Grid.Column="1"
  136. Margin="5,10"
  137. SelectedItem="{Binding SelectCalibration.CalibTechP0Mode}"
  138. ItemsSource="{ext:EnumBindingSource enums:CalibTechP0Mode}"
  139. Visibility="{Binding SelectCalibration.RobotId,Converter={StaticResource RobotIdToVisibiltyConverterInverse}}" />
  140. <TextBlock x:Name="txt1"
  141. Text="{lex:Loc 示教P0,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  142. Grid.Row="3"
  143. Grid.Column="0"
  144. VerticalAlignment="Center">
  145. <TextBlock.Style>
  146. <Style TargetType="TextBlock">
  147. <Setter Property="Visibility"
  148. Value="Collapsed" />
  149. <Style.Triggers>
  150. <MultiDataTrigger>
  151. <MultiDataTrigger.Conditions>
  152. <Condition Binding="{Binding ElementName=myComboBox,Path=Visibility}"
  153. Value="Visible" />
  154. <Condition Binding="{Binding ElementName=myComboBox,Path=SelectedItem}"
  155. Value="{x:Static enums:CalibTechP0Mode.TechP0}" />
  156. </MultiDataTrigger.Conditions>
  157. <!-- 满足条件时:显示 -->
  158. <Setter Property="Visibility"
  159. Value="Visible" />
  160. </MultiDataTrigger>
  161. </Style.Triggers>
  162. </Style>
  163. </TextBlock.Style>
  164. </TextBlock>
  165. <Button Content="{lex:Loc 示教}"
  166. Grid.Row="3"
  167. Grid.Column="1"
  168. MinWidth="150"
  169. Margin="10,10"
  170. HorizontalAlignment="Center"
  171. VerticalAlignment="Center"
  172. materialDesign:ButtonAssist.CornerRadius="10"
  173. Visibility="{Binding ElementName=txt1,Path=Visibility}"
  174. Style="{StaticResource MaterialDesignRaisedButton}"
  175. Command="{Binding TechMarkPointCommand}">
  176. </Button>
  177. <TextBlock Grid.Row="4"
  178. Grid.Column="0"
  179. Text="{lex:Loc 宽,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  180. <mah:NumericUpDown Grid.Row="4"
  181. Grid.Column="1"
  182. Maximum="600"
  183. Minimum="0"
  184. Interval="1"
  185. MinHeight="30"
  186. Margin="5,10"
  187. StringFormat="{}{0:N3} mm"
  188. materialDesign:HintAssist.Hint="{lex:Loc 图像X方向}"
  189. materialDesign:HintAssist.HelperText="{lex:Loc 图像X方向}"
  190. Value="{Binding SelectCalibration.Width,Mode=TwoWay}" />
  191. <TextBlock Text="{lex:Loc 高,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  192. Grid.Row="5"
  193. Grid.Column="0" />
  194. <mah:NumericUpDown Grid.Row="5"
  195. Grid.Column="1"
  196. Maximum="600"
  197. Minimum="0"
  198. MinHeight="30"
  199. Interval="1"
  200. Margin="5"
  201. StringFormat="{}{0:N3} mm"
  202. materialDesign:HintAssist.Hint="{lex:Loc 图像Y方向}"
  203. materialDesign:HintAssist.HelperText="{lex:Loc 图像Y方向}"
  204. Value="{Binding SelectCalibration.Height,Mode=TwoWay}" />
  205. <StackPanel Grid.Row="6"
  206. Grid.ColumnSpan="2"
  207. Orientation="Horizontal"
  208. HorizontalAlignment="Center">
  209. <ToggleButton x:Name="tb_BI"
  210. Style="{StaticResource MaterialDesignSwitchDarkToggleButton}"
  211. ToolTip="{lex:Loc 夹爪操作}">
  212. <b:Interaction.Triggers>
  213. <b:EventTrigger EventName="Checked">
  214. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  215. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  216. </b:EventTrigger>
  217. <b:EventTrigger EventName="Unchecked">
  218. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  219. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  220. </b:EventTrigger>
  221. </b:Interaction.Triggers>
  222. </ToggleButton>
  223. <ToggleButton materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ArrowRight}"
  224. Content="{materialDesign:PackIcon Kind=RobotIndustrial}"
  225. Style="{StaticResource MaterialDesignActionToggleButton}"
  226. ToolTip="{lex:Loc 机器人步进}"
  227. Margin="10,5"
  228. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  229. </StackPanel>
  230. </Grid>
  231. </materialDesign:DrawerHost>
  232. <StackPanel Grid.Row="2"
  233. Orientation="Horizontal"
  234. HorizontalAlignment="Center"
  235. VerticalAlignment="Center"
  236. Margin="20">
  237. <Button Content="{lex:Loc 下一步}"
  238. IsEnabled="{Binding IsAllowEdit}"
  239. MinWidth="150"
  240. Margin="10,0"
  241. HorizontalAlignment="Center"
  242. VerticalAlignment="Center"
  243. materialDesign:ButtonAssist.CornerRadius="10"
  244. Style="{StaticResource MaterialDesignRaisedButton}"
  245. Command="{Binding NextCommand}" />
  246. </StackPanel>
  247. </Grid>
  248. </UserControl>