Skip to content

Commit 5fede9f

Browse files
committed
Fixed header dialog
1 parent 156f7e0 commit 5fede9f

File tree

3 files changed

+77
-27
lines changed

3 files changed

+77
-27
lines changed

index.html

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ <h2 class="no-wheel">Legend <span class="log-close-legend-dialog glyphicon glyph
551551
<span class="viewer-version">-</span>
552552
</div>
553553
</div>
554+
554555
<!-- Dialog Boxes and Popup Windows -->
555556
<div class="modal fade graph-configuration-dialog" id="dlgGraphConfiguration">
556557
<div class="modal-dialog">
@@ -580,6 +581,7 @@ <h4 class="modal-title">Configure graphs</h4>
580581
</div>
581582
</div>
582583
</div>
584+
583585
<div class="modal fade header-dialog" id="dlgHeaderDialog">
584586
<div class="modal-dialog">
585587
<div class="modal-content">
@@ -737,16 +739,28 @@ <h5 class="modal-title-craft"></h5>
737739
<table class="parameter cf">
738740
<tbody>
739741
<tr>
740-
<td name="ptermSRateWeight" class="bf-only"><label>P-Term<br>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
741-
<td name="setpointRelaxRatio" class="bf-only"><label>Setpoint Relax<br>Ratio</label><input type="number" step="0.01" min="0" max="999" /></td>
742-
<td name="dtermSetpointWeight" class="bf-only"><label>D-Term Setpoint<br>Weight</label><input type="number" step="0.01" min="0" max="999" /></td>
742+
<td name="ptermSRateWeight" class="bf-only"><label>P-Term<br>&nbsp;<br/>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
743+
<td name="setpointRelaxRatio" class="bf-only"><label>Setpoint Relax<br>Ratio<br/>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
744+
<td name="dtermSetpointWeight" class="bf-only"><label>D-Term Setpoint<br>Weight<br/>&nbsp;</label><input type="number" step="0.01" min="0" max="999" /></td>
743745
<td name="rateAccelLimit" class="bf-only"><label>Roll/Pitch Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
744746
<td name="yawRateAccelLimit" class="bf-only"><label>Yaw Rate<br>Acceleration Limit</label><input type="number" step="1" min="0" max="999" /></td>
745-
</tr>
747+
</tr>
748+
</tbody>
749+
</table>
750+
<table class="parameter cf">
751+
<tbody>
746752
<tr>
747753
<td name="antiGravityGain" class="bf-only"><label>AG Gain</label><input type="number" step="0.01" min="0" max="999" /></td>
748754
<td name="antiGravityThreshold" class="bf-only"><label>AG Threshold</label><input type="number" step="0.01" min="0" max="999" /></td>
749755
<td name="itermWindupPointPercent" class="bf-only"><label>Windup Threshold</label><input type="number" step="1" min="0" max="999" /></td>
756+
</tr>
757+
</tbody>
758+
</table>
759+
<table class="parameter cf">
760+
<tbody>
761+
<tr>
762+
<td name="pidSumLimit" class="bf-only"><label>PIDSum Limit</label><input type="number" step="0.01" min="0" max="999" /></td>
763+
<td name="pidSumLimitYaw" class="bf-only"><label>PIDSum Limit Yaw</label><input type="number" step="0.01" min="0" max="999" /></td>
750764
</tr>
751765
</tbody>
752766
</table>
@@ -789,8 +803,8 @@ <h5 class="modal-title-craft"></h5>
789803
<tbody class="static-features noline">
790804
<tr>
791805
<td name="pidAtMinThrottle"><label class="option"><input class="ios-switch" type="checkbox"/><div><div></div></div></label></td>
792-
<td><label>pidAtMinThrottle</label></td>
793-
<td><span>Stabilisation at zero throttle ?</span></td>
806+
<td><label>PID controller active at min-throttle</label></td>
807+
<td><span>Stabilisation at zero throttle</span></td>
794808
</tr>
795809
</tbody>
796810
</table>
@@ -954,15 +968,9 @@ <h5 class="modal-title-craft"></h5>
954968
<td name="rcYawExpo" ><label>Expo</label><input type="number" step="0.01" min="0" max="1.00"/></td>
955969
<td name="yaw_deadband" ><label>Deadband</label><input type="number" step="1" min="0" max="100"/></td>
956970
</tr>
957-
</tbody>
958-
</table>
959-
<table class="parameter cf">
960-
<thead>
961971
<tr>
962972
<th colspan="5">Super Expo Rates</th>
963973
</tr>
964-
</thead>
965-
<tbody>
966974
<tr>
967975
<td name="rates[0]"><label>ROLL Rate</label><input type="number" step="0.01" min="0" max="1.00" /></td>
968976
<td name="rates[1]"><label>PITCH Rate</label><input type="number" step="0.01" min="0" max="1.00" /></td>
@@ -1129,12 +1137,13 @@ <h5 class="modal-title-craft"></h5>
11291137
</div>
11301138
<div class="modal-footer">
11311139
<button type="button" class="btn btn-default header-dialog-toggle" data-toggle="tooltip" title="Change the header display for the respective firmware type">Cleanflight</button>
1132-
<button type="button" class="btn btn-default header-dialog-cancel" data-dismiss="modal" data-toggle="tooltip" title="Close without saving changes">Cancel</button>
1140+
<button type="button" class="btn btn-default header-dialog-cancel" data-dismiss="modal" data-toggle="tooltip" title="Close without saving changes">Close</button>
11331141
<button type="button" class="btn btn-primary header-dialog-save" style="display:none;" data-dismiss="modal" data-toggle="tooltip" title="Close and save changes">Save changes</button>
11341142
</div>
11351143
</div>
11361144
</div>
11371145
</div>
1146+
11381147
<div class="modal fade keys-dialog" id="dlgKeysDialog">
11391148
<div class="modal-dialog">
11401149
<div class="modal-content">

js/flightlog_parser.js

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ var FlightLogParser = function(logData) {
209209
serialrx_provider:null, // name of the serial rx provider
210210
superExpoFactor:null, // Super Expo Factor
211211
rates:[null, null, null], // Rates [ROLL, PITCH, YAW]
212+
rc_rates:[null, null, null], // RC Rates [ROLL, PITCH, YAW]
213+
rc_expo:[null, null, null], // RC Expo [ROLL, PITCH, YAW]
212214
looptime:null, // Looptime
213215
gyro_sync_denom:null, // Gyro Sync Denom
214216
pid_process_denom:null, // PID Process Denom
@@ -262,6 +264,8 @@ var FlightLogParser = function(logData) {
262264
Craft_name:null, // Craft Name
263265
motorOutput:[null,null], // Minimum and maximum outputs to motor's
264266
digitalIdleOffset:null, // min throttle for d-shot (as a percentage)
267+
pidSumLimit:null, // PID sum limit
268+
pidSumLimitYaw:null, // PID sum limit yaw
265269
unknownHeaders : [] // Unknown Extra Headers
266270
},
267271

@@ -388,6 +392,8 @@ var FlightLogParser = function(logData) {
388392
that.sysConfig.frameIntervalPDenom = parseInt(matches[2], 10);
389393
}
390394
break;
395+
case "P denom":
396+
that.sysConfig.frameIntervalPDenom = parseInt(fieldValue, 10);
391397
case "Data version":
392398
dataVersion = parseInt(fieldValue, 10);
393399
break;
@@ -462,6 +468,7 @@ var FlightLogParser = function(logData) {
462468
case "fast_pwm_protocol":
463469
case "motor_pwm_rate":
464470
case "vbatscale":
471+
case "vbat_scale":
465472
case "vbatref":
466473
case "acc_1G":
467474
case "dterm_filter_type":
@@ -483,7 +490,14 @@ var FlightLogParser = function(logData) {
483490
that.sysConfig.rcYawRate = parseInt(fieldValue, 10);
484491
break
485492
case "rc_expo":
486-
that.sysConfig.rcExpo = parseInt(fieldValue, 10);
493+
if(fieldValue.match(/.*,.*/)!=null) {
494+
var expos = parseCommaSeparatedString(fieldValue);
495+
that.sysConfig[fieldName] = expos
496+
that.sysConfig.rcExpo = expos[0];
497+
that.sysConfig.rcYawExpo = expos[1];
498+
} else {
499+
that.sysConfig.rcExpo = parseInt(fieldValue, 10);
500+
}
487501
break
488502
case "rc_expo_yaw":
489503
that.sysConfig.rcYawExpo = parseInt(fieldValue, 10);
@@ -534,7 +548,7 @@ var FlightLogParser = function(logData) {
534548
case "anti_gravity_gain":
535549
if((that.sysConfig.firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver.gte(that.sysConfig.firmwareVersion, '3.1.0')) ||
536550
(that.sysConfig.firmwareType == FIRMWARE_TYPE_CLEANFLIGHT && semver.gte(that.sysConfig.firmwareVersion, '2.0.0'))) {
537-
that.sysConfig[fieldName] = uint32ToFloat(fieldValue, 10);
551+
that.sysConfig[fieldName] = parseInt(fieldValue, 10)/1000;
538552
} else {
539553
that.sysConfig[fieldName] = parseInt(fieldValue, 10);
540554
}
@@ -584,6 +598,13 @@ var FlightLogParser = function(logData) {
584598
}
585599
break;
586600

601+
case "pidsum_limit":
602+
that.sysConfig.pidSumLimit = parseInt(fieldValue, 10);
603+
break;
604+
case "pidsum_limit_yaw":
605+
that.sysConfig.pidSumLimitYaw = parseInt(fieldValue, 10);
606+
break;
607+
587608
/* CSV packed values */
588609
case "rates":
589610
case "rollPID":
@@ -598,6 +619,12 @@ var FlightLogParser = function(logData) {
598619
case "motorOutput":
599620
that.sysConfig[fieldName] = parseCommaSeparatedString(fieldValue);
600621
break;
622+
case "rc_rates":
623+
var rc_rates = parseCommaSeparatedString(fieldValue);
624+
that.sysConfig[fieldName] = rc_rates
625+
that.sysConfig.rcRate = rc_rates[0];
626+
that.sysConfig.rcYawRate = rc_rates[1];
627+
break;
601628
case "magPID":
602629
that.sysConfig.magPID = parseCommaSeparatedString(fieldValue,3); //[parseInt(fieldValue, 10), null, null];
603630
break;
@@ -611,6 +638,7 @@ var FlightLogParser = function(logData) {
611638
that.sysConfig.vbatmaxcellvoltage = vbatcellvoltageParams[2];
612639
break;
613640
case "currentMeter":
641+
case "currentSensor":
614642
var currentMeterParams = parseCommaSeparatedString(fieldValue);
615643

616644
that.sysConfig.currentMeterOffset = currentMeterParams[0];

js/header_dialog.js

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function HeaderDialog(dialog, onSave) {
5858
{name:'setpointRelaxRatio' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
5959
{name:'antiGravityGain' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
6060
{name:'antiGravityThreshold' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
61-
{name:'itermWindupPointPercent' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'}
61+
{name:'itermWindupPointPercent' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.1.0', max:'999.9.9'},
62+
{name:'pidSumLimit' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.3.0', max:'999.9.9'},
63+
{name:'pidSumLimitYaw' , type:FIRMWARE_TYPE_BETAFLIGHT, min:'3.3.0', max:'999.9.9'}
6264
];
6365

6466
function isParameterValid(name) {
@@ -208,30 +210,35 @@ function HeaderDialog(dialog, onSave) {
208210
// generate features
209211
var features = [
210212
{bit: 0, group: 'rxMode', mode: 'group', name: 'RX_PPM', description: 'PPM Receiver Selected'},
211-
{bit: 1, group: 'battery', name: 'VBAT', description: 'Battery Monitoring'},
212213
{bit: 2, group: 'other', name: 'INFLIGHT_ACC_CAL', description: 'In-flight level calibration'},
213214
{bit: 3, group: 'rxMode', mode: 'group', name: 'RX_SERIAL', description: 'Serial Receiver Selected'},
214215
{bit: 4, group: 'other', name: 'MOTOR_STOP', description: 'Motor Stop on low throttle'},
215216
{bit: 5, group: 'other', name: 'SERVO_TILT', description: 'Servo gimbal'},
216217
{bit: 6, group: 'other', name: 'SOFTSERIAL', description: 'Enable CPU based serial port'},
217218
{bit: 7, group: 'other', name: 'GPS', description: 'GPS device connected'},
218-
{bit: 8, group: 'other', name: 'FAILSAFE', description: 'Failsafe mode enabled'},
219219
{bit: 9, group: 'other', name: 'SONAR', description: 'Sonar'},
220220
{bit: 10, group: 'other', name: 'TELEMETRY', description: 'Telemetry Output'},
221-
{bit: 11, group: 'battery', name: 'CURRENT_METER', description: 'Battery current monitoring'},
222221
{bit: 12, group: 'other', name: '3D', description: '3D mode (for use with reversible ESCs)'},
223222
{bit: 13, group: 'rxMode', mode: 'group', name: 'RX_PARALLEL_PWM', description: 'PWM receiver selected'},
224223
{bit: 14, group: 'rxMode', mode: 'group', name: 'RX_MSP', description: 'Controller over MSP'},
225224
{bit: 15, group: 'other', name: 'RSSI_ADC', description: 'ADC RSSI Monitoring'},
226225
{bit: 16, group: 'other', name: 'LED_STRIP', description: 'Addressible RGB LED strip support'},
227-
{bit: 17, group: 'other', name: 'DISPLAY', description: 'OLED Screen Display'},
228-
{bit: 19, group: 'other', name: 'BLACKBOX', description: 'Blackbox flight data recorder'},
226+
{bit: 17, group: 'other', name: 'DISPLAY', description: 'OLED Screen Display'},
229227
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING', description: 'Forward aux channels to servo outputs'},
230-
{bit: 21, group: 'other', name: 'TRANSPONDER', description: 'Transponder enabled'}
228+
{bit: 21, group: 'other', name: 'TRANSPONDER', description: 'Race Transponder'},
231229
];
232230

233231

234-
// Add specific features for betaflight v2.8 onwards....
232+
// Add specific features for betaflight v2.8 onwards....
233+
if (semver.lte(sysConfig.firmwareVersion, "3.2.0")) {
234+
features.push(
235+
{bit: 1, group: 'battery', name: 'VBAT', description: 'Battery Monitoring'},
236+
{bit: 11, group: 'battery', name: 'CURRENT_METER', description: 'Battery current monitoring'},
237+
{bit: 8, group: 'other', name: 'FAILSAFE', description: 'Failsafe mode enabled'},
238+
{bit: 19, group: 'other', name: 'BLACKBOX', description: 'Blackbox flight data recorder'},
239+
);
240+
}
241+
235242
if (semver.gte(sysConfig.firmwareVersion, "2.8.0")) {
236243
features.push(
237244
{bit: 22, group: 'other', name: 'AIRMODE', description: 'Airmode always enabled, set off to use modes'}
@@ -258,7 +265,9 @@ function HeaderDialog(dialog, onSave) {
258265

259266
if (semver.gte(sysConfig.firmwareVersion, "3.1.0")) {
260267
features.push(
261-
{bit: 27, group: 'other', name: 'ESC_SENSOR', description: 'Use KISS ESC 24A telemetry as sensor'}
268+
{bit: 27, group: 'other', name: 'ESC_SENSOR', description: 'Use KISS ESC 24A telemetry as sensor'},
269+
{bit: 28, group: 'other', name: 'ANTI_GRAVITY', description: 'Temporary boost I-Term on high throttle changes'},
270+
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER', description: 'Dynamic gyro notch filtering'}
262271
)
263272
}
264273

@@ -516,7 +525,9 @@ function HeaderDialog(dialog, onSave) {
516525
setParameter('digitalIdleOffset' ,sysConfig.digitalIdleOffset,2);
517526
setParameter('antiGravityGain' ,sysConfig.anti_gravity_gain,0);
518527
setParameter('antiGravityThreshold' ,sysConfig.anti_gravity_threshold,0);
519-
setParameter('setpointRelaxRatio' ,sysConfig.setpointRelaxRatio,2);
528+
setParameter('setpointRelaxRatio' ,sysConfig.setpointRelaxRatio,2);
529+
setParameter('pidSumLimit' ,sysConfig.pidSumLimit,0);
530+
setParameter('pidSumLimitYaw' ,sysConfig.pidSumLimitYaw,0);
520531

521532
/* Packed Flags */
522533

@@ -622,8 +633,10 @@ function HeaderDialog(dialog, onSave) {
622633

623634
this.show = function(sysConfig) {
624635
dialog.modal('show');
625-
renderSysConfig(sysConfig);
626-
636+
renderSysConfig(sysConfig);
637+
// Disable changing input and dropdowns
638+
$('#dlgHeaderDialog input').prop('disabled', 'disabled');
639+
$('#dlgHeaderDialog select').prop('disabled', 'disabled');
627640
}
628641

629642
// Buttons

0 commit comments

Comments
 (0)