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

This commit is contained in:
2023-02-07 15:22:01 +01:00
parent 94fee2d429
commit d82810d5e7
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;