From 0bba9b53ba016877c38eb97a5fb83476c6ae7781 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 28 Mar 2023 15:03:34 +0200 Subject: [PATCH] some more documentation --- mission/tmtc/TmStoreTaskBase.cpp | 4 ++-- mission/tmtc/TmStoreTaskBase.h | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/mission/tmtc/TmStoreTaskBase.cpp b/mission/tmtc/TmStoreTaskBase.cpp index d0787535..191272ed 100644 --- a/mission/tmtc/TmStoreTaskBase.cpp +++ b/mission/tmtc/TmStoreTaskBase.cpp @@ -80,8 +80,8 @@ void TmStoreTaskBase::cancelDump(DumpContext& ctx, PersistentTmStore& store, boo ReturnValue_t TmStoreTaskBase::handleOneDump(PersistentTmStoreWithTmQueue& store, DumpContext& dumpContext, bool& dumpPerformed) { ReturnValue_t result = returnvalue::OK; - // The PTME might have been reset an transmitter state change, so there is - // not point in continuing the dump. + // The PTME might have been reset an transmitter state change, so there is no point in continuing + // the dump. if (not channel.isTxOn()) { cancelDump(dumpContext, store, false); return returnvalue::FAILED; diff --git a/mission/tmtc/TmStoreTaskBase.h b/mission/tmtc/TmStoreTaskBase.h index c75ac8e4..319e3361 100644 --- a/mission/tmtc/TmStoreTaskBase.h +++ b/mission/tmtc/TmStoreTaskBase.h @@ -5,6 +5,10 @@ #include #include +/** + * Generic class which composes a Virtual Channel and a persistent TM stores. This allows dumping + * the TM store into the virtual channel directly. + */ class TmStoreTaskBase : public SystemObject { public: struct DumpContext { @@ -30,7 +34,21 @@ class TmStoreTaskBase : public SystemObject { SdCardMountedIF& sdcMan); protected: + StorageManagerIF& ipcStore; + Countdown sdCardCheckCd = Countdown(800); + // 20 minutes are allowed as maximum dump time. + Countdown cancelDumpCd = Countdown(60 * 20 * 1000); + // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. + // TODO: Reset this to default value. + Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); + VirtualChannel& channel; + bool storesInitialized = false; + bool fileHasSwapped = false; + SdCardMountedIF& sdcMan; + + void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn); /** + * * Handling for one store. Returns if anything was done. * @param store * @return @@ -48,18 +66,6 @@ class TmStoreTaskBase : public SystemObject { virtual bool initStoresIfPossible() = 0; - StorageManagerIF& ipcStore; - Countdown sdCardCheckCd = Countdown(800); - // 20 minutes are allowed as maximum dump time. - Countdown cancelDumpCd = Countdown(60 * 20 * 1000); - // If the TM sink is busy for 1 minute for whatever reason, cancel the dump. - Countdown tmSinkBusyCd = Countdown(60 * 20 * 1000); // Countdown(60 * 1000 ); - VirtualChannel& channel; - bool storesInitialized = false; - bool fileHasSwapped = false; - SdCardMountedIF& sdcMan; - - void cancelDump(DumpContext& ctx, PersistentTmStore& store, bool isTxOn); }; #endif /* MISSION_TMTC_TMSTORETASKBASE_H_ */