From aeef870dbed6488483dc8dadfdf57858a9d84b7c Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Thu, 17 Nov 2022 20:50:46 -0600 Subject: Initial Commit --- battery.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 battery.h (limited to 'battery.h') diff --git a/battery.h b/battery.h new file mode 100644 index 0000000..c1b7a86 --- /dev/null +++ b/battery.h @@ -0,0 +1,50 @@ +#ifndef BATTERY_H +#define BATTERY_H + +#include + +typedef struct batteryData { + QString name; + double nominalVoltage; + double specificEnergy; // Wh/Kg + float cellDischargeRate; + float cellChargeRate; +}batteryData_t; + +static const batteryData_t batteries[] +{ + {.name = "Li-ion Phosphate", .nominalVoltage = 3.3, .specificEnergy = 105.0, .cellDischargeRate = 30, .cellChargeRate = 10}, + {.name = "Li-ion Manganese", .nominalVoltage = 3.7, .specificEnergy = 125.0, .cellDischargeRate = 30, .cellChargeRate = 10}, + {.name = "Li-ion Cobalt", .nominalVoltage = 3.6, .specificEnergy = 200.0, .cellDischargeRate = 2, .cellChargeRate = 1}, + {.name = "NiMH", .nominalVoltage = 1.2, .specificEnergy = 90.0, .cellDischargeRate = 5, .cellChargeRate = 0.5}, + {.name = "NiCd", .nominalVoltage = 1.2, .specificEnergy = 60.0, .cellDischargeRate = 20, .cellChargeRate = 1}, +}; +enum batteryNames +{ + LiionPhosphate = 0, + LiionManganese, + LiionCobalt, + NiMH, + NICd, +}; + +class Battery : public QObject +{ + Q_OBJECT +public: + Battery(); +private: + void changeBatteryChemistry(int name); + + batteryData_t activeBattery; + int seriesCells; + int parallelCells; + float packDischargeRate; + float packChargeRate; + float packWeight; + float packEnergy; +signals: + +}; + +#endif // BATTERY_H -- cgit v1.2.3