From 283b897ae703b0d627ce06e54cb5200d57892776 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 13 Dec 2022 15:34:13 +0100 Subject: [PATCH] allow minutely rollover as well --- mission/tmtc/TmStore.cpp | 4 +++- mission/tmtc/TmStore.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mission/tmtc/TmStore.cpp b/mission/tmtc/TmStore.cpp index 5ae6dcc7..6ec49da8 100644 --- a/mission/tmtc/TmStore.cpp +++ b/mission/tmtc/TmStore.cpp @@ -86,7 +86,9 @@ ReturnValue_t TmStore::storePacket(PusTmReader& reader) { MessageQueueId_t TmStore::getCommandQueue() { return MessageQueueIF::NO_QUEUE; } void TmStore::calcDiffSeconds(RolloverInterval intervalUnit, uint32_t intervalCount) { - if (intervalUnit == RolloverInterval::HOURLY) { + if (intervalUnit == RolloverInterval::MINUTELY) { + rolloverDiffSeconds = 60 * intervalCount; + } else if (intervalUnit == RolloverInterval::HOURLY) { rolloverDiffSeconds = 60 * 60 * intervalCount; } else if (intervalUnit == RolloverInterval::DAILY) { rolloverDiffSeconds = 60 * 60 * 24 * intervalCount; diff --git a/mission/tmtc/TmStore.h b/mission/tmtc/TmStore.h index 9d20bbe4..193a1db5 100644 --- a/mission/tmtc/TmStore.h +++ b/mission/tmtc/TmStore.h @@ -15,7 +15,7 @@ struct PacketFilter { std::optional>> serviceSubservices; }; -enum class RolloverInterval { HOURLY, DAILY }; +enum class RolloverInterval { MINUTELY, HOURLY, DAILY }; class TmStore : public SystemObject { public: @@ -41,7 +41,7 @@ class TmStore : public SystemObject { std::string baseName; std::filesystem::path baseDir; uint32_t rolloverDiffSeconds = 0; - std::array fileBuf{}; + std::array fileBuf{}; timeval& currentTv; std::optional mostRecentTv; std::optional mostRecentFile;