Battery.hh
Go to the documentation of this file.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: SuppressWarning.hh:64
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: SuppressWarning.hh:67
Battery(const std::string &_name, const double _voltage)
Constructor that sets the name and initial voltage.
bool operator!=(const Battery &_battery) const
Inequality operator.
void SetUpdateFunc(std::function< double(Battery *)> _updateFunc)
Setup function to update voltage.
void SetName(const std::string &_name) const
Set the name of the battery.
virtual void ResetVoltage()
Reset the battery voltage to the initial value. The initial value might have been loaded from an sdf ...
std::map< uint32_t, double > PowerLoad_M
Typedef the powerload map.
Definition: Battery.hh:48
virtual void SetInitVoltage(const double _voltage)
Set the initial voltage.
bool SetPowerLoad(const uint32_t _consumerId, const double _powerLoad)
Set consumer power load in watts.
bool PowerLoad(const uint32_t _consumerId, double &_powerLoad) const
Get consumer power load in watts.
Battery & operator=(const Battery &_battery)
Assignment operator.
void ResetUpdateFunc()
Reset function to update voltage, upon destruction of current callback function.
bool operator==(const Battery &_battery) const
Equal to operator.
const PowerLoad_M & PowerLoads() const
Get list of power loads in watts.
bool RemoveConsumer(const uint32_t _consumerId)
Remove a consumer.
void Update()
Update the battery. This will in turn trigger the function set using the SetUpdateFunc function.
Forward declarations for the common classes.