CalibrationTeachCenterPoint.xaml 18 KB

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