2022-03-28 12:48:15 +02:00
|
|
|
#ifndef FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_
|
|
|
|
#define FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_
|
|
|
|
|
2022-03-28 12:57:11 +02:00
|
|
|
#include <cstddef>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-03-28 12:48:15 +02:00
|
|
|
#include "PowerSwitchIF.h"
|
|
|
|
#include "definitions.h"
|
2022-03-30 17:41:38 +02:00
|
|
|
#include "fsfw/objectmanager/SystemObject.h"
|
2022-03-28 12:48:15 +02:00
|
|
|
|
2022-05-12 15:02:06 +02:00
|
|
|
/**
|
|
|
|
* @brief This component can be used to simulate a power switcher like a
|
|
|
|
* Power Control Distribution Unit (PCDU)
|
|
|
|
* @details
|
|
|
|
* The dummy switcher will simply cache the commanded fuse and switch states and return them
|
|
|
|
* in the according switch getter functions. In that sense, it simulates an ideal PCDU.
|
|
|
|
*/
|
2022-03-30 17:41:38 +02:00
|
|
|
class DummyPowerSwitcher : public SystemObject, public PowerSwitchIF {
|
2022-03-28 12:57:11 +02:00
|
|
|
public:
|
2022-03-30 17:41:38 +02:00
|
|
|
DummyPowerSwitcher(object_id_t objectId, size_t numberOfSwitches, size_t numberOfFuses,
|
2022-04-01 18:38:25 +02:00
|
|
|
bool registerGlobally = true, uint32_t switchDelayMs = 5000);
|
2022-03-28 12:48:15 +02:00
|
|
|
|
|
|
|
void setInitialSwitcherList(std::vector<ReturnValue_t> switcherList);
|
|
|
|
void setInitialFusesList(std::vector<ReturnValue_t> switcherList);
|
|
|
|
|
|
|
|
virtual ReturnValue_t sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) override;
|
|
|
|
virtual ReturnValue_t sendFuseOnCommand(uint8_t fuseNr) override;
|
|
|
|
virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const override;
|
|
|
|
virtual ReturnValue_t getFuseState(uint8_t fuseNr) const override;
|
|
|
|
virtual uint32_t getSwitchDelayMs(void) const override;
|
|
|
|
|
2022-03-28 12:57:11 +02:00
|
|
|
private:
|
2022-03-28 12:48:15 +02:00
|
|
|
std::vector<ReturnValue_t> switcherList;
|
|
|
|
std::vector<ReturnValue_t> fuseList;
|
|
|
|
uint32_t switchDelayMs = 5000;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_SRC_FSFW_POWER_DUMMYPOWERSWITCHER_H_ */
|