eive-obsw/mission/tmtc/PersistentLogTmStoreTask.h

42 lines
1.4 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-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>
2023-03-09 19:42:20 +01:00
#include <mission/tmtc/TmStoreTaskBase.h>
2023-03-09 17:44:05 +01:00
#include <mission/tmtc/VirtualChannelWithQueue.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);
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-10 02:05:51 +01:00
bool initStoresIfPossible();
2023-03-09 17:44:05 +01:00
};
#endif /* MISSION_TMTC_PERSISTENTLOGTMSTORETASK_H_ */