add dumpFrom method
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-02-07 15:22:01 +01:00
parent 94fee2d429
commit d82810d5e7
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 12 additions and 3 deletions

View File

@ -57,6 +57,10 @@ ReturnValue_t TmStore::passPacket(PusTmReader& reader) {
return returnvalue::OK;
}
void TmStore::dumpFrom(uint32_t fromUnixSeconds, TmFunnelBase &tmFunnel) {
return dumpFromUpTo(fromUnixSeconds, currentTv.tv_sec, tmFunnel);
}
ReturnValue_t TmStore::storePacket(PusTmReader& reader) {
using namespace std::filesystem;
if (baseDirUninitialized) {
@ -208,8 +212,12 @@ void TmStore::dumpFromUpTo(uint32_t fromUnixSeconds, uint32_t upToUnixSeconds,
TmFunnelBase& funnel) {
using namespace std::filesystem;
for (auto const& file : directory_iterator(basePath)) {
if (file.is_directory() or
(mostRecentFile.has_value() and (mostRecentFile.value() == file.path()))) {
if (file.is_directory()) {
continue;
}
if (mostRecentFile.has_value() and mostRecentTv.has_value() and
(file.path() == mostRecentFile.value()) and
(upToUnixSeconds < static_cast<uint32_t>(mostRecentTv.value().tv_sec))) {
continue;
}
Clock::TimeOfDay_t tod;

View File

@ -39,6 +39,7 @@ class TmStore : public SystemObject {
void addServiceSubservice(uint8_t service, uint8_t subservice);
void deleteUpTo(uint32_t unixSeconds);
void dumpFrom(uint32_t fromUnixSeconds, TmFunnelBase& tmFunnel);
void dumpFromUpTo(uint32_t fromUnixSeconds, uint32_t upToUnixSeconds, TmFunnelBase& tmFunnel);
void updateBaseDir();

2
tmtc

@ -1 +1 @@
Subproject commit d6445d38a8eb644a5e1bd27f0fc56d29e93c030d
Subproject commit 2bd6caa3c21255f2ab5a2773eb83d2fca78c2234