CalibrationTeachCenterPoint.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. <RowDefinition Height="auto" />
  81. <RowDefinition Height="auto" />
  82. <RowDefinition Height="auto" />
  83. </Grid.RowDefinitions>
  84. <Grid.ColumnDefinitions>
  85. <ColumnDefinition Width="auto"
  86. MinWidth="100" />
  87. <ColumnDefinition Width="*" />
  88. <ColumnDefinition Width="auto"
  89. />
  90. </Grid.ColumnDefinitions>
  91. <Grid.Resources>
  92. <Style TargetType="TextBlock">
  93. <Setter Property="HorizontalAlignment"
  94. Value="Left" />
  95. <Setter Property="VerticalAlignment"
  96. Value="Center" />
  97. </Style>
  98. </Grid.Resources>
  99. <TextBlock Text="{lex:Loc 示教中心点,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  100. FontWeight="Bold"
  101. Grid.Row="0"
  102. Grid.Column="0" />
  103. <Button Content="{lex:Loc 示教}"
  104. Grid.Row="0"
  105. Grid.Column="1"
  106. MinWidth="150"
  107. Margin="10,0"
  108. HorizontalAlignment="Center"
  109. VerticalAlignment="Center"
  110. materialDesign:ButtonAssist.CornerRadius="10"
  111. Style="{StaticResource MaterialDesignRaisedButton}"
  112. Command="{Binding TechCenterCommand}">
  113. <Button.ToolTip>
  114. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/FeederCenterPoint.png" />
  115. </Button.ToolTip>
  116. </Button>
  117. <Button Content="{lex:Loc 移动至}"
  118. Grid.Row="0"
  119. Grid.Column="2"
  120. Margin="5,0"
  121. HorizontalAlignment="Center"
  122. VerticalAlignment="Center"
  123. materialDesign:ButtonAssist.CornerRadius="10"
  124. Style="{StaticResource MaterialDesignRaisedButton}"
  125. Command="{Binding MoveCenterCommand}">
  126. <Button.ToolTip>
  127. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/FeederCenterPoint.png" />
  128. </Button.ToolTip>
  129. </Button>
  130. <TextBlock Grid.Row="1"
  131. Grid.ColumnSpan="2"
  132. Foreground="{DynamicResource PrimaryHueMidForegroundBrush}">
  133. <TextBlock.Text>
  134. <MultiBinding StringFormat="{}X:{0:F3} mm Y:{1:F3} mm Z:{2:F3} mm">
  135. <Binding Path="SelectCalibration.CenterPoint.X"
  136. TargetNullValue="0.000"
  137. FallbackValue="0.000" />
  138. <Binding Path="SelectCalibration.CenterPoint.Y"
  139. TargetNullValue="0.000"
  140. FallbackValue="0.000" />
  141. <Binding Path="SelectCalibration.CenterPoint.Z"
  142. TargetNullValue="0.000"
  143. FallbackValue="0.000" />
  144. </MultiBinding>
  145. </TextBlock.Text>
  146. </TextBlock>
  147. <TextBlock Text="{lex:Loc 示教避让点,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  148. FontWeight="Bold"
  149. Grid.Row="2"
  150. Grid.Column="0"
  151. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}" />
  152. <Button Content="{lex:Loc 示教}"
  153. Grid.Row="2"
  154. Grid.Column="1"
  155. MinWidth="150"
  156. Margin="10,10"
  157. HorizontalAlignment="Center"
  158. VerticalAlignment="Center"
  159. materialDesign:ButtonAssist.CornerRadius="10"
  160. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}"
  161. Style="{StaticResource MaterialDesignRaisedButton}"
  162. Command="{Binding TechHomeCommand}">
  163. </Button>
  164. <TextBlock Grid.Row="3"
  165. Grid.ColumnSpan="2"
  166. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}">
  167. <TextBlock.Text>
  168. <MultiBinding StringFormat="{}X:{0:F3} mm Y:{1:F3} mm Z:{1:F3} mm">
  169. <Binding Path="SelectCalibration.HomePoint.X"
  170. TargetNullValue="0.000"
  171. FallbackValue="0.000" />
  172. <Binding Path="SelectCalibration.HomePoint.Y"
  173. TargetNullValue="0.000"
  174. FallbackValue="0.000" />
  175. <Binding Path="SelectCalibration.HomePoint.Z"
  176. TargetNullValue="0.000"
  177. FallbackValue="0.000" />
  178. </MultiBinding>
  179. </TextBlock.Text>
  180. </TextBlock>
  181. <TextBlock Text="{lex:Loc 选择模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  182. Grid.Row="4"
  183. Grid.Column="0"
  184. Visibility="{Binding IsShowTechP0ModeSelect,Converter={StaticResource BooleanToVisibilityConverter}}" />
  185. <ComboBox x:Name="myComboBox"
  186. Grid.Row="4"
  187. Grid.Column="1"
  188. Margin="5,10"
  189. SelectedItem="{Binding SelectCalibration.CalibTechP0Mode}"
  190. ItemsSource="{ext:EnumBindingSource enums:CalibTechP0Mode}"
  191. Visibility="{Binding IsShowTechP0ModeSelect,Converter={StaticResource BooleanToVisibilityConverter}}" />
  192. <TextBlock x:Name="txt1"
  193. Text="{lex:Loc 示教P0,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  194. Grid.Row="5"
  195. Grid.Column="0"
  196. d:Visibility="Visible"
  197. VerticalAlignment="Center">
  198. <TextBlock.Style>
  199. <Style TargetType="TextBlock">
  200. <Setter Property="Visibility"
  201. Value="Collapsed" />
  202. <Style.Triggers>
  203. <MultiDataTrigger>
  204. <MultiDataTrigger.Conditions>
  205. <Condition Binding="{Binding ElementName=myComboBox,Path=Visibility}"
  206. Value="Visible" />
  207. <Condition Binding="{Binding ElementName=myComboBox,Path=SelectedItem}"
  208. Value="{x:Static enums:CalibTechP0Mode.TechP0}" />
  209. </MultiDataTrigger.Conditions>
  210. <!-- 满足条件时:显示 -->
  211. <Setter Property="Visibility"
  212. Value="Visible" />
  213. </MultiDataTrigger>
  214. </Style.Triggers>
  215. </Style>
  216. </TextBlock.Style>
  217. </TextBlock>
  218. <Button Content="{lex:Loc 示教}"
  219. Grid.Row="5"
  220. Grid.Column="1"
  221. MinWidth="150"
  222. Margin="10,10"
  223. HorizontalAlignment="Center"
  224. VerticalAlignment="Center"
  225. materialDesign:ButtonAssist.CornerRadius="10"
  226. Visibility="{Binding ElementName=txt1,Path=Visibility}"
  227. Style="{StaticResource MaterialDesignRaisedButton}"
  228. Command="{Binding TechMarkPointCommand}">
  229. </Button>
  230. <TextBlock Grid.Row="6"
  231. Grid.Column="0"
  232. Text="{lex:Loc 宽,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  233. <mah:NumericUpDown Grid.Row="6"
  234. Grid.Column="1"
  235. Maximum="600"
  236. Minimum="0"
  237. Interval="1"
  238. MinHeight="30"
  239. Margin="5,10"
  240. StringFormat="{}{0:N3} mm"
  241. materialDesign:HintAssist.Hint="{lex:Loc 图像X方向}"
  242. materialDesign:HintAssist.HelperText="{lex:Loc 图像X方向}"
  243. Value="{Binding SelectCalibration.Width,Mode=TwoWay}" />
  244. <TextBlock Text="{lex:Loc 高,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  245. Grid.Row="7"
  246. Grid.Column="0" />
  247. <mah:NumericUpDown Grid.Row="7"
  248. Grid.Column="1"
  249. Maximum="600"
  250. Minimum="0"
  251. MinHeight="30"
  252. Interval="1"
  253. Margin="5"
  254. StringFormat="{}{0:N3} mm"
  255. materialDesign:HintAssist.Hint="{lex:Loc 图像Y方向}"
  256. materialDesign:HintAssist.HelperText="{lex:Loc 图像Y方向}"
  257. Value="{Binding SelectCalibration.Height,Mode=TwoWay}" />
  258. <StackPanel Grid.Row="8"
  259. Grid.ColumnSpan="2"
  260. Orientation="Horizontal"
  261. HorizontalAlignment="Center">
  262. <ToggleButton x:Name="tb_BI"
  263. Style="{StaticResource MaterialDesignSwitchDarkToggleButton}"
  264. ToolTip="{lex:Loc 夹爪操作}">
  265. <b:Interaction.Triggers>
  266. <b:EventTrigger EventName="Checked">
  267. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  268. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  269. </b:EventTrigger>
  270. <b:EventTrigger EventName="Unchecked">
  271. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  272. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  273. </b:EventTrigger>
  274. </b:Interaction.Triggers>
  275. </ToggleButton>
  276. <ToggleButton materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ArrowRight}"
  277. Content="{materialDesign:PackIcon Kind=RobotIndustrial}"
  278. Style="{StaticResource MaterialDesignActionToggleButton}"
  279. ToolTip="{lex:Loc 机器人步进}"
  280. Margin="10,5"
  281. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  282. </StackPanel>
  283. </Grid>
  284. </materialDesign:DrawerHost>
  285. <StackPanel Grid.Row="2"
  286. Orientation="Horizontal"
  287. HorizontalAlignment="Center"
  288. VerticalAlignment="Center"
  289. Margin="20">
  290. <Button Content="{lex:Loc 下一步}"
  291. IsEnabled="{Binding IsAllowEdit}"
  292. MinWidth="150"
  293. Margin="10,0"
  294. HorizontalAlignment="Center"
  295. VerticalAlignment="Center"
  296. materialDesign:ButtonAssist.CornerRadius="10"
  297. Style="{StaticResource MaterialDesignRaisedButton}"
  298. Command="{Binding NextCommand}" />
  299. </StackPanel>
  300. </Grid>
  301. </UserControl>