终端一体化运控平台
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.
 
 
 

301 rinda
20 KiB

  1. <UserControl x:Class="BPASmartClient.DosingSystem.View.SendCtrlView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  7. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  8. xmlns:cv ="clr-namespace:BPASmartClient.DosingSystem.Converter"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.DataContext>
  12. <vm:SendCtrlViewModel/>
  13. </UserControl.DataContext>
  14. <UserControl.Resources>
  15. <cv:RunStateConvert x:Key="runStateConvert"/>
  16. <cv:AutoConvert x:Key="autoConvert"/>
  17. <cv:VisibleConvert x:Key="visibleConvert"/>
  18. <Style x:Key="CheckState" TargetType="CheckBox">
  19. <Setter Property="Margin" Value="1" />
  20. <Setter Property="Background" Value="Transparent" />
  21. <Setter Property="Foreground" Value="#ddd" />
  22. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  23. <Setter Property="Margin" Value="2,5" />
  24. <Setter Property="FontSize" Value="16" />
  25. <Setter Property="FontFamily" Value="Consolas" />
  26. <Setter Property="Template">
  27. <Setter.Value>
  28. <ControlTemplate TargetType="CheckBox">
  29. <Border
  30. Name="radiobutton"
  31. Background="{TemplateBinding Background}"
  32. CornerRadius="5"
  33. Opacity="0.85">
  34. <Grid>
  35. <!--<Border
  36. x:Name="back_border"
  37. BorderBrush="Black"
  38. BorderThickness="0"
  39. CornerRadius="1">
  40. <Border.Effect>
  41. <BlurEffect KernelType="Gaussian" Radius="2" />
  42. </Border.Effect>
  43. </Border>
  44. <Border
  45. x:Name="fore_border"
  46. Margin="2"
  47. BorderBrush="White"
  48. BorderThickness="0"
  49. CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
  50. Opacity="0.7">
  51. <Border.Effect>
  52. <BlurEffect KernelType="Gaussian" Radius="2" />
  53. </Border.Effect>
  54. </Border>-->
  55. <ContentPresenter
  56. HorizontalAlignment="Center"
  57. VerticalAlignment="Center"
  58. Content="{TemplateBinding Content}"
  59. TextBlock.FontFamily="{TemplateBinding FontFamily}"
  60. TextBlock.FontSize="{TemplateBinding FontSize}"
  61. TextBlock.Foreground="{TemplateBinding Foreground}" />
  62. <Image
  63. Name="im"
  64. Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
  65. Stretch="Fill" />
  66. </Grid>
  67. </Border>
  68. <ControlTemplate.Triggers>
  69. <Trigger Property="IsChecked" Value="True">
  70. <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
  71. <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
  72. <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
  73. <Setter Property="Background" Value=" #4169E1" />-->
  74. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
  75. </Trigger>
  76. <Trigger Property="IsChecked" Value="False">
  77. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
  78. </Trigger>
  79. <Trigger Property="IsMouseOver" Value="True">
  80. <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
  81. <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
  82. <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
  83. <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
  84. </Trigger>
  85. </ControlTemplate.Triggers>
  86. </ControlTemplate>
  87. </Setter.Value>
  88. </Setter>
  89. </Style>
  90. <Style x:Key="RadioState" TargetType="RadioButton">
  91. <Setter Property="Margin" Value="1" />
  92. <Setter Property="Background" Value="Transparent" />
  93. <Setter Property="Foreground" Value="#ddd" />
  94. <Setter Property="VerticalContentAlignment" Value="Bottom" />
  95. <Setter Property="Margin" Value="2,5" />
  96. <Setter Property="FontSize" Value="16" />
  97. <Setter Property="FontFamily" Value="Consolas" />
  98. <Setter Property="Template">
  99. <Setter.Value>
  100. <ControlTemplate TargetType="RadioButton">
  101. <Border
  102. Name="radiobutton"
  103. Background="{TemplateBinding Background}"
  104. CornerRadius="5"
  105. Opacity="0.85">
  106. <Grid>
  107. <!--<Border
  108. x:Name="back_border"
  109. BorderBrush="Black"
  110. BorderThickness="0"
  111. CornerRadius="1">
  112. <Border.Effect>
  113. <BlurEffect KernelType="Gaussian" Radius="2" />
  114. </Border.Effect>
  115. </Border>
  116. <Border
  117. x:Name="fore_border"
  118. Margin="2"
  119. BorderBrush="White"
  120. BorderThickness="0"
  121. CornerRadius="{Binding ElementName=button, Path=CornerRadius}"
  122. Opacity="0.7">
  123. <Border.Effect>
  124. <BlurEffect KernelType="Gaussian" Radius="2" />
  125. </Border.Effect>
  126. </Border>-->
  127. <ContentPresenter
  128. HorizontalAlignment="Center"
  129. VerticalAlignment="Center"
  130. Content="{TemplateBinding Content}"
  131. TextBlock.FontFamily="{TemplateBinding FontFamily}"
  132. TextBlock.FontSize="{TemplateBinding FontSize}"
  133. TextBlock.Foreground="{TemplateBinding Foreground}" />
  134. <Image
  135. Name="im"
  136. Source="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png"
  137. Stretch="Fill" />
  138. </Grid>
  139. </Border>
  140. <ControlTemplate.Triggers>
  141. <Trigger Property="IsChecked" Value="True">
  142. <!--<Setter TargetName="back_border" Property="BorderThickness" Value="1,0,1,1" />
  143. <Setter TargetName="back_border" Property="CornerRadius" Value="5" />
  144. <Setter TargetName="fore_border" Property="BorderThickness" Value="0,2,0,0" />
  145. <Setter Property="Background" Value=" #4169E1" />-->
  146. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 7.png" />
  147. </Trigger>
  148. <Trigger Property="IsChecked" Value="False">
  149. <Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮/组 8.png" />
  150. </Trigger>
  151. <Trigger Property="IsMouseOver" Value="True">
  152. <!--<Setter TargetName="back_border" Property="BorderBrush" Value="white" />
  153. <Setter TargetName="back_border" Property="BorderThickness" Value="1,1,1,1" />-->
  154. <Setter TargetName="radiobutton" Property="Opacity" Value="1" />
  155. <!--<Setter TargetName="im" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/按钮背景蓝色.png" />-->
  156. </Trigger>
  157. </ControlTemplate.Triggers>
  158. </ControlTemplate>
  159. </Setter.Value>
  160. </Setter>
  161. </Style>
  162. </UserControl.Resources>
  163. <Grid Margin="20">
  164. <Grid.RowDefinitions>
  165. <RowDefinition Height="60"/>
  166. <RowDefinition/>
  167. <RowDefinition/>
  168. </Grid.RowDefinitions>
  169. <Grid Grid.Row="0">
  170. <Grid.ColumnDefinitions>
  171. <ColumnDefinition/>
  172. <ColumnDefinition/>
  173. <ColumnDefinition/>
  174. </Grid.ColumnDefinitions>
  175. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
  176. <TextBlock Text="手自动控制:" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
  177. <TextBlock Margin="10,0,0,0" Text="{Binding AutoCtrl,Converter={StaticResource autoConvert}}" Foreground="Red" Style="{StaticResource TextBlockStyle}" FontSize="18"/>
  178. </StackPanel>
  179. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Orientation="Horizontal">
  180. <RadioButton Margin="10" Content="手动" Style="{DynamicResource RadioState}" IsChecked="{Binding HandCtrl}"/>
  181. <RadioButton Margin="10" Content="自动" Style="{DynamicResource RadioState}" IsChecked="{Binding AutoCtrl}"/>
  182. </StackPanel>
  183. <StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
  184. <CheckBox Margin="10" IsEnabled="False" Content="料仓输送限制" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.SendInfo}"/>
  185. <CheckBox Margin="10" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2" Content="{Binding RunState,Converter={StaticResource runStateConvert}}" Style="{StaticResource CheckState}" IsChecked="{Binding RunState}"/>
  186. </StackPanel>
  187. </Grid>
  188. <Grid Grid.Row="1">
  189. <UniformGrid Columns="2" Rows="2">
  190. <TextBlock Text="桶到位光电状态" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
  191. <TextBlock Text="气缸状态" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
  192. <UniformGrid Columns="2" Rows="2">
  193. <CheckBox Margin="5" IsEnabled="False" Content="进桶1光电" Style="{StaticResource CheckState}" />
  194. <CheckBox Margin="5" IsEnabled="False" Content="出桶1光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_1}"/>
  195. <CheckBox Margin="5" IsEnabled="False" Content="出桶2光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_2}"/>
  196. <CheckBox Margin="5" IsEnabled="False" Content="出桶3光电" Style="{StaticResource CheckState}" IsChecked="{Binding SendCtrlModel.OutputOptical_3}"/>
  197. </UniformGrid>
  198. <Grid Margin="5">
  199. <ListBox
  200. ItemsSource="{Binding SendCtrlModel.CylinderModels}"
  201. Background="Transparent"
  202. BorderThickness="0"
  203. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  204. ScrollViewer.VerticalScrollBarVisibility="Disabled">
  205. <ListBox.ItemContainerStyle>
  206. <Style TargetType="ListBoxItem">
  207. <Setter Property="HorizontalAlignment" Value="Stretch"/>
  208. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  209. <Setter Property="VerticalAlignment" Value="Stretch"/>
  210. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  211. </Style>
  212. </ListBox.ItemContainerStyle>
  213. <ListBox.ItemsPanel>
  214. <ItemsPanelTemplate>
  215. <UniformGrid Rows="3"/>
  216. </ItemsPanelTemplate>
  217. </ListBox.ItemsPanel>
  218. <ListBox.ItemTemplate>
  219. <DataTemplate>
  220. <Grid Margin="10" Background="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
  221. <StackPanel Margin="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  222. <TextBlock Text="{Binding Name}" Foreground="White" Style="{StaticResource TitleTextblockStyle}" FontSize="20"/>
  223. <CheckBox Height="30" Margin="5" IsEnabled="false" Content="开" Style="{DynamicResource CheckState}" IsChecked="{Binding OnStatus}"/>
  224. <CheckBox Height="30" Margin="5" Content="关" IsEnabled="false" Style="{DynamicResource CheckState}" IsChecked="{Binding OffStatus}"/>
  225. </StackPanel>
  226. </Grid>
  227. </DataTemplate>
  228. </ListBox.ItemTemplate>
  229. </ListBox>
  230. </Grid>
  231. </UniformGrid>
  232. </Grid>
  233. <Grid Margin="20,0,20,40" Grid.Row="2" >
  234. <UniformGrid Columns="3" Rows="3">
  235. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  236. <TextBlock Text="进口输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  237. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.InSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.InSend}"/>
  238. </StackPanel>
  239. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  240. <TextBox Text="{Binding SendCtrlModel.InSendSp}" x:Name="sp1" Width="80" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  241. <Button Margin="5" Content="复位1" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp1}"/>
  242. </StackPanel >
  243. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  244. <TextBlock Text="气缸1" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  245. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_1}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_1}"/>
  246. </StackPanel>
  247. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  248. <TextBlock Text="出口输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  249. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.OutSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.OutSend}"/>
  250. </StackPanel>
  251. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  252. <TextBox Text="{Binding SendCtrlModel.OutSendSp}" x:Name="sp2" Width="80" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  253. <Button Margin="5" Content="复位2" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp2}"/>
  254. </StackPanel>
  255. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  256. <TextBlock Text="气缸2" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  257. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_2}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_2}"/>
  258. </StackPanel>
  259. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  260. <TextBlock Text="缓存输送" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  261. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.CacheSend}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.CacheSend}"/>
  262. </StackPanel>
  263. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  264. <TextBox Text="{Binding SendCtrlModel.CacheSendSp}" Width="80" x:Name="sp3" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  265. <Button Margin="5" Content="复位3" Width="140" Height="30" Style="{StaticResource ImageButtonStyle}" Command="{Binding SendCtrl.Reset}" CommandParameter="{Binding ElementName=sp3}"/>
  266. </StackPanel>
  267. <StackPanel Margin="10,2" Orientation="Horizontal" HorizontalAlignment="Center">
  268. <TextBlock Text="气缸3" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  269. <CheckBox Margin="5" Content="启停" Style="{StaticResource CheckState}" Command="{Binding SendCtrl.Clinder_2}" CommandParameter="{Binding IsChecked,RelativeSource={RelativeSource self}}" IsChecked="{Binding SendCtrlModel.Clinder_3}"/>
  270. </StackPanel>
  271. </UniformGrid>
  272. </Grid>
  273. </Grid>
  274. </UserControl>