Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions js/flightlog_fielddefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ var
"SRXL",
"CUSTOM",
"FPORT",
"SRXL2",
"GHST"
]),

ANTI_GRAVITY_MODE = makeReadOnly([
Expand Down
17 changes: 10 additions & 7 deletions js/flightlog_fields_presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,17 @@ function FlightLogFieldPresenter() {
return "";
}

const highResolutionScale = (flightLog && flightLog.getSysConfig().blackbox_high_resolution > 0) ? 10 : 1;
const highResolutionAddPrecision = (flightLog && flightLog.getSysConfig().blackbox_high_resolution > 0) ? 1 : 0;

switch (fieldName) {
case 'time':
return formatTime(value / 1000, true);

case 'gyroADC[0]':
case 'gyroADC[1]':
case 'gyroADC[2]':
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + " deg/s";
return flightLog.gyroRawToDegreesPerSecond(value / highResolutionScale).toFixed(highResolutionAddPrecision) + " deg/s";

case 'gyroADCs[0]':
case 'gyroADCs[1]':
Expand All @@ -772,14 +775,14 @@ function FlightLogFieldPresenter() {
case 'axisError[0]':
case 'axisError[1]':
case 'axisError[2]':
return Math.round(value) + " deg/s";
return (value / highResolutionScale).toFixed(highResolutionAddPrecision) + " deg/s";

case 'rcCommand[0]':
case 'rcCommand[1]':
case 'rcCommand[2]':
return (value + 1500).toFixed(0) + " us";
return (value / highResolutionScale + 1500).toFixed(highResolutionAddPrecision) + " us";
case 'rcCommand[3]':
return value.toFixed(0) + " us";
return (value / highResolutionScale).toFixed(highResolutionAddPrecision) + " us";

case 'motor[0]':
case 'motor[1]':
Expand All @@ -804,7 +807,7 @@ function FlightLogFieldPresenter() {
case 'rcCommands[0]':
case 'rcCommands[1]':
case 'rcCommands[2]':
return value.toFixed(0) + " deg/s";
return (value / highResolutionScale).toFixed(highResolutionAddPrecision) + " deg/s";
case 'rcCommands[3]':
return value.toFixed(1) + "%";

Expand All @@ -828,7 +831,7 @@ function FlightLogFieldPresenter() {
case 'accSmooth[0]':
case 'accSmooth[1]':
case 'accSmooth[2]':
return flightLog.accRawToGs(value).toFixed(2) + "g";
return flightLog.accRawToGs(value).toFixed(2 + highResolutionAddPrecision) + "g";

case 'vbatLatest':
if(flightLog.getSysConfig().firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver.gte(flightLog.getSysConfig().firmwareVersion, '4.0.0')) {
Expand Down Expand Up @@ -905,7 +908,7 @@ function FlightLogFieldPresenter() {
case 'debug[0]':
return value.toFixed(0);
default:
return (value/10).toFixed(1) + "V";
return (value / 10).toFixed(1) + "V";
}
case 'ACCELEROMETER':
return flightLog.accRawToGs(value).toFixed(2) + "g";
Expand Down
3 changes: 3 additions & 0 deletions js/flightlog_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ var FlightLogParser = function(logData) {
anti_gravity_gain:null, // Anti gravity gain
anti_gravity_mode:null, // Anti gravity mode
anti_gravity_threshold:null, // Anti gravity threshold for step mode
blackbox_high_resolution:null, // Blackbox high resolution mode
thrMid:null, // Throttle Mid Position
thrExpo:null, // Throttle Expo
tpa_breakpoint:null, // TPA Breakpoint
Expand Down Expand Up @@ -737,6 +738,8 @@ var FlightLogParser = function(logData) {
case "throttle_boost_cutoff":

case "motor_poles":

case "blackbox_high_resolution":
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
break;
case "rc_expo":
Expand Down
11 changes: 6 additions & 5 deletions js/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ GraphConfig.load = function(config) {
}

const gyroScaleMargin = 1.20; // Give a 20% margin for gyro graphs
const highResolutionScale = sysConfig.blackbox_high_resolution > 0 ? 10 : 1;

try {
if (fieldName.match(/^motor\[/)) {
Expand Down Expand Up @@ -302,7 +303,7 @@ GraphConfig.load = function(config) {
return {
offset: 0,
power: 0.25, /* Make this 1.0 to scale linearly */
inputRange: maxDegreesSecond(gyroScaleMargin), // Maximum grad/s + 20%
inputRange: maxDegreesSecond(gyroScaleMargin * highResolutionScale), // Maximum grad/s + 20%
outputRange: 1.0
};
} else if (fieldName.match(/^axis.+\[/)) {
Expand All @@ -314,16 +315,16 @@ GraphConfig.load = function(config) {
};
} else if (fieldName == "rcCommand[3]") { // Throttle
return {
offset: -1500,
offset: -1500 * highResolutionScale,
power: 1.0,
inputRange: 500,
inputRange: 500 * highResolutionScale,
outputRange: 1.0
};
} else if (fieldName.match(/^rcCommand\[/)) {
return {
offset: 0,
power: 0.25,
inputRange: 500 * gyroScaleMargin, // +20% to let compare in the same scale with the rccommands
inputRange: 500 * highResolutionScale * gyroScaleMargin, // +20% to let compare in the same scale with the rccommands
outputRange: 1.0
};
} else if (fieldName == "heading[2]") {
Expand Down Expand Up @@ -771,7 +772,7 @@ GraphConfig.load = function(config) {
EXAMPLE_GRAPHS.push({label: "Gyros",fields: ["gyroADC[all]"]});
}
if (!flightLog.isFieldDisabled().SETPOINT) {
EXAMPLE_GRAPHS.push({label: "RC Rates",fields: ["rcCommands[all]"]});
EXAMPLE_GRAPHS.push({label: "Setpoint",fields: ["rcCommands[all]"]});
}
if (!flightLog.isFieldDisabled().RC_COMMANDS) {
EXAMPLE_GRAPHS.push({label: "RC Command",fields: ["rcCommand[all]"]});
Expand Down
4 changes: 3 additions & 1 deletion js/sticks.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,14 @@ function FlightLogSticks(flightLog, rcCommandFields, canvas) {
stickIndex,
rcCommand = [], rcCommandLabels = [];

const highResolutionScale = flightLog.getSysConfig().blackbox_high_resolution > 0 ? 10 : 1;

for (stickIndex = 0; stickIndex < 4; stickIndex++) {
//Check that stick data is present to be drawn:
if (rcCommandFields[stickIndex] === undefined)
return;

rcCommand[stickIndex] = frame[rcCommandFields[stickIndex]];
rcCommand[stickIndex] = frame[rcCommandFields[stickIndex]] / highResolutionScale;
if (stickLabel != null) {
rcCommandLabels[stickIndex] = (rcCommand[stickIndex] * ((stickIndex == 2) ? -1 : 1)) + ""; // correct the value for Yaw being inverted
if (userSettings.stickUnits != null) {
Expand Down