Skip to content

Commit

Permalink
Restylized all source files to be harmonized.
Browse files Browse the repository at this point in the history
  • Loading branch information
collin80 committed Jul 7, 2016
1 parent de94b50 commit ef75e4e
Show file tree
Hide file tree
Showing 65 changed files with 7,573 additions and 7,387 deletions.
28 changes: 14 additions & 14 deletions BatteryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,34 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
*/

#include "BatteryManager.h"
BatteryManager::BatteryManager() : Device()

BatteryManager::BatteryManager() : Device()
{
packVoltage = 0;
packCurrent = 0;
packVoltage = 0;
packCurrent = 0;
}

BatteryManager::~BatteryManager()
BatteryManager::~BatteryManager()
{
}

DeviceType BatteryManager::getType() {
return (DEVICE_BMS);
return (DEVICE_BMS);
}

void BatteryManager::handleTick() {
}

void BatteryManager::setup() {
#ifndef USE_HARD_CODED
if (prefsHandler->checksumValid()) { //checksum is good, read in the values stored in EEPROM
}
else { //checksum invalid. Reinitialize values and store to EEPROM
//prefsHandler->saveChecksum();
}
if (prefsHandler->checksumValid()) { //checksum is good, read in the values stored in EEPROM
}
else { //checksum invalid. Reinitialize values and store to EEPROM
//prefsHandler->saveChecksum();
}
#else
#endif

Expand All @@ -62,12 +62,12 @@ void BatteryManager::setup() {

int BatteryManager::getPackVoltage()
{
return packVoltage;
return packVoltage;
}

signed int BatteryManager::getPackCurrent()
{
return packCurrent;
return packCurrent;
}


Expand Down
50 changes: 25 additions & 25 deletions BatteryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
*/

#ifndef BATTMANAGE_H_
#define BATTMANAGE_H_

Expand All @@ -35,32 +35,32 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class BatteryManager : public Device {
public:
BatteryManager();
~BatteryManager();
int getPackVoltage(); //in tenths of a volt
signed int getPackCurrent(); //in tenths of an amp
//bool allowCharging();
//bool allowDischarging();
DeviceType getType();
BatteryManager();
~BatteryManager();
int getPackVoltage(); //in tenths of a volt
signed int getPackCurrent(); //in tenths of an amp
//bool allowCharging();
//bool allowDischarging();
DeviceType getType();
void setup();
void handleTick();
//a bunch of boolean functions. Derived classes must implment
//these functions to tell everyone else what they support
virtual bool hasPackVoltage() = 0;
virtual bool hasPackCurrent() = 0;
virtual bool hasTemperatures() = 0;
virtual bool isChargeOK() = 0;
virtual bool isDischargeOK() = 0;
//a bunch of boolean functions. Derived classes must implment
//these functions to tell everyone else what they support
virtual bool hasPackVoltage() = 0;
virtual bool hasPackCurrent() = 0;
virtual bool hasTemperatures() = 0;
virtual bool isChargeOK() = 0;
virtual bool isDischargeOK() = 0;
protected:
int packVoltage; //tenths of a volt
signed int packCurrent; //tenths of an amp
int SOC; //state of charge in percent
int lowestCellV, highestCellV; //in mv
int lowestCellTemp, highestCellTemp;
//should be some form of discharge and charge limit. I don't know if it should be % or amps
//some BMS systems will report one way and some the other.
int dischargeLimit, chargeLimit;
bool allowCharge, allowDischarge;
int packVoltage; //tenths of a volt
signed int packCurrent; //tenths of an amp
int SOC; //state of charge in percent
int lowestCellV, highestCellV; //in mv
int lowestCellTemp, highestCellTemp;
//should be some form of discharge and charge limit. I don't know if it should be % or amps
//some BMS systems will report one way and some the other.
int dischargeLimit, chargeLimit;
bool allowCharge, allowDischarge;

private:
};
Expand Down
Loading

0 comments on commit ef75e4e

Please sign in to comment.