semf
batterystateofcharge.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_BATTERY_BATTERYSTATEOFCHARGE_H_
11#define SEMF_APP_BATTERY_BATTERYSTATEOFCHARGE_H_
12
13#include <cstdint>
14
15namespace semf
16{
17namespace app
18{
27template <typename T_SOC, typename T_VOLTAGE, typename T_CURRENT, typename T_TEMPERATURE>
29{
30public:
31 virtual ~BatteryStateOfCharge() = default;
32
40 virtual void updateSoc(uint16_t timeDelta, T_VOLTAGE voltage, T_CURRENT current, T_TEMPERATURE temperature) = 0;
47 virtual T_SOC relativeSoc() const = 0;
54 virtual T_SOC absoluteSoc() const = 0;
55
56protected:
61 virtual void initSocByLastSoc(T_SOC lastAbsoluteSoc) = 0;
66 virtual void initSocByOcv(T_VOLTAGE ocv) {}
71 virtual void setAbsoluteSoc(T_SOC soc) = 0;
72};
73} /* namespace app */
74} /* namespace semf */
75#endif /* SEMF_APP_BATTERY_BATTERYSTATEOFCHARGE_H_ */
Interface for using state of charge in a battery model.
virtual void setAbsoluteSoc(T_SOC soc)=0
Sets the absolute state of charge.
virtual T_SOC absoluteSoc() const =0
Returns the absolute state of charge.
virtual void updateSoc(uint16_t timeDelta, T_VOLTAGE voltage, T_CURRENT current, T_TEMPERATURE temperature)=0
Updates the state of charge relative to the current, voltage and temperature of the battery.
virtual void initSocByLastSoc(T_SOC lastAbsoluteSoc)=0
Initializes the state of charge calculation by the open circuit voltage after booting.
virtual ~BatteryStateOfCharge()=default
virtual void initSocByOcv(T_VOLTAGE ocv)
Initializes the state of charge calculation by the open circuit voltage after booting.
virtual T_SOC relativeSoc() const =0
Returns the relative state of charge. This is the value normally showed on a display.