BatteryConfigView.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <UserControl x:Class="OHV.Module.Interactivity.PopUp.BatteryConfigView"
  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:OHV.Module.Interactivity.PopUp"
  7. xmlns:prism="http://prismlibrary.com/"
  8. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  9. prism:ViewModelLocator.AutoWireViewModel="True"
  10. mc:Ignorable="d"
  11. Height="1080" Width="1920"
  12. Background="#CC282C34">
  13. <prism:Dialog.WindowStyle>
  14. <Style TargetType="Window">
  15. <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
  16. <Setter Property="Background" Value="Transparent"/>
  17. <Setter Property="AllowsTransparency" Value="True"/>
  18. <Setter Property="ResizeMode" Value="NoResize"/>
  19. <Setter Property="WindowStyle" Value="None"/>
  20. <Setter Property="BorderThickness" Value="1"/>
  21. <Setter Property="BorderBrush" Value="{DynamicResource BorderSolidNormal}"/>
  22. <Setter Property="Template" Value="{DynamicResource WindowTemplateKey}"/>
  23. <Setter Property="WindowState" Value="Maximized"/>
  24. <!--<Style.Triggers>
  25. <Trigger Property="ResizeMode" Value="CanResizeWithGrip">
  26. <Setter Property="Template" Value="{StaticResource WindowTemplateKey}"/>
  27. </Trigger>
  28. </Style.Triggers>-->
  29. </Style>
  30. </prism:Dialog.WindowStyle>
  31. <UserControl.Resources>
  32. <ResourceDictionary>
  33. <ResourceDictionary.MergedDictionaries>
  34. <ResourceDictionary Source="/OHV.LanguageHelper;component/Languages/English.xaml"/>
  35. </ResourceDictionary.MergedDictionaries>
  36. </ResourceDictionary>
  37. </UserControl.Resources>
  38. <Border BorderBrush="Gray" BorderThickness="2" Width="800" Height="600">
  39. <Grid>
  40. <Grid.ColumnDefinitions>
  41. <ColumnDefinition Width="*"/>
  42. <ColumnDefinition Width="130"/>
  43. </Grid.ColumnDefinitions>
  44. <Grid.RowDefinitions>
  45. <RowDefinition Height="50"/>
  46. <RowDefinition Height="*"/>
  47. </Grid.RowDefinitions>
  48. <Grid Grid.Row="0">
  49. <StackPanel Orientation="Horizontal">
  50. <TextBlock Grid.Row="0" Margin="5" Text="Battery View" FontSize="25" Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Center"/>
  51. <!--<materialDesign:PackIcon Margin="10,0,0,0" Kind="OfflineBolt" VerticalAlignment="Center" HorizontalAlignment="Center" Height="Auto" Width="auto"/>-->
  52. </StackPanel>
  53. <StackPanel VerticalAlignment="Center"
  54. HorizontalAlignment="Right"
  55. Margin="1">
  56. <Button Margin="1" HorizontalAlignment="Center" Height="45" BorderBrush="Gray" BorderThickness="0" Background="{x:Null}"
  57. HorizontalContentAlignment="Right">
  58. <StackPanel Orientation="Horizontal">
  59. <Ellipse Margin="0,0,10,0" Fill="{Binding BatteryConnectBrush, FallbackValue=Gray}" Width="23" Height="21"/>
  60. <TextBlock Margin="2" Text="{Binding BatteryConnect, FallbackValue=STATUS}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  61. </StackPanel>
  62. </Button>
  63. </StackPanel>
  64. </Grid>
  65. <Grid Grid.Column="0" Grid.Row="1">
  66. <Grid Margin="15" Background="#37474f">
  67. <Grid Grid.Row="0">
  68. <Grid.ColumnDefinitions>
  69. <ColumnDefinition Width="*"/>
  70. <ColumnDefinition Width="*"/>
  71. <ColumnDefinition Width="*"/>
  72. <ColumnDefinition Width="*"/>
  73. <ColumnDefinition Width="*"/>
  74. </Grid.ColumnDefinitions>
  75. <Grid.RowDefinitions>
  76. <RowDefinition Height="*"/>
  77. <RowDefinition Height="*"/>
  78. <RowDefinition Height="*"/>
  79. <RowDefinition Height="*"/>
  80. <RowDefinition Height="*"/>
  81. </Grid.RowDefinitions>
  82. <Button Grid.Column="0" Grid.Row="0"
  83. Content="Voltage" Margin="3" VerticalAlignment="Bottom"/>
  84. <Border Grid.Row="1" Grid.Column="0" BorderBrush="Gray" BorderThickness="1" Margin="5">
  85. <TextBlock Grid.Column="0" Grid.Row="1"
  86. VerticalAlignment="Center"
  87. HorizontalAlignment="Center"
  88. Foreground="Orange" FontSize="20">
  89. <Run Text="{Binding Voltage, StringFormat={}{0:0.0V}, FallbackValue=0.00V}"/>
  90. </TextBlock>
  91. </Border>
  92. <!--Current-->
  93. <Button Grid.Column="1" Grid.Row="0"
  94. Content="Current" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  95. <Border Grid.Column="1" Grid.Row="1" Margin="5"
  96. BorderBrush="Gray" BorderThickness="1">
  97. <TextBlock Grid.Column="0" Grid.Row="1"
  98. VerticalAlignment="Center"
  99. HorizontalAlignment="Center"
  100. Foreground="Orange" FontSize="20">
  101. <Run Text="{Binding Current,StringFormat={}{0:0.0A}, FallbackValue=0.0A}"/>
  102. </TextBlock>
  103. </Border>
  104. <!--SOC-->
  105. <Button Grid.Column="2" Grid.Row="0"
  106. Content="SOC" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  107. <Border Grid.Column="2" Grid.Row="1" Margin="5"
  108. BorderBrush="Gray" BorderThickness="1">
  109. <TextBlock Grid.Column="0" Grid.Row="1"
  110. VerticalAlignment="Center"
  111. HorizontalAlignment="Center"
  112. Foreground="Orange" FontSize="20">
  113. <Run Text="{Binding SOC, StringFormat={}{0}%, FallbackValue=0%}"/>
  114. </TextBlock>
  115. </Border>
  116. <!--Battery State-->
  117. <Button Grid.Column="3" Grid.Row="0"
  118. Content="Battery State" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  119. <Border Grid.Column="3" Grid.Row="1" Margin="5"
  120. BorderBrush="Gray" BorderThickness="1">
  121. <TextBlock Grid.Column="0" Grid.Row="1"
  122. VerticalAlignment="Center"
  123. HorizontalAlignment="Center"
  124. Foreground="Orange" FontSize="20">
  125. <Run Text="{Binding BatteryState, FallbackValue=None}"/>
  126. </TextBlock>
  127. </Border>
  128. <!--Temperature-->
  129. <Button Grid.Column="4" Grid.Row="0"
  130. Content="Temperature" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  131. <Border Grid.Column="4" Grid.Row="1" Margin="5"
  132. BorderBrush="Gray" BorderThickness="1">
  133. <TextBlock Grid.Column="0" Grid.Row="1"
  134. VerticalAlignment="Center"
  135. HorizontalAlignment="Center"
  136. Foreground="Orange" FontSize="20">
  137. <Run Text="{Binding Temperature, StringFormat={}{0:0.0C}, FallbackValue=C}"/>
  138. </TextBlock>
  139. </Border>
  140. <!--ChargeTime-->
  141. <Button Grid.Column="0" Grid.Row="2"
  142. Content="ChargeTime" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  143. <Border Grid.Column="0" Grid.Row="3" Margin="5"
  144. BorderBrush="Gray" BorderThickness="1">
  145. <TextBlock Grid.Column="0" Grid.Row="1"
  146. VerticalAlignment="Center"
  147. HorizontalAlignment="Center"
  148. Foreground="Orange" FontSize="20">
  149. <Run Text="{Binding AverageTimeToFull,StringFormat={}{0:0.0}H, FallbackValue=H}"/>
  150. </TextBlock>
  151. </Border>
  152. <!--DisChargeTime-->
  153. <Button Grid.Column="1" Grid.Row="2"
  154. Content="DisChargeTime" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  155. <Border Grid.Column="1" Grid.Row="3" Margin="5"
  156. BorderBrush="Gray" BorderThickness="1">
  157. <TextBlock Grid.Column="0" Grid.Row="1"
  158. VerticalAlignment="Center"
  159. HorizontalAlignment="Center"
  160. Foreground="Orange" FontSize="20">
  161. <Run Text="{Binding AverageTimeToEmpty, StringFormat={}{0:0.0}H,FallbackValue=H}"/>
  162. </TextBlock>
  163. </Border>
  164. <!--SOH-->
  165. <Button Grid.Column="2" Grid.Row="2"
  166. Content="SOH" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  167. <Border Grid.Column="2" Grid.Row="3" Margin="5"
  168. BorderBrush="Gray" BorderThickness="1">
  169. <TextBlock Grid.Column="0" Grid.Row="1"
  170. VerticalAlignment="Center"
  171. HorizontalAlignment="Center"
  172. Foreground="Orange" FontSize="20">
  173. <Run Text="{Binding SOH, StringFormat={}{0}%,FallbackValue=0%}"/>
  174. </TextBlock>
  175. </Border>
  176. <!--Capacity-->
  177. <Button Grid.Column="3" Grid.Row="2"
  178. Content="Capacity" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  179. <Border Grid.Column="3" Grid.Row="3" Margin="5"
  180. BorderBrush="Gray" BorderThickness="1">
  181. <TextBlock Grid.Column="0" Grid.Row="1"
  182. VerticalAlignment="Center"
  183. HorizontalAlignment="Center"
  184. Foreground="Orange" FontSize="20">
  185. <Run Text="{Binding Capacity, StringFormat={}{0:0Ah}, FallbackValue=Ah}"/>
  186. </TextBlock>
  187. </Border>
  188. <!--Energy-->
  189. <Button Grid.Column="4" Grid.Row="2"
  190. Content="Energy" Margin="3" Width="Auto" VerticalAlignment="Bottom"/>
  191. <Border Grid.Column="4" Grid.Row="3" Margin="5"
  192. BorderBrush="Gray" BorderThickness="1">
  193. <TextBlock Grid.Column="0" Grid.Row="1"
  194. VerticalAlignment="Center"
  195. HorizontalAlignment="Center"
  196. Foreground="Orange" FontSize="20">
  197. <Run Text="{Binding Energy, StringFormat={}{0:0.0Wh},FallbackValue=Wh}"/>
  198. </TextBlock>
  199. </Border>
  200. </Grid>
  201. </Grid>
  202. </Grid>
  203. <Grid Grid.Column="1" Background="#263238" Grid.RowSpan="2">
  204. <Border Margin="1" BorderBrush="#FF00FFD3" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
  205. <StackPanel VerticalAlignment="Bottom">
  206. <Button Margin="10,0,10,10" HorizontalAlignment="Stretch" Height="90" BorderBrush="Gray" BorderThickness="2" Command="{Binding CloseDialogCommand}" CommandParameter="true">
  207. <StackPanel>
  208. <materialDesign:PackIcon Kind="ExitToApp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="42" Width="auto"/>
  209. <TextBlock Text="Close" VerticalAlignment="Stretch" HorizontalAlignment="Center" />
  210. </StackPanel>
  211. </Button>
  212. </StackPanel>
  213. </Grid>
  214. </Grid>
  215. </Border>
  216. </UserControl>