summaryrefslogtreecommitdiff
path: root/battery.cpp
blob: b38a0ac800214e85b68c860373702a4abbf68ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "battery.h"

Battery::Battery() :
    activeBattery(batteries[LiionPhosphate]),
    seriesCells(0),
    parallelCells(0),
    systemVoltage(0),
    peakPower(0),
    packDischargeRate(0),
    packChargeRate(0),
    packWeight(0),
    packEnergy(0)
{

}

void Battery::changeBatteryChemistry(int name)
{
    activeBattery= batteries[name];
}

void Battery::setSystemVoltage(double voltage)
{
    systemVoltage = voltage;
}

void Battery::setPeakSystemPower(double power)
{
    peakPower = power;
}

void Battery::calculate()
{
    seriesCells = ceil(systemVoltage/activeBattery.nominalVoltage);


}