ProductParams.xaml 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <UserControl x:Class="TeamAAS_VP.Views.Product.ProductParams"
  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:mah="http://metro.mahapps.com/winfx/xaml/controls"
  9. xmlns:uControl="clr-namespace:TeamAAS_VP.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:lex="http://wpflocalizeextension.codeplex.com"
  14. lex:LocalizeDictionary.DesignCulture="zh-CN"
  15. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  16. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d"
  19. d:DataContext="{d:DesignInstance Type=vm:ProductParamsViewModel}"
  20. d:Height="600"
  21. d:Width="1024"
  22. d:Background="White"
  23. FontFamily="{DynamicResource DefaultFont}">
  24. <b:Interaction.Triggers>
  25. <b:EventTrigger EventName="Loaded">
  26. <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
  27. </b:EventTrigger>
  28. </b:Interaction.Triggers>
  29. <Grid>
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="auto" />
  32. <RowDefinition Height="*" />
  33. <RowDefinition Height="auto" />
  34. </Grid.RowDefinitions>
  35. <Button Grid.Row="0"
  36. Content="{materialDesign:PackIcon Kind=ArrowLeftCircle}"
  37. Width="50"
  38. HorizontalAlignment="Left"
  39. VerticalAlignment="Top"
  40. ToolTip="{lex:Loc 返回}"
  41. Style="{StaticResource MaterialDesignIconButton}"
  42. Command="{Binding BackCommand}" />
  43. <StackPanel Grid.Row="0"
  44. Orientation="Horizontal"
  45. Margin="50,0"
  46. VerticalAlignment="Center">
  47. <materialDesign:PackIcon Kind="CubeOutline"
  48. Width="30"
  49. Height="30" />
  50. <TextBlock Text="{Binding SelectProduct.Name}"
  51. VerticalAlignment="Center" />
  52. <TextBlock Text="{lex:Loc 产品参数,Converter={StaticResource StringFormatConverter},ConverterParameter=' - {0}'}"
  53. VerticalAlignment="Center" />
  54. </StackPanel>
  55. <Border BorderThickness="1,1,1,1"
  56. VerticalAlignment="Bottom"
  57. Height="1">
  58. <Border.BorderBrush>
  59. <VisualBrush>
  60. <VisualBrush.Visual>
  61. <Rectangle StrokeDashArray="4 4"
  62. Stroke="LightGray"
  63. StrokeThickness="1"
  64. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  65. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" />
  66. </VisualBrush.Visual>
  67. </VisualBrush>
  68. </Border.BorderBrush>
  69. </Border>
  70. <materialDesign:DrawerHost Grid.Row="1"
  71. OpenMode="Standard"
  72. x:Name="DrawerHost"
  73. IsEnabled="{Binding IsAllowEdit}">
  74. <materialDesign:DrawerHost.RightDrawerContent>
  75. <uControl:ParameterEdit x:Name="parameterEdit"/>
  76. </materialDesign:DrawerHost.RightDrawerContent>
  77. <Grid>
  78. <Grid.ColumnDefinitions>
  79. <ColumnDefinition Width="auto" />
  80. <ColumnDefinition Width="*" />
  81. </Grid.ColumnDefinitions>
  82. <Expander Grid.Column="0"
  83. ExpandDirection="Right"
  84. Background="Transparent">
  85. <Expander.Header>
  86. <TextBlock RenderTransformOrigin=".5,.5"
  87. Text="Navigation Description">
  88. <TextBlock.LayoutTransform>
  89. <RotateTransform Angle="90" />
  90. </TextBlock.LayoutTransform>
  91. </TextBlock>
  92. </Expander.Header>
  93. <ScrollViewer>
  94. <StackPanel Margin="8,24,16,24"
  95. Orientation="Vertical">
  96. <Image Source="pack://application:,,,/TeamAAS-VP;component/Resources/Images/10产品参数.png"
  97. Stretch="Uniform"
  98. Width="350"
  99. HorizontalAlignment="Center"
  100. VerticalAlignment="Top" />
  101. <TextBlock Text="{lex:Loc 产品参数设定}" />
  102. <TextBlock Foreground="Gray"
  103. TextWrapping="Wrap"
  104. Text="{lex:Loc 产品参数设定描述}" />
  105. </StackPanel>
  106. </ScrollViewer>
  107. </Expander>
  108. <Grid Grid.Column="1"
  109. IsEnabled="{Binding IsAllowEdit}"
  110. Margin="10"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center">
  113. <Grid.RowDefinitions>
  114. <RowDefinition Height="auto" />
  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. </Grid.RowDefinitions>
  126. <Grid.ColumnDefinitions>
  127. <ColumnDefinition Width="auto" />
  128. <ColumnDefinition Width="auto" />
  129. </Grid.ColumnDefinitions>
  130. <Grid.Resources>
  131. <Style TargetType="TextBlock">
  132. <Setter Property="HorizontalAlignment"
  133. Value="Right" />
  134. <Setter Property="VerticalAlignment"
  135. Value="Center" />
  136. <Setter Property="FontSize"
  137. Value="10" />
  138. <Setter Property="FontWeight"
  139. Value="Bold" />
  140. <Setter Property="Margin"
  141. Value="5,2" />
  142. </Style>
  143. <Style TargetType="TextBox"
  144. BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
  145. <Setter Property="HorizontalAlignment"
  146. Value="Center" />
  147. <Setter Property="VerticalAlignment"
  148. Value="Center" />
  149. <Setter Property="FontSize"
  150. Value="10" />
  151. <Setter Property="Margin"
  152. Value="5,2" />
  153. <Setter Property="MinWidth"
  154. Value="100" />
  155. <Setter Property="HorizontalContentAlignment"
  156. Value="Center" />
  157. <Setter Property="VerticalContentAlignment"
  158. Value="Center" />
  159. </Style>
  160. </Grid.Resources>
  161. <ToggleButton Grid.Column="1"
  162. Grid.Row="0"
  163. HorizontalAlignment="Right"
  164. VerticalAlignment="Top"
  165. materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ChevronDoubleLeft}"
  166. Content="{materialDesign:PackIcon Kind=ChevronDoubleRight}"
  167. Style="{StaticResource MaterialDesignActionToggleButton}"
  168. ToolTip="{lex:Loc 其他参数}"
  169. Margin="0,-40"
  170. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  171. <!--PTP速度-->
  172. <TextBlock Grid.Row="0"
  173. Grid.Column="0"
  174. Text="{lex:Loc PTP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  175. <mah:NumericUpDown Grid.Row="0"
  176. Grid.Column="1"
  177. Margin="0,5"
  178. Maximum="100"
  179. Minimum="1"
  180. StringFormat="{}{0:N0} %"
  181. Value="{Binding SelectProduct.Speed,Mode=TwoWay}" />
  182. <!--PTP加减速度--><!--
  183. <TextBlock Grid.Row="1"
  184. Grid.Column="0"
  185. Text="{lex:Loc PTP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  186. <mah:NumericUpDown Grid.Row="1"
  187. Grid.Column="1"
  188. Margin="0,5"
  189. Maximum="100"
  190. Minimum="1"
  191. StringFormat="{}{0:N0} %"
  192. Value="{Binding SelectProduct.Accel,Mode=TwoWay}" />
  193. --><!--CP速度--><!--
  194. <TextBlock Grid.Row="2"
  195. Grid.Column="0"
  196. Text="{lex:Loc CP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  197. <mah:NumericUpDown Grid.Row="2"
  198. Grid.Column="1"
  199. Margin="0,5"
  200. Maximum="3000"
  201. Minimum="1"
  202. StringFormat="{}{0:N0} mm/s"
  203. Value="{Binding SelectProduct.Speeds,Mode=TwoWay}" />
  204. --><!--CP加减速度--><!--
  205. <TextBlock Grid.Row="3"
  206. Grid.Column="0"
  207. Text="{lex:Loc CP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  208. <mah:NumericUpDown Grid.Row="3"
  209. Grid.Column="1"
  210. Margin="0,5"
  211. Maximum="30000"
  212. Minimum="1"
  213. StringFormat="{}{0:N0} mm/s²"
  214. Value="{Binding SelectProduct.Accels,Mode=TwoWay}" />
  215. --><!--功率--><!--
  216. <TextBlock Grid.Row="4"
  217. Grid.Column="0"
  218. Text="{lex:Loc 功率,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  219. <CheckBox Grid.Row="4"
  220. Grid.Column="1"
  221. Content="{lex:Loc 高功率}"
  222. IsChecked="{Binding SelectProduct.Power}" />
  223. --><!--二次相机功能--><!--
  224. <TextBlock Grid.Row="5"
  225. Grid.Column="0"
  226. Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  227. <CheckBox Grid.Row="5"
  228. Grid.Column="1"
  229. Content="{lex:Loc 启用二次定位相机}"
  230. IsChecked="{Binding SelectProduct.IsUserUpCamera}" />-->
  231. <!--固定向上相机1视觉流程-->
  232. <TextBlock Grid.Row="1"
  233. Grid.Column="0"
  234. Text="固定向上相机1视觉流程ID: " />
  235. <ComboBox Grid.Row="1"
  236. Grid.Column="1"
  237. ItemsSource="{Binding ProcedureModels}"
  238. SelectedItem="{Binding FixedUpCamera1Procedure}"
  239. materialDesign:TextFieldAssist.HasClearButton="True"
  240. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  241. <ComboBox.ItemTemplate>
  242. <DataTemplate>
  243. <StackPanel Orientation="Horizontal">
  244. <materialDesign:PackIcon Kind="VideoOutline" />
  245. <TextBlock Text="{Binding CameraName}"
  246. Margin="6,0" />
  247. <materialDesign:PackIcon Kind="ProgressWrench" />
  248. <TextBlock Text="{Binding Name}"
  249. Margin="6,0" />
  250. </StackPanel>
  251. </DataTemplate>
  252. </ComboBox.ItemTemplate>
  253. </ComboBox>
  254. <!--固定向上相机2视觉流程-->
  255. <TextBlock Grid.Row="2"
  256. Grid.Column="0"
  257. Text="固定向上相机2视觉流程ID: " />
  258. <ComboBox Grid.Row="2"
  259. Grid.Column="1"
  260. ItemsSource="{Binding ProcedureModels}"
  261. SelectedItem="{Binding FixedUpCamera2Procedure}"
  262. materialDesign:TextFieldAssist.HasClearButton="True"
  263. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  264. <ComboBox.ItemTemplate>
  265. <DataTemplate>
  266. <StackPanel Orientation="Horizontal">
  267. <materialDesign:PackIcon Kind="VideoOutline" />
  268. <TextBlock Text="{Binding CameraName}"
  269. Margin="6,0" />
  270. <materialDesign:PackIcon Kind="ProgressWrench" />
  271. <TextBlock Text="{Binding Name}"
  272. Margin="6,0" />
  273. </StackPanel>
  274. </DataTemplate>
  275. </ComboBox.ItemTemplate>
  276. </ComboBox>
  277. <!--固定向下相机1取料流程-->
  278. <TextBlock Grid.Row="3"
  279. Grid.Column="0"
  280. Text="固定向下相机1取料流程ID: " />
  281. <ComboBox Grid.Row="3"
  282. Grid.Column="1"
  283. ItemsSource="{Binding ProcedureModels}"
  284. SelectedItem="{Binding FixedDownCamera1Procedure}"
  285. materialDesign:TextFieldAssist.HasClearButton="True"
  286. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  287. <ComboBox.ItemTemplate>
  288. <DataTemplate>
  289. <StackPanel Orientation="Horizontal">
  290. <materialDesign:PackIcon Kind="VideoOutline" />
  291. <TextBlock Text="{Binding CameraName}"
  292. Margin="6,0" />
  293. <materialDesign:PackIcon Kind="ProgressWrench" />
  294. <TextBlock Text="{Binding Name}"
  295. Margin="6,0" />
  296. </StackPanel>
  297. </DataTemplate>
  298. </ComboBox.ItemTemplate>
  299. </ComboBox>
  300. <!--固定向下相机2取料流程-->
  301. <TextBlock Grid.Row="4"
  302. Grid.Column="0"
  303. Text="固定向下相机2取料流程ID: " />
  304. <ComboBox Grid.Row="4"
  305. Grid.Column="1"
  306. ItemsSource="{Binding ProcedureModels}"
  307. SelectedItem="{Binding FixedDownCamera2Procedure}"
  308. materialDesign:TextFieldAssist.HasClearButton="True"
  309. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  310. <ComboBox.ItemTemplate>
  311. <DataTemplate>
  312. <StackPanel Orientation="Horizontal">
  313. <materialDesign:PackIcon Kind="VideoOutline" />
  314. <TextBlock Text="{Binding CameraName}"
  315. Margin="6,0" />
  316. <materialDesign:PackIcon Kind="ProgressWrench" />
  317. <TextBlock Text="{Binding Name}"
  318. Margin="6,0" />
  319. </StackPanel>
  320. </DataTemplate>
  321. </ComboBox.ItemTemplate>
  322. </ComboBox>
  323. <!--移动向下相机1锁付拍照流程-->
  324. <TextBlock Grid.Row="5"
  325. Grid.Column="0"
  326. Text="移动向下相机1锁付拍照流程ID: " />
  327. <ComboBox Grid.Row="5"
  328. Grid.Column="1"
  329. ItemsSource="{Binding ProcedureModels}"
  330. SelectedItem="{Binding MoveDownCamera1LockPhotoProcedure}"
  331. materialDesign:TextFieldAssist.HasClearButton="True"
  332. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  333. <ComboBox.ItemTemplate>
  334. <DataTemplate>
  335. <StackPanel Orientation="Horizontal">
  336. <materialDesign:PackIcon Kind="VideoOutline" />
  337. <TextBlock Text="{Binding CameraName}"
  338. Margin="6,0" />
  339. <materialDesign:PackIcon Kind="ProgressWrench" />
  340. <TextBlock Text="{Binding Name}"
  341. Margin="6,0" />
  342. </StackPanel>
  343. </DataTemplate>
  344. </ComboBox.ItemTemplate>
  345. </ComboBox>
  346. <!--移动向下相机2锁付拍照流程-->
  347. <TextBlock Grid.Row="6"
  348. Grid.Column="0"
  349. Text="移动向下相机2锁付拍照流程ID: " />
  350. <ComboBox Grid.Row="6"
  351. Grid.Column="1"
  352. ItemsSource="{Binding ProcedureModels}"
  353. SelectedItem="{Binding MoveDownCamera2LockPhotoProcedure}"
  354. materialDesign:TextFieldAssist.HasClearButton="True"
  355. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  356. <ComboBox.ItemTemplate>
  357. <DataTemplate>
  358. <StackPanel Orientation="Horizontal">
  359. <materialDesign:PackIcon Kind="VideoOutline" />
  360. <TextBlock Text="{Binding CameraName}"
  361. Margin="6,0" />
  362. <materialDesign:PackIcon Kind="ProgressWrench" />
  363. <TextBlock Text="{Binding Name}"
  364. Margin="6,0" />
  365. </StackPanel>
  366. </DataTemplate>
  367. </ComboBox.ItemTemplate>
  368. </ComboBox>
  369. <!--移动向下相机1取料拍照流程-->
  370. <TextBlock Grid.Row="7"
  371. Grid.Column="0"
  372. Text="移动向下相机1取料拍照流程ID: " />
  373. <ComboBox Grid.Row="7"
  374. Grid.Column="1"
  375. ItemsSource="{Binding ProcedureModels}"
  376. SelectedItem="{Binding MoveDownCamer1PickPhotoProcedureId}"
  377. materialDesign:TextFieldAssist.HasClearButton="True"
  378. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  379. <ComboBox.ItemTemplate>
  380. <DataTemplate>
  381. <StackPanel Orientation="Horizontal">
  382. <materialDesign:PackIcon Kind="VideoOutline" />
  383. <TextBlock Text="{Binding CameraName}"
  384. Margin="6,0" />
  385. <materialDesign:PackIcon Kind="ProgressWrench" />
  386. <TextBlock Text="{Binding Name}"
  387. Margin="6,0" />
  388. </StackPanel>
  389. </DataTemplate>
  390. </ComboBox.ItemTemplate>
  391. </ComboBox>
  392. <!--移动向下相机2取料拍照流程-->
  393. <TextBlock Grid.Row="8"
  394. Grid.Column="0"
  395. Text="移动向下相机2取料拍照流程ID: " />
  396. <ComboBox Grid.Row="8"
  397. Grid.Column="1"
  398. ItemsSource="{Binding ProcedureModels}"
  399. SelectedItem="{Binding MoveDownCamer2PickPhotoProcedureId}"
  400. materialDesign:TextFieldAssist.HasClearButton="True"
  401. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  402. <ComboBox.ItemTemplate>
  403. <DataTemplate>
  404. <StackPanel Orientation="Horizontal">
  405. <materialDesign:PackIcon Kind="VideoOutline" />
  406. <TextBlock Text="{Binding CameraName}"
  407. Margin="6,0" />
  408. <materialDesign:PackIcon Kind="ProgressWrench" />
  409. <TextBlock Text="{Binding Name}"
  410. Margin="6,0" />
  411. </StackPanel>
  412. </DataTemplate>
  413. </ComboBox.ItemTemplate>
  414. </ComboBox>
  415. <!--固定相机1检测拍照流程-->
  416. <TextBlock Grid.Row="9"
  417. Grid.Column="0"
  418. Text="固定机1检测拍照流程ID: " />
  419. <ComboBox Grid.Row="9"
  420. Grid.Column="1"
  421. ItemsSource="{Binding ProcedureModels}"
  422. SelectedItem="{Binding MoveDownCamer1CheckProcedureId}"
  423. materialDesign:TextFieldAssist.HasClearButton="True"
  424. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  425. <ComboBox.ItemTemplate>
  426. <DataTemplate>
  427. <StackPanel Orientation="Horizontal">
  428. <materialDesign:PackIcon Kind="VideoOutline" />
  429. <TextBlock Text="{Binding CameraName}"
  430. Margin="6,0" />
  431. <materialDesign:PackIcon Kind="ProgressWrench" />
  432. <TextBlock Text="{Binding Name}"
  433. Margin="6,0" />
  434. </StackPanel>
  435. </DataTemplate>
  436. </ComboBox.ItemTemplate>
  437. </ComboBox>
  438. <!--固定相机2检测拍照流程-->
  439. <TextBlock Grid.Row="10"
  440. Grid.Column="0"
  441. Text="固定机2检测拍照流程ID: " />
  442. <ComboBox Grid.Row="10"
  443. Grid.Column="1"
  444. ItemsSource="{Binding ProcedureModels}"
  445. SelectedItem="{Binding MoveDownCamer2CheckProcedureId}"
  446. materialDesign:TextFieldAssist.HasClearButton="True"
  447. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  448. <ComboBox.ItemTemplate>
  449. <DataTemplate>
  450. <StackPanel Orientation="Horizontal">
  451. <materialDesign:PackIcon Kind="VideoOutline" />
  452. <TextBlock Text="{Binding CameraName}"
  453. Margin="6,0" />
  454. <materialDesign:PackIcon Kind="ProgressWrench" />
  455. <TextBlock Text="{Binding Name}"
  456. Margin="6,0" />
  457. </StackPanel>
  458. </DataTemplate>
  459. </ComboBox.ItemTemplate>
  460. </ComboBox>
  461. </Grid>
  462. </Grid>
  463. </materialDesign:DrawerHost>
  464. <StackPanel Grid.Row="2"
  465. Orientation="Horizontal"
  466. HorizontalAlignment="Center"
  467. VerticalAlignment="Center"
  468. Margin="20">
  469. <Button Content="{lex:Loc 完成}"
  470. IsEnabled="{Binding IsAllowEdit}"
  471. MinWidth="100"
  472. HorizontalAlignment="Center"
  473. VerticalAlignment="Center"
  474. materialDesign:ButtonAssist.CornerRadius="10"
  475. Style="{StaticResource MaterialDesignRaisedButton}"
  476. Command="{Binding NextCommand}" />
  477. </StackPanel>
  478. </Grid>
  479. </UserControl>