-
Notifications
You must be signed in to change notification settings - Fork 9
/
BMSModuleManager.h
73 lines (68 loc) · 1.99 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
73
#pragma once
#include "Config.h"
#include "BMSModule.h"
#include <FlexCAN.h>
class BMSModuleManager
{
public:
BMSModuleManager();
int seriescells();
void clearmodules();
void decodecan(CAN_message_t &msg,int debug);
void decodetemp(CAN_message_t &msg, int debug, int CSC);
void balanceCells();
void setupBoards();
bool checkcomms();
bool checkstatus();
void findBoards();
void renumberBoardIDs();
void getAllVoltTemp();
void readSetpoints();
void setBatteryID(int id);
void setBalIgnore(bool BalIgn);
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, int tempoff);
float getPackVoltage();
float getAvgTemperature();
float getHighTemperature();
float getLowTemperature();
float getAvgCellVolt();
float getLowCellVolt();
float getHighCellVolt();
float getHighVoltage();
float getLowVoltage();
/*
void processCANMsg(CAN_FRAME &frame);
*/
void printAllCSV(unsigned long timestamp,float current, int SOC);
void printPackSummary();
void printPackDetails(int digits,int CSCvariant);
int getNumModules();
private:
bool BalIgnore;
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;
/*
void sendBatterySummary();
void sendModuleSummary(int module);
void sendCellDetails(int module, int cell);
*/
};