diff --git a/Helios/Source/Battery.cs b/Helios/Source/Battery.cs new file mode 100644 index 0000000000000000000000000000000000000000..833d49eedf40431f4f85a277ed00b6c06b03066c --- /dev/null +++ b/Helios/Source/Battery.cs @@ -0,0 +1,42 @@ +using System; +namespace Helios.Source +{ + public class Battery + { + public int Capacity { get; set; } + public int Voltage { get; set; } + public double Charge { get; private set; } + public double DepthOfDischarge { get; private set; } + + public Battery() { } + + public Battery(int capacity, int voltage) + { + this.Capacity = capacity; + this.Voltage = voltage; + } + + public double GetCharge(double powerBalence) + { + double charge; + + charge = powerBalence / this.Voltage; + + this.Charge = charge; + + return charge; + } + + public double GetDepthOfDischarge() + { + double depthOfDischarge; + + depthOfDischarge = (1 - (this.Charge / this.Capacity)) * 100; + + this.DepthOfDischarge = depthOfDischarge; + + return depthOfDischarge; + } + } +} +