blob: 5be2fc8fc0ae667b8d4a0830de8a51dbbda58e97 (
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[0]),
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);
}
|