Skip to content

Commit

Permalink
Merge pull request #440 from IllusionFpv/fix-graphs-for-new-rate-systems
Browse files Browse the repository at this point in the history
Fix graphs for new rate systems
  • Loading branch information
mikeller committed Apr 19, 2020
2 parents f73ad7f + 38d976d commit 535e34c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/graph_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,17 @@ GraphConfig.load = function(config) {
sysConfig = flightLog.getSysConfig();

var maxDegreesSecond = function(scale) {
return Math.max(flightLog.rcCommandRawToDegreesPerSecond(500,0) * scale,
flightLog.rcCommandRawToDegreesPerSecond(500,1) * scale,
flightLog.rcCommandRawToDegreesPerSecond(500,2) * scale);
switch(sysConfig["rates_type"]){
case RATES_TYPE.indexOf('ACTUAL'):
case RATES_TYPE.indexOf('QUICK'):
return Math.max(sysConfig["rates"][0] * 10.0 * scale,
sysConfig["rates"][1] * 10.0 * scale,
sysConfig["rates"][2] * 10.0 * scale);
default:
return Math.max(flightLog.rcCommandRawToDegreesPerSecond(500,0) * scale,
flightLog.rcCommandRawToDegreesPerSecond(500,1) * scale,
flightLog.rcCommandRawToDegreesPerSecond(500,2) * scale);
}
}

var getMinMaxForFields = function(/* fieldName1, fieldName2, ... */) {
Expand Down

0 comments on commit 535e34c

Please sign in to comment.