@@ -533,7 +533,7 @@ export function FlightLogParser(logData) {
533533 */
534534 function translateFieldName ( fieldName ) {
535535 let translation = translationValues [ fieldName ] ;
536- if ( typeof translation !== " undefined" ) {
536+ if ( translation !== undefined ) {
537537 return translation ;
538538 } else {
539539 return fieldName ;
@@ -823,7 +823,7 @@ export function FlightLogParser(logData) {
823823 ) {
824824 that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) ;
825825 } else {
826- that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100.0 ;
826+ that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100 ;
827827 }
828828 break ;
829829
@@ -837,13 +837,13 @@ export function FlightLogParser(logData) {
837837 ) {
838838 that . sysConfig [ fieldName ] = parseCommaSeparatedString ( fieldValue ) ;
839839 } else {
840- that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100.0 ;
840+ that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100 ;
841841 }
842842 break ;
843843
844844 case "motor_idle" :
845845 case "digitalIdleOffset" :
846- that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100.0 ;
846+ that . sysConfig [ fieldName ] = parseInt ( fieldValue , 10 ) / 100 ;
847847
848848 /** Cleanflight Only log headers **/
849849 case "dterm_cut_hz" :
@@ -984,7 +984,7 @@ export function FlightLogParser(logData) {
984984 } else {
985985 // Cleanflight 1.x and others
986986 that . sysConfig . firmwareVersion = "0.0.0" ;
987- that . sysConfig . firmware = 0.0 ;
987+ that . sysConfig . firmware = 0 ;
988988 that . sysConfig . firmwarePatch = 0 ;
989989 }
990990 }
@@ -1085,10 +1085,8 @@ export function FlightLogParser(logData) {
10851085 min : frame [ i ] ,
10861086 } ;
10871087 } else {
1088- fieldStats [ i ] . max =
1089- frame [ i ] > fieldStats [ i ] . max ? frame [ i ] : fieldStats [ i ] . max ;
1090- fieldStats [ i ] . min =
1091- frame [ i ] < fieldStats [ i ] . min ? frame [ i ] : fieldStats [ i ] . min ;
1088+ fieldStats [ i ] . max = Math . max ( frame [ i ] , fieldStats [ i ] . max ) ;
1089+ fieldStats [ i ] . min = Math . min ( frame [ i ] , fieldStats [ i ] . min ) ;
10921090 }
10931091 }
10941092 }
@@ -1446,7 +1444,7 @@ export function FlightLogParser(logData) {
14461444 * save space for positive values). So we need to convert those very large unsigned values into their
14471445 * corresponding 32-bit signed values.
14481446 */
1449- value = ( value | 0 ) + that . sysConfig . minthrottle ;
1447+ value = Math . trunc ( value ) + that . sysConfig . minthrottle ;
14501448 break ;
14511449 case FLIGHT_LOG_FIELD_PREDICTOR_MINMOTOR :
14521450 /*
@@ -1455,7 +1453,7 @@ export function FlightLogParser(logData) {
14551453 * save space for positive values). So we need to convert those very large unsigned values into their
14561454 * corresponding 32-bit signed values.
14571455 */
1458- value = ( value | 0 ) + ( that . sysConfig . motorOutput [ 0 ] | 0 ) ; // motorOutput[0] is the min motor output
1456+ value = Math . trunc ( value ) + Math . trunc ( that . sysConfig . motorOutput [ 0 ] ) ; // motorOutput[0] is the min motor output
14591457 break ;
14601458 case FLIGHT_LOG_FIELD_PREDICTOR_1500 :
14611459 value += 1500 ;
@@ -1675,13 +1673,13 @@ export function FlightLogParser(logData) {
16751673 break ;
16761674 case FlightLogEvent . AUTOTUNE_TARGETS :
16771675 //Convert the angles from decidegrees back to plain old degrees for ease of use
1678- lastEvent . data . currentAngle = stream . readS16 ( ) / 10.0 ;
1676+ lastEvent . data . currentAngle = stream . readS16 ( ) / 10 ;
16791677
16801678 lastEvent . data . targetAngle = stream . readS8 ( ) ;
16811679 lastEvent . data . targetAngleAtPeak = stream . readS8 ( ) ;
16821680
1683- lastEvent . data . firstPeakAngle = stream . readS16 ( ) / 10.0 ;
1684- lastEvent . data . secondPeakAngle = stream . readS16 ( ) / 10.0 ;
1681+ lastEvent . data . firstPeakAngle = stream . readS16 ( ) / 10 ;
1682+ lastEvent . data . secondPeakAngle = stream . readS16 ( ) / 10 ;
16851683 break ;
16861684 case FlightLogEvent . GTUNE_CYCLE_RESULT :
16871685 lastEvent . data . axis = stream . readU8 ( ) ;
0 commit comments