Skip to content

Commit

Permalink
Add helper method to set decimation
Browse files Browse the repository at this point in the history
Summary: Simple time base decimation is too complex to set. This helper will help...

Reviewed By: kiminoue7

Differential Revision: D51460326

fbshipit-source-id: d9fa723b7c0f729c8f8a093bcb27e935ed9c1255
  • Loading branch information
Georges Berenger authored and facebook-github-bot committed Nov 21, 2023
1 parent d6cd470 commit d4fb0bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vrs/utils/FilteredFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ void FilteredFileReader::constrainTimeRange(double& inOutStartTimestamp, double&
}
}

void FilteredFileReader::decimateByInterval(double minIntervalSec) {
utils::DecimationParams params;
params.bucketInterval = minIntervalSec;
decimator_ = make_unique<utils::Decimator>(*this, params);
}

void FilteredFileReader::getConstrainedTimeRange(
double& outStartTimestamp,
double& outEndTimestamp) {
Expand Down
3 changes: 3 additions & 0 deletions vrs/utils/FilteredFileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ struct FilteredFileReader {
// Constrain the given time range to the current filter's time constraints
void constrainTimeRange(double& inOutStartTimestamp, double& inOutEndTimestamp) const;

// Decimate data record with a minimum time interval
void decimateByInterval(double minIntervalSec);

// Apply filters, which can only be done after the file was opened already
void applyFilters(const RecordFilterParams& filters);
void applyRecordableFilters(const vector<string>& filter);
Expand Down

0 comments on commit d4fb0bb

Please sign in to comment.