终端一体化运控平台
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

1040 rindas
53 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.RecipeControlView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:con="clr-namespace:BPASmartClient.DosingSystem.Converter"
  6. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  11. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  12. d:DesignHeight="800"
  13. d:DesignWidth="1400"
  14. mc:Ignorable="d">
  15. <UserControl.DataContext>
  16. <vm:RecipeControlViewModel x:Name="bingSource" />
  17. </UserControl.DataContext>
  18. <UserControl.Resources>
  19. <con:RunStatusConvert x:Key="RunStatusConvert" />
  20. <con:EnbleConvert x:Key="EnbleConvert" />
  21. <con:IntToSourceConvert x:Key="IntToSourceConvert" />
  22. <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
  23. <Style.Resources>
  24. <!-- SelectedItem with focus -->
  25. <SolidColorBrush
  26. x:Key="{x:Static SystemColors.HighlightBrushKey}"
  27. Opacity=".4"
  28. Color="White" />
  29. <!-- SelectedItem without focus -->
  30. <SolidColorBrush
  31. x:Key="{x:Static SystemColors.ControlBrushKey}"
  32. Opacity=".4"
  33. Color="White" />
  34. </Style.Resources>
  35. <!-- 设置触发器 -->
  36. <Style.Triggers>
  37. <Trigger Property="IsMouseOver" Value="true">
  38. <Setter Property="Background" Value="White" />
  39. <Setter Property="Foreground" Value="White" />
  40. </Trigger>
  41. <Trigger Property="IsFocused" Value="true">
  42. <Setter Property="Background" Value="White" />
  43. <Setter Property="Foreground" Value="White" />
  44. </Trigger>
  45. </Style.Triggers>
  46. </Style>
  47. <Style x:Key="RadioState" TargetType="RadioButton">
  48. <Setter Property="Margin" Value="1" />
  49. <Setter Property="Background" Value="Transparent" />
  50. <Setter Property="Foreground" Value="#ddd" />
  51. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  52. <Setter Property="Margin" Value="2,5" />
  53. <Setter Property="FontSize" Value="16" />
  54. <Setter Property="FontFamily" Value="Consolas" />
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="RadioButton">
  58. <Border
  59. Name="radiobutton"
  60. Background="{TemplateBinding Background}"
  61. CornerRadius="5"
  62. Opacity="0.85">
  63. <Grid>
  64. <!--<Border
  65. x:Name="back_border"
  66. BorderBrush="Black"
  67. BorderThickness="0"
  68. CornerRadius="1">
  69. <Border.Effect>
  70. <BlurEffect KernelType="Gaussian" Radius="2" />
  71. </Border.Effect>
  72. </Border>
  73. <Border
  74. x:Name="fore_border"
  75. Margin="2"
  76. BorderBrush="White"
  77. BorderThickness="0"
  78. CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
  79. Opacity="0.7">
  80. <Border.Effect>
  81. <BlurEffect KernelType="Gaussian" Radius="2" />
  82. </Border.Effect>
  83. </Border>-->
  84. <ContentPresenter
  85. HorizontalAlignment="Center"
  86. VerticalAlignment="Center"
  87. Content="{TemplateBinding Content}"
  88. TextBlock.FontFamily="{TemplateBinding FontFamily}"
  89. TextBlock.FontSize="{TemplateBinding FontSize}"
  90. TextBlock.Foreground="{TemplateBinding Foreground}" />
  91. <Image
  92. Name="im"
  93. Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
  94. Stretch="Fill" />
  95. </Grid>
  96. </Border>
  97. <ControlTemplate.Triggers>
  98. <Trigger Property="IsChecked" Value="True">
  99. <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
  100. <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
  101. <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
  102. <Setter Property="Background" Value=" #4169E1" />-->
  103. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
  104. </Trigger>
  105. <Trigger Property="IsChecked" Value="False">
  106. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
  107. </Trigger>
  108. <Trigger Property="IsMouseOver" Value="True">
  109. <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
  110. <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
  111. <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
  112. <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
  113. </Trigger>
  114. </ControlTemplate.Triggers>
  115. </ControlTemplate>
  116. </Setter.Value>
  117. </Setter>
  118. </Style>
  119. <Style x:Key="materialMakingButton" TargetType="Button">
  120. <Setter Property="Background" Value="Transparent" />
  121. <Setter Property="FontSize" Value="16" />
  122. <Setter Property="Foreground" Value="#CD5555" />
  123. <Setter Property="BorderThickness" Value="0" />
  124. <Setter Property="HorizontalAlignment" Value="Left" />
  125. <Setter Property="Template">
  126. <Setter.Value>
  127. <ControlTemplate>
  128. <Border
  129. x:Name="brState"
  130. Padding="2"
  131. BorderBrush="White"
  132. BorderThickness="0">
  133. <TextBlock
  134. x:Name="txState"
  135. Margin="1"
  136. HorizontalAlignment="Center"
  137. VerticalAlignment="Center"
  138. Text="{Binding RecipeStatus, Converter={StaticResource RunStatusConvert}}" />
  139. </Border>
  140. <ControlTemplate.Triggers>
  141. <Trigger Property="IsEnabled" Value="True">
  142. <Setter TargetName="brState" Property="BorderThickness" Value="0" />
  143. <Setter TargetName="brState" Property="CornerRadius" Value="5" />
  144. <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
  145. <Setter TargetName="txState" Property="Foreground" Value="#CD5555" />
  146. </Trigger>
  147. <DataTrigger Binding="{Binding RecipeStatus}" Value="3">
  148. <Setter TargetName="brState" Property="Background" Value="#F0FFFF" />
  149. <Setter TargetName="txState" Property="Foreground" Value="#3CB371" />
  150. </DataTrigger>
  151. <DataTrigger Binding="{Binding RecipeStatus}" Value="2">
  152. <Setter TargetName="txState" Property="Foreground" Value="Aqua" />
  153. </DataTrigger>
  154. <MultiTrigger>
  155. <MultiTrigger.Conditions>
  156. <Condition Property="IsMouseOver" Value="True" />
  157. <Condition Property="IsEnabled" Value="True" />
  158. </MultiTrigger.Conditions>
  159. <Setter TargetName="txState" Property="FontSize" Value="17 " />
  160. </MultiTrigger>
  161. </ControlTemplate.Triggers>
  162. </ControlTemplate>
  163. </Setter.Value>
  164. </Setter>
  165. <Style.Triggers />
  166. </Style>
  167. <DataTemplate x:Key="TreeItemTemplate" DataType="TreeViewItem">
  168. <Grid Height="28" Margin="50,0,0,0">
  169. <Grid.ColumnDefinitions>
  170. <ColumnDefinition Width="*" />
  171. <ColumnDefinition Width="*" />
  172. </Grid.ColumnDefinitions>
  173. <TextBlock
  174. Margin="10,0"
  175. HorizontalAlignment="Left"
  176. VerticalAlignment="Center"
  177. FontSize="15"
  178. Foreground="#aa2AB2E7"
  179. Text="原料:" />
  180. <TextBlock
  181. Grid.Column="1"
  182. Margin="10,0"
  183. HorizontalAlignment="Left"
  184. VerticalAlignment="Center"
  185. FontSize="15"
  186. Foreground="#aa2AB2E7"
  187. Text="{Binding RawMaterialName}" />
  188. </Grid>
  189. </DataTemplate>
  190. <Style x:Key="recipeTreeItem" TargetType="TreeViewItem">
  191. <Setter Property="Background" Value="Transparent" />
  192. <Setter Property="BorderThickness" Value="0" />
  193. <Setter Property="IsExpanded" Value="True" />
  194. <Setter Property="HeaderTemplate">
  195. <Setter.Value>
  196. <HierarchicalDataTemplate ItemTemplate="{StaticResource TreeItemTemplate}" ItemsSource="{Binding RawMaterials, Mode=TwoWay}">
  197. <StackPanel
  198. Height="28"
  199. HorizontalAlignment="Left"
  200. VerticalAlignment="Center"
  201. Orientation="Horizontal">
  202. <TextBlock
  203. Margin="5,0,0,0"
  204. VerticalAlignment="Center"
  205. FontSize="15"
  206. Foreground="#FF2AB2E7"
  207. Text="配方:" />
  208. <TextBlock
  209. Margin="5,0,0,0"
  210. VerticalAlignment="Center"
  211. FontSize="15"
  212. Foreground="#FF2AB2E7"
  213. Text="{Binding RecipeName}" />
  214. </StackPanel>
  215. </HierarchicalDataTemplate>
  216. </Setter.Value>
  217. </Setter>
  218. <Setter Property="Template">
  219. <Setter.Value>
  220. <ControlTemplate TargetType="{x:Type TreeViewItem}">
  221. <Grid>
  222. <Grid.ColumnDefinitions>
  223. <ColumnDefinition Width="Auto" />
  224. <ColumnDefinition Width="*" />
  225. </Grid.ColumnDefinitions>
  226. <Grid.RowDefinitions>
  227. <RowDefinition Height="Auto" />
  228. <RowDefinition />
  229. </Grid.RowDefinitions>
  230. <Border
  231. x:Name="Bd"
  232. Grid.Column="0"
  233. Padding="{TemplateBinding Padding}"
  234. Background="{TemplateBinding Background}"
  235. BorderBrush="{TemplateBinding BorderBrush}"
  236. BorderThickness="{TemplateBinding BorderThickness}">
  237. <ContentPresenter
  238. x:Name="PART_Header"
  239. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  240. ContentSource="Header" />
  241. </Border>
  242. <ItemsPresenter
  243. x:Name="ItemsHost"
  244. Grid.Row="1"
  245. Grid.Column="0"
  246. Grid.ColumnSpan="2"
  247. Visibility="Collapsed" />
  248. <VisualStateManager.VisualStateGroups>
  249. <VisualStateGroup x:Name="SelectionStates">
  250. <VisualState x:Name="Selected">
  251. <Storyboard>
  252. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  253. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  254. </ColorAnimationUsingKeyFrames>
  255. </Storyboard>
  256. </VisualState>
  257. <VisualState x:Name="Unselected" />
  258. <VisualState x:Name="SelectedInactive">
  259. <Storyboard>
  260. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  261. <EasingColorKeyFrame KeyTime="0" Value="Transparent" />
  262. </ColorAnimationUsingKeyFrames>
  263. </Storyboard>
  264. </VisualState>
  265. </VisualStateGroup>
  266. <VisualStateGroup x:Name="ExpansionStates">
  267. <VisualState x:Name="Expanded">
  268. <Storyboard>
  269. <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Visibility)">
  270. <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
  271. </ObjectAnimationUsingKeyFrames>
  272. </Storyboard>
  273. </VisualState>
  274. <VisualState x:Name="Collapsed" />
  275. </VisualStateGroup>
  276. </VisualStateManager.VisualStateGroups>
  277. </Grid>
  278. <ControlTemplate.Triggers>
  279. <MultiTrigger>
  280. <MultiTrigger.Conditions>
  281. <Condition Property="HasHeader" Value="false" />
  282. <Condition Property="Width" Value="Auto" />
  283. </MultiTrigger.Conditions>
  284. <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
  285. </MultiTrigger>
  286. <MultiTrigger>
  287. <MultiTrigger.Conditions>
  288. <Condition Property="HasHeader" Value="false" />
  289. <Condition Property="Height" Value="Auto" />
  290. </MultiTrigger.Conditions>
  291. <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
  292. </MultiTrigger>
  293. </ControlTemplate.Triggers>
  294. </ControlTemplate>
  295. </Setter.Value>
  296. </Setter>
  297. </Style>
  298. </UserControl.Resources>
  299. <Grid Margin="20">
  300. <Grid.ColumnDefinitions>
  301. <ColumnDefinition />
  302. <ColumnDefinition Width="0.25*" />
  303. </Grid.ColumnDefinitions>
  304. <Grid Name="ggr" Margin="10">
  305. <pry:ImageBorder Width="{Binding ElementName=ggr, Path=ActualWidth}" Height="{Binding ElementName=ggr, Path=ActualHeight}" />
  306. <ListBox
  307. Margin="5"
  308. VerticalAlignment="Top"
  309. Background="Transparent"
  310. BorderThickness="0"
  311. ItemsSource="{Binding Recipes}"
  312. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  313. <ListBox.ItemsPanel>
  314. <ItemsPanelTemplate>
  315. <WrapPanel Orientation="Horizontal" />
  316. </ItemsPanelTemplate>
  317. </ListBox.ItemsPanel>
  318. <ListBox.ItemTemplate>
  319. <DataTemplate>
  320. <Grid
  321. Name="tt"
  322. Width="180"
  323. Height="300"
  324. Margin="5">
  325. <Grid.RowDefinitions>
  326. <RowDefinition Height="30" />
  327. <RowDefinition Height="20" />
  328. <RowDefinition Height="20" />
  329. <RowDefinition Height="108" />
  330. <RowDefinition Height="2" />
  331. <RowDefinition />
  332. </Grid.RowDefinitions>
  333. <Image
  334. Grid.RowSpan="5"
  335. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  336. Stretch="Fill" />
  337. <TextBlock
  338. Grid.Row="0"
  339. Margin="5,0,0,0"
  340. VerticalAlignment="Center"
  341. Foreground="#FF2AB2E7"
  342. Text="配方信息:" />
  343. <TextBlock
  344. Grid.Row="1"
  345. Margin="20,0,0,0"
  346. HorizontalAlignment="Left"
  347. VerticalAlignment="Center"
  348. FontSize="12"
  349. Foreground="#FF2AB2E7"
  350. Text="配方名称:" />
  351. <TextBlock
  352. Grid.Row="1"
  353. Margin="100,0,0,0"
  354. HorizontalAlignment="Left"
  355. VerticalAlignment="Center"
  356. FontSize="12"
  357. Foreground="#FF2AB2E7"
  358. Text="{Binding RecipeName}" />
  359. <TextBlock
  360. Grid.Row="2"
  361. Margin="20,0,0,0"
  362. HorizontalAlignment="Left"
  363. VerticalAlignment="Center"
  364. FontSize="12"
  365. Foreground="#FF2AB2E7"
  366. Text="配方总重:" />
  367. <TextBlock
  368. Grid.Row="2"
  369. Margin="100,0,0,0"
  370. HorizontalAlignment="Left"
  371. VerticalAlignment="Center"
  372. FontSize="12"
  373. Foreground="#FF2AB2E7"
  374. Text="{Binding All_RawMt_weight}" />
  375. <ScrollViewer
  376. Grid.Row="3"
  377. VerticalAlignment="Top"
  378. Background="Transparent"
  379. HorizontalScrollBarVisibility="Hidden"
  380. VerticalScrollBarVisibility="Hidden">
  381. <Grid>
  382. <Grid.ColumnDefinitions>
  383. <ColumnDefinition Width="auto" />
  384. <ColumnDefinition />
  385. </Grid.ColumnDefinitions>
  386. <ItemsControl ItemsSource="{Binding RawMaterials}">
  387. <ItemsControl.ItemTemplate>
  388. <DataTemplate>
  389. <Grid>
  390. <Grid.ColumnDefinitions>
  391. <ColumnDefinition />
  392. <ColumnDefinition />
  393. </Grid.ColumnDefinitions>
  394. <TextBlock
  395. Grid.Row="0"
  396. Margin="5,0,0,0"
  397. HorizontalAlignment="Right"
  398. VerticalAlignment="Center"
  399. Foreground="#aa2AB2E7"
  400. Text="{Binding RawMaterialName}" />
  401. <TextBlock
  402. Grid.Row="1"
  403. Margin="5,0,0,0"
  404. HorizontalAlignment="Right"
  405. VerticalAlignment="Center"
  406. Foreground="#aa2AB2E7"
  407. Text="{Binding RawMaterialWeight}" />
  408. </Grid>
  409. </DataTemplate>
  410. </ItemsControl.ItemTemplate>
  411. </ItemsControl>
  412. <!--<ItemsControl Grid.Column="1" ItemsSource="{Binding RawMaterials}">
  413. <ItemsControl.ItemTemplate>
  414. <DataTemplate>
  415. <StackPanel Orientation="Horizontal">
  416. <TextBlock
  417. Margin="5,0,0,0"
  418. HorizontalAlignment="Center"
  419. VerticalAlignment="Center"
  420. Foreground="#aa2AB2E7"
  421. Text=":" />
  422. <TextBlock
  423. Margin="5,0,0,0"
  424. HorizontalAlignment="Center"
  425. VerticalAlignment="Center"
  426. Foreground="#aa2AB2E7"
  427. Text="{Binding RawMaterialWeight}" />
  428. <TextBlock
  429. Margin="5,0,0,0"
  430. HorizontalAlignment="Center"
  431. VerticalAlignment="Center"
  432. Foreground="#aa2AB2E7"
  433. Text="g" />
  434. </StackPanel>
  435. </DataTemplate>
  436. </ItemsControl.ItemTemplate>
  437. </ItemsControl>-->
  438. </Grid>
  439. </ScrollViewer>
  440. <!--<Grid
  441. Grid.Row="3"
  442. Height="2"
  443. VerticalAlignment="Bottom">
  444. <Grid.Background>
  445. <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/直线.png" Stretch="Fill" />
  446. </Grid.Background>
  447. </Grid>-->
  448. <Image
  449. Grid.Row="4"
  450. Width="{Binding ElementName=tt, Path=ActualWidth}"
  451. Height="2"
  452. VerticalAlignment="Bottom"
  453. Source="/BPASmartClient.CustomResource;component/Image/直线.png"
  454. Stretch="Fill" />
  455. <Grid Grid.Row="5">
  456. <Grid.RowDefinitions>
  457. <RowDefinition />
  458. <RowDefinition />
  459. </Grid.RowDefinitions>
  460. <StackPanel
  461. HorizontalAlignment="Center"
  462. VerticalAlignment="Center"
  463. Orientation="Horizontal">
  464. <TextBlock
  465. HorizontalAlignment="Center"
  466. VerticalAlignment="Center"
  467. Foreground="#aa2AB2E7"
  468. Text="下发数量:" />
  469. <TextBox
  470. Width="80"
  471. Height="30"
  472. Margin="3,0,0,0"
  473. HorizontalAlignment="Center"
  474. VerticalAlignment="Center"
  475. FontSize="15"
  476. PreviewTextInput="TextBox_PreviewTextInput"
  477. Style="{StaticResource TextBoxStyle}"
  478. Text="{Binding DataContext.RecipeCount, RelativeSource={RelativeSource AncestorType={x:Type ListBox}, AncestorLevel=1}}"
  479. TextChanged="TextBox_TextChanged" />
  480. </StackPanel>
  481. <Grid
  482. Name="gr"
  483. Grid.Row="1"
  484. Height="30"
  485. Margin="0,0,0,10"
  486. VerticalAlignment="Bottom"
  487. Background="Transparent">
  488. <!--<Grid.ColumnDefinitions>
  489. <ColumnDefinition />
  490. <ColumnDefinition />
  491. </Grid.ColumnDefinitions>-->
  492. <!--<Image
  493. Height="2"
  494. Grid.ColumnSpan="2"
  495. Width="{Binding ElementName=gr, Path=ActualWidth}"
  496. VerticalAlignment="Top"
  497. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />-->
  498. <pry:IcoButton
  499. Width="{Binding ElementName=gr, Path=ActualWidth}"
  500. Height="{Binding ElementName=gr, Path=ActualHeight}"
  501. Margin="4,4,4,0"
  502. HorizontalAlignment="Center"
  503. VerticalAlignment="Center"
  504. Background="#222bd06f"
  505. BorderThickness="0"
  506. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  507. CommandParameter="{Binding RecipeName}"
  508. Content="配方下发"
  509. EnterBackground="#332bd06f"
  510. FontStyle="Normal"
  511. Foreground="#ff2bd06f"
  512. IcoText="&#xe6cf;"
  513. IsEnabled="True"
  514. Style="{StaticResource IcoButtonStyle}" />
  515. <!--<pry:IcoButton
  516. Width="{Binding ElementName=gr, Path=ActualWidth}"
  517. Height="{Binding ElementName=gr, Path=ActualHeight}"
  518. Margin="4,4,3,0"
  519. HorizontalAlignment="Center"
  520. VerticalAlignment="Center"
  521. Background="#11F53F62"
  522. BorderThickness="0"
  523. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  524. CommandParameter="{Binding RecipCode}"
  525. Content="删除"
  526. EnterBackground="#22F53F62"
  527. FontStyle="Normal"
  528. Foreground="#FFF53F62"
  529. IcoText="&#xe68e;"
  530. Style="{StaticResource IcoButtonStyle}" />
  531. <pry:IcoButton
  532. Grid.Column="1"
  533. Width="{Binding ElementName=gr, Path=ActualWidth}"
  534. Height="{Binding ElementName=gr, Path=ActualHeight}"
  535. Margin="3,4,4,0"
  536. HorizontalAlignment="Center"
  537. VerticalAlignment="Center"
  538. Background="#112AB2E7"
  539. BorderThickness="0"
  540. Command="{Binding DataContext.DetailsCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  541. CommandParameter="{Binding RecipCode}"
  542. Content="编辑"
  543. EnterBackground="#222AB2E7"
  544. Foreground="#FF2AB2E7"
  545. IcoText="&#xe636;"
  546. Style="{StaticResource IcoButtonStyle}" />-->
  547. </Grid>
  548. </Grid>
  549. <!--</StackPanel>-->
  550. </Grid>
  551. <!--<Grid Name="tt" Margin="5">
  552. <Grid.RowDefinitions>
  553. <RowDefinition Height="auto" />
  554. <RowDefinition Height="auto" />
  555. <RowDefinition />
  556. <RowDefinition />
  557. </Grid.RowDefinitions>
  558. <Image
  559. Grid.RowSpan="4"
  560. Source="/BPASmartClient.CustomResource;component/Image/配方背景/竖背景框.png"
  561. Stretch="Fill" />
  562. <TextBlock
  563. Grid.Row="0"
  564. Margin="2,5,0,0"
  565. HorizontalAlignment="Center"
  566. VerticalAlignment="Top"
  567. FontSize="18"
  568. Foreground="#FF2AB2E7"
  569. Text="{Binding RecipeName}" />
  570. <TextBlock
  571. Grid.Row="1"
  572. Margin="5,0,0,5"
  573. Foreground="#ffc000"
  574. Text="配方信息:" />
  575. <ScrollViewer
  576. Grid.Row="2"
  577. HorizontalScrollBarVisibility="Hidden"
  578. VerticalScrollBarVisibility="Hidden">
  579. <Grid>
  580. <Grid.ColumnDefinitions>
  581. <ColumnDefinition Width="auto" />
  582. <ColumnDefinition />
  583. </Grid.ColumnDefinitions>
  584. <ItemsControl ItemsSource="{Binding RawMaterials}">
  585. <ItemsControl.ItemTemplate>
  586. <DataTemplate>
  587. <Grid>
  588. <TextBlock
  589. Grid.Row="1"
  590. Margin="5,0,0,0"
  591. HorizontalAlignment="Right"
  592. VerticalAlignment="Center"
  593. Foreground="#aaffc000"
  594. Text="{Binding RawMaterialName}" />
  595. </Grid>
  596. </DataTemplate>
  597. </ItemsControl.ItemTemplate>
  598. </ItemsControl>
  599. <ItemsControl Grid.Column="1" ItemsSource="{Binding RawMaterials}">
  600. <ItemsControl.ItemTemplate>
  601. <DataTemplate>
  602. <StackPanel Orientation="Horizontal">
  603. <TextBlock
  604. Margin="5,0,0,0"
  605. HorizontalAlignment="Center"
  606. VerticalAlignment="Center"
  607. Foreground="#aaffc000"
  608. Text=":" />
  609. <TextBlock
  610. Margin="5,0,0,0"
  611. HorizontalAlignment="Center"
  612. VerticalAlignment="Center"
  613. Foreground="#aaffc000"
  614. Text="{Binding RawMaterialWeight}" />
  615. <TextBlock
  616. Margin="5,0,0,0"
  617. HorizontalAlignment="Center"
  618. VerticalAlignment="Center"
  619. Foreground="#aaffc000"
  620. Text="g" />
  621. </StackPanel>
  622. </DataTemplate>
  623. </ItemsControl.ItemTemplate>
  624. </ItemsControl>
  625. </Grid>
  626. </ScrollViewer>
  627. <Grid
  628. Name="grb"
  629. Grid.Row="3"
  630. Height="30"
  631. Margin="0,0,0,10"
  632. VerticalAlignment="Bottom"
  633. Background="Transparent">
  634. <Image
  635. Width="{Binding ElementName=grb, Path=ActualWidth}"
  636. VerticalAlignment="Top"
  637. StretchDirection="Both"
  638. Source="/BPASmartClient.CustomResource;component/Image/直线.png" />
  639. <pry:IcoButton
  640. Width="{Binding ElementName=grb, Path=ActualWidth}"
  641. Height="{Binding ElementName=grb, Path=ActualHeight}"
  642. Margin="4,4,4,0"
  643. HorizontalAlignment="Center"
  644. VerticalAlignment="Center"
  645. Background="#222bd06f"
  646. BorderThickness="0"
  647. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListBox, Mode=FindAncestor}}"
  648. CommandParameter="{Binding RecipeName}"
  649. Content="配方下发"
  650. EnterBackground="#332bd06f"
  651. FontStyle="Normal"
  652. Foreground="#ff2bd06f"
  653. IcoText="&#xe6cf;"
  654. IsEnabled="{Binding IsEnable}"
  655. Style="{StaticResource IcoButtonStyle}" />
  656. </Grid>
  657. </Grid>-->
  658. </DataTemplate>
  659. </ListBox.ItemTemplate>
  660. </ListBox>
  661. <Button
  662. Width="130"
  663. Height="40"
  664. HorizontalAlignment="Right"
  665. VerticalAlignment="Bottom"
  666. Command="{Binding Clear}"
  667. Content="清除信号"
  668. Foreground="Green"
  669. Style="{DynamicResource ControlButtonStyle}" />
  670. </Grid>
  671. <Grid
  672. Name="gr"
  673. Grid.Column="1"
  674. Margin="10">
  675. <Grid.RowDefinitions>
  676. <RowDefinition Height="50" />
  677. <RowDefinition />
  678. </Grid.RowDefinitions>
  679. <pry:ImageBorder
  680. Grid.RowSpan="2"
  681. Width="{Binding ElementName=gr, Path=ActualWidth}"
  682. Height="{Binding ElementName=gr, Path=ActualHeight}" />
  683. <Grid Margin="5">
  684. <Grid.ColumnDefinitions>
  685. <ColumnDefinition />
  686. <ColumnDefinition />
  687. <ColumnDefinition />
  688. </Grid.ColumnDefinitions>
  689. <RadioButton
  690. Click="RadioButtonWait_Click"
  691. Command="{Binding ChangeRecipeStateCommand}"
  692. Content="等待中"
  693. GroupName="state"
  694. IsChecked="True"
  695. Style="{DynamicResource RadioState}" />
  696. <RadioButton
  697. Grid.Column="1"
  698. Click="RadioButtonMaking_Click"
  699. Content="执行中"
  700. GroupName="state"
  701. Style="{DynamicResource RadioState}" />
  702. <RadioButton
  703. Grid.Column="2"
  704. Click="RadioButtonCompelete_Click"
  705. Content="已完成"
  706. GroupName="state"
  707. Style="{DynamicResource RadioState}" />
  708. </Grid>
  709. <!--#region 等待制作和制作完成列表显示-->
  710. <Grid
  711. Name="WaitOrCompleteGrid"
  712. Grid.Row="1"
  713. Margin="10"
  714. Visibility="Collapsed">
  715. <Grid.RowDefinitions>
  716. <RowDefinition Height="30" />
  717. <RowDefinition />
  718. <RowDefinition Height="50" />
  719. </Grid.RowDefinitions>
  720. <!--#region 表格标题栏设置-->
  721. <Grid
  722. Grid.Row="0"
  723. Margin="0,5"
  724. Background="#ff0C255F">
  725. <Grid.ColumnDefinitions>
  726. <ColumnDefinition Width="50" />
  727. <ColumnDefinition />
  728. <ColumnDefinition Width="70" />
  729. </Grid.ColumnDefinitions>
  730. <TextBlock
  731. Grid.Column="0"
  732. Style="{StaticResource TitleTextblockStyle}"
  733. Text="序号" />
  734. <Grid Grid.Column="1">
  735. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="配方名称" />
  736. <Border
  737. BorderBrush="{StaticResource bordColor}"
  738. BorderThickness="1,0,1,0"
  739. Cursor="SizeWE" />
  740. </Grid>
  741. <TextBlock
  742. Grid.Column="2"
  743. Style="{StaticResource TitleTextblockStyle}"
  744. Text="状态" />
  745. <Border
  746. Grid.ColumnSpan="10"
  747. BorderBrush="{StaticResource bordColor}"
  748. BorderThickness="1,0,1,0" />
  749. </Grid>
  750. <!--#endregion-->
  751. <ScrollViewer
  752. Grid.Row="1"
  753. HorizontalScrollBarVisibility="Hidden"
  754. VerticalScrollBarVisibility="Hidden">
  755. <ItemsControl Name="Wait" ItemsSource="{Binding UserTreeWait}">
  756. <ItemsControl.ItemTemplate>
  757. <DataTemplate>
  758. <Grid Height="30">
  759. <Grid.ColumnDefinitions>
  760. <ColumnDefinition Width="50" />
  761. <ColumnDefinition />
  762. <ColumnDefinition Width="100" />
  763. </Grid.ColumnDefinitions>
  764. <TextBlock
  765. HorizontalAlignment="Center"
  766. VerticalAlignment="Center"
  767. FontSize="16"
  768. Foreground="#FF2AB2E7"
  769. Text="{Binding SerialNum}" />
  770. <Grid Grid.Column="1">
  771. <TextBlock
  772. Grid.Column="1"
  773. Margin="5,0,0,0"
  774. HorizontalAlignment="Left"
  775. VerticalAlignment="Center"
  776. FontSize="16"
  777. Foreground="#FF2AB2E7"
  778. Text="{Binding RecipeName}" />
  779. <Border
  780. BorderBrush="{StaticResource bordColor}"
  781. BorderThickness="1,0,1,0"
  782. Cursor="SizeWE" />
  783. </Grid>
  784. <TextBlock
  785. Grid.Column="2"
  786. HorizontalAlignment="Center"
  787. VerticalAlignment="Center"
  788. FontSize="16"
  789. Foreground="{Binding RecipStatus, Converter={StaticResource RecipeStatusConvert}}"
  790. Text="{Binding RecipStatus}" />
  791. <Border
  792. Grid.ColumnSpan="10"
  793. BorderBrush="{StaticResource bordColor}"
  794. BorderThickness="1" />
  795. </Grid>
  796. </DataTemplate>
  797. </ItemsControl.ItemTemplate>
  798. </ItemsControl>
  799. </ScrollViewer>
  800. <StackPanel
  801. Grid.Row="2"
  802. HorizontalAlignment="Center"
  803. VerticalAlignment="Center"
  804. Orientation="Horizontal">
  805. <Button
  806. Width="130"
  807. Height="40"
  808. Command="{Binding Open}"
  809. Content="开始配料"
  810. Foreground="Green"
  811. Style="{DynamicResource ControlButtonStyle}" />
  812. <Button
  813. Width="130"
  814. Height="40"
  815. Margin="20,0,0,0"
  816. Command="{Binding Close}"
  817. Content="停止配料"
  818. Style="{DynamicResource ControlButtonStyle}" />
  819. </StackPanel>
  820. </Grid>
  821. <!--#endregion-->
  822. <!--#region 制作中设备状态监视-->
  823. <Grid
  824. Name="CookingGrid"
  825. Grid.Row="1"
  826. Margin="10"
  827. Panel.ZIndex="10"
  828. Visibility="Collapsed">
  829. <ScrollViewer VerticalScrollBarVisibility="Hidden">
  830. <ItemsControl ItemsSource="{Binding recipeProcesses}">
  831. <ItemsControl.ItemTemplate>
  832. <DataTemplate>
  833. <Grid>
  834. <Grid.RowDefinitions>
  835. <RowDefinition Height="30" />
  836. <RowDefinition Height="30" />
  837. <RowDefinition Height="auto" />
  838. <RowDefinition Height="40" />
  839. <RowDefinition Height="10" />
  840. </Grid.RowDefinitions>
  841. <Image
  842. Grid.RowSpan="5"
  843. Source="/BPASmartClient.CustomResource;component/Image/背景边框4.png"
  844. Stretch="Fill" />
  845. <TextBlock
  846. Grid.Row="0"
  847. Margin="0,5,0,0"
  848. HorizontalAlignment="Center"
  849. VerticalAlignment="Top"
  850. FontSize="18"
  851. Foreground="#FF2AB2E7"
  852. Text="{Binding RecipeName}" />
  853. <!--#region 表格标题栏设置-->
  854. <Grid
  855. Grid.Row="1"
  856. Height="30"
  857. Margin="5,0"
  858. VerticalAlignment="Top"
  859. Background="#ff0C255F">
  860. <Grid.ColumnDefinitions>
  861. <ColumnDefinition />
  862. <ColumnDefinition />
  863. </Grid.ColumnDefinitions>
  864. <TextBlock
  865. Grid.Column="0"
  866. Style="{StaticResource TitleTextblockStyle}"
  867. Text="原料" />
  868. <Grid Grid.Column="1">
  869. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="状态" />
  870. <Border
  871. BorderBrush="{StaticResource bordColor}"
  872. BorderThickness="1,0,1,0"
  873. Cursor="SizeWE" />
  874. </Grid>
  875. <Border
  876. Grid.ColumnSpan="10"
  877. BorderBrush="{StaticResource bordColor}"
  878. BorderThickness="1,0,1,0" />
  879. </Grid>
  880. <!--#endregion-->
  881. <ItemsControl
  882. Grid.Row="2"
  883. Margin="0,0,0,15"
  884. ItemsSource="{Binding RawMaterials}">
  885. <ItemsControl.ItemTemplate>
  886. <DataTemplate>
  887. <Grid Height="30">
  888. <Grid.ColumnDefinitions>
  889. <ColumnDefinition />
  890. <ColumnDefinition />
  891. </Grid.ColumnDefinitions>
  892. <StackPanel
  893. Margin="0,0,5,0"
  894. HorizontalAlignment="Right"
  895. Orientation="Horizontal">
  896. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="{Binding RawMaterialName}" />
  897. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text=":" />
  898. </StackPanel>
  899. <StackPanel
  900. Grid.Column="1"
  901. Margin="2,0,0,0"
  902. Orientation="Horizontal">
  903. <TextBlock
  904. Margin="0,0,5,0"
  905. Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}"
  906. Style="{StaticResource TitleTextblockStyle}"
  907. Text="{Binding Status}" />
  908. <TextBlock
  909. FontFamily="/BPASmartClient.CustomResource;component/Fonts/#iconfont"
  910. FontSize="20"
  911. Foreground="{Binding Status, Converter={StaticResource ForegroundConverter}}"
  912. Style="{StaticResource TitleTextblockStyle}"
  913. Text="{Binding Status, Converter={StaticResource StatusIconConverter}}" />
  914. </StackPanel>
  915. </Grid>
  916. </DataTemplate>
  917. </ItemsControl.ItemTemplate>
  918. </ItemsControl>
  919. </Grid>
  920. </DataTemplate>
  921. </ItemsControl.ItemTemplate>
  922. </ItemsControl>
  923. </ScrollViewer>
  924. </Grid>
  925. <!--#endregion-->
  926. </Grid>
  927. </Grid>
  928. </UserControl>