终端一体化运控平台
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

370 行
17 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.DeviceMaterialParView"
  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:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  10. d:DesignHeight="1080"
  11. d:DesignWidth="1920"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:DeviceMaterialParViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <SolidColorBrush x:Key="tabColor" Color="#FF2AB2E7" />
  18. <!--<SolidColorBrush x:Key="bordColor" Color="#33ffffff" />-->
  19. <SolidColorBrush x:Key="bordColor" Color="#332AB2E7" />
  20. <con:DataTableRedundantConverter x:Key="tabConvert" />
  21. <Style x:Key="RowRadioButtonStyle" TargetType="{x:Type RadioButton}">
  22. <Setter Property="Template">
  23. <Setter.Value>
  24. <ControlTemplate TargetType="{x:Type RadioButton}">
  25. <Border
  26. x:Name="NvaBor"
  27. Background="Transparent"
  28. BorderBrush="#FF2AB2E7"
  29. BorderThickness="0">
  30. <ContentControl
  31. Margin="10,4"
  32. HorizontalAlignment="Center"
  33. VerticalAlignment="Center"
  34. HorizontalContentAlignment="Center"
  35. VerticalContentAlignment="Center"
  36. Content="{TemplateBinding Content}"
  37. FontSize="16" />
  38. </Border>
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="IsChecked" Value="True">
  41. <Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
  42. <Setter TargetName="NvaBor" Property="BorderThickness" Value="0" />
  43. </Trigger>
  44. <MultiTrigger>
  45. <MultiTrigger.Conditions>
  46. <Condition Property="IsChecked" Value="false" />
  47. <Condition Property="IsMouseOver" Value="True" />
  48. </MultiTrigger.Conditions>
  49. <MultiTrigger.Setters>
  50. <Setter TargetName="NvaBor" Property="Background" Value="#22ffffff" />
  51. </MultiTrigger.Setters>
  52. </MultiTrigger>
  53. </ControlTemplate.Triggers>
  54. </ControlTemplate>
  55. </Setter.Value>
  56. </Setter>
  57. </Style>
  58. <Style x:Key="InputTextboxStyle" TargetType="TextBox">
  59. <Setter Property="Margin" Value="5,0,0,0" />
  60. <Setter Property="BorderThickness" Value="0" />
  61. <Setter Property="HorizontalContentAlignment" Value="Left" />
  62. <Setter Property="Height" Value="40" />
  63. <Setter Property="CaretBrush" Value="{StaticResource TitleBorderColor}" />
  64. <Setter Property="Foreground" Value="{StaticResource TitleBorderColor}" />
  65. <Setter Property="VerticalContentAlignment" Value="Center" />
  66. <Setter Property="FontSize" Value="14" />
  67. <Setter Property="Background" Value="Transparent" />
  68. <Setter Property="VerticalAlignment" Value="Center" />
  69. </Style>
  70. <Style x:Key="ControlButtonStyle" TargetType="Button">
  71. <Setter Property="Margin" Value="0" />
  72. <Setter Property="FontSize" Value="18" />
  73. <Setter Property="Foreground" Value="#FFF53F62" />
  74. <Setter Property="FontWeight" Value="SemiBold" />
  75. <Setter Property="FontFamily" Value="楷体" />
  76. <Setter Property="VerticalContentAlignment" Value="Center" />
  77. <Setter Property="Template">
  78. <Setter.Value>
  79. <ControlTemplate TargetType="Button">
  80. <Border
  81. Name="TitleBarBr"
  82. BorderBrush="#00c2f4"
  83. BorderThickness="0"
  84. CornerRadius="0"
  85. Opacity="0.8">
  86. <ContentPresenter
  87. Margin="{TemplateBinding Margin}"
  88. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  89. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  90. <Border.Background>
  91. <ImageBrush
  92. ImageSource="/BPASmartClient.CustomResource;component/Image/组合边框1.1.png"
  93. Opacity="0.8"
  94. Stretch="Fill" />
  95. </Border.Background>
  96. </Border>
  97. <ControlTemplate.Triggers>
  98. <Trigger Property="IsMouseOver" Value="true">
  99. <Setter TargetName="TitleBarBr" Property="Opacity" Value="1" />
  100. </Trigger>
  101. </ControlTemplate.Triggers>
  102. </ControlTemplate>
  103. </Setter.Value>
  104. </Setter>
  105. </Style>
  106. <Style x:Key="TitleTextblockStyle" TargetType="TextBlock">
  107. <Setter Property="FontSize" Value="16" />
  108. <Setter Property="HorizontalAlignment" Value="Center" />
  109. <Setter Property="VerticalAlignment" Value="Center" />
  110. <Setter Property="Foreground" Value="{StaticResource tabColor}" />
  111. <Setter Property="FontFamily" Value="楷体" />
  112. <Setter Property="FontWeight" Value="SemiBold" />
  113. </Style>
  114. </UserControl.Resources>
  115. <Grid Margin="10">
  116. <Grid.RowDefinitions>
  117. <RowDefinition Height="40" />
  118. <RowDefinition Height="40" />
  119. <RowDefinition />
  120. </Grid.RowDefinitions>
  121. <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
  122. <Button
  123. Width="150"
  124. Height="40"
  125. Margin="10,0,10,0"
  126. Command="{Binding AddCommand}"
  127. Content="添加原料参数"
  128. FontSize="20"
  129. Style="{StaticResource ImageButtonStyle}" />
  130. <Button
  131. Width="150"
  132. Height="40"
  133. Margin="10,0,10,0"
  134. Command="{Binding SaveCommand}"
  135. Content="保存参数"
  136. FontSize="20"
  137. Style="{StaticResource ImageButtonStyle}" />
  138. </StackPanel>
  139. <!--#region 表格标题栏设置-->
  140. <Grid
  141. Grid.Row="1"
  142. Margin="0,10,0,0"
  143. Background="#ff0C255F">
  144. <Grid.ColumnDefinitions>
  145. <ColumnDefinition />
  146. <ColumnDefinition />
  147. <ColumnDefinition />
  148. <ColumnDefinition />
  149. <ColumnDefinition />
  150. <ColumnDefinition />
  151. <ColumnDefinition />
  152. <ColumnDefinition />
  153. <ColumnDefinition />
  154. <ColumnDefinition />
  155. </Grid.ColumnDefinitions>
  156. <TextBlock
  157. Grid.Column="0"
  158. Style="{StaticResource TitleTextblockStyle}"
  159. Text="原料名称" />
  160. <Grid Grid.Column="1">
  161. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="慢加重量(g)" />
  162. <Border
  163. BorderBrush="{StaticResource bordColor}"
  164. BorderThickness="1,0,1,0"
  165. Cursor="SizeWE" />
  166. </Grid>
  167. <TextBlock
  168. Grid.Column="2"
  169. Style="{StaticResource TitleTextblockStyle}"
  170. Text="提前关阀重量" />
  171. <Grid Grid.Column="3">
  172. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="快加速度" />
  173. <Border
  174. BorderBrush="{StaticResource bordColor}"
  175. BorderThickness="1,0,1,0"
  176. Cursor="SizeWE" />
  177. </Grid>
  178. <TextBlock
  179. Grid.Column="4"
  180. Style="{StaticResource TitleTextblockStyle}"
  181. Text="慢加速度" />
  182. <Grid Grid.Column="5">
  183. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="伺服手动速度" />
  184. <Border
  185. BorderBrush="{StaticResource bordColor}"
  186. BorderThickness="1,0,1,0"
  187. Cursor="SizeWE" />
  188. </Grid>
  189. <TextBlock
  190. Grid.Column="6"
  191. Style="{StaticResource TitleTextblockStyle}"
  192. Text="料仓上限重量" />
  193. <Grid Grid.Column="7">
  194. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="料仓下限重量" />
  195. <Border
  196. BorderBrush="{StaticResource bordColor}"
  197. BorderThickness="1,0,1,0"
  198. Cursor="SizeWE" />
  199. </Grid>
  200. <TextBlock
  201. Grid.Column="8"
  202. Style="{StaticResource TitleTextblockStyle}"
  203. Text="搅拌速度" />
  204. <Grid Grid.Column="9">
  205. <TextBlock Style="{StaticResource TitleTextblockStyle}" Text="功能操作" />
  206. <Border
  207. BorderBrush="{StaticResource bordColor}"
  208. BorderThickness="1,0,1,0"
  209. Cursor="SizeWE" />
  210. </Grid>
  211. <Border
  212. Grid.ColumnSpan="10"
  213. BorderBrush="{StaticResource bordColor}"
  214. BorderThickness="1,0,1,0" />
  215. </Grid>
  216. <!--#endregion-->
  217. <Grid Grid.Row="2">
  218. <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  219. <ItemsControl ItemsSource="{Binding deviceParModels}">
  220. <ItemsControl.ItemTemplate>
  221. <DataTemplate>
  222. <Grid Name="gr" Height="30">
  223. <Grid.ColumnDefinitions>
  224. <ColumnDefinition />
  225. <ColumnDefinition />
  226. <ColumnDefinition />
  227. <ColumnDefinition />
  228. <ColumnDefinition />
  229. <ColumnDefinition />
  230. <ColumnDefinition />
  231. <ColumnDefinition />
  232. <ColumnDefinition />
  233. <ColumnDefinition />
  234. </Grid.ColumnDefinitions>
  235. <TextBox
  236. Grid.Column="0"
  237. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  238. Style="{StaticResource InputTextboxStyle}"
  239. Text="{Binding MaterialName}" />
  240. <Grid Grid.Column="1">
  241. <TextBox
  242. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  243. Style="{StaticResource InputTextboxStyle}"
  244. Text="{Binding SlowlyAddWeight}" />
  245. <Border
  246. BorderBrush="{StaticResource bordColor}"
  247. BorderThickness="1,0,1,0"
  248. Cursor="SizeWE" />
  249. </Grid>
  250. <TextBox
  251. Grid.Column="2"
  252. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  253. Style="{StaticResource InputTextboxStyle}"
  254. Text="{Binding PreCloseValveWeight}" />
  255. <Grid Grid.Column="3">
  256. <TextBox
  257. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  258. Style="{StaticResource InputTextboxStyle}"
  259. Text="{Binding RapidAcceleration}" />
  260. <Border
  261. BorderBrush="{StaticResource bordColor}"
  262. BorderThickness="1,0,1,0"
  263. Cursor="SizeWE" />
  264. </Grid>
  265. <TextBox
  266. Grid.Column="4"
  267. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  268. Style="{StaticResource InputTextboxStyle}"
  269. Text="{Binding SlowAcceleration}" />
  270. <Grid Grid.Column="5">
  271. <TextBox
  272. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  273. Style="{StaticResource InputTextboxStyle}"
  274. Text="{Binding ServoManualSpeed}" />
  275. <Border
  276. BorderBrush="{StaticResource bordColor}"
  277. BorderThickness="1,0,1,0"
  278. Cursor="SizeWE" />
  279. </Grid>
  280. <TextBox
  281. Grid.Column="6"
  282. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  283. Style="{StaticResource InputTextboxStyle}"
  284. Text="{Binding SiloUpperLimitWeight}" />
  285. <Grid Grid.Column="7">
  286. <TextBox
  287. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  288. Style="{StaticResource InputTextboxStyle}"
  289. Text="{Binding LowerLimitWeightOfSilo}" />
  290. <Border
  291. BorderBrush="{StaticResource bordColor}"
  292. BorderThickness="1,0,1,0"
  293. Cursor="SizeWE" />
  294. </Grid>
  295. <TextBox
  296. Grid.Column="8"
  297. Foreground="{Binding IsRedundant, Converter={StaticResource tabConvert}}"
  298. Style="{StaticResource InputTextboxStyle}"
  299. Text="{Binding StirringSpeed}" />
  300. <Grid Grid.Column="9">
  301. <Button
  302. Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  303. CommandParameter="{Binding MaterialName}"
  304. Content="删除"
  305. FontSize="16"
  306. Style="{StaticResource ControlButtonStyle}" />
  307. <Border
  308. BorderBrush="{StaticResource bordColor}"
  309. BorderThickness="1,0,1,0"
  310. Cursor="SizeWE" />
  311. </Grid>
  312. <Border
  313. Grid.ColumnSpan="10"
  314. BorderBrush="{StaticResource bordColor}"
  315. BorderThickness="1,0,1,1" />
  316. </Grid>
  317. <DataTemplate.Triggers>
  318. <Trigger Property="IsMouseOver" Value="true">
  319. <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
  320. </Trigger>
  321. </DataTemplate.Triggers>
  322. </DataTemplate>
  323. </ItemsControl.ItemTemplate>
  324. </ItemsControl>
  325. </ScrollViewer>
  326. </Grid>
  327. </Grid>
  328. </UserControl>