ProductParams.xaml 20 KB

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