@@ -31,7 +31,7 @@ import {
3131export function FlightLog ( logData ) {
3232 let ADDITIONAL_COMPUTED_FIELD_COUNT = 15 /** attitude + PID_SUM + PID_ERROR + RCCOMMAND_SCALED **/ ,
3333 that = this ,
34- logIndex = false ,
34+ logIndex = 0 ,
3535 logIndexes = new FlightLogIndex ( logData ) ,
3636 parser = new FlightLogParser ( logData ) ,
3737 iframeDirectory ,
@@ -117,20 +117,21 @@ export function FlightLog(logData) {
117117 * Get the earliest time seen in the log of the given index (in microseconds), or leave off the logIndex
118118 * argument to fetch details for the current log.
119119 */
120- this . getMinTime = function ( logIndex ) {
121- return getRawStats ( logIndex ) . frame [ "I" ] . field [
122- FlightLogParser . prototype . FLIGHT_LOG_FIELD_INDEX_TIME
123- ] . min ;
120+ this . getMinTime = function ( ) {
121+ return logIndexes . getIntraframeDirectory ( logIndex ) . minTime ;
124122 } ;
125123
126124 /**
127125 * Get the latest time seen in the log of the given index (in microseconds), or leave off the logIndex
128126 * argument to fetch details for the current log.
129127 */
130- this . getMaxTime = function ( logIndex ) {
131- return getRawStats ( logIndex ) . frame [ "I" ] . field [
132- FlightLogParser . prototype . FLIGHT_LOG_FIELD_INDEX_TIME
133- ] . max ;
128+ this . getMaxTime = function ( ) {
129+ return logIndexes . getIntraframeDirectory ( logIndex ) . maxTime ;
130+ } ;
131+
132+ this . getActualLoggedTime = function ( ) {
133+ const directory = logIndexes . getIntraframeDirectory ( logIndex ) ;
134+ return directory . maxTime - directory . minTime - directory . unLoggedTime ;
134135 } ;
135136
136137 /**
0 commit comments