summaryrefslogtreecommitdiff
path: root/battery.h
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2022-11-17 20:50:46 -0600
committerJoshua Drake <joshua.ellis.drake@gmail.com>2022-11-17 20:50:46 -0600
commitaeef870dbed6488483dc8dadfdf57858a9d84b7c (patch)
tree3974d2eaf2e50c8108d31c48e21d07f301eb6b73 /battery.h
Initial Commit
Diffstat (limited to 'battery.h')
-rw-r--r--battery.h50
1 files changed, 50 insertions, 0 deletions
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 <QObject>
+
+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