ShakerInfoView.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <UserControl
  2. x:Class="ShakerManger.View.ShakerInfoView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:ShakerManger.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  10. d:DataContext="{d:DesignInstance {x:Type vm:ShakerControlViewModel}}"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <Viewbox Margin="4" Stretch="Fill">
  15. <Grid Width="960" Height="460">
  16. <Grid.RowDefinitions>
  17. <RowDefinition Height="0.4*" />
  18. <RowDefinition Height="0.6*" />
  19. <RowDefinition Height="Auto" />
  20. </Grid.RowDefinitions>
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition />
  23. <ColumnDefinition />
  24. </Grid.ColumnDefinitions>
  25. <GroupBox
  26. Grid.Row="0"
  27. Grid.Column="0"
  28. hc:TitleElement.Background="Transparent"
  29. hc:TitleElement.Foreground="White"
  30. hc:TitleElement.MinHeight="42"
  31. Background="Transparent"
  32. BorderBrush="Gray"
  33. BorderThickness="1"
  34. FontSize="22"
  35. FontWeight="Bold"
  36. Foreground="{StaticResource TitleBrush}"
  37. Header="输出"
  38. Style="{StaticResource GroupBoxTab}">
  39. <Grid>
  40. <Grid.ColumnDefinitions>
  41. <ColumnDefinition />
  42. <ColumnDefinition />
  43. </Grid.ColumnDefinitions>
  44. <StackPanel
  45. Grid.Column="0"
  46. VerticalAlignment="Center"
  47. Orientation="Vertical">
  48. <StackPanel
  49. HorizontalAlignment="Center"
  50. VerticalAlignment="Center"
  51. Orientation="Horizontal">
  52. <Viewbox
  53. Width="20"
  54. Height="20"
  55. Stretch="Fill">
  56. <Path
  57. Data="{StaticResource CurrentGeometry}"
  58. Fill="Green"
  59. Stretch="Fill" />
  60. </Viewbox>
  61. <TextBlock
  62. HorizontalAlignment="Center"
  63. VerticalAlignment="Center"
  64. FontSize="16"
  65. FontWeight="Normal"
  66. Foreground="White"
  67. Text="电流(A)" />
  68. </StackPanel>
  69. <TextBlock
  70. Margin="4,0,0,0"
  71. HorizontalAlignment="Center"
  72. VerticalAlignment="Center"
  73. FontSize="48"
  74. Foreground="Green"
  75. Text="{Binding CurrentData.OutputCurrent, StringFormat={}{0:0000}}" />
  76. </StackPanel>
  77. <Line
  78. HorizontalAlignment="Right"
  79. VerticalAlignment="Center"
  80. Stroke="Gray"
  81. StrokeThickness="1"
  82. X1="0"
  83. X2="0"
  84. Y1="0"
  85. Y2="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=ActualHeight}" />
  86. <StackPanel
  87. Grid.Column="1"
  88. VerticalAlignment="Center"
  89. Orientation="Vertical">
  90. <StackPanel
  91. HorizontalAlignment="Center"
  92. VerticalAlignment="Center"
  93. Orientation="Horizontal">
  94. <Viewbox
  95. Width="20"
  96. Height="20"
  97. Stretch="Fill">
  98. <Path
  99. Data="{StaticResource VoltageGeometry}"
  100. Fill="Green"
  101. Stretch="Fill" />
  102. </Viewbox>
  103. <TextBlock
  104. Margin="4,0,0,0"
  105. HorizontalAlignment="Center"
  106. VerticalAlignment="Center"
  107. FontSize="16"
  108. FontWeight="Normal"
  109. Foreground="White"
  110. Text="电压(V)" />
  111. </StackPanel>
  112. <TextBlock
  113. HorizontalAlignment="Center"
  114. VerticalAlignment="Center"
  115. FontSize="48"
  116. Foreground="Green"
  117. Text="{Binding CurrentData.OutputVoltage, StringFormat={}{0:0000}}" />
  118. </StackPanel>
  119. </Grid>
  120. </GroupBox>
  121. <GroupBox
  122. Grid.Row="1"
  123. Grid.Column="0"
  124. Margin="0,4,0,0"
  125. hc:TitleElement.Background="Transparent"
  126. hc:TitleElement.Foreground="White"
  127. hc:TitleElement.MinHeight="42"
  128. Background="Transparent"
  129. BorderBrush="Gray"
  130. BorderThickness="1"
  131. FontSize="22"
  132. FontWeight="Black"
  133. Foreground="{StaticResource TitleBrush}"
  134. Header="系统"
  135. Style="{StaticResource GroupBoxTab}">
  136. <Grid Margin="4,0,0,0" TextBlock.FontWeight="Normal">
  137. <Grid.RowDefinitions>
  138. <RowDefinition />
  139. <RowDefinition />
  140. <RowDefinition />
  141. <RowDefinition />
  142. </Grid.RowDefinitions>
  143. <StackPanel
  144. Grid.Row="0"
  145. VerticalAlignment="Center"
  146. Orientation="Horizontal">
  147. <TextBlock
  148. Width="120"
  149. HorizontalAlignment="Center"
  150. VerticalAlignment="Center"
  151. FontSize="16"
  152. Foreground="White"
  153. Text="励磁电流(A)" />
  154. <TextBlock
  155. HorizontalAlignment="Center"
  156. VerticalAlignment="Center"
  157. FontSize="16"
  158. Foreground="White"
  159. Text="{Binding CurrentData.ExcitationCurrent, StringFormat={}{0:000}}" />
  160. </StackPanel>
  161. <StackPanel
  162. Grid.Row="1"
  163. VerticalAlignment="Center"
  164. Orientation="Horizontal">
  165. <TextBlock
  166. Width="120"
  167. HorizontalAlignment="Center"
  168. VerticalAlignment="Center"
  169. FontSize="16"
  170. Foreground="White"
  171. Text="直流电压(V)" />
  172. <TextBlock
  173. HorizontalAlignment="Center"
  174. VerticalAlignment="Center"
  175. FontSize="16"
  176. Foreground="White"
  177. Text="{Binding CurrentData.DCVoltage1, StringFormat={}{0:000}}" />
  178. <TextBlock
  179. Margin="20,0,0,0"
  180. HorizontalAlignment="Center"
  181. VerticalAlignment="Center"
  182. FontSize="16"
  183. Foreground="White"
  184. Text="{Binding CurrentData.DCVoltage2, StringFormat={}{0:000}}" />
  185. <TextBlock
  186. Margin="20,0,0,0"
  187. HorizontalAlignment="Center"
  188. VerticalAlignment="Center"
  189. FontSize="16"
  190. Foreground="White"
  191. Text="{Binding CurrentData.DCVoltage3, StringFormat={}{0:000}}" />
  192. <TextBlock
  193. Margin="20,0,0,0"
  194. HorizontalAlignment="Center"
  195. VerticalAlignment="Center"
  196. FontSize="16"
  197. Foreground="White"
  198. Text="{Binding CurrentData.DCVoltage4, StringFormat={}{0:000}}" />
  199. </StackPanel>
  200. <StackPanel
  201. Grid.Row="2"
  202. VerticalAlignment="Center"
  203. Orientation="Horizontal">
  204. <TextBlock
  205. Width="120"
  206. HorizontalAlignment="Center"
  207. VerticalAlignment="Center"
  208. FontSize="16"
  209. Foreground="White"
  210. Text="温度(℃)" />
  211. <TextBlock
  212. HorizontalAlignment="Center"
  213. VerticalAlignment="Center"
  214. FontSize="16"
  215. Foreground="White"
  216. Text="{Binding CurrentData.AbutmentTemperature0, StringFormat={}{0:000}}" />
  217. <TextBlock
  218. Margin="20,0,0,0"
  219. HorizontalAlignment="Center"
  220. VerticalAlignment="Center"
  221. FontSize="16"
  222. Foreground="White"
  223. Text="{Binding CurrentData.AbutmentTemperature1, StringFormat={}{0:000}}" />
  224. </StackPanel>
  225. <StackPanel
  226. Grid.Row="3"
  227. VerticalAlignment="Center"
  228. Orientation="Horizontal">
  229. <TextBlock
  230. Width="120"
  231. HorizontalAlignment="Center"
  232. VerticalAlignment="Center"
  233. FontSize="16"
  234. Foreground="White"
  235. Text="三相电压(V)" />
  236. <TextBlock
  237. HorizontalAlignment="Center"
  238. VerticalAlignment="Center"
  239. FontSize="16"
  240. Foreground="White"
  241. Text="{Binding CurrentData.ThreePhaseVoltage, StringFormat={}{0:000}}" />
  242. </StackPanel>
  243. </Grid>
  244. </GroupBox>
  245. <GroupBox
  246. Grid.Row="0"
  247. Margin="4,0,0,0"
  248. Grid.Column="1"
  249. Grid.RowSpan="2"
  250. hc:TitleElement.Background="Transparent"
  251. hc:TitleElement.Foreground="White"
  252. hc:TitleElement.MinHeight="42"
  253. Background="Transparent"
  254. BorderBrush="Gray"
  255. BorderThickness="1"
  256. FontSize="22"
  257. FontWeight="Black"
  258. Foreground="{StaticResource TitleBrush}"
  259. Header="系统"
  260. Style="{StaticResource GroupBoxTab}">
  261. <Grid Margin="4,0,0,0" TextBlock.FontWeight="Normal">
  262. <Grid.RowDefinitions>
  263. <RowDefinition Height="0.25*"/>
  264. <RowDefinition Height="0.25*"/>
  265. <RowDefinition Height="0.5*"/>
  266. </Grid.RowDefinitions>
  267. <hc:BulletCheckBox
  268. Width="140"
  269. Height="48"
  270. BorderBrush="Gray"
  271. CheckedText="开"
  272. IsChecked="{Binding GainSwich}"
  273. IsEnabled="{Binding ShakerControl.GainSwitchEnabled, Mode=OneWay}"
  274. Text="关">
  275. <hc:Interaction.Triggers>
  276. <hc:EventTrigger EventName="Click">
  277. <hc:ExInvokeCommandAction Command="{Binding ShakerControl.PowerAmplifier.GainSwitchCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=hc:BulletCheckBox}, Path=IsChecked}" />
  278. </hc:EventTrigger>
  279. </hc:Interaction.Triggers>
  280. </hc:BulletCheckBox>
  281. </Grid>
  282. </GroupBox>
  283. </Grid>
  284. </Viewbox>
  285. </UserControl>