BOLT Dash (C++)
Loading...
Searching...
No Matches
Backend Class Reference

A class to represent the C++ backend of the dash which can be included in QML to give the frontend access. More...

#include <backend.h>

Inheritance diagram for Backend:

Signals

void motorTempChanged ()
 
void auxVoltageChanged ()
 
void auxPercentChanged ()
 
void packSOCChanged ()
 
void packVoltageChanged ()
 
void highCellTempChanged ()
 
void lowCellTempChanged ()
 
void bmsTempChanged ()
 
void motorSpeedChanged ()
 
void bikeSpeedChanged ()
 
void mcTempChanged ()
 
void bmsFaultChanged ()
 
void mcFaultChanged ()
 
void motorOnChanged ()
 
void bikeStatusChanged ()
 
void packCurrentChanged ()
 
void bmsErrorChanged ()
 
void bmsWarningChanged ()
 
void bmsErrorCodesChanged ()
 
void bmsErrorCodesStringChanged ()
 
void latChanged ()
 
void lonChanged ()
 

Public Member Functions

 Backend (QObject *parent=nullptr)
 Create Backend class which can be included in QML.
 
double motorTemp () const
 Get the motor temperature.
 
double auxVoltage () const
 Get the voltage of the aux pack.
 
double auxPercent () const
 Get the percent charge of the aux pack.
 
double packSOC () const
 Get the state of charge of the main battery.
 
double packVoltage () const
 Get the voltage of the main battery.
 
double highCellTemp () const
 Get the highest cell temperature in the pack.
 
double lowCellTemp () const
 Get the lowest cell temperature in the pack.
 
double bmsTemp () const
 Get the temeprature of the BMS.
 
double motorSpeed () const
 Get the speed of the motor.
 
double bikeSpeed () const
 Get the speed of the bike.
 
double mcTemp () const
 Get the temperature of the motor controller.
 
bool bmsFault () const
 Get whether or not there is a BMS fault.
 
bool mcFault () const
 Get whether or not there is a motor controller fault.
 
bool motorOn () const
 Get whether or not the motor is currently active.
 
int bikeStatus () const
 Get the current status of the bike.
 
double packCurrent () const
 Get the current flowing from the main pack.
 
bool bmsError () const
 Get whether or not there is a BMS error.
 
bool bmsWarning () const
 Get whether or not there is a BMS warning.
 
uint32_t bmsErrorCodes () const
 Get the BMS error codes as a bitfield.
 
std::vector< QString > bmsErrorCodesString () const
 Get the BMS error codes as a vector of strings.
 
double lat () const
 Get the latitude of the bike.
 
double lon () const
 Get the longitude of the bike.
 
void setMotorTemp (const double temp)
 Set the Motor Temperature parameter, will get overwritten internally.
 
void setAuxVoltage (const double cap)
 Set the Aux Voltage parameter, will get overwritten internally.
 
void setAuxPercent (const double cap)
 Set the Aux Percent parameter, will get overwritten internally.
 
void setPackSOC (const double soc)
 Set the Pack SOC parameter, will get overwritten internally.
 
void setPackVoltage (const double voltage)
 Set the Pack Voltage parameter, will get overwritten internally.
 
void setHighCellTemp (const double temp)
 Set the High Cell Temp parameter, will get overwritten internally.
 
void setLowCellTemp (const double temp)
 Set the Low Cell Temp parameter, will get overwritten internally.
 
void setBmsTemp (const double temp)
 Set the BMS Temp parameter, will get overwritten internally.
 
void setMotorSpeed (const double speed)
 Set the Motor Speed parameter, will get overwritten internally.
 
void setBikeSpeed (const double speed)
 Set the Bike Speed parameter, will get overwritten internally.
 
void setMcTemp (const double temp)
 Set the MC Temp parameter, will get overwritten internally.
 
void setBmsFault (const bool fault)
 Set the BMS Fault parameter, will get overwritten internally.
 
void setMcFault (const bool fault)
 Set the MC Fault parameter, will get overwritten internally.
 
void setMotorOn (const bool on)
 Set the Motor On parameter, will get overwritten internally.
 
void setBikeStatus (const int status)
 Set the Bike Status parameter, will get overwritten internally.
 
void setPackCurrent (const double current)
 Set the Pack Current parameter, will get overwritten internally.
 
void setBmsError (const bool error)
 Set the BMS Error parameter, will get overwritten internally.
 
void setBmsWarning (const bool warning)
 Set the BMS Warning parameter, will get overwritten internally.
 
void setBmsErrorCodes (const uint32_t warnings)
 Set the BMS Error Codes parameter, will get overwritten internally.
 
void setBmsErrorCodesString (const std::vector< QString > warnings)
 Set the BMS Error Codes String parameter, will get overwritten internally.
 
void setLat (const double lat)
 Set the Latitude parameter, will get overwritten internally.
 
void setLon (const double lon)
 Set the Longitude parameter, will get overwritten internally.
 

Properties

QML_ELEMENTdouble motorTemp
 
double auxVoltage
 
double auxPercent
 
double packSOC
 
double packVoltage
 
double highCellTemp
 
double lowCellTemp
 
double bmsTemp
 
double motorSpeed
 
double bikeSpeed
 
double mcTemp
 
bool bmsFault
 
bool mcFault
 
bool motorOn
 
int bikeStatus
 
double packCurrent
 
uint32_t bmsErrorCodes
 
bool bmsError
 
bool bmsWarning
 
std::vector< QString > bmsErrorCodesString
 
double lat
 
double lon
 

Detailed Description

A class to represent the C++ backend of the dash which can be included in QML to give the frontend access.

Constructor & Destructor Documentation

◆ Backend()

Backend::Backend ( QObject * parent = nullptr)
explicit

Create Backend class which can be included in QML.

Parameters
parentthe QObject parent above the Backend

Member Function Documentation

◆ auxPercent()

double Backend::auxPercent ( ) const

Get the percent charge of the aux pack.

Returns
The percentage as a percent (e.g. 87.3)

◆ auxVoltage()

double Backend::auxVoltage ( ) const

Get the voltage of the aux pack.

Returns
The voltage in volts

◆ bikeSpeed()

double Backend::bikeSpeed ( ) const

Get the speed of the bike.

Returns
The speed in mph

◆ bikeStatus()

int Backend::bikeStatus ( ) const

Get the current status of the bike.

  1. Idle
  2. Precharge
  3. Ready
  4. Active
  5. There is a fault somewhere
Returns
An integer representing the status as shown above

◆ bmsError()

bool Backend::bmsError ( ) const

Get whether or not there is a BMS error.

Returns
true if there is any major error
false if there is not

◆ bmsErrorCodes()

uint32_t Backend::bmsErrorCodes ( ) const

Get the BMS error codes as a bitfield.

Returns
A 32-bit integer with each bit representing a different error

◆ bmsErrorCodesString()

std::vector< QString > Backend::bmsErrorCodesString ( ) const

Get the BMS error codes as a vector of strings.

Returns
A Vector of Qt-Strings with each string representing a different error

◆ bmsFault()

bool Backend::bmsFault ( ) const

Get whether or not there is a BMS fault.

Returns
true if there is a fault
false if all is good

◆ bmsTemp()

double Backend::bmsTemp ( ) const

Get the temeprature of the BMS.

Returns
The temperature in degrees Celsius

◆ bmsWarning()

bool Backend::bmsWarning ( ) const

Get whether or not there is a BMS warning.

Returns
true if there is a minor error/warning
false if there is not

◆ highCellTemp()

double Backend::highCellTemp ( ) const

Get the highest cell temperature in the pack.

Returns
The temperature in degrees Celsius

◆ lat()

double Backend::lat ( ) const

Get the latitude of the bike.

Returns
The latitude in degrees

◆ lon()

double Backend::lon ( ) const

Get the longitude of the bike.

Returns
The longitude in degrees

◆ lowCellTemp()

double Backend::lowCellTemp ( ) const

Get the lowest cell temperature in the pack.

Returns
The temperature in degrees Celsius

◆ mcFault()

bool Backend::mcFault ( ) const

Get whether or not there is a motor controller fault.

Returns
true if there is a fault
false if all is good

◆ mcTemp()

double Backend::mcTemp ( ) const

Get the temperature of the motor controller.

Returns
The highest temperature of the three sensors in degrees Celsius

◆ motorOn()

bool Backend::motorOn ( ) const

Get whether or not the motor is currently active.

Returns
true if the motor can be moved with the throttle
false if it cannot be moved electrically

◆ motorSpeed()

double Backend::motorSpeed ( ) const

Get the speed of the motor.

Returns
The motor speed in RPM

◆ motorTemp()

double Backend::motorTemp ( ) const

Get the motor temperature.

Returns
The temperature in degrees Celsius

◆ packCurrent()

double Backend::packCurrent ( ) const

Get the current flowing from the main pack.

Returns
The current in amps

◆ packSOC()

double Backend::packSOC ( ) const

Get the state of charge of the main battery.

Returns
The percentage as a percent (e.g. 87.3)

◆ packVoltage()

double Backend::packVoltage ( ) const

Get the voltage of the main battery.

Returns
The voltage in volts

◆ setAuxPercent()

void Backend::setAuxPercent ( const double cap)

Set the Aux Percent parameter, will get overwritten internally.

Parameters
capThe percent to set

◆ setAuxVoltage()

void Backend::setAuxVoltage ( const double cap)

Set the Aux Voltage parameter, will get overwritten internally.

Parameters
capThe temperature to set in degrees Celsius

◆ setBikeSpeed()

void Backend::setBikeSpeed ( const double speed)

Set the Bike Speed parameter, will get overwritten internally.

Parameters
speedThe speed to set in mph

◆ setBikeStatus()

void Backend::setBikeStatus ( const int status)

Set the Bike Status parameter, will get overwritten internally.

Parameters
statusThe status of the bike

◆ setBmsError()

void Backend::setBmsError ( const bool error)

Set the BMS Error parameter, will get overwritten internally.

Parameters
errorWhether or not there is an error

◆ setBmsErrorCodes()

void Backend::setBmsErrorCodes ( const uint32_t warnings)

Set the BMS Error Codes parameter, will get overwritten internally.

Parameters
warningsThe error codes to set

◆ setBmsErrorCodesString()

void Backend::setBmsErrorCodesString ( const std::vector< QString > warnings)

Set the BMS Error Codes String parameter, will get overwritten internally.

Parameters
warningsThe error codes to set

◆ setBmsFault()

void Backend::setBmsFault ( const bool fault)

Set the BMS Fault parameter, will get overwritten internally.

Parameters
faultWhether or not there is a fault

◆ setBmsTemp()

void Backend::setBmsTemp ( const double temp)

Set the BMS Temp parameter, will get overwritten internally.

Parameters
tempThe temperature to set in degrees Celsius

◆ setBmsWarning()

void Backend::setBmsWarning ( const bool warning)

Set the BMS Warning parameter, will get overwritten internally.

Parameters
warningWhether or not there is a warning

◆ setHighCellTemp()

void Backend::setHighCellTemp ( const double temp)

Set the High Cell Temp parameter, will get overwritten internally.

Parameters
tempThe temperature to set in degrees Celsius

◆ setLat()

void Backend::setLat ( const double lat)

Set the Latitude parameter, will get overwritten internally.

Parameters
latThe latitude to set in degrees

◆ setLon()

void Backend::setLon ( const double lon)

Set the Longitude parameter, will get overwritten internally.

Parameters
lonThe longitude to set in degrees

◆ setLowCellTemp()

void Backend::setLowCellTemp ( const double temp)

Set the Low Cell Temp parameter, will get overwritten internally.

Parameters
tempThe temperature to set in degrees Celsius

◆ setMcFault()

void Backend::setMcFault ( const bool fault)

Set the MC Fault parameter, will get overwritten internally.

Parameters
faultWhether or not there is a fault

◆ setMcTemp()

void Backend::setMcTemp ( const double temp)

Set the MC Temp parameter, will get overwritten internally.

Parameters
tempThe temperature to set in degrees Celsius

◆ setMotorOn()

void Backend::setMotorOn ( const bool on)

Set the Motor On parameter, will get overwritten internally.

Parameters
onWhether or not the motor is on

◆ setMotorSpeed()

void Backend::setMotorSpeed ( const double speed)

Set the Motor Speed parameter, will get overwritten internally.

Parameters
speedThe speed to set in RPM

◆ setMotorTemp()

void Backend::setMotorTemp ( const double temp)

Set the Motor Temperature parameter, will get overwritten internally.

Parameters
tempThe temperature to set in degrees Celsius

◆ setPackCurrent()

void Backend::setPackCurrent ( const double current)

Set the Pack Current parameter, will get overwritten internally.

Parameters
currentThe current to set in amps

◆ setPackSOC()

void Backend::setPackSOC ( const double soc)

Set the Pack SOC parameter, will get overwritten internally.

Parameters
socThe percent to set

◆ setPackVoltage()

void Backend::setPackVoltage ( const double voltage)

Set the Pack Voltage parameter, will get overwritten internally.

Parameters
voltageThe voltage to set in volts

The documentation for this class was generated from the following files: