|

INTRODUCTION
Overview
Download and Install
Documentation
Publications
REPOSITORY
Libraries
DEVELOPER
Dev Guide
Dashboard
PEOPLE
Contributors
Users

Project
Download
Mailing lists
|
|
|
gbxsmartbatteryacfr Namespace Reference
SmartBattery library.
More...
Classes |
class | HardwareReadingException |
| Exception for hardware reading problems. More...
|
class | ParsingException |
| Exception for parsing problems. More...
|
class | OceanServer |
struct | BatteryHealthWarningConfig |
class | OceanServerParser |
class | OceanServerReader |
class | OceanServerSystem |
class | SmartBattery |
Enumerations |
enum | SmartBatteryDataField |
Functions |
bool | checkNumberOfBatteries (const OceanServerSystem &batteryData, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose, int expectedNumBatteries) |
bool | conductAllHealthChecks (const OceanServerSystem &batteryData, const BatteryHealthWarningConfig &batteryConfig, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose, bool printRawRecord) |
bool | checkNumCycles (const OceanServerSystem &batteryData, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose, int numCyclesThreshhold, bool printRawRecord=false) |
bool | checkTemperatures (const OceanServerSystem &batteryData, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose, double chargeTempThreshhold, double dischargeTempThreshhold, bool printRawRecord=false) |
bool | checkCharges (const OceanServerSystem &batteryData, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose, int chargeWarnThreshhold, int chargeDeviationThreshold) |
bool | checkModuleHealth (const OceanServerSystem &batteryData, std::vector< std::string > &warnShort, std::vector< std::string > &warnVerbose) |
string | toString (const OceanServerSystem &system) |
| Puts OceanServerSystem data into a human-readable string.
|
string | toLogString (const OceanServerSystem &system) |
| Puts OceanServerSystem data into a machine-readable ASCII string.
|
void | updateWithNewData (const OceanServerSystem &from, OceanServerSystem &to) |
bool | isChargePowerPresent (const OceanServerSystem &batterySystem) |
| Returns true if the charge power is present for at least one of the battery modules, otherwise false.
|
string | toString (const SmartBattery &b) |
| Puts SmartBattery data into a human-readable string.
|
string | toLogString (const SmartBattery &b) |
| Puts SmartBattery data into a machine-readable ASCII string.
|
SmartBatteryDataField | keyToSmartField (const std::string &key) |
void | readFlags (const std::string &str, std::vector< bool > &flags) |
double | readTemperature (const std::string &str) |
double | readCurrent (const std::string &str) |
double | readVoltage (const std::string &str) |
int | readNumBatteries (const std::string &str) |
int | readPercentWord (const std::string &str) |
int | readPercentByte (const std::string &str) |
int | readMinutes (const std::string &str) |
int | readCapacity (const std::string &str) |
uint16_t | read16Flags (const std::string &str) |
int | readCount (const std::string &str) |
int | readNumber (const std::string &str) |
int | readRate (const std::string &str) |
bool | isChecksumValid (const std::string &input, const std::string &expected) |
void | toKeyValuePairs (const std::vector< std::string > &fields, std::map< std::string, std::string > &pairs, gbxutilacfr::Tracer &tracer) |
Detailed Description
SmartBattery library.
This namespace is part of a SmartBattery library.
- See also:
- GbxSmartBatteryAcfr
Enumeration Type Documentation
Function Documentation
bool gbxsmartbatteryacfr::checkCharges |
( |
const OceanServerSystem & |
batteryData, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose, |
|
|
int |
chargeWarnThreshhold, |
|
|
int |
chargeDeviationThreshold | |
|
) |
| | |
Issues a short and verbose warning if the charge of one or more batteries is below the threshold or if the charge of any battery deviates by chargeDeviationThreshold percent from the average of all batteries Returns true if there was a warning otherwise false
bool gbxsmartbatteryacfr::checkModuleHealth |
( |
const OceanServerSystem & |
batteryData, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose | |
|
) |
| | |
Issues a short and verbose warning if any of the individual modules have "bad power" or are "charge-inhibited" Returns true if there was a warning otherwise false
bool gbxsmartbatteryacfr::checkNumberOfBatteries |
( |
const OceanServerSystem & |
batteryData, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose, |
|
|
int |
expectedNumBatteries | |
|
) |
| | |
Issues a short and verbose warning if the number of expected batteries are not installed Returns true if there was a warning otherwise false
bool gbxsmartbatteryacfr::checkNumCycles |
( |
const OceanServerSystem & |
batteryData, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose, |
|
|
int |
numCyclesThreshhold, |
|
|
bool |
printRawRecord = false | |
|
) |
| | |
Issues a short and verbose warning if the number of recharge cycles of one or more batteries are exceeded Optionally includes the raw battery record in warnVerbose Returns true if there was a warning otherwise false
bool gbxsmartbatteryacfr::checkTemperatures |
( |
const OceanServerSystem & |
batteryData, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose, |
|
|
double |
chargeTempThreshhold, |
|
|
double |
dischargeTempThreshhold, |
|
|
bool |
printRawRecord = false | |
|
) |
| | |
Issues a short and verbose warning if the temperature threshholds are of one or more batteries are exceeded Optionally includes the raw battery record in warnVerbose Returns true if there was a warning otherwise false
bool gbxsmartbatteryacfr::conductAllHealthChecks |
( |
const OceanServerSystem & |
batteryData, |
|
|
const BatteryHealthWarningConfig & |
batteryCheckConfig, |
|
|
std::vector< std::string > & |
warnShort, |
|
|
std::vector< std::string > & |
warnVerbose, |
|
|
bool |
printRawRecord = false | |
|
) |
| | |
Conducts all of the health checks above given a battery health configuration Adds up short and verbose warning messages Optionally includes the raw battery record at the end of warnVerbose if any check generated a warning Returns true if there were warnings otherwise false
bool gbxsmartbatteryacfr::isChecksumValid |
( |
const std::string & |
input, |
|
|
const std::string & |
expected | |
|
) |
| | |
Computes an XOR checksum from 'input' (skips the first character). Returns true if it matches with 'expected', otherwise false
Converts a key (string) to a SmartBatteryDataField. Throws a ParsingException if key is unknown.
uint16_t gbxsmartbatteryacfr::read16Flags |
( |
const std::string & |
str |
) |
|
Expects 4 hex characters, translates them into uint16_t May throw ParsingException
int gbxsmartbatteryacfr::readCapacity |
( |
const std::string & |
str |
) |
|
int gbxsmartbatteryacfr::readCount |
( |
const std::string & |
str |
) |
|
double gbxsmartbatteryacfr::readCurrent |
( |
const std::string & |
str |
) |
|
void gbxsmartbatteryacfr::readFlags |
( |
const std::string & |
str, |
|
|
std::vector< bool > & |
flags | |
|
) |
| | |
Expects 2 hex characters and translates them into a vector of boolean flags May throw ParsingException
int gbxsmartbatteryacfr::readMinutes |
( |
const std::string & |
str |
) |
|
int gbxsmartbatteryacfr::readNumBatteries |
( |
const std::string & |
str |
) |
|
Expects 2 hex characters, returns number of batteries May throw ParsingException
int gbxsmartbatteryacfr::readNumber |
( |
const std::string & |
str |
) |
|
int gbxsmartbatteryacfr::readPercentByte |
( |
const std::string & |
str |
) |
|
int gbxsmartbatteryacfr::readPercentWord |
( |
const std::string & |
str |
) |
|
int gbxsmartbatteryacfr::readRate |
( |
const std::string & |
str |
) |
|
double gbxsmartbatteryacfr::readTemperature |
( |
const std::string & |
str |
) |
|
double gbxsmartbatteryacfr::readVoltage |
( |
const std::string & |
str |
) |
|
void gbxsmartbatteryacfr::toKeyValuePairs |
( |
const std::vector< std::string > & |
fields, |
|
|
std::map< std::string, std::string > & |
pairs, |
|
|
gbxutilacfr::Tracer & |
tracer | |
|
) |
| | |
Decomposes 'fields' (a flat list of keys and values) into 'pairs' (a map of keys and values). May throw ParsingException.
void gbxsmartbatteryacfr::updateWithNewData |
( |
const OceanServerSystem & |
from, |
|
|
OceanServerSystem & |
to | |
|
) |
| | |
Updates all fields in 'to' with data from 'from'. Also reaps batteries in 'to' if they are not in 'from'. Has persistence capabilities: if fields in 'from' are not set and corresponding fields in 'to' are set, the ones in 'to' are kept. There's one exception: the rawRecord field is always updated Use case: a class stores 'to' as a member variable, receives the latest records into 'from', calls this function to update 'to'. The reaping capability makes sure that battery modules which are no longer connected don't persist.
Referenced by gbxsmartbatteryacfr::OceanServer::walk().
|
|