Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/flightlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,23 @@ export function FlightLog(logData) {
* Get the earliest time seen in the log of the given index (in microseconds), or leave off the logIndex
* argument to fetch details for the current log.
*/
this.getMinTime = function () {
return logIndexes.getIntraframeDirectory(logIndex).minTime;
this.getMinTime = function (index) {
index = index ?? logIndex;
return logIndexes.getIntraframeDirectory(index).minTime;
};

/**
* Get the latest time seen in the log of the given index (in microseconds), or leave off the logIndex
* argument to fetch details for the current log.
*/
this.getMaxTime = function () {
return logIndexes.getIntraframeDirectory(logIndex).maxTime;
this.getMaxTime = function (index) {
index = index ?? logIndex;
return logIndexes.getIntraframeDirectory(index).maxTime;
};

this.getActualLoggedTime = function () {
const directory = logIndexes.getIntraframeDirectory(logIndex);
this.getActualLoggedTime = function (index) {
index = index ?? logIndex;
const directory = logIndexes.getIntraframeDirectory(index);
return directory.maxTime - directory.minTime - directory.unLoggedTime;
};

Expand Down