终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

315 lines
15 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="450"
  13. d:DesignWidth="800"
  14. mc:Ignorable="d">
  15. <UserControl.DataContext>
  16. <vm:RecipeControlViewModel />
  17. </UserControl.DataContext>
  18. <UserControl.Resources>
  19. <con:RunStatusConvert x:Key="RunStatusConvert" />
  20. <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
  21. <Style.Resources>
  22. <!-- SelectedItem with focus -->
  23. <SolidColorBrush
  24. x:Key="{x:Static SystemColors.HighlightBrushKey}"
  25. Opacity=".4"
  26. Color="White" />
  27. <!-- SelectedItem without focus -->
  28. <SolidColorBrush
  29. x:Key="{x:Static SystemColors.ControlBrushKey}"
  30. Opacity=".4"
  31. Color="White" />
  32. </Style.Resources>
  33. <!-- 设置触发器 -->
  34. <Style.Triggers>
  35. <Trigger Property="IsMouseOver" Value="true">
  36. <Setter Property="Background" Value="White" />
  37. <Setter Property="Foreground" Value="White" />
  38. </Trigger>
  39. <Trigger Property="IsFocused" Value="true">
  40. <Setter Property="Background" Value="White" />
  41. <Setter Property="Foreground" Value="White" />
  42. </Trigger>
  43. </Style.Triggers>
  44. </Style>
  45. </UserControl.Resources>
  46. <Grid Margin="20">
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition />
  49. <ColumnDefinition Width="0.2*" />
  50. </Grid.ColumnDefinitions>
  51. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  52. <ListView
  53. Margin="5"
  54. VerticalAlignment="Top"
  55. Background="Transparent"
  56. BorderThickness="0"
  57. ItemsSource="{Binding Recipes}"
  58. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  59. <ListView.ItemsPanel>
  60. <ItemsPanelTemplate>
  61. <UniformGrid
  62. HorizontalAlignment="Left"
  63. VerticalAlignment="Top"
  64. Columns="8" />
  65. </ItemsPanelTemplate>
  66. </ListView.ItemsPanel>
  67. <ListView.ItemTemplate>
  68. <DataTemplate>
  69. <Border Margin="5" Background="LightSkyBlue">
  70. <Grid>
  71. <Grid.RowDefinitions>
  72. <RowDefinition />
  73. <RowDefinition Height="0.25*" />
  74. <RowDefinition Height="0.2*" />
  75. </Grid.RowDefinitions>
  76. <Image Source="/BPASmartClient.CustomResource;component/Image/AGV/炒锅.png" />
  77. <TextBlock
  78. Grid.Row="1"
  79. Margin="2,0,0,0"
  80. HorizontalAlignment="Center"
  81. VerticalAlignment="Center"
  82. Foreground="#dd000000"
  83. Text="{Binding RecipeName}" />
  84. <Grid
  85. Name="gr"
  86. Grid.Row="2"
  87. Height="30"
  88. Background="#00BEFA">
  89. <pry:IcoButton
  90. Width="{Binding ElementName=gr, Path=ActualWidth}"
  91. Height="{Binding ElementName=gr, Path=ActualHeight}"
  92. HorizontalAlignment="Center"
  93. VerticalAlignment="Center"
  94. BorderThickness="0"
  95. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
  96. CommandParameter="{Binding RecipeName}"
  97. Content="订单下发"
  98. EnterBackground="Red"
  99. FontStyle="Normal"
  100. Foreground="#dd000000"
  101. IcoText="&#xe6cf;"
  102. IsEnabled="{Binding IsEnable}"
  103. Style="{StaticResource IcoButtonStyle}" />
  104. </Grid>
  105. </Grid>
  106. </Border>
  107. </DataTemplate>
  108. </ListView.ItemTemplate>
  109. </ListView>
  110. <!--<ItemsControl ItemsSource="{Binding Recipes}">
  111. <ItemsControl.ItemTemplate>
  112. <DataTemplate>
  113. <Grid
  114. Height="150"
  115. Margin="0,0,0,50"
  116. VerticalAlignment="Top">
  117. <Border
  118. Name="ShadowElement"
  119. Height="150"
  120. VerticalAlignment="Top"
  121. BorderBrush="#00BEFA"
  122. BorderThickness="2"
  123. ClipToBounds="True"
  124. CornerRadius="8">
  125. <Border.Effect>
  126. <DropShadowEffect
  127. BlurRadius="18"
  128. ShadowDepth="0"
  129. Color="#00BEFA" />
  130. </Border.Effect>
  131. </Border>
  132. <Grid>
  133. <Grid.ColumnDefinitions>
  134. <ColumnDefinition Width="200" />
  135. <ColumnDefinition />
  136. <ColumnDefinition Width="100" />
  137. </Grid.ColumnDefinitions>
  138. <Grid Margin="20,0,0,0">
  139. <Grid.RowDefinitions>
  140. <RowDefinition />
  141. <RowDefinition />
  142. </Grid.RowDefinitions>
  143. <TextBlock
  144. FontSize="40"
  145. Foreground="White"
  146. Text="{Binding RecipeName}" />
  147. <Button
  148. Grid.Row="1"
  149. Width="80"
  150. Height="30"
  151. HorizontalAlignment="Left"
  152. Background="#00BEFA"
  153. Command="{Binding DataContext.StartCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  154. CommandParameter="{Binding RecipeName}"
  155. Content="配方下发"
  156. IsEnabled="{Binding IsEnable}" />
  157. </Grid>
  158. <ListView
  159. Grid.Column="1"
  160. Margin="10"
  161. Background="Transparent"
  162. BorderBrush="#00BEFA"
  163. BorderThickness="2,0,2,0"
  164. ItemsSource="{Binding RawMaterials}"
  165. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  166. <ListView.ItemsPanel>
  167. <ItemsPanelTemplate>
  168. <UniformGrid
  169. HorizontalAlignment="Left"
  170. VerticalAlignment="Top"
  171. Columns="4" />
  172. </ItemsPanelTemplate>
  173. </ListView.ItemsPanel>
  174. <ListView.ItemTemplate>
  175. <DataTemplate>
  176. <StackPanel
  177. Grid.Column="1"
  178. Height="20"
  179. Margin="20,0,0,0"
  180. VerticalAlignment="Top"
  181. Orientation="Horizontal">
  182. <Ellipse
  183. Width="{Binding ElementName=n, Path=ActualHeight}"
  184. Margin="0,0,5,0"
  185. Fill="{Binding RecipeStatus, Converter={StaticResource StatusConverter}}" />
  186. <TextBlock
  187. Name="n"
  188. FontSize="16"
  189. Foreground="White"
  190. Text="{Binding RawMaterialName}" />
  191. </StackPanel>
  192. </DataTemplate>
  193. </ListView.ItemTemplate>
  194. </ListView>
  195. <StackPanel
  196. Grid.Column="2"
  197. Margin="5,0"
  198. VerticalAlignment="Center">
  199. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  200. <Ellipse
  201. Width="{Binding ElementName=tb, Path=ActualHeight}"
  202. Margin="0,0,5,0"
  203. Fill="Green" />
  204. <TextBlock
  205. Name="tb"
  206. Foreground="#ddd"
  207. Text="准备就绪" />
  208. </StackPanel>
  209. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  210. <Ellipse
  211. Width="{Binding ElementName=tb, Path=ActualHeight}"
  212. Margin="0,0,5,0"
  213. Fill="Yellow" />
  214. <TextBlock
  215. Name="tb1"
  216. Foreground="#ddd"
  217. Text="等待接料" />
  218. </StackPanel>
  219. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  220. <Ellipse
  221. Width="{Binding ElementName=tb, Path=ActualHeight}"
  222. Margin="0,0,5,0"
  223. Fill="Aqua" />
  224. <TextBlock
  225. Name="tb2"
  226. Foreground="#ddd"
  227. Text="接料完成" />
  228. </StackPanel>
  229. <StackPanel Margin="0,0,0,5" Orientation="Horizontal">
  230. <Ellipse
  231. Width="{Binding ElementName=tb, Path=ActualHeight}"
  232. Margin="0,0,5,0"
  233. Fill="Red" />
  234. <TextBlock
  235. Name="tb3"
  236. Foreground="#ddd"
  237. Text="设备异常" />
  238. </StackPanel>
  239. </StackPanel>
  240. </Grid>
  241. </Grid>
  242. </DataTemplate>
  243. </ItemsControl.ItemTemplate>
  244. </ItemsControl>-->
  245. </ScrollViewer>
  246. <Grid Grid.Column="1">
  247. <Grid.RowDefinitions>
  248. <RowDefinition Height="30" />
  249. <RowDefinition />
  250. </Grid.RowDefinitions>
  251. <TextBlock
  252. FontSize="16"
  253. Foreground="Aqua"
  254. Text="{Binding RecipeName}" />
  255. <ItemsControl Grid.Row="1" ItemsSource="{Binding recipeProcesses}">
  256. <ItemsControl.ItemTemplate>
  257. <DataTemplate>
  258. <Grid>
  259. <Grid.RowDefinitions>
  260. <RowDefinition />
  261. <RowDefinition />
  262. </Grid.RowDefinitions>
  263. <Grid.ColumnDefinitions>
  264. <ColumnDefinition />
  265. <ColumnDefinition />
  266. </Grid.ColumnDefinitions>
  267. <TextBlock
  268. Margin="0,0,5,0"
  269. HorizontalAlignment="Right"
  270. FontSize="16"
  271. Foreground="Aqua"
  272. Text="{Binding RawMaterialName}" />
  273. <TextBlock
  274. Grid.Column="1"
  275. HorizontalAlignment="Left"
  276. FontSize="16"
  277. Foreground="Aqua"
  278. Text="{Binding RawMaterialStatus, Converter={StaticResource RunStatusConvert}}" />
  279. </Grid>
  280. </DataTemplate>
  281. </ItemsControl.ItemTemplate>
  282. </ItemsControl>
  283. </Grid>
  284. </Grid>
  285. </UserControl>