2020-10-01 12:05:24 +02:00
|
|
|
#ifndef FSFW_HOUSEKEEPING_PERIODICHOUSEKEEPINGHELPER_H_
|
|
|
|
#define FSFW_HOUSEKEEPING_PERIODICHOUSEKEEPINGHELPER_H_
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
#include "fsfw/timemanager/Clock.h"
|
2023-07-11 15:40:43 +02:00
|
|
|
#include "fsfw/timemanager/Countdown.h"
|
2022-02-02 10:29:30 +01:00
|
|
|
|
2020-10-01 12:05:24 +02:00
|
|
|
class LocalPoolDataSetBase;
|
|
|
|
|
|
|
|
class PeriodicHousekeepingHelper {
|
2022-02-02 10:29:30 +01:00
|
|
|
public:
|
|
|
|
PeriodicHousekeepingHelper(LocalPoolDataSetBase* owner);
|
2020-10-01 12:05:24 +02:00
|
|
|
|
2023-03-14 17:40:39 +01:00
|
|
|
void initialize(float collectionInterval, dur_millis_t minimumPeriodicInterval);
|
2021-03-11 12:04:54 +01:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
void changeCollectionInterval(float newInterval);
|
|
|
|
float getCollectionIntervalInSeconds() const;
|
|
|
|
bool checkOpNecessary();
|
2020-10-01 12:05:24 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
private:
|
|
|
|
LocalPoolDataSetBase* owner = nullptr;
|
2023-07-10 14:14:31 +02:00
|
|
|
Countdown hkGenerationCd;
|
2023-07-10 14:20:02 +02:00
|
|
|
float collectionInterval = 0.0;
|
2020-10-01 12:05:24 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
dur_millis_t minimumPeriodicInterval = 0;
|
2020-10-01 12:05:24 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_HOUSEKEEPING_PERIODICHOUSEKEEPINGHELPER_H_ */
|