FixedUpCameraFindP0.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <UserControl x:Class="TeamAAS_VP.Views.Calibration.FixedUpCameraFindP0"
  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:mah="http://metro.mahapps.com/winfx/xaml/controls"
  10. xmlns:wf="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  11. xmlns:vp="clr-namespace:Cognex.VisionPro.ToolBlock;assembly=Cognex.VisionPro.ToolGroup.Controls"
  12. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  13. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Calibration"
  14. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  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:FixedUpCameraFindP0ViewModel}"
  22. d:Height="600"
  23. d:Width="1024"
  24. d:Background="White"
  25. FontFamily="{DynamicResource DefaultFont}">
  26. <b:Interaction.Triggers>
  27. <b:EventTrigger EventName="Loaded">
  28. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  29. </b:EventTrigger>
  30. </b:Interaction.Triggers>
  31. <UserControl.Resources>
  32. <convert:JogConverter x:Key="JogConverter" />
  33. </UserControl.Resources>
  34. <Grid>
  35. <Grid.RowDefinitions>
  36. <RowDefinition Height="auto" />
  37. <RowDefinition Height="*" />
  38. <RowDefinition Height="auto" />
  39. </Grid.RowDefinitions>
  40. <Button Grid.Row="0"
  41. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  42. Width="50"
  43. HorizontalAlignment="Left"
  44. VerticalAlignment="Top"
  45. ToolTip="{lex:Loc 返回}"
  46. Style="{StaticResource MaterialDesignIconButton}"
  47. Command="{Binding BackCommand}" />
  48. <StackPanel Grid.Row="0"
  49. Orientation="Horizontal"
  50. Margin="50,0"
  51. VerticalAlignment="Center">
  52. <materialDesign:PackIcon Kind="CrosshairsGps"
  53. Width="30"
  54. Height="30" />
  55. <TextBlock Text="{Binding SelectCalibration.Name,Converter={StaticResource StringFormatConverter},ConverterParameter=' [{0}] '}"
  56. VerticalAlignment="Center" />
  57. <TextBlock Text="{lex:Loc 校准视觉处理,Converter={StaticResource StringFormatConverter},ConverterParameter='- {0}'}"
  58. VerticalAlignment="Center" />
  59. </StackPanel>
  60. <materialDesign:DrawerHost Grid.Row="1"
  61. IsEnabled="{Binding IsAllowEdit}"
  62. OpenMode="Standard"
  63. x:Name="DrawerHost">
  64. <materialDesign:DrawerHost.RightDrawerContent>
  65. <uControl:RobotManual x:Name="robotManual" />
  66. </materialDesign:DrawerHost.RightDrawerContent>
  67. <Grid>
  68. <Grid.ColumnDefinitions>
  69. <ColumnDefinition Width="*" />
  70. <ColumnDefinition Width="auto" />
  71. </Grid.ColumnDefinitions>
  72. <wf:WindowsFormsHost Grid.Column="0"
  73. Margin="0,0,0,35">
  74. <vp:CogToolBlockEditV2 x:Name="ToolBlockEditV2" />
  75. </wf:WindowsFormsHost>
  76. <Button Content="{lex:Loc 运行流程}"
  77. Width="100"
  78. HorizontalAlignment="Left"
  79. VerticalAlignment="Bottom"
  80. Margin="5,3"
  81. Command="{Binding RunVisionProcessCommand}" />
  82. <Grid Grid.Column="1">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="auto" />
  85. <RowDefinition Height="auto" />
  86. <RowDefinition Height="auto" />
  87. <RowDefinition Height="auto" />
  88. <RowDefinition Height="auto" />
  89. <RowDefinition Height="auto" />
  90. <RowDefinition Height="auto" />
  91. <RowDefinition Height="auto" />
  92. </Grid.RowDefinitions>
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition Width="auto" />
  95. <ColumnDefinition Width="*" />
  96. </Grid.ColumnDefinitions>
  97. <TextBlock Text="{lex:Loc 选择下相机}"
  98. FontWeight="Bold"
  99. Grid.Row="0"
  100. VerticalAlignment="Center"
  101. Grid.Column="0" />
  102. <ComboBox Grid.Row="0"
  103. Grid.Column="1"
  104. ItemsSource="{Binding Cameras}"
  105. SelectedItem="{Binding SelectCamera}"
  106. materialDesign:HintAssist.Hint="{lex:Loc 选择相机}">
  107. <ComboBox.ItemTemplate>
  108. <DataTemplate>
  109. <StackPanel Orientation="Horizontal">
  110. <materialDesign:PackIcon Kind="Camera" />
  111. <TextBlock Text="{Binding CameraName}"
  112. Margin="6,0" />
  113. </StackPanel>
  114. </DataTemplate>
  115. </ComboBox.ItemTemplate>
  116. </ComboBox>
  117. <TextBlock Text="{lex:Loc 相机参数设置}"
  118. Grid.Row="1"
  119. FontWeight="Bold"
  120. Margin="0,10"
  121. Grid.ColumnSpan="2" />
  122. <TextBlock Grid.Row="2"
  123. Grid.Column="0"
  124. Margin="5"
  125. VerticalAlignment="Center"
  126. Text="{lex:Loc 曝光时间,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  127. <mah:NumericUpDown Grid.Row="2"
  128. Grid.Column="1"
  129. Margin="5"
  130. Minimum="35"
  131. Maximum="999985"
  132. Interval="35"
  133. StringFormat="{}{0:N0} us"
  134. Value="{Binding ExposureTime,Mode=TwoWay}" />
  135. <TextBlock Grid.Row="3"
  136. Grid.Column="0"
  137. Margin="5"
  138. VerticalAlignment="Center"
  139. Text="{lex:Loc 增益,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  140. <mah:NumericUpDown Grid.Row="3"
  141. Grid.Column="1"
  142. Margin="5"
  143. Minimum="0"
  144. Maximum="63"
  145. Interval="1"
  146. StringFormat="{}{0:N2} db"
  147. Value="{Binding Gain,Mode=TwoWay}" />
  148. <TextBlock Text="{lex:Loc 选择校准}"
  149. FontWeight="Bold"
  150. Grid.Row="4"
  151. VerticalAlignment="Center"
  152. Grid.Column="0" />
  153. <ComboBox Grid.Row="4"
  154. Grid.Column="1"
  155. ItemsSource="{Binding CalibrationList}"
  156. SelectedItem="{Binding SelectedCalibration}"
  157. materialDesign:HintAssist.Hint="选择校准">
  158. <ComboBox.ItemTemplate>
  159. <DataTemplate>
  160. <StackPanel Orientation="Horizontal">
  161. <materialDesign:PackIcon Kind="Camera" />
  162. <TextBlock Text="{Binding Name}"
  163. Margin="6,0" />
  164. </StackPanel>
  165. </DataTemplate>
  166. </ComboBox.ItemTemplate>
  167. </ComboBox>
  168. <TextBlock Text="{lex:Loc 获取P0点}"
  169. FontWeight="Bold"
  170. Grid.Row="5"
  171. VerticalAlignment="Center"
  172. Grid.Column="0" />
  173. <Button Content="获取P0点"
  174. Grid.Row="5"
  175. Margin="0,10"
  176. Grid.Column="1"
  177. Command="{Binding FindP0Command}" />
  178. <TextBlock Grid.Row="6"
  179. Grid.ColumnSpan="2">
  180. <TextBlock.Text>
  181. <MultiBinding StringFormat="{}P0点 X:{0:F3} Y:{1:F3}">
  182. <Binding Path="SelectCalibration.MarkPoint.X"
  183. TargetNullValue="0.000"
  184. FallbackValue="0.000" />
  185. <Binding Path="SelectCalibration.MarkPoint.Y"
  186. TargetNullValue="0.000"
  187. FallbackValue="0.000" />
  188. </MultiBinding>
  189. </TextBlock.Text>
  190. </TextBlock>
  191. </Grid>
  192. </Grid>
  193. </materialDesign:DrawerHost>
  194. <StackPanel Orientation="Horizontal"
  195. HorizontalAlignment="Right"
  196. VerticalAlignment="Bottom">
  197. <ToggleButton materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ArrowRight}"
  198. Content="{materialDesign:PackIcon Kind=RobotIndustrial}"
  199. IsEnabled="{Binding IsAllowEdit}"
  200. Style="{StaticResource MaterialDesignActionToggleButton}"
  201. ToolTip="{lex:Loc 机器人步进}"
  202. Margin="2,0"
  203. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  204. </StackPanel>
  205. <StackPanel Grid.Row="2"
  206. Orientation="Horizontal"
  207. HorizontalAlignment="Center"
  208. VerticalAlignment="Center"
  209. Margin="20">
  210. <Button Content="{lex:Loc 下一步}"
  211. IsEnabled="{Binding IsAllowEdit}"
  212. MinWidth="150"
  213. Margin="10,0"
  214. HorizontalAlignment="Center"
  215. VerticalAlignment="Center"
  216. materialDesign:ButtonAssist.CornerRadius="10"
  217. Style="{StaticResource MaterialDesignRaisedButton}"
  218. Command="{Binding NextCommand}" />
  219. </StackPanel>
  220. </Grid>
  221. </UserControl>