MainPage.xaml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. <Page x:Class="CCDCountWpf.WpfPage.MainPage"
  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:CCDCountWpf.WpfPage"
  7. xmlns:BindNameSpace="clr-namespace:CCDCountWpf"
  8. mc:Ignorable="d"
  9. Title="MainPage" Height="503" Width="950" Loaded="Page_Loaded">
  10. <Grid>
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="*"/>
  13. <ColumnDefinition Width="380"/>
  14. </Grid.ColumnDefinitions>
  15. <Grid Margin="0,0,0,187">
  16. <Border BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2">
  17. <Image x:Name="ShowBox" Source="{Binding BitmapImage}" Margin="0,0,0,0"/>
  18. </Border>
  19. </Grid>
  20. <Border BorderBrush="Black" BorderThickness="1" Height="180" VerticalAlignment="Bottom" Padding="0,0,0,10">
  21. <Grid>
  22. <Grid.ColumnDefinitions>
  23. <ColumnDefinition Width="*"/>
  24. <ColumnDefinition Width="*"/>
  25. </Grid.ColumnDefinitions>
  26. <Border Grid.Column="0"
  27. Background="#FF0087FF"
  28. CornerRadius="8"
  29. BorderBrush="Gray"
  30. BorderThickness="1"
  31. Margin="15,10,15,0" Height="155" VerticalAlignment="Top" Cursor="">
  32. <Grid>
  33. <StackPanel Orientation="Vertical" Margin="0,0,80,0">
  34. <StackPanel Orientation="Horizontal">
  35. <Label Content="总粒数:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  36. <Label x:Name="AllActiveNumLab" Content="{Binding AllActiveNum}" HorizontalAlignment="Left" Margin="20,10,0,0" Width="80" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  37. </StackPanel>
  38. <StackPanel Orientation="Horizontal">
  39. <Label Content="合格数:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  40. <Label x:Name="AllOkNumLab" Content="{Binding AllOkNum}" HorizontalAlignment="Left" Margin="20,10,0,0" Width="80" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  41. </StackPanel>
  42. <StackPanel Orientation="Horizontal">
  43. <Label Content="不合格数:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  44. <Label x:Name="AllNgNumLab" Content="{Binding AllNgNum}" HorizontalAlignment="Left" Margin="0,10,0,0" Width="80" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  45. </StackPanel>
  46. </StackPanel>
  47. <Label x:Name="CamRunStaticLab" Content="{Binding CamRunStatic}" HorizontalAlignment="Right" Margin="10,5,10,0" VerticalAlignment="Top" Background="{x:Null}" FontSize="25" Foreground="{Binding CameraStaticColor}" FontWeight="Bold" />
  48. <Button x:Name="DataClear" Content="清零" BorderThickness="1" HorizontalAlignment="Right" Margin="10,0,10,12" Width="80" Height="40" Background="#FF0123FF" FontWeight="Bold" FontSize="20" Foreground="White" Click="DataClear_Click" Cursor="Hand" VerticalAlignment="Bottom">
  49. <Button.Template>
  50. <ControlTemplate TargetType="Button">
  51. <Border CornerRadius="5"
  52. Background="{TemplateBinding Background}"
  53. BorderBrush="{TemplateBinding BorderBrush}"
  54. BorderThickness="{TemplateBinding BorderThickness}">
  55. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  56. </Border>
  57. </ControlTemplate>
  58. </Button.Template>
  59. </Button>
  60. </Grid>
  61. <!-- 卡片内容 -->
  62. </Border>
  63. <Border Grid.Column="1"
  64. Background="#FF0087FF"
  65. CornerRadius="8"
  66. BorderBrush="Gray"
  67. BorderThickness="1"
  68. Margin="15,10,15,0" Height="60" VerticalAlignment="Top">
  69. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  70. <Label Content="计数速度:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  71. <Label x:Name="ShuLiSpeedTbx" Content="{Binding ShuLiSpeed}" HorizontalAlignment="Left" Margin="0,0,0,0" Width="60" FontWeight="Bold" FontSize="20" Background="{x:Null}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White"/>
  72. <Label Content="粒/秒" FontWeight="Bold" FontSize="20" Margin="0,10,0,0" Foreground="White" />
  73. </StackPanel>
  74. </Border>
  75. <Border Grid.Column="1"
  76. Background="#FF0087FF"
  77. CornerRadius="8"
  78. BorderBrush="Gray"
  79. BorderThickness="1"
  80. Margin="15,80,15,0" Height="85" VerticalAlignment="Top">
  81. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  82. <Button x:Name="StartIdentifyBtn" Content="开始" BorderThickness="1" HorizontalAlignment="Right" Margin="0,0,20,0" VerticalAlignment="Top" Width="100" Height="60" Background="#FF0123FF" FontWeight="Bold" FontSize="20" Foreground="White" Cursor="Hand" Click="StartIdentifyBtn_Click">
  83. <Button.Template>
  84. <ControlTemplate TargetType="Button">
  85. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  86. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  87. </Border>
  88. </ControlTemplate>
  89. </Button.Template>
  90. </Button>
  91. <Button x:Name="StopIdentifyBtn" Content="暂停" BorderThickness="1" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Top" Width="100" Height="60" Background="#FF0123FF" FontWeight="Bold" FontSize="20" Foreground="White" Cursor="Hand" Click="StopIdentifyBtn_Click">
  92. <Button.Template>
  93. <ControlTemplate TargetType="Button">
  94. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  95. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  96. </Border>
  97. </ControlTemplate>
  98. </Button.Template>
  99. </Button>
  100. </StackPanel>
  101. </Border>
  102. </Grid>
  103. </Border>
  104. <Border Grid.Column="1" BorderBrush="Black" BorderThickness="1">
  105. <Border Background="#FF0087FF"
  106. CornerRadius="8"
  107. BorderBrush="Gray"
  108. BorderThickness="1"
  109. Margin="15,10,15,10" Cursor="">
  110. <Grid>
  111. <ScrollViewer VerticalScrollBarVisibility="Auto">
  112. <StackPanel Orientation="Vertical">
  113. <StackPanel Orientation="Horizontal" Margin="0,10,0,0" HorizontalAlignment="Center">
  114. <TextBlock Text="A速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  115. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpUPBtn" Content="++" Width="45" Height="45" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  116. <Button.Template>
  117. <ControlTemplate TargetType="Button">
  118. <Border CornerRadius="5"
  119. Background="{TemplateBinding Background}"
  120. BorderBrush="{TemplateBinding BorderBrush}"
  121. BorderThickness="{TemplateBinding BorderThickness}">
  122. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  123. </Border>
  124. </ControlTemplate>
  125. </Button.Template>
  126. </Button>
  127. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn" Content="+" Width="45" Height="45" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  128. <Button.Template>
  129. <ControlTemplate TargetType="Button">
  130. <Border CornerRadius="5"
  131. Background="{TemplateBinding Background}"
  132. BorderBrush="{TemplateBinding BorderBrush}"
  133. BorderThickness="{TemplateBinding BorderThickness}">
  134. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  135. </Border>
  136. </ControlTemplate>
  137. </Button.Template>
  138. </Button>
  139. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingMaterialCylinderVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Width="79" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}"/>
  140. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  141. <Button.Template>
  142. <ControlTemplate TargetType="Button">
  143. <Border CornerRadius="5"
  144. Background="{TemplateBinding Background}"
  145. BorderBrush="{TemplateBinding BorderBrush}"
  146. BorderThickness="{TemplateBinding BorderThickness}">
  147. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  148. </Border>
  149. </ControlTemplate>
  150. </Button.Template>
  151. </Button>
  152. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="45" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  153. <Button.Template>
  154. <ControlTemplate TargetType="Button">
  155. <Border CornerRadius="5"
  156. Background="{TemplateBinding Background}"
  157. BorderBrush="{TemplateBinding BorderBrush}"
  158. BorderThickness="{TemplateBinding BorderThickness}">
  159. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  160. </Border>
  161. </ControlTemplate>
  162. </Button.Template>
  163. </Button>
  164. </StackPanel>
  165. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  166. <TextBlock Text="B速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  167. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="45" Height="45" Click="BottingFilterVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  168. <Button.Template>
  169. <ControlTemplate TargetType="Button">
  170. <Border CornerRadius="5"
  171. Background="{TemplateBinding Background}"
  172. BorderBrush="{TemplateBinding BorderBrush}"
  173. BorderThickness="{TemplateBinding BorderThickness}">
  174. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  175. </Border>
  176. </ControlTemplate>
  177. </Button.Template>
  178. </Button>
  179. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpBtn" Content="+" Width="45" Height="45" Click="BottingFilterVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  180. <Button.Template>
  181. <ControlTemplate TargetType="Button">
  182. <Border CornerRadius="5"
  183. Background="{TemplateBinding Background}"
  184. BorderBrush="{TemplateBinding BorderBrush}"
  185. BorderThickness="{TemplateBinding BorderThickness}">
  186. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  187. </Border>
  188. </ControlTemplate>
  189. </Button.Template>
  190. </Button>
  191. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingFilterVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" Background="{x:Null}"/>
  192. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingFilterVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  193. <Button.Template>
  194. <ControlTemplate TargetType="Button">
  195. <Border CornerRadius="5"
  196. Background="{TemplateBinding Background}"
  197. BorderBrush="{TemplateBinding BorderBrush}"
  198. BorderThickness="{TemplateBinding BorderThickness}">
  199. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  200. </Border>
  201. </ControlTemplate>
  202. </Button.Template>
  203. </Button>
  204. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="45" Click="BottingFilterVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  205. <Button.Template>
  206. <ControlTemplate TargetType="Button">
  207. <Border CornerRadius="5"
  208. Background="{TemplateBinding Background}"
  209. BorderBrush="{TemplateBinding BorderBrush}"
  210. BorderThickness="{TemplateBinding BorderThickness}">
  211. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  212. </Border>
  213. </ControlTemplate>
  214. </Button.Template>
  215. </Button>
  216. </StackPanel>
  217. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  218. <TextBlock Text="C速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  219. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="45" Height="45" Click="BottingCountVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  220. <Button.Template>
  221. <ControlTemplate TargetType="Button">
  222. <Border CornerRadius="5"
  223. Background="{TemplateBinding Background}"
  224. BorderBrush="{TemplateBinding BorderBrush}"
  225. BorderThickness="{TemplateBinding BorderThickness}">
  226. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  227. </Border>
  228. </ControlTemplate>
  229. </Button.Template>
  230. </Button>
  231. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpBtn" Content="+" Width="45" Height="45" Click="BottingCountVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  232. <Button.Template>
  233. <ControlTemplate TargetType="Button">
  234. <Border CornerRadius="5"
  235. Background="{TemplateBinding Background}"
  236. BorderBrush="{TemplateBinding BorderBrush}"
  237. BorderThickness="{TemplateBinding BorderThickness}">
  238. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  239. </Border>
  240. </ControlTemplate>
  241. </Button.Template>
  242. </Button>
  243. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottingCountVibrationTableHighSpeedValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White"/>
  244. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="45" Click="BottingCountVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  245. <Button.Template>
  246. <ControlTemplate TargetType="Button">
  247. <Border CornerRadius="5"
  248. Background="{TemplateBinding Background}"
  249. BorderBrush="{TemplateBinding BorderBrush}"
  250. BorderThickness="{TemplateBinding BorderThickness}">
  251. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  252. </Border>
  253. </ControlTemplate>
  254. </Button.Template>
  255. </Button>
  256. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="45" Click="BottingCountVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  257. <Button.Template>
  258. <ControlTemplate TargetType="Button">
  259. <Border CornerRadius="5"
  260. Background="{TemplateBinding Background}"
  261. BorderBrush="{TemplateBinding BorderBrush}"
  262. BorderThickness="{TemplateBinding BorderThickness}">
  263. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  264. </Border>
  265. </ControlTemplate>
  266. </Button.Template>
  267. </Button>
  268. </StackPanel>
  269. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  270. <TextBlock Text="罐装值:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  271. <Button x:Name="BottValueSetUpUpBtn" Content="++" Width="45" Height="45" Click="BottValueSetUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  272. <Button.Template>
  273. <ControlTemplate TargetType="Button">
  274. <Border CornerRadius="5"
  275. Background="{TemplateBinding Background}"
  276. BorderBrush="{TemplateBinding BorderBrush}"
  277. BorderThickness="{TemplateBinding BorderThickness}">
  278. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  279. </Border>
  280. </ControlTemplate>
  281. </Button.Template>
  282. </Button>
  283. <Button x:Name="BottValueSetUpBtn" Content="+" Width="45" Height="45" Click="BottValueSetUpBtn_Click" Background="#FF0123FF" Foreground="White">
  284. <Button.Template>
  285. <ControlTemplate TargetType="Button">
  286. <Border CornerRadius="5"
  287. Background="{TemplateBinding Background}"
  288. BorderBrush="{TemplateBinding BorderBrush}"
  289. BorderThickness="{TemplateBinding BorderThickness}">
  290. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  291. </Border>
  292. </ControlTemplate>
  293. </Button.Template>
  294. </Button>
  295. <TextBox Text="{Binding Source={x:Static BindNameSpace:PlcSettingMessageBus.PlcMessageShowBindage},Path = BottValueSet,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="16" Width="80" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="{x:Null}" Foreground="White"/>
  296. <Button x:Name="BottValueSetDownBtn" Content="-" Width="45" Click="BottValueSetDownBtn_Click" Background="#FF0123FF" Foreground="White">
  297. <Button.Template>
  298. <ControlTemplate TargetType="Button">
  299. <Border CornerRadius="5"
  300. Background="{TemplateBinding Background}"
  301. BorderBrush="{TemplateBinding BorderBrush}"
  302. BorderThickness="{TemplateBinding BorderThickness}">
  303. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  304. </Border>
  305. </ControlTemplate>
  306. </Button.Template>
  307. </Button>
  308. <Button x:Name="BottValueSetDownDownBtn" Content="--" Width="45" Click="BottValueSetDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  309. <Button.Template>
  310. <ControlTemplate TargetType="Button">
  311. <Border CornerRadius="5"
  312. Background="{TemplateBinding Background}"
  313. BorderBrush="{TemplateBinding BorderBrush}"
  314. BorderThickness="{TemplateBinding BorderThickness}">
  315. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  316. </Border>
  317. </ControlTemplate>
  318. </Button.Template>
  319. </Button>
  320. </StackPanel>
  321. </StackPanel>
  322. </ScrollViewer>
  323. </Grid>
  324. </Border>
  325. </Border>
  326. </Grid>
  327. </Page>