2020-12-03 18:29:28 +01:00
|
|
|
#ifndef FSFW_POWER_POWERCOMPONENT_H_
|
|
|
|
#define FSFW_POWER_POWERCOMPONENT_H_
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "PowerComponentIF.h"
|
2021-07-13 20:22:54 +02:00
|
|
|
#include "fsfw/objectmanager/SystemObjectIF.h"
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/objectmanager/frameworkObjects.h"
|
2020-12-03 18:29:28 +01:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
class PowerComponent : public PowerComponentIF {
|
|
|
|
public:
|
|
|
|
PowerComponent(object_id_t setId, uint8_t moduleId, float minPower, float maxPower,
|
|
|
|
uint8_t switchId1, bool twoSwitches = false, uint8_t switchId2 = 0xFF);
|
2020-12-03 18:29:28 +01:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
virtual object_id_t getDeviceObjectId();
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
virtual uint8_t getSwitchId1();
|
|
|
|
virtual uint8_t getSwitchId2();
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
bool hasTwoSwitches();
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
float getMin();
|
|
|
|
float getMax();
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
|
|
|
Endianness streamEndianness) const override;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
size_t getSerializedSize() const override;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
|
|
|
|
Endianness streamEndianness) override;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId, ParameterWrapper* parameterWrapper,
|
|
|
|
const ParameterWrapper* newValues, uint16_t startAtIndex);
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
private:
|
|
|
|
const object_id_t deviceObjectId = objects::NO_OBJECT;
|
|
|
|
const uint8_t switchId1;
|
|
|
|
const uint8_t switchId2;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
const bool doIHaveTwoSwitches;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
float minPower = 0.0;
|
|
|
|
float maxPower = 0.0;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
uint8_t moduleId = 0;
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
PowerComponent();
|
2018-07-12 16:29:32 +02:00
|
|
|
};
|
|
|
|
|
2020-12-03 18:29:28 +01:00
|
|
|
#endif /* FSFW_POWER_POWERCOMPONENT_H_ */
|