CalibrationTeachCenterPoint.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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="移动至"
  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. <TextBlock.Text>
  133. <MultiBinding StringFormat="{}X:{0:F3} Y:{1:F3}}">
  134. <Binding Path="SelectCalibration.CenterPoint.X" />
  135. <Binding Path="SelectCalibration.CenterPoint.Y" />
  136. </MultiBinding>
  137. </TextBlock.Text>
  138. </TextBlock>
  139. <TextBlock Text="{lex:Loc 示教避让点,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  140. FontWeight="Bold"
  141. Grid.Row="2"
  142. Grid.Column="0"
  143. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}" />
  144. <Button Content="{lex:Loc 示教}"
  145. Grid.Row="2"
  146. Grid.Column="1"
  147. MinWidth="150"
  148. Margin="10,10"
  149. HorizontalAlignment="Center"
  150. VerticalAlignment="Center"
  151. materialDesign:ButtonAssist.CornerRadius="10"
  152. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}"
  153. Style="{StaticResource MaterialDesignRaisedButton}"
  154. Command="{Binding TechHomeCommand}">
  155. </Button>
  156. <TextBlock Grid.Row="3"
  157. Grid.ColumnSpan="2"
  158. Visibility="{Binding IsShowTechHome,Converter={StaticResource BooleanToVisibilityConverter}}">
  159. <TextBlock.Text>
  160. <MultiBinding StringFormat="{}X:{0:F3} Y:{1:F3}}">
  161. <Binding Path="SelectCalibration.HomePoint.X" />
  162. <Binding Path="SelectCalibration.HomePoint.Y" />
  163. </MultiBinding>
  164. </TextBlock.Text>
  165. </TextBlock>
  166. <TextBlock Text="{lex:Loc 选择模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  167. Grid.Row="4"
  168. Grid.Column="0"
  169. Visibility="{Binding IsShowTechP0ModeSelect,Converter={StaticResource BooleanToVisibilityConverter}}" />
  170. <ComboBox x:Name="myComboBox"
  171. Grid.Row="4"
  172. Grid.Column="1"
  173. Margin="5,10"
  174. SelectedItem="{Binding SelectCalibration.CalibTechP0Mode}"
  175. ItemsSource="{ext:EnumBindingSource enums:CalibTechP0Mode}"
  176. Visibility="{Binding IsShowTechP0ModeSelect,Converter={StaticResource BooleanToVisibilityConverter}}" />
  177. <TextBlock x:Name="txt1"
  178. Text="{lex:Loc 示教P0,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  179. Grid.Row="5"
  180. Grid.Column="0"
  181. d:Visibility="Visible"
  182. VerticalAlignment="Center">
  183. <TextBlock.Style>
  184. <Style TargetType="TextBlock">
  185. <Setter Property="Visibility"
  186. Value="Collapsed" />
  187. <Style.Triggers>
  188. <MultiDataTrigger>
  189. <MultiDataTrigger.Conditions>
  190. <Condition Binding="{Binding ElementName=myComboBox,Path=Visibility}"
  191. Value="Visible" />
  192. <Condition Binding="{Binding ElementName=myComboBox,Path=SelectedItem}"
  193. Value="{x:Static enums:CalibTechP0Mode.TechP0}" />
  194. </MultiDataTrigger.Conditions>
  195. <!-- 满足条件时:显示 -->
  196. <Setter Property="Visibility"
  197. Value="Visible" />
  198. </MultiDataTrigger>
  199. </Style.Triggers>
  200. </Style>
  201. </TextBlock.Style>
  202. </TextBlock>
  203. <Button Content="{lex:Loc 示教}"
  204. Grid.Row="5"
  205. Grid.Column="1"
  206. MinWidth="150"
  207. Margin="10,10"
  208. HorizontalAlignment="Center"
  209. VerticalAlignment="Center"
  210. materialDesign:ButtonAssist.CornerRadius="10"
  211. Visibility="{Binding ElementName=txt1,Path=Visibility}"
  212. Style="{StaticResource MaterialDesignRaisedButton}"
  213. Command="{Binding TechMarkPointCommand}">
  214. </Button>
  215. <TextBlock Grid.Row="6"
  216. Grid.Column="0"
  217. Text="{lex:Loc 宽,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  218. <mah:NumericUpDown Grid.Row="6"
  219. Grid.Column="1"
  220. Maximum="600"
  221. Minimum="0"
  222. Interval="1"
  223. MinHeight="30"
  224. Margin="5,10"
  225. StringFormat="{}{0:N3} mm"
  226. materialDesign:HintAssist.Hint="{lex:Loc 图像X方向}"
  227. materialDesign:HintAssist.HelperText="{lex:Loc 图像X方向}"
  228. Value="{Binding SelectCalibration.Width,Mode=TwoWay}" />
  229. <TextBlock Text="{lex:Loc 高,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  230. Grid.Row="7"
  231. Grid.Column="0" />
  232. <mah:NumericUpDown Grid.Row="7"
  233. Grid.Column="1"
  234. Maximum="600"
  235. Minimum="0"
  236. MinHeight="30"
  237. Interval="1"
  238. Margin="5"
  239. StringFormat="{}{0:N3} mm"
  240. materialDesign:HintAssist.Hint="{lex:Loc 图像Y方向}"
  241. materialDesign:HintAssist.HelperText="{lex:Loc 图像Y方向}"
  242. Value="{Binding SelectCalibration.Height,Mode=TwoWay}" />
  243. <StackPanel Grid.Row="8"
  244. Grid.ColumnSpan="2"
  245. Orientation="Horizontal"
  246. HorizontalAlignment="Center">
  247. <ToggleButton x:Name="tb_BI"
  248. Style="{StaticResource MaterialDesignSwitchDarkToggleButton}"
  249. ToolTip="{lex:Loc 夹爪操作}">
  250. <b:Interaction.Triggers>
  251. <b:EventTrigger EventName="Checked">
  252. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  253. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  254. </b:EventTrigger>
  255. <b:EventTrigger EventName="Unchecked">
  256. <b:InvokeCommandAction Command="{Binding BlowOrInhalControlCommand}"
  257. CommandParameter="{Binding ElementName=tb_BI,Path=IsChecked}" />
  258. </b:EventTrigger>
  259. </b:Interaction.Triggers>
  260. </ToggleButton>
  261. <ToggleButton materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ArrowRight}"
  262. Content="{materialDesign:PackIcon Kind=RobotIndustrial}"
  263. Style="{StaticResource MaterialDesignActionToggleButton}"
  264. ToolTip="{lex:Loc 机器人步进}"
  265. Margin="10,5"
  266. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  267. </StackPanel>
  268. </Grid>
  269. </materialDesign:DrawerHost>
  270. <StackPanel Grid.Row="2"
  271. Orientation="Horizontal"
  272. HorizontalAlignment="Center"
  273. VerticalAlignment="Center"
  274. Margin="20">
  275. <Button Content="{lex:Loc 下一步}"
  276. IsEnabled="{Binding IsAllowEdit}"
  277. MinWidth="150"
  278. Margin="10,0"
  279. HorizontalAlignment="Center"
  280. VerticalAlignment="Center"
  281. materialDesign:ButtonAssist.CornerRadius="10"
  282. Style="{StaticResource MaterialDesignRaisedButton}"
  283. Command="{Binding NextCommand}" />
  284. </StackPanel>
  285. </Grid>
  286. </UserControl>