ProductParams.xaml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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. </Grid.RowDefinitions>
  124. <Grid.ColumnDefinitions>
  125. <ColumnDefinition Width="auto" />
  126. <ColumnDefinition Width="auto" />
  127. </Grid.ColumnDefinitions>
  128. <Grid.Resources>
  129. <Style TargetType="TextBlock">
  130. <Setter Property="HorizontalAlignment"
  131. Value="Right" />
  132. <Setter Property="VerticalAlignment"
  133. Value="Center" />
  134. <Setter Property="FontSize"
  135. Value="10" />
  136. <Setter Property="FontWeight"
  137. Value="Bold" />
  138. <Setter Property="Margin"
  139. Value="5,2" />
  140. </Style>
  141. <Style TargetType="TextBox"
  142. BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}">
  143. <Setter Property="HorizontalAlignment"
  144. Value="Center" />
  145. <Setter Property="VerticalAlignment"
  146. Value="Center" />
  147. <Setter Property="FontSize"
  148. Value="10" />
  149. <Setter Property="Margin"
  150. Value="5,2" />
  151. <Setter Property="MinWidth"
  152. Value="100" />
  153. <Setter Property="HorizontalContentAlignment"
  154. Value="Center" />
  155. <Setter Property="VerticalContentAlignment"
  156. Value="Center" />
  157. </Style>
  158. </Grid.Resources>
  159. <ToggleButton Grid.Column="1"
  160. Grid.Row="0"
  161. HorizontalAlignment="Right"
  162. VerticalAlignment="Top"
  163. materialDesign:ToggleButtonAssist.OnContent="{materialDesign:PackIcon Kind=ChevronDoubleLeft}"
  164. Content="{materialDesign:PackIcon Kind=ChevronDoubleRight}"
  165. Style="{StaticResource MaterialDesignActionToggleButton}"
  166. ToolTip="{lex:Loc 其他参数}"
  167. Margin="0,-40"
  168. IsChecked="{Binding IsRightDrawerOpen,ElementName=DrawerHost}" />
  169. <!--PTP速度-->
  170. <TextBlock Grid.Row="0"
  171. Grid.Column="0"
  172. Text="{lex:Loc PTP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  173. <mah:NumericUpDown Grid.Row="0"
  174. Grid.Column="1"
  175. Margin="0,5"
  176. Maximum="100"
  177. Minimum="1"
  178. StringFormat="{}{0:N0} %"
  179. Value="{Binding SelectProduct.Speed,Mode=TwoWay}" />
  180. <!--PTP加减速度--><!--
  181. <TextBlock Grid.Row="1"
  182. Grid.Column="0"
  183. Text="{lex:Loc PTP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  184. <mah:NumericUpDown Grid.Row="1"
  185. Grid.Column="1"
  186. Margin="0,5"
  187. Maximum="100"
  188. Minimum="1"
  189. StringFormat="{}{0:N0} %"
  190. Value="{Binding SelectProduct.Accel,Mode=TwoWay}" />
  191. --><!--CP速度--><!--
  192. <TextBlock Grid.Row="2"
  193. Grid.Column="0"
  194. Text="{lex:Loc CP速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  195. <mah:NumericUpDown Grid.Row="2"
  196. Grid.Column="1"
  197. Margin="0,5"
  198. Maximum="3000"
  199. Minimum="1"
  200. StringFormat="{}{0:N0} mm/s"
  201. Value="{Binding SelectProduct.Speeds,Mode=TwoWay}" />
  202. --><!--CP加减速度--><!--
  203. <TextBlock Grid.Row="3"
  204. Grid.Column="0"
  205. Text="{lex:Loc CP加减速度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  206. <mah:NumericUpDown Grid.Row="3"
  207. Grid.Column="1"
  208. Margin="0,5"
  209. Maximum="30000"
  210. Minimum="1"
  211. StringFormat="{}{0:N0} mm/s²"
  212. Value="{Binding SelectProduct.Accels,Mode=TwoWay}" />
  213. --><!--功率--><!--
  214. <TextBlock Grid.Row="4"
  215. Grid.Column="0"
  216. Text="{lex:Loc 功率,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  217. <CheckBox Grid.Row="4"
  218. Grid.Column="1"
  219. Content="{lex:Loc 高功率}"
  220. IsChecked="{Binding SelectProduct.Power}" />
  221. --><!--二次相机功能--><!--
  222. <TextBlock Grid.Row="5"
  223. Grid.Column="0"
  224. Text="{lex:Loc 视觉引导模式,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}" />
  225. <CheckBox Grid.Row="5"
  226. Grid.Column="1"
  227. Content="{lex:Loc 启用二次定位相机}"
  228. IsChecked="{Binding SelectProduct.IsUserUpCamera}" />-->
  229. <!--固定向上相机1视觉流程-->
  230. <TextBlock Grid.Row="1"
  231. Grid.Column="0"
  232. Text="固定向上相机1视觉流程ID: " />
  233. <ComboBox Grid.Row="1"
  234. Grid.Column="1"
  235. ItemsSource="{Binding ProcedureModels}"
  236. SelectedItem="{Binding FixedUpCamera1Procedure}"
  237. materialDesign:TextFieldAssist.HasClearButton="True"
  238. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  239. <ComboBox.ItemTemplate>
  240. <DataTemplate>
  241. <StackPanel Orientation="Horizontal">
  242. <materialDesign:PackIcon Kind="VideoOutline" />
  243. <TextBlock Text="{Binding CameraName}"
  244. Margin="6,0" />
  245. <materialDesign:PackIcon Kind="ProgressWrench" />
  246. <TextBlock Text="{Binding Name}"
  247. Margin="6,0" />
  248. </StackPanel>
  249. </DataTemplate>
  250. </ComboBox.ItemTemplate>
  251. </ComboBox>
  252. <!--固定向上相机2视觉流程-->
  253. <TextBlock Grid.Row="2"
  254. Grid.Column="0"
  255. Text="固定向上相机2视觉流程ID: " />
  256. <ComboBox Grid.Row="2"
  257. Grid.Column="1"
  258. ItemsSource="{Binding ProcedureModels}"
  259. SelectedItem="{Binding FixedUpCamera2Procedure}"
  260. materialDesign:TextFieldAssist.HasClearButton="True"
  261. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  262. <ComboBox.ItemTemplate>
  263. <DataTemplate>
  264. <StackPanel Orientation="Horizontal">
  265. <materialDesign:PackIcon Kind="VideoOutline" />
  266. <TextBlock Text="{Binding CameraName}"
  267. Margin="6,0" />
  268. <materialDesign:PackIcon Kind="ProgressWrench" />
  269. <TextBlock Text="{Binding Name}"
  270. Margin="6,0" />
  271. </StackPanel>
  272. </DataTemplate>
  273. </ComboBox.ItemTemplate>
  274. </ComboBox>
  275. <!--固定向下相机1取料流程-->
  276. <TextBlock Grid.Row="3"
  277. Grid.Column="0"
  278. Text="固定向下相机1取料流程ID: " />
  279. <ComboBox Grid.Row="3"
  280. Grid.Column="1"
  281. ItemsSource="{Binding ProcedureModels}"
  282. SelectedItem="{Binding FixedDownCamera1Procedure}"
  283. materialDesign:TextFieldAssist.HasClearButton="True"
  284. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  285. <ComboBox.ItemTemplate>
  286. <DataTemplate>
  287. <StackPanel Orientation="Horizontal">
  288. <materialDesign:PackIcon Kind="VideoOutline" />
  289. <TextBlock Text="{Binding CameraName}"
  290. Margin="6,0" />
  291. <materialDesign:PackIcon Kind="ProgressWrench" />
  292. <TextBlock Text="{Binding Name}"
  293. Margin="6,0" />
  294. </StackPanel>
  295. </DataTemplate>
  296. </ComboBox.ItemTemplate>
  297. </ComboBox>
  298. <!--固定向下相机2取料流程-->
  299. <TextBlock Grid.Row="4"
  300. Grid.Column="0"
  301. Text="固定向下相机2取料流程ID: " />
  302. <ComboBox Grid.Row="4"
  303. Grid.Column="1"
  304. ItemsSource="{Binding ProcedureModels}"
  305. SelectedItem="{Binding FixedDownCamera2Procedure}"
  306. materialDesign:TextFieldAssist.HasClearButton="True"
  307. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  308. <ComboBox.ItemTemplate>
  309. <DataTemplate>
  310. <StackPanel Orientation="Horizontal">
  311. <materialDesign:PackIcon Kind="VideoOutline" />
  312. <TextBlock Text="{Binding CameraName}"
  313. Margin="6,0" />
  314. <materialDesign:PackIcon Kind="ProgressWrench" />
  315. <TextBlock Text="{Binding Name}"
  316. Margin="6,0" />
  317. </StackPanel>
  318. </DataTemplate>
  319. </ComboBox.ItemTemplate>
  320. </ComboBox>
  321. <!--移动向下相机1锁付拍照流程-->
  322. <TextBlock Grid.Row="5"
  323. Grid.Column="0"
  324. Text="移动向下相机1锁付拍照流程ID: " />
  325. <ComboBox Grid.Row="5"
  326. Grid.Column="1"
  327. ItemsSource="{Binding ProcedureModels}"
  328. SelectedItem="{Binding MoveDownCamera1LockPhotoProcedure}"
  329. materialDesign:TextFieldAssist.HasClearButton="True"
  330. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  331. <ComboBox.ItemTemplate>
  332. <DataTemplate>
  333. <StackPanel Orientation="Horizontal">
  334. <materialDesign:PackIcon Kind="VideoOutline" />
  335. <TextBlock Text="{Binding CameraName}"
  336. Margin="6,0" />
  337. <materialDesign:PackIcon Kind="ProgressWrench" />
  338. <TextBlock Text="{Binding Name}"
  339. Margin="6,0" />
  340. </StackPanel>
  341. </DataTemplate>
  342. </ComboBox.ItemTemplate>
  343. </ComboBox>
  344. <!--移动向下相机2锁付拍照流程-->
  345. <TextBlock Grid.Row="6"
  346. Grid.Column="0"
  347. Text="移动向下相机2锁付拍照流程ID: " />
  348. <ComboBox Grid.Row="6"
  349. Grid.Column="1"
  350. ItemsSource="{Binding ProcedureModels}"
  351. SelectedItem="{Binding MoveDownCamera2LockPhotoProcedure}"
  352. materialDesign:TextFieldAssist.HasClearButton="True"
  353. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  354. <ComboBox.ItemTemplate>
  355. <DataTemplate>
  356. <StackPanel Orientation="Horizontal">
  357. <materialDesign:PackIcon Kind="VideoOutline" />
  358. <TextBlock Text="{Binding CameraName}"
  359. Margin="6,0" />
  360. <materialDesign:PackIcon Kind="ProgressWrench" />
  361. <TextBlock Text="{Binding Name}"
  362. Margin="6,0" />
  363. </StackPanel>
  364. </DataTemplate>
  365. </ComboBox.ItemTemplate>
  366. </ComboBox>
  367. <!--移动向下相机1取料拍照流程-->
  368. <TextBlock Grid.Row="7"
  369. Grid.Column="0"
  370. Text="移动向下相机1取料拍照流程ID: " />
  371. <ComboBox Grid.Row="7"
  372. Grid.Column="1"
  373. ItemsSource="{Binding ProcedureModels}"
  374. SelectedItem="{Binding MoveDownCamer1PickPhotoProcedureId}"
  375. materialDesign:TextFieldAssist.HasClearButton="True"
  376. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  377. <ComboBox.ItemTemplate>
  378. <DataTemplate>
  379. <StackPanel Orientation="Horizontal">
  380. <materialDesign:PackIcon Kind="VideoOutline" />
  381. <TextBlock Text="{Binding CameraName}"
  382. Margin="6,0" />
  383. <materialDesign:PackIcon Kind="ProgressWrench" />
  384. <TextBlock Text="{Binding Name}"
  385. Margin="6,0" />
  386. </StackPanel>
  387. </DataTemplate>
  388. </ComboBox.ItemTemplate>
  389. </ComboBox>
  390. <!--移动向下相机2取料拍照流程-->
  391. <TextBlock Grid.Row="8"
  392. Grid.Column="0"
  393. Text="移动向下相机2取料拍照流程ID: " />
  394. <ComboBox Grid.Row="8"
  395. Grid.Column="1"
  396. ItemsSource="{Binding ProcedureModels}"
  397. SelectedItem="{Binding MoveDownCamer2PickPhotoProcedureId}"
  398. materialDesign:TextFieldAssist.HasClearButton="True"
  399. materialDesign:HintAssist.Hint="{lex:Loc 选择需要配置的流程}">
  400. <ComboBox.ItemTemplate>
  401. <DataTemplate>
  402. <StackPanel Orientation="Horizontal">
  403. <materialDesign:PackIcon Kind="VideoOutline" />
  404. <TextBlock Text="{Binding CameraName}"
  405. Margin="6,0" />
  406. <materialDesign:PackIcon Kind="ProgressWrench" />
  407. <TextBlock Text="{Binding Name}"
  408. Margin="6,0" />
  409. </StackPanel>
  410. </DataTemplate>
  411. </ComboBox.ItemTemplate>
  412. </ComboBox>
  413. </Grid>
  414. </Grid>
  415. </materialDesign:DrawerHost>
  416. <StackPanel Grid.Row="2"
  417. Orientation="Horizontal"
  418. HorizontalAlignment="Center"
  419. VerticalAlignment="Center"
  420. Margin="20">
  421. <Button Content="{lex:Loc 完成}"
  422. IsEnabled="{Binding IsAllowEdit}"
  423. MinWidth="100"
  424. HorizontalAlignment="Center"
  425. VerticalAlignment="Center"
  426. materialDesign:ButtonAssist.CornerRadius="10"
  427. Style="{StaticResource MaterialDesignRaisedButton}"
  428. Command="{Binding NextCommand}" />
  429. </StackPanel>
  430. </Grid>
  431. </UserControl>