-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathBMSModuleManager.h
72 lines (69 loc) · 2 KB
/
BMSModuleManager.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include "config.h"
#include "BMSModule.h"
class BMSModuleManager
{
public:
BMSModuleManager();
int seriescells();
void clearmodules();
void StopBalancing();
void balanceCells(int duration, int debug);
void setupBoards();
void findBoards();
void renumberBoardIDs();
void clearFaults();
void sleepBoards();
void wakeBoards();
void getAllVoltTemp();
void readSetpoints();
void setBatteryID(int id);
void setPstrings(int Pstrings);
void setUnderVolt(float newVal);
void setOverVolt(float newVal);
void setOverTemp(float newVal);
void setBalanceV(float newVal);
void setBalanceHyst(float newVal);
void setSensors(int sensor, float Ignore);
float getPackVoltage();
float getAvgTemperature();
float getHighTemperature();
float getLowTemperature();
float getAvgCellVolt();
float getLowCellVolt();
float getHighCellVolt();
float getHighVoltage();
float getLowVoltage();
int getBalancing();
uint16_t getcellvolt(int modid, int cellid);
uint16_t gettemp(int modid, int tempid);
/*
void processCANMsg(CAN_FRAME &frame);
*/
void printAllCSV(unsigned long timestamp,float current, int SOC, int delim);
void printPackSummary();
void printPackDetails(int digits);
int getNumModules();
private:
float packVolt; // All modules added together
int Pstring;
float LowCellVolt;
float HighCellVolt;
float lowestPackVolt;
float highestPackVolt;
float lowestPackTemp;
float highestPackTemp;
float highTemp;
float lowTemp;
BMSModule modules[MAX_MODULE_ADDR + 1]; // store data for as many modules as we've configured for.
int batteryID;
int numFoundModules; // The number of modules that seem to exist
bool isFaulted;
int spack;
int CellsBalancing;
/*
void sendBatterySummary();
void sendModuleSummary(int module);
void sendCellDetails(int module, int cell);
*/
};