Skip to content

Commit 1483793

Browse files
authored
Remove special charachters from eRPM field (#666)
1 parent 964ce3f commit 1483793

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

js/flightlog_fields_presenter.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ function FlightLogFieldPresenter() {
7373
'motor[6]': 'Motor [7]',
7474
'motor[7]': 'Motor [8]',
7575

76-
'eRPM(/100)[all]': 'RPM',
77-
'eRPM(/100)[0]': 'RPM [1]',
78-
'eRPM(/100)[1]': 'RPM [2]',
79-
'eRPM(/100)[2]': 'RPM [3]',
80-
'eRPM(/100)[3]': 'RPM [4]',
81-
'eRPM(/100)[4]': 'RPM [5]',
82-
'eRPM(/100)[5]': 'RPM [6]',
83-
'eRPM(/100)[6]': 'RPM [7]',
84-
'eRPM(/100)[7]': 'RPM [8]',
76+
'eRPM[all]': 'RPM',
77+
'eRPM[0]': 'RPM [1]',
78+
'eRPM[1]': 'RPM [2]',
79+
'eRPM[2]': 'RPM [3]',
80+
'eRPM[3]': 'RPM [4]',
81+
'eRPM[4]': 'RPM [5]',
82+
'eRPM[5]': 'RPM [6]',
83+
'eRPM[6]': 'RPM [7]',
84+
'eRPM[7]': 'RPM [8]',
8585

8686
'servo[all]': 'Servos',
8787
'servo[5]': 'Servo Tail',
@@ -1308,14 +1308,14 @@ function FlightLogFieldPresenter() {
13081308
case 'motor[7]':
13091309
return `${flightLog.rcMotorRawToPctPhysical(value).toFixed(2)} %`;
13101310

1311-
case 'eRPM(/100)[0]':
1312-
case 'eRPM(/100)[1]':
1313-
case 'eRPM(/100)[2]':
1314-
case 'eRPM(/100)[3]':
1315-
case 'eRPM(/100)[4]':
1316-
case 'eRPM(/100)[5]':
1317-
case 'eRPM(/100)[6]':
1318-
case 'eRPM(/100)[7]':
1311+
case 'eRPM[0]':
1312+
case 'eRPM[1]':
1313+
case 'eRPM[2]':
1314+
case 'eRPM[3]':
1315+
case 'eRPM[4]':
1316+
case 'eRPM[5]':
1317+
case 'eRPM[6]':
1318+
case 'eRPM[7]':
13191319
let motor_poles = flightLog.getSysConfig()['motor_poles'];
13201320
return (value * 200 / motor_poles).toFixed(0) + " rpm / " + (value * 3.333 / motor_poles).toFixed(1) + ' hz';
13211321

js/graph_config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ GraphConfig.load = function(config) {
286286
DSHOT_RANGE / 2 : (sysConfig.maxthrottle - sysConfig.minthrottle) / 2,
287287
outputRange: 1.0,
288288
};
289-
} else if (fieldName.match(/^eRPM\(\/100\)\[/)) {
290-
return getCurveForMinMaxFields('eRPM(/100)[0]', 'eRPM(/100)[1]', 'eRPM(/100)[2]', 'eRPM(/100)[3]', 'eRPM(/100)[4]', 'eRPM(/100)[5]', 'eRPM(/100)[6]', 'eRPM(/100)[7]');
289+
} else if (fieldName.match(/^eRPM\[/)) {
290+
return getCurveForMinMaxFields('eRPM[0]', 'eRPM[1]', 'eRPM[2]', 'eRPM[3]', 'eRPM[4]', 'eRPM[5]', 'eRPM[6]', 'eRPM[7]');
291291
} else if (fieldName.match(/^servo\[/)) {
292292
return {
293293
offset: -1500,
@@ -1000,7 +1000,7 @@ GraphConfig.load = function(config) {
10001000
EXAMPLE_GRAPHS.push({label: "Motors (Legacy)",fields: ["motorLegacy[all]", "servo[5]"]});
10011001
}
10021002
if (!flightLog.isFieldDisabled().RPM) {
1003-
EXAMPLE_GRAPHS.push({label: "RPM",fields: ["eRPM(/100)[all]"]});
1003+
EXAMPLE_GRAPHS.push({label: "RPM",fields: ["eRPM[all]"]});
10041004
}
10051005
if (!flightLog.isFieldDisabled().GYRO) {
10061006
EXAMPLE_GRAPHS.push({label: "Gyros",fields: ["gyroADC[all]"]});

0 commit comments

Comments
 (0)