Skip to content

Commit a001c72

Browse files
authored
Add Iterm relax fields to header (#375)
Add Iterm relax fields to header
2 parents 916122c + ac7112c commit a001c72

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed

index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,30 @@ <h5 class="modal-title-craft"></h5>
982982
</tr>
983983
</tbody>
984984
</table>
985+
986+
<table class="parameter cf">
987+
<tbody>
988+
<tr>
989+
<td name="iterm_relax" class="bf-only">
990+
<label>ITerm Relax</label>
991+
<select>
992+
<!-- list generated here -->
993+
</select>
994+
</td>
995+
<td name="iterm_relax_type" class="bf-only">
996+
<label>ITerm Relax Type</label>
997+
<select>
998+
<!-- list generated here -->
999+
</select>
1000+
</td>
1001+
<td name="iterm_relax_cutoff" class="bf-only">
1002+
<label>ITerm Relax Cutoff</label>
1003+
<input type="number" step="0.01" min="0" max="999" />
1004+
</td>
1005+
</tr>
1006+
</tbody>
1007+
</table>
1008+
9851009
<table class="parameter cf">
9861010
<tbody>
9871011
<tr>

js/flightlog_fielddefs.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,22 @@ var
402402
"CALC_FREQUENCIES",
403403
"UPDATE_FILTERS",
404404
"HANNING"
405+
]),
406+
407+
ITERM_RELAX = makeReadOnly([
408+
"OFF",
409+
"RP",
410+
"RPY",
411+
"RP_INC",
412+
"RPY_INC",
413+
]),
414+
415+
ITERM_RELAX_TYPE = makeReadOnly([
416+
"GYRO",
417+
"SETPOINT",
405418
]);
406419

420+
407421
function adjustFieldDefsList(firmwareType, firmwareVersion) {
408422
if((firmwareType == FIRMWARE_TYPE_BETAFLIGHT) && semver.gte(firmwareVersion, '3.3.0')) {
409423

js/flightlog_parser.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ var FlightLogParser = function(logData) {
296296
d_min : [null, null, null], // D_Min [P, I, D]
297297
d_min_gain : null, // D_Min gain
298298
d_min_advance : null, // D_Min advance
299+
iterm_relax: null, // ITerm Relax mode
300+
iterm_relax_type: null, // ITerm Relax type
301+
iterm_relax_cutoff: null, // ITerm Relax cutoff
299302
unknownHeaders : [] // Unknown Extra Headers
300303
},
301304

@@ -599,7 +602,9 @@ var FlightLogParser = function(logData) {
599602
case "dterm_rpm_notch_harmonics":
600603
case "dterm_rpm_notch_q":
601604
case "dterm_rpm_notch_min":
602-
605+
case "iterm_relax":
606+
case "iterm_relax_type":
607+
case "iterm_relax_cutoff":
603608
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
604609
break;
605610

js/header_dialog.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ function HeaderDialog(dialog, onSave) {
8787
{name:'dterm_rpm_notch_q' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
8888
{name:'dterm_rpm_notch_min' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
8989
{name:'dshot_bidir' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
90-
90+
{name:'iterm_relax' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
91+
{name:'iterm_relax_type' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
92+
{name:'iterm_relax_cutoff' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'4.1.0', max:'999.9.9'},
9193
];
9294

9395
function isParameterValid(name) {
@@ -619,6 +621,10 @@ function HeaderDialog(dialog, onSave) {
619621
$("#rate_limits").hide();
620622
}
621623

624+
renderSelect('iterm_relax' , sysConfig.iterm_relax , ITERM_RELAX);
625+
renderSelect('iterm_relax_type' , sysConfig.iterm_relax_type , ITERM_RELAX_TYPE);
626+
setParameter('iterm_relax_cutoff', sysConfig.iterm_relax_cutoff, 0);
627+
622628
renderSelect('unsynced_fast_pwm' ,sysConfig.unsynced_fast_pwm, MOTOR_SYNC);
623629
renderSelect('fast_pwm_protocol' ,sysConfig.fast_pwm_protocol, FAST_PROTOCOL);
624630
setParameter('motor_pwm_rate' ,sysConfig.motor_pwm_rate,0);

0 commit comments

Comments
 (0)