ProcedureParams.xaml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <UserControl x:Class="TeamAAS_VP.Views.Product.ProcedureParams"
  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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  6. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib"
  8. xmlns:uControl="clr-namespace:TeamAAS_VP.Controls"
  9. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  10. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  11. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  12. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Product"
  13. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  14. xmlns:valueConverter="clr-namespace:TeamAAS_VP.ValueConverter"
  15. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  16. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  17. lex:LocalizeDictionary.DesignCulture="zh-CN"
  18. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  19. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  20. prism:ViewModelLocator.AutoWireViewModel="True"
  21. mc:Ignorable="d"
  22. d:DataContext="{d:DesignInstance Type=vm:ProcedureParamsViewModel}"
  23. d:Height="1080"
  24. d:Width="1024"
  25. d:Background="White"
  26. FontFamily="{DynamicResource DefaultFont}">
  27. <b:Interaction.Triggers>
  28. <b:EventTrigger EventName="Loaded">
  29. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  30. </b:EventTrigger>
  31. </b:Interaction.Triggers>
  32. <UserControl.Resources>
  33. <valueConverter:ImageFileNameFormatConverter x:Key="ImageFileNameFormatConverter" />
  34. </UserControl.Resources>
  35. <Grid>
  36. <Grid.RowDefinitions>
  37. <RowDefinition Height="auto" />
  38. <RowDefinition Height="*" />
  39. <RowDefinition Height="auto" />
  40. </Grid.RowDefinitions>
  41. <Button Grid.Row="0"
  42. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  43. Width="50"
  44. HorizontalAlignment="Left"
  45. VerticalAlignment="Top"
  46. ToolTip="{lex:Loc 返回}"
  47. Style="{StaticResource MaterialDesignIconButton}"
  48. Command="{Binding BackCommand}" />
  49. <StackPanel Grid.Row="0"
  50. Orientation="Horizontal"
  51. Margin="50,0"
  52. VerticalAlignment="Center">
  53. <materialDesign:PackIcon Kind="CubeOutline"
  54. Width="30"
  55. Height="30" />
  56. <TextBlock Text="{Binding SelectProduct.Name}"
  57. VerticalAlignment="Center" />
  58. <TextBlock Text="{lex:Loc 流程参数设定,Converter={StaticResource StringFormatConverter},ConverterParameter=' - {0}'}"
  59. VerticalAlignment="Center" />
  60. </StackPanel>
  61. <Border BorderThickness="1,1,1,1"
  62. VerticalAlignment="Bottom"
  63. Height="1">
  64. <Border.BorderBrush>
  65. <VisualBrush>
  66. <VisualBrush.Visual>
  67. <Rectangle StrokeDashArray="4 4"
  68. Stroke="LightGray"
  69. StrokeThickness="1"
  70. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  71. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" />
  72. </VisualBrush.Visual>
  73. </VisualBrush>
  74. </Border.BorderBrush>
  75. </Border>
  76. <Grid Grid.Row="1">
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition Width="auto" />
  79. <ColumnDefinition Width="*" />
  80. </Grid.ColumnDefinitions>
  81. <Expander Grid.Column="0"
  82. ExpandDirection="Right"
  83. Background="Transparent">
  84. <Expander.Header>
  85. <TextBlock RenderTransformOrigin=".5,.5"
  86. Text="Navigation Description">
  87. <TextBlock.LayoutTransform>
  88. <RotateTransform Angle="90" />
  89. </TextBlock.LayoutTransform>
  90. </TextBlock>
  91. </Expander.Header>
  92. <ScrollViewer>
  93. <StackPanel Margin="8,24,16,24"
  94. Orientation="Vertical">
  95. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/8流程参数设置.png"
  96. Stretch="Uniform"
  97. Width="350"
  98. HorizontalAlignment="Center"
  99. VerticalAlignment="Top" />
  100. <TextBlock Text="{lex:Loc 流程参数设定}" />
  101. <TextBlock Foreground="Gray"
  102. TextWrapping="Wrap"
  103. Text="{lex:Loc 流程参数设定描述}" />
  104. </StackPanel>
  105. </ScrollViewer>
  106. </Expander>
  107. <ScrollViewer Grid.Column="1"
  108. IsEnabled="{Binding IsAllowEdit}">
  109. <Grid x:Name="grid"
  110. Grid.Column="1"
  111. Margin="10"
  112. IsEnabled="{Binding IsAllowEdit}"
  113. HorizontalAlignment="Center"
  114. VerticalAlignment="Center">
  115. <Grid.RowDefinitions>
  116. <RowDefinition Height="*" />
  117. <RowDefinition Height="auto" />
  118. <RowDefinition Height="auto" />
  119. <RowDefinition Height="auto" />
  120. <RowDefinition Height="auto" />
  121. <RowDefinition Height="auto" />
  122. <RowDefinition Height="auto" />
  123. <RowDefinition Height="auto" />
  124. <RowDefinition Height="auto" />
  125. <RowDefinition Height="auto" />
  126. <RowDefinition Height="auto" />
  127. <RowDefinition Height="auto" />
  128. <RowDefinition Height="auto" />
  129. <RowDefinition Height="auto" />
  130. <RowDefinition Height="auto" />
  131. <RowDefinition Height="auto" />
  132. <RowDefinition Height="auto" />
  133. <RowDefinition Height="auto" />
  134. <RowDefinition Height="auto" />
  135. <RowDefinition Height="auto" />
  136. </Grid.RowDefinitions>
  137. <Grid.ColumnDefinitions>
  138. <ColumnDefinition Width="auto" />
  139. <ColumnDefinition Width="auto" />
  140. </Grid.ColumnDefinitions>
  141. <Grid.Resources>
  142. <Style TargetType="TextBlock">
  143. <Setter Property="HorizontalAlignment"
  144. Value="Right" />
  145. <Setter Property="VerticalAlignment"
  146. Value="Center" />
  147. <Setter Property="FontSize"
  148. Value="12" />
  149. <Setter Property="FontWeight"
  150. Value="Bold" />
  151. <Setter Property="Margin"
  152. Value="5,2" />
  153. </Style>
  154. <Style TargetType="TextBox"
  155. BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
  156. <Setter Property="HorizontalAlignment"
  157. Value="Center" />
  158. <Setter Property="VerticalAlignment"
  159. Value="Center" />
  160. <Setter Property="FontSize"
  161. Value="14" />
  162. <Setter Property="Margin"
  163. Value="5,2" />
  164. <Setter Property="MinWidth"
  165. Value="100" />
  166. <Setter Property="HorizontalContentAlignment"
  167. Value="Center" />
  168. <Setter Property="VerticalContentAlignment"
  169. Value="Center" />
  170. </Style>
  171. <Style TargetType="mah:NumericUpDown">
  172. <Setter Property="Margin"
  173. Value="0,2,0,0" />
  174. </Style>
  175. </Grid.Resources>
  176. <GroupBox Grid.Row="0"
  177. Grid.ColumnSpan="2"
  178. Header="{lex:Loc 工具末端设定}">
  179. <Grid>
  180. <Grid.RowDefinitions>
  181. <RowDefinition Height="auto" />
  182. <RowDefinition Height="*" />
  183. </Grid.RowDefinitions>
  184. <StackPanel Orientation="Horizontal">
  185. <Button Content="{lex:Loc 添加}"
  186. Command="{Binding AddToolCommand}" />
  187. </StackPanel>
  188. <ScrollViewer Grid.Row="1"
  189. Grid.IsSharedSizeScope="True">
  190. <ItemsControl x:Name="toollistview"
  191. ItemsSource="{Binding SelectProcedure.ToolInfo}">
  192. <ItemsControl.ItemTemplate>
  193. <DataTemplate>
  194. <Border x:Name="Border"
  195. Padding="8"
  196. BorderBrush="{DynamicResource MaterialDesignDivider}"
  197. BorderThickness="0,0,0,1">
  198. <Grid>
  199. <Grid.ColumnDefinitions>
  200. <ColumnDefinition />
  201. <ColumnDefinition SharedSizeGroup="Checkerz" />
  202. <ColumnDefinition SharedSizeGroup="Checkerz" />
  203. </Grid.ColumnDefinitions>
  204. <Grid>
  205. <Grid.RowDefinitions>
  206. <RowDefinition Height="auto" />
  207. <RowDefinition Height="auto" />
  208. </Grid.RowDefinitions>
  209. <Grid.ColumnDefinitions>
  210. <ColumnDefinition Width="auto" />
  211. <ColumnDefinition Width="auto" />
  212. <ColumnDefinition Width="auto" />
  213. <ColumnDefinition Width="auto" />
  214. </Grid.ColumnDefinitions>
  215. <!--offset-->
  216. <TextBox Grid.Row="0"
  217. Grid.Column="0"
  218. materialDesign:HintAssist.Hint="Offset X"
  219. Text="{Binding OffsetX,StringFormat={}{0:F3},Mode=TwoWay}" />
  220. <TextBox Grid.Row="0"
  221. Grid.Column="1"
  222. materialDesign:HintAssist.Hint="Offset Y"
  223. Text="{Binding OffsetY,StringFormat={}{0:F3},Mode=TwoWay}" />
  224. <TextBox Grid.Row="0"
  225. Grid.Column="2"
  226. materialDesign:HintAssist.Hint="{lex:Loc 取料高度}"
  227. Text="{Binding OffsetZ,StringFormat={}{0:F3},Mode=TwoWay}" />
  228. <TextBox Grid.Row="0"
  229. Grid.Column="3"
  230. materialDesign:HintAssist.Hint="Offset U"
  231. Text="{Binding OffsetU,StringFormat={}{0:F3},Mode=TwoWay}" />
  232. <!--Tool-->
  233. <TextBox Grid.Row="1"
  234. Grid.Column="0"
  235. Grid.ColumnSpan="2"
  236. materialDesign:HintAssist.Hint="{lex:Loc 描述}"
  237. Text="{Binding Description,Mode=TwoWay}" />
  238. <TextBox Grid.Row="1"
  239. Grid.Column="2"
  240. materialDesign:HintAssist.Hint="Tool.X"
  241. Text="{Binding Tool.X,StringFormat={}{0:F3},Mode=TwoWay}" />
  242. <TextBox Grid.Row="1"
  243. Grid.Column="3"
  244. materialDesign:HintAssist.Hint="Tool.Y"
  245. Text="{Binding Tool.Y,StringFormat={}{0:F3},Mode=TwoWay}" />
  246. </Grid>
  247. <Button Grid.Column="1"
  248. Content="{lex:Loc 自动计算}"
  249. HorizontalAlignment="Center"
  250. VerticalAlignment="Center"
  251. Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.CalculateOffsetUAndToolCommand}"
  252. CommandParameter="{Binding Id}" />
  253. <Button Grid.Column="2"
  254. Style="{StaticResource MaterialDesignIconForegroundButton}"
  255. Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.RemoveToolCommand}"
  256. CommandParameter="{Binding Id}">
  257. <materialDesign:PackIcon Kind="CloseOctagon"
  258. Foreground="DarkRed" />
  259. </Button>
  260. </Grid>
  261. </Border>
  262. <DataTemplate.Triggers>
  263. <DataTrigger Binding="{Binding IsSelected}"
  264. Value="True">
  265. <Setter TargetName="Border"
  266. Property="Background"
  267. Value="{DynamicResource MaterialDesignSelection}" />
  268. </DataTrigger>
  269. </DataTemplate.Triggers>
  270. </DataTemplate>
  271. </ItemsControl.ItemTemplate>
  272. </ItemsControl>
  273. </ScrollViewer>
  274. </Grid>
  275. </GroupBox>
  276. <!--Feeder振动完延时拍照-->
  277. <TextBlock Grid.Row="1"
  278. Grid.Column="0"
  279. Text="{lex:Loc Feeder振动完延时拍照,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  280. <mah:NumericUpDown Grid.Row="1"
  281. Grid.Column="1"
  282. Maximum="60000"
  283. Minimum="0"
  284. Interval="100"
  285. StringFormat="{}{0:N0} ms"
  286. Value="{Binding SelectProcedure.WaitFeederStop,Mode=TwoWay}" />
  287. <!--Feeder光源打开延时拍照-->
  288. <TextBlock Grid.Row="2"
  289. Grid.Column="0"
  290. Text="{lex:Loc Feeder光源打开延时拍照,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  291. <mah:NumericUpDown Grid.Row="2"
  292. Grid.Column="1"
  293. Maximum="60000"
  294. Minimum="0"
  295. Interval="100"
  296. StringFormat="{}{0:N0} ms"
  297. Value="{Binding SelectProcedure.WaitPhoto,Mode=TwoWay}" />
  298. <!--检测重复点位并剔除重复点位-->
  299. <TextBlock Grid.Row="3"
  300. Grid.Column="0"
  301. Text="{lex:Loc 检测重复点位并剔除重复点位,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  302. <CheckBox Grid.Row="3"
  303. Grid.Column="1"
  304. Margin="0,2,0,0"
  305. IsChecked="{Binding SelectProcedure.IsExcludeNearPoint,Mode=TwoWay}" />
  306. <TextBlock Grid.Row="4"
  307. Grid.Column="0"
  308. Text="是否启用当前流程界面显示" />
  309. <CheckBox Grid.Row="4"
  310. Grid.Column="1"
  311. Margin="0,2,0,0"
  312. IsChecked="{Binding SelectProcedure.IsImageVisibility,Mode=TwoWay}" />
  313. <!--点位输出的模式-->
  314. <TextBlock Grid.Row="5"
  315. Grid.Column="0"
  316. Text="{lex:Loc 点位输出的模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  317. <ComboBox Grid.Row="5"
  318. Grid.Column="1"
  319. SelectedItem="{Binding SelectProcedure.OutputPointMode,Mode=TwoWay}"
  320. ItemsSource="{ext:EnumBindingSource EnumType=enums:OutputPointMode}"
  321. BorderBrush="LightGray"
  322. BorderThickness="1"
  323. Margin="0,2,0,0" />
  324. <!--视觉引导模式(先拍再振/先振再拍)-->
  325. <TextBlock Grid.Row="6"
  326. Grid.Column="0"
  327. Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  328. <ComboBox Grid.Row="6"
  329. Grid.Column="1"
  330. SelectedItem="{Binding SelectProcedure.VibrationModel,Mode=TwoWay}"
  331. ItemsSource="{ext:EnumBindingSource EnumType=enums:VibrationModel}"
  332. BorderBrush="LightGray"
  333. BorderThickness="1"
  334. Margin="0,2,0,0" />
  335. <!--拍照失败Feeder振动最大次数-->
  336. <TextBlock Grid.Row="7"
  337. Grid.Column="0"
  338. Text="{lex:Loc Feeder最大振动拍照次数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  339. <mah:NumericUpDown Grid.Row="7"
  340. Grid.Column="1"
  341. Maximum="100"
  342. Minimum="1"
  343. StringFormat="{}{0:N0}"
  344. Value="{Binding SelectProcedure.FeederFailLimit,Mode=TwoWay}" />
  345. <!--每次发送给机器人的点数最大值-->
  346. <TextBlock Grid.Row="8"
  347. Grid.Column="0"
  348. Text="{lex:Loc 发送给机器人的最大点位数量,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  349. <mah:NumericUpDown Grid.Row="8"
  350. Grid.Column="1"
  351. Maximum="100"
  352. Minimum="1"
  353. StringFormat="{}{0:N0}"
  354. Value="{Binding SelectProcedure.OutputPointCountMax,Mode=TwoWay}" />
  355. <!--视觉流程输出项之间的分割符-->
  356. <TextBlock Grid.Row="9"
  357. Grid.Column="0"
  358. Text="{lex:Loc 视觉流程输出项之间的分割符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  359. <TextBox Grid.Row="9"
  360. Grid.Column="1"
  361. Text="{Binding SelectProcedure.OutputSeparator,Mode=TwoWay}"
  362. BorderThickness="1"
  363. Padding="0"
  364. HorizontalAlignment="Stretch"
  365. Margin="0,2,0,0" />
  366. <!--保存图像-->
  367. <TextBlock Grid.Row="10"
  368. Grid.Column="0"
  369. Text="{lex:Loc 保存图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  370. <CheckBox x:Name="chbSaveImage"
  371. Grid.Row="10"
  372. Grid.Column="1"
  373. d:IsChecked="True"
  374. Content="{lex:Loc 是否保存,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  375. IsChecked="{Binding SelectProcedure.IsSaveImage,Mode=TwoWay}"
  376. Style="{StaticResource MaterialDesignLightCheckBox}" />
  377. <!--保存图像模式-->
  378. <TextBlock Grid.Row="11"
  379. Grid.Column="0"
  380. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  381. Text="{lex:Loc 图像存储模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  382. <ComboBox Grid.Row="11"
  383. Grid.Column="1"
  384. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  385. materialDesign:HintAssist.Hint="{lex:Loc 图像存储模式}"
  386. SelectedItem="{Binding SelectProcedure.SaveImageModel,Mode=TwoWay}"
  387. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImageModel}" />
  388. <!--保存图像路径存放模式-->
  389. <TextBlock Grid.Row="12"
  390. Grid.Column="0"
  391. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  392. Text="{lex:Loc 图像路径存储方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  393. <ComboBox Grid.Row="12"
  394. Grid.Column="1"
  395. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  396. materialDesign:HintAssist.Hint="{lex:Loc 图像路径存储方式}"
  397. SelectedItem="{Binding SelectProcedure.SaveImagePathModel,Mode=TwoWay}"
  398. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImagePathModel}" />
  399. <!--保存路径-->
  400. <TextBlock Grid.Row="13"
  401. Grid.Column="0"
  402. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  403. Text="{lex:Loc 保存路径,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  404. <Grid Grid.Row="13"
  405. Grid.Column="1"
  406. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
  407. <Grid.ColumnDefinitions>
  408. <ColumnDefinition Width="*" />
  409. <ColumnDefinition Width="auto" />
  410. </Grid.ColumnDefinitions>
  411. <TextBox BorderThickness="1"
  412. BorderBrush="LightGray"
  413. HorizontalAlignment="Stretch"
  414. materialDesign:HintAssist.Hint="{lex:Loc 保存路径}"
  415. materialDesign:HintAssist.FloatingHintHorizontalAlignment="Left"
  416. Text="{Binding SelectProcedure.SavePath,Mode=TwoWay}" />
  417. <Button Grid.Column="1"
  418. ToolTip="{lex:Loc 选择路径}"
  419. Command="{Binding SelectSaveImagePathCommand}">
  420. <Button.Content>
  421. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  422. </Button.Content>
  423. </Button>
  424. </Grid>
  425. <!--是否压缩图像-->
  426. <TextBlock Grid.Row="14"
  427. Grid.Column="0"
  428. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  429. Text="{lex:Loc 压缩图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  430. <CheckBox Grid.Row="14"
  431. Grid.Column="1"
  432. Content="{lex:Loc 是否压缩}"
  433. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  434. IsChecked="{Binding SelectProcedure.IsCompress,Mode=TwoWay}"
  435. Style="{StaticResource MaterialDesignLightCheckBox}" />
  436. <!--是否延迟保存图片-->
  437. <TextBlock Grid.Row="15"
  438. Grid.Column="0"
  439. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  440. Text="{lex:Loc 延迟保存图片,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  441. <CheckBox Grid.Row="15"
  442. Grid.Column="1"
  443. Content="{lex:Loc 是否延迟保存图片}"
  444. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  445. IsChecked="{Binding SelectProcedure.IsDelaySaveImage,Mode=TwoWay}"
  446. Style="{StaticResource MaterialDesignLightCheckBox}" />
  447. <!--图片名称格式-->
  448. <TextBlock Grid.Row="16"
  449. Grid.Column="0"
  450. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  451. Text="图片名称格式:" />
  452. <TextBox Grid.Row="16"
  453. Grid.Column="1"
  454. HorizontalAlignment="Stretch"
  455. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  456. Text="{Binding SelectProcedure.ImageFileNameFormat,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
  457. </TextBox>
  458. <!--示例-->
  459. <StackPanel Grid.Row="17"
  460. Grid.Column="0"
  461. Grid.ColumnSpan="2"
  462. Orientation="Vertical"
  463. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
  464. <TextBlock Text="示例:{ProductSN}_Daisy_KB Screw _01 _{CameraName}-Locate_{ShotCount}_WhiteRingLight_{Result}_Screw{Number}_{DateTime:yyyy-MM-dd_HH-mm-ss}"
  465. Foreground="LightGray"
  466. FontSize="10"
  467. TextTrimming="CharacterEllipsis"
  468. TextWrapping="Wrap"
  469. Width="{Binding Width, ElementName=grid}" />
  470. <TextBlock Text="转换后的名称:"
  471. Foreground="Gray"
  472. FontSize="10" />
  473. <TextBlock Text="{Binding SelectProcedure.ImageFileNameFormat,Converter={StaticResource ImageFileNameFormatConverter},Mode=TwoWay}"
  474. Foreground="Gray"
  475. FontSize="10"
  476. TextTrimming="CharacterEllipsis"
  477. TextWrapping="Wrap"
  478. Width="{Binding Width, ElementName=grid}" />
  479. </StackPanel>
  480. <!--自定义参数-->
  481. <GroupBox Grid.Row="18"
  482. Grid.Column="0"
  483. Grid.ColumnSpan="2"
  484. HorizontalAlignment="Stretch"
  485. Header="{lex:Loc 自定义参数}"
  486. FontSize="14"
  487. Style="{x:Null}">
  488. <DockPanel>
  489. <StackPanel DockPanel.Dock="Top"
  490. Orientation="Horizontal">
  491. <Button Content="{materialDesign:PackIcon Kind=AddCircle}"
  492. Style="{StaticResource MahApps.Styles.Button.Flat}"
  493. Command="{Binding AddUserDefineParameterCommand}" />
  494. <Button Content="{materialDesign:PackIcon Kind=RemoveCircle}"
  495. Style="{StaticResource MahApps.Styles.Button.Flat}"
  496. Margin="5,0"
  497. Command="{Binding RemoveUserDefineParameterCommand}" />
  498. </StackPanel>
  499. <DataGrid HorizontalAlignment="Stretch"
  500. VerticalAlignment="Stretch"
  501. SelectedItem="{Binding SelectedUserDefineParam,Mode=TwoWay}"
  502. ItemsSource="{Binding SelectProcedure.UserDefineParameters,Mode=TwoWay}"
  503. HeadersVisibility="Column"
  504. GridLinesVisibility="All"
  505. CanUserAddRows="False"
  506. CanUserDeleteRows="False"
  507. SelectionUnit="FullRow"
  508. SelectionMode="Single"
  509. AutoGenerateColumns="False"
  510. IsReadOnly="False"
  511. RowHeight="30"
  512. ColumnWidth="*"
  513. Height="Auto"
  514. MinHeight="100"
  515. MaxHeight="150"
  516. BorderThickness="1">
  517. <!-- 提高选中行可见性 -->
  518. <DataGrid.Resources>
  519. <Style TargetType="DataGridRow">
  520. <Setter Property="Background"
  521. Value="Transparent" />
  522. <Style.Triggers>
  523. <Trigger Property="IsSelected"
  524. Value="True">
  525. <Setter Property="Background"
  526. Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  527. <Setter Property="Foreground"
  528. Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
  529. </Trigger>
  530. <Trigger Property="IsMouseOver"
  531. Value="True">
  532. <Setter Property="Background"
  533. Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
  534. </Trigger>
  535. </Style.Triggers>
  536. </Style>
  537. </DataGrid.Resources>
  538. <DataGrid.Columns>
  539. <DataGridTextColumn Header="{lex:Loc 名称}"
  540. Width="*"
  541. MinWidth="100"
  542. Binding="{Binding ParamName, UpdateSourceTrigger=PropertyChanged}" />
  543. <DataGridTextColumn Header="{lex:Loc 值}"
  544. Width="*"
  545. MinWidth="100"
  546. Binding="{Binding ParamValue, UpdateSourceTrigger=PropertyChanged}" />
  547. </DataGrid.Columns>
  548. </DataGrid>
  549. </DockPanel>
  550. </GroupBox>
  551. <TextBlock Grid.Row="19"
  552. Grid.Column="0"
  553. Text="{lex:Loc 重写视觉处理逻辑}" />
  554. <Button Grid.Row="19"
  555. Grid.Column="1"
  556. Margin="0,2,0,0"
  557. Command="{Binding OverrideVisionTaskCommand}">
  558. <Button.Content>
  559. <StackPanel Orientation="Horizontal">
  560. <materialDesign:PackIcon Kind="ScriptTextPlayOutline"
  561. VerticalAlignment="Center" />
  562. <TextBlock Text="{lex:Loc 脚本}"
  563. FontSize="{DynamicResource Font.Size.Title4}"
  564. Margin="8,0,0,0" />
  565. </StackPanel>
  566. </Button.Content>
  567. </Button>
  568. </Grid>
  569. </ScrollViewer>
  570. </Grid>
  571. <StackPanel Grid.Row="2"
  572. Orientation="Horizontal"
  573. HorizontalAlignment="Center"
  574. VerticalAlignment="Center"
  575. Margin="20">
  576. <Button Content="{lex:Loc 返回视觉流程选择界面}"
  577. IsEnabled="{Binding IsAllowEdit}"
  578. MinWidth="100"
  579. Margin="10,0"
  580. HorizontalAlignment="Center"
  581. VerticalAlignment="Center"
  582. materialDesign:ButtonAssist.CornerRadius="10"
  583. Style="{StaticResource MaterialDesignRaisedButton}"
  584. Command="{Binding NextCommand}" />
  585. </StackPanel>
  586. </Grid>
  587. </UserControl>