CalibrationTeachCenterPoint.xaml 17 KB

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