Skip to content

Commit 6efbe95

Browse files
authored
Add Dyn Notch info to Header (#378)
Add Dyn Notch info to Header
2 parents 688a6ce + ac230bb commit 6efbe95

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,31 @@ <h5 class="modal-title-craft"></h5>
12221222
</td>
12231223
</tr>
12241224

1225+
<tr class="dyn_filter_required">
1226+
<td name='dyn_notch_range'>
1227+
<label>Dyn Notch
1228+
<br>Range</label>
1229+
<select>
1230+
<!-- list generated here -->
1231+
</select>
1232+
</td>
1233+
<td name="dyn_notch_width_percent">
1234+
<label>Dyn Notch
1235+
<br>Width (percent)</label>
1236+
<input type="number" step="0.1" min="0" max="999.00" />
1237+
</td>
1238+
<td name='dyn_notch_q'>
1239+
<label>Dyn Notch
1240+
<br>Q</label>
1241+
<input type="number" step="0.01" min="0" max="999.00" />
1242+
</td>
1243+
<td name="dyn_notch_min_hz">
1244+
<label>Dyn Notch
1245+
<br>Min (Hz)</label>
1246+
<input type="number" step="0.1" min="0" max="999.00" />
1247+
</td>
1248+
</tr>
1249+
12251250
<tr class='dshot_bidir_required'>
12261251
<td name='gyro_rpm_notch_harmonics'>
12271252
<label>RPM Notch

js/flightlog_fielddefs.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,14 @@ var
415415
ITERM_RELAX_TYPE = makeReadOnly([
416416
"GYRO",
417417
"SETPOINT",
418-
]);
418+
]),
419419

420+
DYN_NOTCH_RANGE = makeReadOnly([
421+
"LOW",
422+
"MEDIUM",
423+
"HIGH",
424+
"AUTO",
425+
]);
420426

421427
function adjustFieldDefsList(firmwareType, firmwareVersion) {
422428
if((firmwareType == FIRMWARE_TYPE_BETAFLIGHT) && semver.gte(firmwareVersion, '3.3.0')) {

js/flightlog_parser.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ var FlightLogParser = function(logData) {
299299
iterm_relax: null, // ITerm Relax mode
300300
iterm_relax_type: null, // ITerm Relax type
301301
iterm_relax_cutoff: null, // ITerm Relax cutoff
302+
dyn_notch_range: null, // Dyn Notch Range (LOW, MED, HIGH or AUTO)
303+
dyn_notch_width_percent: null, // Dyn Notch width percent distance between the two notches
304+
dyn_notch_q: null, // Dyn Notch width of each dynamic filter
305+
dyn_notch_min_hz: null, // Gyn Notch min limit in Hz for the filter
302306
unknownHeaders : [] // Unknown Extra Headers
303307
},
304308

@@ -605,6 +609,11 @@ var FlightLogParser = function(logData) {
605609
case "iterm_relax":
606610
case "iterm_relax_type":
607611
case "iterm_relax_cutoff":
612+
case "dyn_notch_range":
613+
case "dyn_notch_width_percent":
614+
case "dyn_notch_q":
615+
case "dyn_notch_min_hz":
616+
608617
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
609618
break;
610619

js/header_dialog.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ function HeaderDialog(dialog, onSave) {
9090
{name:'iterm_relax' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
9191
{name:'iterm_relax_type' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
9292
{name:'iterm_relax_cutoff' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
93+
{name:'dyn_notch_range' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
94+
{name:'dyn_notch_width_percent' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
95+
{name:'dyn_notch_q' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
96+
{name:'dyn_notch_min_hz' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
9397
];
9498

9599
function isParameterValid(name) {
@@ -563,6 +567,11 @@ function HeaderDialog(dialog, onSave) {
563567
setParameter('gyro_lowpass_hz' ,sysConfig.gyro_lowpass_hz,0);
564568
setParameter('gyro_lowpass2_hz' ,sysConfig.gyro_lowpass2_hz,0);
565569

570+
renderSelect('dyn_notch_range' ,sysConfig.dyn_notch_range , DYN_NOTCH_RANGE);
571+
setParameter('dyn_notch_width_percent' ,sysConfig.dyn_notch_width_percent, 0);
572+
setParameter('dyn_notch_q' ,sysConfig.dyn_notch_q , 0);
573+
setParameter('dyn_notch_min_hz' ,sysConfig.dyn_notch_min_hz , 0);
574+
566575
setParameter('gyro_rpm_notch_harmonics', sysConfig.gyro_rpm_notch_harmonics, 0);
567576
setParameter('gyro_rpm_notch_q' , sysConfig.gyro_rpm_notch_q , 0);
568577
setParameter('gyro_rpm_notch_min' , sysConfig.gyro_rpm_notch_min , 0);

0 commit comments

Comments
 (0)