CalibrationBasics.xaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <UserControl x:Class="TeamAAS_VP.Views.Calibration.CalibrationBasics"
  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:mah="http://metro.mahapps.com/winfx/xaml/controls"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  11. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  12. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  13. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Calibration"
  14. xmlns:local="clr-namespace:TeamAAS_VP.ValueConverter"
  15. xmlns:localbehaviors="clr-namespace:TeamAAS_VP.Behaviors"
  16. xmlns:conv="http://schemas.superdev.ch/valueconverters/2016/xaml"
  17. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  18. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  19. lex:LocalizeDictionary.DesignCulture="zh-CN"
  20. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  21. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  22. prism:ViewModelLocator.AutoWireViewModel="True"
  23. mc:Ignorable="d"
  24. d:DataContext="{d:DesignInstance Type=vm:CalibrationBasicsViewModel}"
  25. d:Height="600"
  26. d:Width="1024"
  27. d:Background="White"
  28. FontFamily="{DynamicResource DefaultFont}">
  29. <b:Interaction.Triggers>
  30. <b:EventTrigger EventName="Loaded">
  31. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  32. </b:EventTrigger>
  33. </b:Interaction.Triggers>
  34. <UserControl.Resources>
  35. <ObjectDataProvider x:Key="eCameraMount"
  36. MethodName="GetValues"
  37. ObjectType="{x:Type sys:Enum}">
  38. <ObjectDataProvider.MethodParameters>
  39. <x:Type TypeName="enums:CameraMount" />
  40. </ObjectDataProvider.MethodParameters>
  41. </ObjectDataProvider>
  42. <ObjectDataProvider x:Key="ePickPlaceModel"
  43. MethodName="GetValues"
  44. ObjectType="{x:Type sys:Enum}">
  45. <ObjectDataProvider.MethodParameters>
  46. <x:Type TypeName="enums:PickPlaceModel" />
  47. </ObjectDataProvider.MethodParameters>
  48. </ObjectDataProvider>
  49. <local:CameraMountConverter x:Key="EnumToImageConverter" />
  50. <local:PickPlaceModelConverter x:Key="EnumToImageConverter1" />
  51. <conv:ValueConverterGroup x:Key="StringToBoolConverter">
  52. <conv:StringIsNullOrEmptyConverter />
  53. </conv:ValueConverterGroup>
  54. </UserControl.Resources>
  55. <Grid>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="auto" />
  58. <RowDefinition Height="*" />
  59. <RowDefinition Height="auto" />
  60. </Grid.RowDefinitions>
  61. <Button Grid.Row="0"
  62. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  63. Width="50"
  64. HorizontalAlignment="Left"
  65. VerticalAlignment="Top"
  66. ToolTip="{lex:Loc 返回}"
  67. Style="{StaticResource MaterialDesignIconButton}"
  68. Command="{Binding BackCommand}" />
  69. <StackPanel Grid.Row="0"
  70. Orientation="Horizontal"
  71. Margin="50,0"
  72. VerticalAlignment="Center">
  73. <materialDesign:PackIcon Kind="CrosshairsGps"
  74. Width="30"
  75. Height="30" />
  76. <TextBlock Text="{Binding SelectCalibration.Name,Converter={StaticResource StringFormatConverter},ConverterParameter=' [{0}] '}"
  77. VerticalAlignment="Center" />
  78. <TextBlock Text="{lex:Loc 校准配置,Converter={StaticResource StringFormatConverter},ConverterParameter='- {0}'}"
  79. VerticalAlignment="Center" />
  80. </StackPanel>
  81. <ScrollViewer Grid.Row="1"
  82. IsEnabled="{Binding IsAllowEdit}">
  83. <Grid Grid.Row="1"
  84. Margin="50,50"
  85. Width="350">
  86. <Grid.RowDefinitions>
  87. <RowDefinition Height="auto"
  88. MinHeight="35" />
  89. <RowDefinition Height="auto"
  90. MinHeight="35" />
  91. <RowDefinition Height="auto"
  92. MinHeight="35" />
  93. <RowDefinition Height="auto"
  94. MinHeight="35" />
  95. <RowDefinition Height="auto"
  96. MinHeight="35" />
  97. <RowDefinition Height="auto"
  98. MinHeight="35" />
  99. <RowDefinition Height="auto"
  100. MinHeight="35" />
  101. <RowDefinition Height="auto"
  102. MinHeight="35" />
  103. <RowDefinition Height="auto"
  104. MinHeight="35" />
  105. <RowDefinition Height="auto"
  106. MinHeight="35" />
  107. <RowDefinition Height="auto"
  108. MinHeight="35" />
  109. <RowDefinition Height="auto"
  110. MinHeight="35" />
  111. <RowDefinition Height="auto"
  112. MinHeight="35" />
  113. </Grid.RowDefinitions>
  114. <Grid.ColumnDefinitions>
  115. <ColumnDefinition Width="100" />
  116. <ColumnDefinition Width="*" />
  117. </Grid.ColumnDefinitions>
  118. <Grid.Resources>
  119. <Style TargetType="TextBlock">
  120. <Setter Property="HorizontalAlignment"
  121. Value="Left" />
  122. <Setter Property="VerticalAlignment"
  123. Value="Center" />
  124. </Style>
  125. </Grid.Resources>
  126. <TextBlock Text="{lex:Loc 相机,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  127. FontWeight="Bold"
  128. Grid.Row="0"
  129. Grid.Column="0" />
  130. <ComboBox Grid.Row="0"
  131. Grid.Column="1"
  132. ItemsSource="{Binding Cameras}"
  133. SelectedItem="{Binding SelectCamera}"
  134. materialDesign:HintAssist.Hint="{lex:Loc 选择相机}">
  135. <ComboBox.ItemTemplate>
  136. <DataTemplate>
  137. <StackPanel Orientation="Horizontal">
  138. <materialDesign:PackIcon Kind="Camera" />
  139. <TextBlock Text="{Binding CameraName}" Margin="6,0"/>
  140. </StackPanel>
  141. </DataTemplate>
  142. </ComboBox.ItemTemplate>
  143. </ComboBox>
  144. <TextBlock Text="{lex:Loc 机器人,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  145. Grid.Row="1"
  146. Grid.Column="0" />
  147. <ComboBox Grid.Row="1"
  148. Grid.Column="1"
  149. ItemsSource="{Binding Robots}"
  150. SelectedItem="{Binding SelectRobot}"
  151. materialDesign:HintAssist.Hint="{lex:Loc 选择机器人}">
  152. <ComboBox.ItemTemplate>
  153. <DataTemplate>
  154. <StackPanel Orientation="Horizontal">
  155. <materialDesign:PackIcon Kind="RobotIndustrialOutline" />
  156. <TextBlock Text="{Binding RobotName}"
  157. Margin="6,0" />
  158. </StackPanel>
  159. </DataTemplate>
  160. </ComboBox.ItemTemplate>
  161. </ComboBox>
  162. <TextBlock Text="Feeder: "
  163. Grid.Row="2"
  164. Grid.Column="0" />
  165. <ComboBox Grid.Row="2"
  166. Grid.Column="1"
  167. materialDesign:HintAssist.Hint="{lex:Loc 选择Feeder}"
  168. materialDesign:TextFieldAssist.HasClearButton="True"
  169. ItemsSource="{Binding Feeders}"
  170. SelectedItem="{Binding SelectFeeder}">
  171. <ComboBox.ItemTemplate>
  172. <DataTemplate>
  173. <StackPanel Orientation="Horizontal">
  174. <materialDesign:PackIcon Kind="Vibrate" />
  175. <TextBlock Text="{Binding FeederName}"
  176. Margin="6,0" />
  177. </StackPanel>
  178. </DataTemplate>
  179. </ComboBox.ItemTemplate>
  180. </ComboBox>
  181. <TextBlock Text="{lex:Loc 相机安装方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  182. Grid.Row="3"
  183. Grid.Column="0" />
  184. <ComboBox Grid.Row="3"
  185. Grid.Column="1"
  186. materialDesign:HintAssist.Hint="{lex:Loc 相机安装方式}"
  187. SelectedItem="{Binding SelectCalibration.CameraMount,Mode=TwoWay}"
  188. ItemsSource="{Binding Source={StaticResource eCameraMount}}">
  189. <ComboBox.ItemTemplate>
  190. <DataTemplate>
  191. <StackPanel Orientation="Horizontal">
  192. <Image Source="{Binding Converter={StaticResource EnumToImageConverter}}"
  193. MaxHeight="80"
  194. MaxWidth="80"
  195. Stretch="Uniform" />
  196. <TextBlock Text="{Binding}"
  197. Margin="5,0"
  198. VerticalAlignment="Center" />
  199. </StackPanel>
  200. </DataTemplate>
  201. </ComboBox.ItemTemplate>
  202. <b:Interaction.Behaviors>
  203. <localbehaviors:ComboBoxSelectionBehavior UserSelectionCommand="{Binding SelectCameraMountChangedCommand}" />
  204. </b:Interaction.Behaviors>
  205. </ComboBox>
  206. <mah:NumericUpDown Grid.Row="3"
  207. Grid.Column="1"
  208. HorizontalAlignment="Right"
  209. Margin="0,0,-65,0"
  210. Width="50"
  211. Height="30"
  212. Minimum="0"
  213. Interval="1"
  214. Maximum="4"
  215. d:Visibility="Visible"
  216. Value="{Binding SelectCalibration.CameraMotionModuleIndex,Mode=TwoWay}"
  217. ToolTip="{lex:Loc 相机运动模组编号}">
  218. <mah:NumericUpDown.Style>
  219. <Style TargetType="mah:NumericUpDown">
  220. <Setter Property="Visibility"
  221. Value="Collapsed" />
  222. <Style.Triggers>
  223. <DataTrigger Binding="{Binding SelectCalibration.CameraMount}"
  224. Value="{x:Static enums:CameraMount.MobileDown_IndependentXYPlatform}">
  225. <Setter Property="Visibility"
  226. Value="Visible" />
  227. </DataTrigger>
  228. </Style.Triggers>
  229. </Style>
  230. </mah:NumericUpDown.Style>
  231. </mah:NumericUpDown>
  232. <TextBlock Text="{lex:Loc 取料方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  233. Grid.Row="4"
  234. Grid.Column="0" />
  235. <ComboBox x:Name="PickPlaceModel"
  236. Grid.Row="4"
  237. Grid.Column="1"
  238. materialDesign:HintAssist.Hint="{lex:Loc 取料方式}"
  239. SelectedItem="{Binding SelectCalibration.Pick.PickPlaceModel,Mode=TwoWay}"
  240. ItemsSource="{Binding Source={StaticResource ePickPlaceModel}}">
  241. <ComboBox.ItemTemplate>
  242. <DataTemplate>
  243. <StackPanel Orientation="Horizontal">
  244. <Image Source="{Binding Converter={StaticResource EnumToImageConverter1}}"
  245. MaxHeight="80"
  246. MaxWidth="80"
  247. Stretch="Uniform" />
  248. <TextBlock Text="{Binding}"
  249. Margin="5,0"
  250. VerticalAlignment="Center" />
  251. </StackPanel>
  252. </DataTemplate>
  253. </ComboBox.ItemTemplate>
  254. </ComboBox>
  255. <Grid Grid.Row="5"
  256. Grid.Column="1"
  257. Margin="0,5">
  258. <Grid.RowDefinitions>
  259. <RowDefinition Height="auto" />
  260. <RowDefinition Height="auto" />
  261. </Grid.RowDefinitions>
  262. <Grid.ColumnDefinitions>
  263. <ColumnDefinition Width="50*" />
  264. <ColumnDefinition Width="50*" />
  265. </Grid.ColumnDefinitions>
  266. <TextBlock x:Name="txt_Inhal"
  267. Text="{lex:Loc 吸真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  268. <TextBlock x:Name="txt_Blow"
  269. Text="{lex:Loc 破真空,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  270. Grid.Column="1" />
  271. <uControl:myNumericUpDowm Grid.Row="1"
  272. Grid.Column="0"
  273. Minimum="-1"
  274. Maximum="5000"
  275. Interval="1"
  276. materialDesign:HintAssist.Hint="{lex:Loc 破真空}"
  277. StringFormat="Out: {0:N0}"
  278. Value="{Binding SelectCalibration.Pick.Inhal,Mode=TwoWay}" />
  279. <uControl:myNumericUpDowm Grid.Row="1"
  280. Grid.Column="1"
  281. Minimum="-1"
  282. Maximum="5000"
  283. Interval="1"
  284. materialDesign:HintAssist.Hint="{lex:Loc 破真空}"
  285. StringFormat="Out: {0:N0}"
  286. Value="{Binding SelectCalibration.Pick.Blow,Mode=TwoWay}" />
  287. </Grid>
  288. <!--PTP速度-->
  289. <TextBlock x:Name="txtSpeed"
  290. Grid.Row="6"
  291. Grid.Column="0"
  292. Text="{lex:Loc 速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  293. <uControl:myNumericUpDowm Grid.Row="6"
  294. Grid.Column="1"
  295. Maximum="100"
  296. Minimum="1"
  297. Height="35"
  298. Interval="1"
  299. StringFormat="{}{0:N0} %"
  300. materialDesign:HintAssist.Hint="{lex:Loc 速度}"
  301. Value="{Binding SelectCalibration.Speed,Mode=TwoWay}" />
  302. <!--加减速度-->
  303. <TextBlock x:Name="txtAccel"
  304. Grid.Row="7"
  305. Grid.Column="0"
  306. Text="{lex:Loc 加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  307. <uControl:myNumericUpDowm Grid.Row="7"
  308. Grid.Column="1"
  309. Maximum="100"
  310. Minimum="1"
  311. Height="35"
  312. Interval="1"
  313. StringFormat="{}{0:N0} %"
  314. materialDesign:HintAssist.Hint="{lex:Loc 加减速度}"
  315. Value="{Binding SelectCalibration.Accel,Mode=TwoWay}" />
  316. <!--功率-->
  317. <TextBlock Grid.Row="8"
  318. Grid.Column="0"
  319. Text="{lex:Loc 功率,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  320. <CheckBox Grid.Row="8"
  321. Grid.Column="1"
  322. Content="{lex:Loc 高功率}"
  323. IsChecked="{Binding SelectCalibration.Power,Mode=TwoWay}" />
  324. <!--延时拍照-->
  325. <TextBlock x:Name="txtWaitPhoto"
  326. Grid.Row="9"
  327. Grid.Column="0"
  328. Text="{lex:Loc 延时拍照,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  329. <uControl:myNumericUpDowm Grid.Row="9"
  330. Grid.Column="1"
  331. Maximum="10000"
  332. Minimum="0"
  333. Height="35"
  334. Interval="50"
  335. StringFormat="{}{0:N0} ms"
  336. materialDesign:HintAssist.Hint="{lex:Loc 延时拍照}"
  337. Value="{Binding SelectCalibration.WaitPhoto,Mode=TwoWay}" />
  338. <!--吸真空延时-->
  339. <TextBlock x:Name="txtWaitSuction"
  340. Grid.Row="10"
  341. Grid.Column="0"
  342. Text="{lex:Loc 吸真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  343. <uControl:myNumericUpDowm Grid.Row="10"
  344. Grid.Column="1"
  345. Maximum="60000"
  346. Minimum="0"
  347. Height="35"
  348. Interval="50"
  349. StringFormat="{}{0:N0} ms"
  350. materialDesign:HintAssist.Hint="{Binding ElementName=txtWaitSuction,Path=Text}"
  351. Value="{Binding SelectCalibration.WaitSuction,Mode=TwoWay}" />
  352. <!--破真空延时-->
  353. <TextBlock x:Name="txtWaitBlow"
  354. Grid.Row="11"
  355. Grid.Column="0"
  356. Text="{lex:Loc 破真空时长,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  357. <uControl:myNumericUpDowm Grid.Row="11"
  358. Grid.Column="1"
  359. Maximum="60000"
  360. Minimum="0"
  361. Height="35"
  362. Interval="50"
  363. StringFormat="{}{0:N0} ms"
  364. materialDesign:HintAssist.Hint="{lex:Loc 破真空时长}"
  365. Value="{Binding SelectCalibration.WaitBlow,Mode=TwoWay}" />
  366. <CheckBox Grid.Row="12"
  367. Grid.Column="1"
  368. Content="是否进行畸变校正"
  369. IsChecked="{Binding SelectCalibration.IsDistortionCorrection,Mode=TwoWay}" />
  370. </Grid>
  371. </ScrollViewer>
  372. <Grid Grid.Row="2"
  373. HorizontalAlignment="Center"
  374. VerticalAlignment="Center"
  375. Margin="20"
  376. IsEnabled="{Binding Error,Converter={StaticResource StringToBoolConverter}}">
  377. <TextBlock Text="{Binding Error}"
  378. HorizontalAlignment="Center"
  379. Foreground="Red"
  380. Margin="0,-20"/>
  381. <Button Content="{lex:Loc 下一步}"
  382. IsEnabled="{Binding IsAllowEdit}"
  383. MinWidth="150"
  384. HorizontalAlignment="Center"
  385. VerticalAlignment="Center"
  386. materialDesign:ButtonAssist.CornerRadius="10"
  387. Style="{StaticResource MaterialDesignRaisedButton}"
  388. Command="{Binding NextCommand}" />
  389. </Grid>
  390. </Grid>
  391. </UserControl>