eive-obsw/mission/tmtc/PersistentLogTmStoreTask.h
Robin Mueller 63b50e6101
Some checks are pending
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop Build started...
clean up op done
2023-03-26 16:42:00 +02:00

42 lines
1.4 KiB
C++

#ifndef MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_
#define MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/storagemanager/StorageManagerIF.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
#include <mission/genericFactory.h>
#include <mission/tmtc/PersistentTmStore.h>
#include <mission/tmtc/PersistentTmStoreWithTmQueue.h>
#include <mission/tmtc/TmStoreTaskBase.h>
#include <mission/tmtc/VirtualChannelWithQueue.h>
struct LogStores {
LogStores(PersistentTmStores& stores)
: okStore(*stores.okStore), notOkStore(*stores.notOkStore), miscStore(*stores.miscStore) {}
PersistentTmStoreWithTmQueue& okStore;
PersistentTmStoreWithTmQueue& notOkStore;
PersistentTmStoreWithTmQueue& miscStore;
};
class PersistentLogTmStoreTask : public TmStoreTaskBase, public ExecutableObjectIF {
public:
PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore, LogStores tmStore,
VirtualChannel& channel, SdCardMountedIF& sdcMan);
ReturnValue_t performOperation(uint8_t opCode) override;
private:
LogStores stores;
DumpContext okStoreContext;
DumpContext notOkStoreContext;
DumpContext miscStoreContext;
Countdown tcHandlingCd = Countdown(400);
Countdown graceDelayDuringDumping = Countdown(200);
bool someFileWasSwapped = false;
bool initStoresIfPossible();
};
#endif /* MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_ */