Skip to content

Commit

Permalink
Added battery wear percentage to real capacity text
Browse files Browse the repository at this point in the history
  • Loading branch information
sowa705 committed May 19, 2019
1 parent 61e0a77 commit c3ffec4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Power Monitor/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<Label Content="Real capacity:" HorizontalAlignment="Left" Margin="25,95,0,0" VerticalAlignment="Top"/>
<Label Content="Current voltage:" HorizontalAlignment="Left" Margin="25,121,0,0" VerticalAlignment="Top"/>
<Label Content="Time Remaining:" HorizontalAlignment="Left" Margin="25,147,0,0" VerticalAlignment="Top"/>
<Button x:Name="SettingsBtn" Content="Settings" HorizontalAlignment="Right" Margin="0,0,14,14" VerticalAlignment="Bottom" Width="93" Height="33" BorderBrush="{x:Null}" BorderThickness="0" Background="#FFCFCFCF" FontFamily="Segoe UI Semibold"/>
<Button x:Name="SettingsBtn" Content="Settings" HorizontalAlignment="Right" Margin="0,0,14,14" VerticalAlignment="Bottom" Width="93" Height="33" BorderBrush="{x:Null}" BorderThickness="0" Background="#FFCFCFCF" FontFamily="Segoe UI Semibold" IsEnabled="False"/>
<Label x:Name="NomCap" Content="45 Wh" HorizontalAlignment="Left" Margin="134,69,0,0" VerticalAlignment="Top"/>
<Label x:Name="RealCap" Content="37 Wh (87%)" HorizontalAlignment="Left" Margin="134,95,0,0" VerticalAlignment="Top"/>
<Label x:Name="Voltage" Content="11,57 V" HorizontalAlignment="Left" Margin="134,121,0,0" VerticalAlignment="Top"/>
Expand Down
2 changes: 1 addition & 1 deletion Power Monitor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void UIUpdate()
}

}
RealCap.Content= (Math.Round(battery.RealCapacity * 10) / 10f) + " Wh";
RealCap.Content= (Math.Round(battery.RealCapacity * 10) / 10f) + $" Wh ({Math.Round((battery.RealCapacity/battery.NominalCapacity)*100)}%)";
NomCap.Content = (Math.Round(battery.NominalCapacity * 10) / 10f) + " Wh";
Voltage.Content = (Math.Round(battery.CurrentVoltage * 100) / 100f) + " V";

Expand Down
Binary file modified Screenshot.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c3ffec4

Please sign in to comment.