ProcedureParams.xaml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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. <!--点位输出的模式-->
  307. <TextBlock Grid.Row="4"
  308. Grid.Column="0"
  309. Text="{lex:Loc 点位输出的模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  310. <ComboBox Grid.Row="4"
  311. Grid.Column="1"
  312. SelectedItem="{Binding SelectProcedure.OutputPointMode,Mode=TwoWay}"
  313. ItemsSource="{ext:EnumBindingSource EnumType=enums:OutputPointMode}"
  314. BorderBrush="LightGray"
  315. BorderThickness="1"
  316. Margin="0,2,0,0" />
  317. <!--视觉引导模式(先拍再振/先振再拍)-->
  318. <TextBlock Grid.Row="5"
  319. Grid.Column="0"
  320. Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  321. <ComboBox Grid.Row="5"
  322. Grid.Column="1"
  323. SelectedItem="{Binding SelectProcedure.VibrationModel,Mode=TwoWay}"
  324. ItemsSource="{ext:EnumBindingSource EnumType=enums:VibrationModel}"
  325. BorderBrush="LightGray"
  326. BorderThickness="1"
  327. Margin="0,2,0,0" />
  328. <!--拍照失败Feeder振动最大次数-->
  329. <TextBlock Grid.Row="6"
  330. Grid.Column="0"
  331. Text="{lex:Loc Feeder最大振动拍照次数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  332. <mah:NumericUpDown Grid.Row="6"
  333. Grid.Column="1"
  334. Maximum="100"
  335. Minimum="1"
  336. StringFormat="{}{0:N0}"
  337. Value="{Binding SelectProcedure.FeederFailLimit,Mode=TwoWay}" />
  338. <!--每次发送给机器人的点数最大值-->
  339. <TextBlock Grid.Row="7"
  340. Grid.Column="0"
  341. Text="{lex:Loc 发送给机器人的最大点位数量,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  342. <mah:NumericUpDown Grid.Row="7"
  343. Grid.Column="1"
  344. Maximum="100"
  345. Minimum="1"
  346. StringFormat="{}{0:N0}"
  347. Value="{Binding SelectProcedure.OutputPointCountMax,Mode=TwoWay}" />
  348. <!--视觉流程输出项之间的分割符-->
  349. <TextBlock Grid.Row="8"
  350. Grid.Column="0"
  351. Text="{lex:Loc 视觉流程输出项之间的分割符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  352. <TextBox Grid.Row="8"
  353. Grid.Column="1"
  354. Text="{Binding SelectProcedure.OutputSeparator,Mode=TwoWay}"
  355. BorderThickness="1"
  356. Padding="0"
  357. HorizontalAlignment="Stretch"
  358. Margin="0,2,0,0" />
  359. <!--保存图像-->
  360. <TextBlock Grid.Row="9"
  361. Grid.Column="0"
  362. Text="{lex:Loc 保存图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  363. <CheckBox x:Name="chbSaveImage"
  364. Grid.Row="9"
  365. Grid.Column="1"
  366. d:IsChecked="True"
  367. Content="{lex:Loc 是否保存,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  368. IsChecked="{Binding SelectProcedure.IsSaveImage,Mode=TwoWay}"
  369. Style="{StaticResource MaterialDesignLightCheckBox}" />
  370. <!--保存图像模式-->
  371. <TextBlock Grid.Row="10"
  372. Grid.Column="0"
  373. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  374. Text="{lex:Loc 图像存储模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  375. <ComboBox Grid.Row="10"
  376. Grid.Column="1"
  377. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  378. materialDesign:HintAssist.Hint="{lex:Loc 图像存储模式}"
  379. SelectedItem="{Binding SelectProcedure.SaveImageModel,Mode=TwoWay}"
  380. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImageModel}" />
  381. <!--保存图像路径存放模式-->
  382. <TextBlock Grid.Row="11"
  383. Grid.Column="0"
  384. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  385. Text="{lex:Loc 图像路径存储方式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  386. <ComboBox Grid.Row="11"
  387. Grid.Column="1"
  388. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  389. materialDesign:HintAssist.Hint="{lex:Loc 图像路径存储方式}"
  390. SelectedItem="{Binding SelectProcedure.SaveImagePathModel,Mode=TwoWay}"
  391. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImagePathModel}" />
  392. <!--保存路径-->
  393. <TextBlock Grid.Row="12"
  394. Grid.Column="0"
  395. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  396. Text="{lex:Loc 保存路径,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  397. <Grid Grid.Row="12"
  398. Grid.Column="1"
  399. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
  400. <Grid.ColumnDefinitions>
  401. <ColumnDefinition Width="*" />
  402. <ColumnDefinition Width="auto" />
  403. </Grid.ColumnDefinitions>
  404. <TextBox BorderThickness="1"
  405. BorderBrush="LightGray"
  406. HorizontalAlignment="Stretch"
  407. materialDesign:HintAssist.Hint="{lex:Loc 保存路径}"
  408. materialDesign:HintAssist.FloatingHintHorizontalAlignment="Left"
  409. Text="{Binding SelectProcedure.SavePath,Mode=TwoWay}" />
  410. <Button Grid.Column="1"
  411. ToolTip="{lex:Loc 选择路径}"
  412. Command="{Binding SelectSaveImagePathCommand}">
  413. <Button.Content>
  414. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  415. </Button.Content>
  416. </Button>
  417. </Grid>
  418. <!--是否压缩图像-->
  419. <TextBlock Grid.Row="13"
  420. Grid.Column="0"
  421. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  422. Text="{lex:Loc 压缩图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  423. <CheckBox Grid.Row="13"
  424. Grid.Column="1"
  425. Content="{lex:Loc 是否压缩}"
  426. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  427. IsChecked="{Binding SelectProcedure.IsCompress,Mode=TwoWay}"
  428. Style="{StaticResource MaterialDesignLightCheckBox}" />
  429. <!--是否延迟保存图片-->
  430. <TextBlock Grid.Row="14"
  431. Grid.Column="0"
  432. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  433. Text="{lex:Loc 延迟保存图片,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  434. <CheckBox Grid.Row="14"
  435. Grid.Column="1"
  436. Content="{lex:Loc 是否延迟保存图片}"
  437. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  438. IsChecked="{Binding SelectProcedure.IsDelaySaveImage,Mode=TwoWay}"
  439. Style="{StaticResource MaterialDesignLightCheckBox}" />
  440. <!--图片名称格式-->
  441. <TextBlock Grid.Row="15"
  442. Grid.Column="0"
  443. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  444. Text="图片名称格式:" />
  445. <TextBox Grid.Row="15"
  446. Grid.Column="1"
  447. HorizontalAlignment="Stretch"
  448. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  449. Text="{Binding SelectProcedure.ImageFileNameFormat,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
  450. </TextBox>
  451. <!--示例-->
  452. <StackPanel Grid.Row="16"
  453. Grid.Column="0"
  454. Grid.ColumnSpan="2"
  455. Orientation="Vertical"
  456. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
  457. <TextBlock Text="示例:{ProductSN}_Daisy_KB Screw _01 _{CameraName}-Locate_{ShotCount}_WhiteRingLight_{Result}_Screw{Number}_{DateTime:yyyy-MM-dd_HH-mm-ss}"
  458. Foreground="LightGray"
  459. FontSize="10"
  460. TextTrimming="CharacterEllipsis"
  461. TextWrapping="Wrap"
  462. Width="{Binding Width, ElementName=grid}" />
  463. <TextBlock Text="转换后的名称:"
  464. Foreground="Gray"
  465. FontSize="10" />
  466. <TextBlock Text="{Binding SelectProcedure.ImageFileNameFormat,Converter={StaticResource ImageFileNameFormatConverter},Mode=TwoWay}"
  467. Foreground="Gray"
  468. FontSize="10"
  469. TextTrimming="CharacterEllipsis"
  470. TextWrapping="Wrap"
  471. Width="{Binding Width, ElementName=grid}" />
  472. </StackPanel>
  473. <!--自定义参数-->
  474. <GroupBox Grid.Row="17"
  475. Grid.Column="0"
  476. Grid.ColumnSpan="2"
  477. HorizontalAlignment="Stretch"
  478. Header="{lex:Loc 自定义参数}"
  479. FontSize="14"
  480. Style="{x:Null}">
  481. <DockPanel>
  482. <StackPanel DockPanel.Dock="Top"
  483. Orientation="Horizontal">
  484. <Button Content="{materialDesign:PackIcon Kind=AddCircle}"
  485. Style="{StaticResource MahApps.Styles.Button.Flat}"
  486. Command="{Binding AddUserDefineParameterCommand}" />
  487. <Button Content="{materialDesign:PackIcon Kind=RemoveCircle}"
  488. Style="{StaticResource MahApps.Styles.Button.Flat}"
  489. Margin="5,0"
  490. Command="{Binding RemoveUserDefineParameterCommand}" />
  491. </StackPanel>
  492. <DataGrid HorizontalAlignment="Stretch"
  493. VerticalAlignment="Stretch"
  494. SelectedItem="{Binding SelectedUserDefineParam,Mode=TwoWay}"
  495. ItemsSource="{Binding SelectProcedure.UserDefineParameters,Mode=TwoWay}"
  496. HeadersVisibility="Column"
  497. GridLinesVisibility="All"
  498. CanUserAddRows="False"
  499. CanUserDeleteRows="False"
  500. SelectionUnit="FullRow"
  501. SelectionMode="Single"
  502. AutoGenerateColumns="False"
  503. IsReadOnly="False"
  504. RowHeight="30"
  505. ColumnWidth="*"
  506. Height="Auto"
  507. MinHeight="100"
  508. MaxHeight="150"
  509. BorderThickness="1">
  510. <!-- 提高选中行可见性 -->
  511. <DataGrid.Resources>
  512. <Style TargetType="DataGridRow">
  513. <Setter Property="Background"
  514. Value="Transparent" />
  515. <Style.Triggers>
  516. <Trigger Property="IsSelected"
  517. Value="True">
  518. <Setter Property="Background"
  519. Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  520. <Setter Property="Foreground"
  521. Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
  522. </Trigger>
  523. <Trigger Property="IsMouseOver"
  524. Value="True">
  525. <Setter Property="Background"
  526. Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
  527. </Trigger>
  528. </Style.Triggers>
  529. </Style>
  530. </DataGrid.Resources>
  531. <DataGrid.Columns>
  532. <DataGridTextColumn Header="{lex:Loc 名称}"
  533. Width="*"
  534. MinWidth="100"
  535. Binding="{Binding ParamName, UpdateSourceTrigger=PropertyChanged}" />
  536. <DataGridTextColumn Header="{lex:Loc 值}"
  537. Width="*"
  538. MinWidth="100"
  539. Binding="{Binding ParamValue, UpdateSourceTrigger=PropertyChanged}" />
  540. </DataGrid.Columns>
  541. </DataGrid>
  542. </DockPanel>
  543. </GroupBox>
  544. <TextBlock Grid.Row="18"
  545. Grid.Column="0"
  546. Text="{lex:Loc 重写视觉处理逻辑}" />
  547. <Button Grid.Row="18"
  548. Grid.Column="1"
  549. Margin="0,2,0,0"
  550. Command="{Binding OverrideVisionTaskCommand}">
  551. <Button.Content>
  552. <StackPanel Orientation="Horizontal">
  553. <materialDesign:PackIcon Kind="ScriptTextPlayOutline"
  554. VerticalAlignment="Center" />
  555. <TextBlock Text="{lex:Loc 脚本}"
  556. FontSize="{DynamicResource Font.Size.Title4}"
  557. Margin="8,0,0,0" />
  558. </StackPanel>
  559. </Button.Content>
  560. </Button>
  561. </Grid>
  562. </ScrollViewer>
  563. </Grid>
  564. <StackPanel Grid.Row="2"
  565. Orientation="Horizontal"
  566. HorizontalAlignment="Center"
  567. VerticalAlignment="Center"
  568. Margin="20">
  569. <Button Content="{lex:Loc 返回视觉流程选择界面}"
  570. IsEnabled="{Binding IsAllowEdit}"
  571. MinWidth="100"
  572. Margin="10,0"
  573. HorizontalAlignment="Center"
  574. VerticalAlignment="Center"
  575. materialDesign:ButtonAssist.CornerRadius="10"
  576. Style="{StaticResource MaterialDesignRaisedButton}"
  577. Command="{Binding NextCommand}" />
  578. </StackPanel>
  579. </Grid>
  580. </UserControl>