ProcedureParams.xaml 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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="600"
  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. </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="CubeOutline"
  53. Width="30"
  54. Height="30" />
  55. <TextBlock Text="{Binding SelectProduct.Name}"
  56. VerticalAlignment="Center" />
  57. <TextBlock Text="{lex:Loc 流程参数设定,Converter={StaticResource StringFormatConverter},ConverterParameter=' - {0}'}"
  58. VerticalAlignment="Center" />
  59. </StackPanel>
  60. <Border BorderThickness="1,1,1,1"
  61. VerticalAlignment="Bottom"
  62. Height="1">
  63. <Border.BorderBrush>
  64. <VisualBrush>
  65. <VisualBrush.Visual>
  66. <Rectangle StrokeDashArray="4 4"
  67. Stroke="LightGray"
  68. StrokeThickness="1"
  69. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  70. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" />
  71. </VisualBrush.Visual>
  72. </VisualBrush>
  73. </Border.BorderBrush>
  74. </Border>
  75. <Grid Grid.Row="1">
  76. <Grid.ColumnDefinitions>
  77. <ColumnDefinition Width="auto" />
  78. <ColumnDefinition Width="*" />
  79. </Grid.ColumnDefinitions>
  80. <Expander Grid.Column="0"
  81. ExpandDirection="Right"
  82. Background="Transparent">
  83. <Expander.Header>
  84. <TextBlock RenderTransformOrigin=".5,.5"
  85. Text="Navigation Description">
  86. <TextBlock.LayoutTransform>
  87. <RotateTransform Angle="90" />
  88. </TextBlock.LayoutTransform>
  89. </TextBlock>
  90. </Expander.Header>
  91. <ScrollViewer>
  92. <StackPanel Margin="8,24,16,24"
  93. Orientation="Vertical">
  94. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/8流程参数设置.png"
  95. Stretch="Uniform"
  96. Width="350"
  97. HorizontalAlignment="Center"
  98. VerticalAlignment="Top" />
  99. <TextBlock Text="{lex:Loc 流程参数设定}" />
  100. <TextBlock Foreground="Gray"
  101. TextWrapping="Wrap"
  102. Text="{lex:Loc 流程参数设定描述}" />
  103. </StackPanel>
  104. </ScrollViewer>
  105. </Expander>
  106. <ScrollViewer Grid.Column="1"
  107. IsEnabled="{Binding IsAllowEdit}">
  108. <Grid Grid.Column="1"
  109. Margin="10"
  110. IsEnabled="{Binding IsAllowEdit}"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center">
  113. <Grid.RowDefinitions>
  114. <RowDefinition Height="*" />
  115. <RowDefinition Height="auto" />
  116. <RowDefinition Height="auto" />
  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. </Grid.RowDefinitions>
  133. <Grid.ColumnDefinitions>
  134. <ColumnDefinition Width="auto" />
  135. <ColumnDefinition Width="auto" />
  136. </Grid.ColumnDefinitions>
  137. <Grid.Resources>
  138. <Style TargetType="TextBlock">
  139. <Setter Property="HorizontalAlignment"
  140. Value="Right" />
  141. <Setter Property="VerticalAlignment"
  142. Value="Center" />
  143. <Setter Property="FontSize"
  144. Value="12" />
  145. <Setter Property="FontWeight"
  146. Value="Bold" />
  147. <Setter Property="Margin"
  148. Value="5,2" />
  149. </Style>
  150. <Style TargetType="TextBox"
  151. BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
  152. <Setter Property="HorizontalAlignment"
  153. Value="Center" />
  154. <Setter Property="VerticalAlignment"
  155. Value="Center" />
  156. <Setter Property="FontSize"
  157. Value="14" />
  158. <Setter Property="Margin"
  159. Value="5,2" />
  160. <Setter Property="MinWidth"
  161. Value="100" />
  162. <Setter Property="HorizontalContentAlignment"
  163. Value="Center" />
  164. <Setter Property="VerticalContentAlignment"
  165. Value="Center" />
  166. </Style>
  167. <Style TargetType="mah:NumericUpDown">
  168. <Setter Property="Margin"
  169. Value="0,2,0,0" />
  170. </Style>
  171. </Grid.Resources>
  172. <GroupBox Grid.Row="0"
  173. Grid.ColumnSpan="2"
  174. Header="{lex:Loc 工具末端设定}">
  175. <Grid>
  176. <Grid.RowDefinitions>
  177. <RowDefinition Height="auto" />
  178. <RowDefinition Height="*" />
  179. </Grid.RowDefinitions>
  180. <StackPanel Orientation="Horizontal">
  181. <Button Content="{lex:Loc 添加}"
  182. Command="{Binding AddToolCommand}" />
  183. </StackPanel>
  184. <ScrollViewer Grid.Row="1"
  185. Grid.IsSharedSizeScope="True">
  186. <ItemsControl x:Name="toollistview"
  187. ItemsSource="{Binding SelectProcedure.ToolInfo}">
  188. <ItemsControl.ItemTemplate>
  189. <DataTemplate>
  190. <Border x:Name="Border"
  191. Padding="8"
  192. BorderBrush="{DynamicResource MaterialDesignDivider}"
  193. BorderThickness="0,0,0,1">
  194. <Grid>
  195. <Grid.ColumnDefinitions>
  196. <ColumnDefinition />
  197. <ColumnDefinition SharedSizeGroup="Checkerz" />
  198. <ColumnDefinition SharedSizeGroup="Checkerz" />
  199. </Grid.ColumnDefinitions>
  200. <Grid>
  201. <Grid.RowDefinitions>
  202. <RowDefinition Height="auto" />
  203. <RowDefinition Height="auto" />
  204. </Grid.RowDefinitions>
  205. <Grid.ColumnDefinitions>
  206. <ColumnDefinition Width="auto" />
  207. <ColumnDefinition Width="auto" />
  208. <ColumnDefinition Width="auto" />
  209. <ColumnDefinition Width="auto" />
  210. </Grid.ColumnDefinitions>
  211. <!--offset-->
  212. <TextBox Grid.Row="0"
  213. Grid.Column="0"
  214. materialDesign:HintAssist.Hint="Offset X"
  215. Text="{Binding OffsetX,StringFormat={}{0:F3},Mode=TwoWay}" />
  216. <TextBox Grid.Row="0"
  217. Grid.Column="1"
  218. materialDesign:HintAssist.Hint="Offset Y"
  219. Text="{Binding OffsetY,StringFormat={}{0:F3},Mode=TwoWay}" />
  220. <TextBox Grid.Row="0"
  221. Grid.Column="2"
  222. materialDesign:HintAssist.Hint="{lex:Loc 取料高度}"
  223. Text="{Binding OffsetZ,StringFormat={}{0:F3},Mode=TwoWay}" />
  224. <TextBox Grid.Row="0"
  225. Grid.Column="3"
  226. materialDesign:HintAssist.Hint="Offset U"
  227. Text="{Binding OffsetU,StringFormat={}{0:F3},Mode=TwoWay}" />
  228. <!--Tool-->
  229. <TextBox Grid.Row="1"
  230. Grid.Column="0"
  231. Grid.ColumnSpan="2"
  232. materialDesign:HintAssist.Hint="{lex:Loc 描述}"
  233. Text="{Binding Description,Mode=TwoWay}" />
  234. <TextBox Grid.Row="1"
  235. Grid.Column="2"
  236. materialDesign:HintAssist.Hint="Tool.X"
  237. Text="{Binding Tool.X,StringFormat={}{0:F3},Mode=TwoWay}" />
  238. <TextBox Grid.Row="1"
  239. Grid.Column="3"
  240. materialDesign:HintAssist.Hint="Tool.Y"
  241. Text="{Binding Tool.Y,StringFormat={}{0:F3},Mode=TwoWay}" />
  242. </Grid>
  243. <Button Grid.Column="1"
  244. Content="{lex:Loc 自动计算}"
  245. HorizontalAlignment="Center"
  246. VerticalAlignment="Center"
  247. Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.CalculateOffsetUAndToolCommand}"
  248. CommandParameter="{Binding Id}" />
  249. <Button Grid.Column="2"
  250. Style="{StaticResource MaterialDesignIconForegroundButton}"
  251. Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.RemoveToolCommand}"
  252. CommandParameter="{Binding Id}">
  253. <materialDesign:PackIcon Kind="CloseOctagon"
  254. Foreground="DarkRed" />
  255. </Button>
  256. </Grid>
  257. </Border>
  258. <DataTemplate.Triggers>
  259. <DataTrigger Binding="{Binding IsSelected}"
  260. Value="True">
  261. <Setter TargetName="Border"
  262. Property="Background"
  263. Value="{DynamicResource MaterialDesignSelection}" />
  264. </DataTrigger>
  265. </DataTemplate.Triggers>
  266. </DataTemplate>
  267. </ItemsControl.ItemTemplate>
  268. </ItemsControl>
  269. </ScrollViewer>
  270. </Grid>
  271. </GroupBox>
  272. <!--Feeder振动完延时拍照-->
  273. <TextBlock Grid.Row="1"
  274. Grid.Column="0"
  275. Text="{lex:Loc Feeder振动完延时拍照,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  276. <mah:NumericUpDown Grid.Row="1"
  277. Grid.Column="1"
  278. Maximum="60000"
  279. Minimum="0"
  280. Interval="100"
  281. StringFormat="{}{0:N0} ms"
  282. Value="{Binding SelectProcedure.WaitFeederStop,Mode=TwoWay}" />
  283. <!--Feeder光源打开延时拍照-->
  284. <TextBlock Grid.Row="2"
  285. Grid.Column="0"
  286. Text="{lex:Loc Feeder光源打开延时拍照,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  287. <mah:NumericUpDown Grid.Row="2"
  288. Grid.Column="1"
  289. Maximum="60000"
  290. Minimum="0"
  291. Interval="100"
  292. StringFormat="{}{0:N0} ms"
  293. Value="{Binding SelectProcedure.WaitPhoto,Mode=TwoWay}" />
  294. <!--检测重复点位并剔除重复点位-->
  295. <TextBlock Grid.Row="3"
  296. Grid.Column="0"
  297. Text="{lex:Loc 检测重复点位并剔除重复点位,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  298. <CheckBox Grid.Row="3"
  299. Grid.Column="1"
  300. Margin="0,2,0,0"
  301. IsChecked="{Binding SelectProcedure.IsExcludeNearPoint,Mode=TwoWay}" />
  302. <!--点位输出的模式-->
  303. <TextBlock Grid.Row="4"
  304. Grid.Column="0"
  305. Text="{lex:Loc 点位输出的模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  306. <ComboBox Grid.Row="4"
  307. Grid.Column="1"
  308. SelectedItem="{Binding SelectProcedure.OutputPointMode,Mode=TwoWay}"
  309. ItemsSource="{ext:EnumBindingSource EnumType=enums:OutputPointMode}"
  310. BorderBrush="LightGray"
  311. BorderThickness="1"
  312. Margin="0,2,0,0" />
  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.VibrationModel,Mode=TwoWay}"
  320. ItemsSource="{ext:EnumBindingSource EnumType=enums:VibrationModel}"
  321. BorderBrush="LightGray"
  322. BorderThickness="1"
  323. Margin="0,2,0,0" />
  324. <!--拍照失败Feeder振动最大次数-->
  325. <TextBlock Grid.Row="6"
  326. Grid.Column="0"
  327. Text="{lex:Loc Feeder最大振动拍照次数,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  328. <mah:NumericUpDown Grid.Row="6"
  329. Grid.Column="1"
  330. Maximum="100"
  331. Minimum="1"
  332. StringFormat="{}{0:N0}"
  333. Value="{Binding SelectProcedure.FeederFailLimit,Mode=TwoWay}" />
  334. <!--每次发送给机器人的点数最大值-->
  335. <TextBlock Grid.Row="7"
  336. Grid.Column="0"
  337. Text="{lex:Loc 发送给机器人的最大点位数量,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  338. <mah:NumericUpDown Grid.Row="7"
  339. Grid.Column="1"
  340. Maximum="100"
  341. Minimum="1"
  342. StringFormat="{}{0:N0}"
  343. Value="{Binding SelectProcedure.OutputPointCountMax,Mode=TwoWay}" />
  344. <!--视觉流程输出项之间的分割符-->
  345. <TextBlock Grid.Row="8"
  346. Grid.Column="0"
  347. Text="{lex:Loc 视觉流程输出项之间的分割符,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  348. <TextBox Grid.Row="8"
  349. Grid.Column="1"
  350. Text="{Binding SelectProcedure.OutputSeparator,Mode=TwoWay}"
  351. BorderThickness="1"
  352. Padding="0"
  353. HorizontalAlignment="Stretch"
  354. Margin="0,2,0,0" />
  355. <!--保存图像-->
  356. <TextBlock Grid.Row="9"
  357. Grid.Column="0"
  358. Text="{lex:Loc 保存图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  359. <CheckBox x:Name="chbSaveImage"
  360. Grid.Row="9"
  361. Grid.Column="1"
  362. d:IsChecked="True"
  363. Content="{lex:Loc 是否保存,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  364. IsChecked="{Binding SelectProcedure.IsSaveImage,Mode=TwoWay}"
  365. Style="{StaticResource MaterialDesignLightCheckBox}" />
  366. <!--保存图像模式-->
  367. <TextBlock Grid.Row="10"
  368. Grid.Column="0"
  369. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  370. Text="{lex:Loc 图像存储模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  371. <ComboBox Grid.Row="10"
  372. Grid.Column="1"
  373. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  374. materialDesign:HintAssist.Hint="{lex:Loc 图像存储模式}"
  375. SelectedItem="{Binding SelectProcedure.SaveImageModel,Mode=TwoWay}"
  376. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImageModel}" />
  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.SaveImagePathModel,Mode=TwoWay}"
  387. ItemsSource="{ext:EnumBindingSource EnumType=enums:ProcedureSaveImagePathModel}" />
  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. <Grid Grid.Row="12"
  394. Grid.Column="1"
  395. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
  396. <Grid.ColumnDefinitions>
  397. <ColumnDefinition Width="*" />
  398. <ColumnDefinition Width="auto" />
  399. </Grid.ColumnDefinitions>
  400. <TextBox BorderThickness="1"
  401. BorderBrush="LightGray"
  402. HorizontalAlignment="Stretch"
  403. materialDesign:HintAssist.Hint="{lex:Loc 保存路径}"
  404. materialDesign:HintAssist.FloatingHintHorizontalAlignment="Left"
  405. Text="{Binding SelectProcedure.SavePath,Mode=TwoWay}" />
  406. <Button Grid.Column="1"
  407. ToolTip="{lex:Loc 选择路径}"
  408. Command="{Binding SelectSaveImagePathCommand}">
  409. <Button.Content>
  410. <materialDesign:PackIcon Kind="FolderOpenOutline" />
  411. </Button.Content>
  412. </Button>
  413. </Grid>
  414. <!--是否压缩图像-->
  415. <TextBlock Grid.Row="13"
  416. Grid.Column="0"
  417. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  418. Text="{lex:Loc 压缩图像,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  419. <CheckBox Grid.Row="13"
  420. Grid.Column="1"
  421. Content="{lex:Loc 是否压缩}"
  422. Visibility="{Binding ElementName=chbSaveImage,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}"
  423. IsChecked="{Binding SelectProcedure.IsCompress,Mode=TwoWay}"
  424. Style="{StaticResource MaterialDesignLightCheckBox}" />
  425. <!--自定义参数-->
  426. <GroupBox Grid.Row="14"
  427. Grid.Column="0"
  428. Grid.ColumnSpan="2"
  429. HorizontalAlignment="Stretch"
  430. Header="{lex:Loc 自定义参数}"
  431. FontSize="14"
  432. Style="{x:Null}">
  433. <DockPanel>
  434. <StackPanel DockPanel.Dock="Top"
  435. Orientation="Horizontal">
  436. <Button Content="{materialDesign:PackIcon Kind=AddCircle}"
  437. Style="{StaticResource MahApps.Styles.Button.Flat}"
  438. Command="{Binding AddUserDefineParameterCommand}"/>
  439. <Button Content="{materialDesign:PackIcon Kind=RemoveCircle}"
  440. Style="{StaticResource MahApps.Styles.Button.Flat}"
  441. Margin="5,0"
  442. Command="{Binding RemoveUserDefineParameterCommand}"/>
  443. </StackPanel>
  444. <DataGrid HorizontalAlignment="Stretch"
  445. VerticalAlignment="Stretch"
  446. SelectedItem="{Binding SelectedUserDefineParam,Mode=TwoWay}"
  447. ItemsSource="{Binding SelectProcedure.UserDefineParameters,Mode=TwoWay}"
  448. HeadersVisibility="Column"
  449. GridLinesVisibility="All"
  450. CanUserAddRows="False"
  451. CanUserDeleteRows="False"
  452. SelectionUnit="FullRow"
  453. SelectionMode="Single"
  454. AutoGenerateColumns="False"
  455. IsReadOnly="False"
  456. RowHeight="30"
  457. ColumnWidth="*"
  458. Height="Auto"
  459. MinHeight="100"
  460. MaxHeight="150"
  461. BorderThickness="1">
  462. <!-- 提高选中行可见性 -->
  463. <DataGrid.Resources>
  464. <Style TargetType="DataGridRow">
  465. <Setter Property="Background"
  466. Value="Transparent" />
  467. <Style.Triggers>
  468. <Trigger Property="IsSelected"
  469. Value="True">
  470. <Setter Property="Background"
  471. Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  472. <Setter Property="Foreground"
  473. Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />
  474. </Trigger>
  475. <Trigger Property="IsMouseOver"
  476. Value="True">
  477. <Setter Property="Background"
  478. Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
  479. </Trigger>
  480. </Style.Triggers>
  481. </Style>
  482. </DataGrid.Resources>
  483. <DataGrid.Columns>
  484. <DataGridTextColumn Header="{lex:Loc 名称}"
  485. Width="*"
  486. MinWidth="100"
  487. Binding="{Binding ParamName, UpdateSourceTrigger=PropertyChanged}" />
  488. <DataGridTextColumn Header="{lex:Loc 值}"
  489. Width="*"
  490. MinWidth="100"
  491. Binding="{Binding ParamValue, UpdateSourceTrigger=PropertyChanged}" />
  492. </DataGrid.Columns>
  493. </DataGrid>
  494. </DockPanel>
  495. </GroupBox>
  496. <TextBlock Grid.Row="15"
  497. Grid.Column="0"
  498. Text="{lex:Loc 重写视觉处理逻辑}" />
  499. <Button Grid.Row="15"
  500. Grid.Column="1"
  501. Margin="0,2,0,0"
  502. Command="{Binding OverrideVisionTaskCommand}">
  503. <Button.Content>
  504. <StackPanel Orientation="Horizontal">
  505. <materialDesign:PackIcon Kind="ScriptTextPlayOutline"
  506. VerticalAlignment="Center" />
  507. <TextBlock Text="{lex:Loc 脚本}"
  508. FontSize="{DynamicResource Font.Size.Title4}"
  509. Margin="8,0,0,0" />
  510. </StackPanel>
  511. </Button.Content>
  512. </Button>
  513. </Grid>
  514. </ScrollViewer>
  515. </Grid>
  516. <StackPanel Grid.Row="2"
  517. Orientation="Horizontal"
  518. HorizontalAlignment="Center"
  519. VerticalAlignment="Center"
  520. Margin="20">
  521. <Button Content="{lex:Loc 返回视觉流程选择界面}"
  522. IsEnabled="{Binding IsAllowEdit}"
  523. MinWidth="100"
  524. Margin="10,0"
  525. HorizontalAlignment="Center"
  526. VerticalAlignment="Center"
  527. materialDesign:ButtonAssist.CornerRadius="10"
  528. Style="{StaticResource MaterialDesignRaisedButton}"
  529. Command="{Binding NextCommand}" />
  530. </StackPanel>
  531. </Grid>
  532. </UserControl>