eive-obsw/mission/com/PersistentLogTmStoreTask.h

44 lines
1.6 KiB
C
Raw Normal View History

2023-03-09 17:44:05 +01:00
#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>
2023-03-31 01:14:59 +02:00
#include <mission/com/TmStoreTaskBase.h>
#include <mission/com/VirtualChannelWithQueue.h>
2023-03-26 16:42:00 +02:00
#include <mission/genericFactory.h>
2023-03-09 17:44:05 +01:00
#include <mission/tmtc/PersistentTmStore.h>
#include <mission/tmtc/PersistentTmStoreWithTmQueue.h>
struct LogStores {
2023-03-09 19:42:20 +01:00
LogStores(PersistentTmStores& stores)
: okStore(*stores.okStore), notOkStore(*stores.notOkStore), miscStore(*stores.miscStore) {}
2023-03-09 17:44:05 +01:00
PersistentTmStoreWithTmQueue& okStore;
PersistentTmStoreWithTmQueue& notOkStore;
PersistentTmStoreWithTmQueue& miscStore;
};
2023-03-09 19:42:20 +01:00
class PersistentLogTmStoreTask : public TmStoreTaskBase, public ExecutableObjectIF {
2023-03-09 17:44:05 +01:00
public:
PersistentLogTmStoreTask(object_id_t objectId, StorageManagerIF& ipcStore, LogStores tmStore,
VirtualChannel& channel, SdCardMountedIF& sdcMan,
const std::atomic_bool& ptmeLocked);
2023-03-09 19:42:20 +01:00
ReturnValue_t performOperation(uint8_t opCode) override;
2023-03-09 17:44:05 +01:00
private:
2023-03-09 19:42:20 +01:00
LogStores stores;
2023-03-11 14:59:55 +01:00
DumpContext okStoreContext;
DumpContext notOkStoreContext;
DumpContext miscStoreContext;
2023-03-10 02:05:51 +01:00
Countdown tcHandlingCd = Countdown(400);
Countdown graceDelayDuringDumping = Countdown(200);
bool someFileWasSwapped = false;
2023-03-28 15:06:03 +02:00
bool initStoresIfPossible() override;
2023-03-31 01:14:59 +02:00
void startTransition(Mode_t mode, Submode_t submode) override;
2023-03-09 17:44:05 +01:00
};
#endif /* MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_ */