MainPage.xaml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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="876" Loaded="Page_Loaded">
  10. <Grid>
  11. <Grid Margin="0,0,0,187" SizeChanged="Grid_SizeChanged">
  12. <Grid.ColumnDefinitions>
  13. <ColumnDefinition Width="*"/>
  14. <ColumnDefinition Width="*"/>
  15. </Grid.ColumnDefinitions>
  16. <Border Grid.Column="0" 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. <Border Grid.Column="1" BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2">
  20. <StackPanel Orientation="Vertical">
  21. <Image x:Name="MiniShowImageBox1" Source="{Binding ThumbnailImage1}" Margin="3,5,3,5" MouseDown="MiniShowImageBox1_MouseDown" Cursor="Hand" />
  22. <Image x:Name="MiniShowImageBox2" Source="{Binding ThumbnailImage2}" Margin="3,5,3,5" MouseDown="MiniShowImageBox2_MouseDown" Cursor="Hand" />
  23. <Image x:Name="MiniShowImageBox3" Source="{Binding ThumbnailImage3}" Margin="3,5,3,5" MouseDown="MiniShowImageBox3_MouseDown" Cursor="Hand"/>
  24. <Image x:Name="MiniShowImageBox4" Source="{Binding ThumbnailImage4}" Margin="3,5,3,5" MouseDown="MiniShowImageBox4_MouseDown" Cursor="Hand"/>
  25. </StackPanel>
  26. </Border>
  27. </Grid>
  28. <Grid Margin="0,0,0,10" Height="170" VerticalAlignment="Bottom">
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="*"/>
  31. <ColumnDefinition Width="*"/>
  32. <ColumnDefinition Width="*"/>
  33. </Grid.ColumnDefinitions>
  34. <Border Grid.Column="0"
  35. Background="#FF0087FF"
  36. CornerRadius="8"
  37. BorderBrush="Gray"
  38. BorderThickness="1"
  39. Margin="15,10,15,0" Height="155" VerticalAlignment="Top" Cursor="">
  40. <Grid>
  41. <StackPanel Orientation="Vertical" Margin="0,0,80,0">
  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="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"/>
  45. </StackPanel>
  46. <StackPanel Orientation="Horizontal">
  47. <Label Content="合格数:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  48. <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"/>
  49. </StackPanel>
  50. <StackPanel Orientation="Horizontal">
  51. <Label Content="不合格数:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  52. <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"/>
  53. </StackPanel>
  54. </StackPanel>
  55. <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" />
  56. <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">
  57. <Button.Template>
  58. <ControlTemplate TargetType="Button">
  59. <Border CornerRadius="5"
  60. Background="{TemplateBinding Background}"
  61. BorderBrush="{TemplateBinding BorderBrush}"
  62. BorderThickness="{TemplateBinding BorderThickness}">
  63. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  64. </Border>
  65. </ControlTemplate>
  66. </Button.Template>
  67. </Button>
  68. </Grid>
  69. <!-- 卡片内容 -->
  70. </Border>
  71. <Border Grid.Column="1"
  72. Background="#FF0087FF"
  73. CornerRadius="8"
  74. BorderBrush="Gray"
  75. BorderThickness="1"
  76. Margin="15,10,15,0" Height="60" VerticalAlignment="Top">
  77. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  78. <Label Content="计数速度:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20" Foreground="White"/>
  79. <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"/>
  80. <Label Content="粒/秒" FontWeight="Bold" FontSize="20" Margin="0,10,0,0" Foreground="White" />
  81. </StackPanel>
  82. </Border>
  83. <Border Grid.Column="1"
  84. Background="#FF0087FF"
  85. CornerRadius="8"
  86. BorderBrush="Gray"
  87. BorderThickness="1"
  88. Margin="15,80,15,0" Height="85" VerticalAlignment="Top">
  89. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  90. <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">
  91. <Button.Template>
  92. <ControlTemplate TargetType="Button">
  93. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  94. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  95. </Border>
  96. </ControlTemplate>
  97. </Button.Template>
  98. </Button>
  99. <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">
  100. <Button.Template>
  101. <ControlTemplate TargetType="Button">
  102. <Border CornerRadius="5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  103. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  104. </Border>
  105. </ControlTemplate>
  106. </Button.Template>
  107. </Button>
  108. </StackPanel>
  109. </Border>
  110. <Border Grid.Column="2"
  111. Background="#FF0087FF"
  112. CornerRadius="8"
  113. BorderBrush="Gray"
  114. BorderThickness="1"
  115. Margin="15,10,15,0" Height="155" VerticalAlignment="Top" Cursor="">
  116. <Grid>
  117. <StackPanel Orientation="Vertical">
  118. <StackPanel Orientation="Horizontal" Margin="0,10,0,0" HorizontalAlignment="Center">
  119. <TextBlock Text="A速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  120. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpUPBtn" Content="++" Width="30" Height="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  121. <Button.Template>
  122. <ControlTemplate TargetType="Button">
  123. <Border CornerRadius="5"
  124. Background="{TemplateBinding Background}"
  125. BorderBrush="{TemplateBinding BorderBrush}"
  126. BorderThickness="{TemplateBinding BorderThickness}">
  127. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  128. </Border>
  129. </ControlTemplate>
  130. </Button.Template>
  131. </Button>
  132. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  133. <Button.Template>
  134. <ControlTemplate TargetType="Button">
  135. <Border CornerRadius="5"
  136. Background="{TemplateBinding Background}"
  137. BorderBrush="{TemplateBinding BorderBrush}"
  138. BorderThickness="{TemplateBinding BorderThickness}">
  139. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  140. </Border>
  141. </ControlTemplate>
  142. </Button.Template>
  143. </Button>
  144. <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}"/>
  145. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  146. <Button.Template>
  147. <ControlTemplate TargetType="Button">
  148. <Border CornerRadius="5"
  149. Background="{TemplateBinding Background}"
  150. BorderBrush="{TemplateBinding BorderBrush}"
  151. BorderThickness="{TemplateBinding BorderThickness}">
  152. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  153. </Border>
  154. </ControlTemplate>
  155. </Button.Template>
  156. </Button>
  157. <Button x:Name="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="30" Click="BottingMaterialCylinderVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  158. <Button.Template>
  159. <ControlTemplate TargetType="Button">
  160. <Border CornerRadius="5"
  161. Background="{TemplateBinding Background}"
  162. BorderBrush="{TemplateBinding BorderBrush}"
  163. BorderThickness="{TemplateBinding BorderThickness}">
  164. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  165. </Border>
  166. </ControlTemplate>
  167. </Button.Template>
  168. </Button>
  169. </StackPanel>
  170. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  171. <TextBlock Text="B速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  172. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="30" Height="30" Click="BottingFilterVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  173. <Button.Template>
  174. <ControlTemplate TargetType="Button">
  175. <Border CornerRadius="5"
  176. Background="{TemplateBinding Background}"
  177. BorderBrush="{TemplateBinding BorderBrush}"
  178. BorderThickness="{TemplateBinding BorderThickness}">
  179. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  180. </Border>
  181. </ControlTemplate>
  182. </Button.Template>
  183. </Button>
  184. <Button x:Name="BottingFilterVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingFilterVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  185. <Button.Template>
  186. <ControlTemplate TargetType="Button">
  187. <Border CornerRadius="5"
  188. Background="{TemplateBinding Background}"
  189. BorderBrush="{TemplateBinding BorderBrush}"
  190. BorderThickness="{TemplateBinding BorderThickness}">
  191. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  192. </Border>
  193. </ControlTemplate>
  194. </Button.Template>
  195. </Button>
  196. <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}"/>
  197. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingFilterVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  198. <Button.Template>
  199. <ControlTemplate TargetType="Button">
  200. <Border CornerRadius="5"
  201. Background="{TemplateBinding Background}"
  202. BorderBrush="{TemplateBinding BorderBrush}"
  203. BorderThickness="{TemplateBinding BorderThickness}">
  204. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  205. </Border>
  206. </ControlTemplate>
  207. </Button.Template>
  208. </Button>
  209. <Button x:Name="BottingFilterVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="30" Click="BottingFilterVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  210. <Button.Template>
  211. <ControlTemplate TargetType="Button">
  212. <Border CornerRadius="5"
  213. Background="{TemplateBinding Background}"
  214. BorderBrush="{TemplateBinding BorderBrush}"
  215. BorderThickness="{TemplateBinding BorderThickness}">
  216. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  217. </Border>
  218. </ControlTemplate>
  219. </Button.Template>
  220. </Button>
  221. </StackPanel>
  222. <StackPanel Orientation="Horizontal" Margin="0,20,0,0" HorizontalAlignment="Center">
  223. <TextBlock Text="C速度:" FontSize="20" Margin="0,0,0,0" VerticalAlignment="Center" Foreground="White"/>
  224. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpUpBtn" Content="++" Width="30" Height="30" Click="BottingCountVibrationTableHighSpeedValueUpUpBtn_Click" Background="#FF0123FF" Foreground="White">
  225. <Button.Template>
  226. <ControlTemplate TargetType="Button">
  227. <Border CornerRadius="5"
  228. Background="{TemplateBinding Background}"
  229. BorderBrush="{TemplateBinding BorderBrush}"
  230. BorderThickness="{TemplateBinding BorderThickness}">
  231. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  232. </Border>
  233. </ControlTemplate>
  234. </Button.Template>
  235. </Button>
  236. <Button x:Name="BottingCountVibrationTableHighSpeedValueUpBtn" Content="+" Width="30" Height="30" Click="BottingCountVibrationTableHighSpeedValueUpBtn_Click" Background="#FF0123FF" Foreground="White">
  237. <Button.Template>
  238. <ControlTemplate TargetType="Button">
  239. <Border CornerRadius="5"
  240. Background="{TemplateBinding Background}"
  241. BorderBrush="{TemplateBinding BorderBrush}"
  242. BorderThickness="{TemplateBinding BorderThickness}">
  243. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  244. </Border>
  245. </ControlTemplate>
  246. </Button.Template>
  247. </Button>
  248. <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"/>
  249. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownBtn" Content="-" Width="30" Click="BottingCountVibrationTableHighSpeedValueDownBtn_Click" Background="#FF0123FF" Foreground="White">
  250. <Button.Template>
  251. <ControlTemplate TargetType="Button">
  252. <Border CornerRadius="5"
  253. Background="{TemplateBinding Background}"
  254. BorderBrush="{TemplateBinding BorderBrush}"
  255. BorderThickness="{TemplateBinding BorderThickness}">
  256. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  257. </Border>
  258. </ControlTemplate>
  259. </Button.Template>
  260. </Button>
  261. <Button x:Name="BottingCountVibrationTableHighSpeedValueDownDownBtn" Content="--" Width="30" Click="BottingCountVibrationTableHighSpeedValueDownDownBtn_Click" Background="#FF0123FF" Foreground="White">
  262. <Button.Template>
  263. <ControlTemplate TargetType="Button">
  264. <Border CornerRadius="5"
  265. Background="{TemplateBinding Background}"
  266. BorderBrush="{TemplateBinding BorderBrush}"
  267. BorderThickness="{TemplateBinding BorderThickness}">
  268. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
  269. </Border>
  270. </ControlTemplate>
  271. </Button.Template>
  272. </Button>
  273. </StackPanel>
  274. </StackPanel>
  275. </Grid>
  276. <!-- 卡片内容 -->
  277. </Border>
  278. </Grid>
  279. </Grid>
  280. </Page>