Skip to content

Commit 7ee0aa7

Browse files
Gary KeebleGary Keeble
authored andcommitted
Minor tweaks to appearance and mousewheel
Mouse wheel scrolls page when not over the chart.
1 parent 511026e commit 7ee0aa7

File tree

8 files changed

+66
-33
lines changed

8 files changed

+66
-33
lines changed

css/header_dialog.css

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ input[type="number"]::-webkit-inner-spin-button {
188188
border-top-right-radius: 3px;
189189
}
190190

191-
.header-dialog .parameter {
192-
margin-bottom: 10px;
193-
}
194-
195191
.header-dialog input[type="number"]::-webkit-inner-spin-button {
196192
border: 0;
197193
}
@@ -255,7 +251,7 @@ input[type="number"]::-webkit-inner-spin-button {
255251

256252
.header-dialog table input {
257253
display: block;
258-
width: calc(100% - 0px);
254+
width: calc(100% - 4px);
259255
height: 20px;
260256
line-height: 20px;
261257
text-align: right;
@@ -346,7 +342,7 @@ input[type="number"]::-webkit-inner-spin-button {
346342
.header-dialog .parameter {
347343
float: right;
348344
width: calc(100% - 2px);
349-
margin-bottom: 10px;
345+
margin-top: 10px;
350346
}
351347

352348
html:not(.isCF) .cf-only,
@@ -477,23 +473,10 @@ html:not(.isBF) .bf-only {
477473
border: 0px solid #ccc;
478474
}
479475

480-
.header-dialog .features input[type=checkbox],
481-
.header-dialog .static-features input[type=checkbox] {
482-
width: 50px;
483-
padding-left: 3px;
484-
height: 20px;
485-
line-height: 20px;
486-
text-align: left;
487-
border: 0px solid silver;
488-
border-radius: 3px;
489-
margin-right: 11px;
490-
font-weight: normal;
491-
}
492-
493476
.header-dialog .features label,
494477
.header-dialog .static-features label{
495478
/* width: 70px; */
496-
padding-left: 3px;
479+
/* padding-left: 3px; */
497480
height: 20px;
498481
line-height: 20px;
499482
text-align: left;
@@ -587,4 +570,4 @@ html:not(.isBF) .bf-only {
587570

588571
.header-dialog .topspacer {
589572
margin-top:15px;
590-
}
573+
}

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,19 @@ <h5 class="modal-title-date"></h5>
616616
</table>
617617
</div>
618618
</div>
619+
<div class="gui_box grey topspacer unknown">
620+
<div class="gui_box_titlebar">
621+
<div class="spacer_box_title">Unknown Header Fields</div>
622+
</div>
623+
<div class="spacer_box">
624+
<table class="parameter cf">
625+
<tr>
626+
<td>Name</td>
627+
<td>Value</td>
628+
</tr>
629+
</table>
630+
</div>
631+
</div>
619632
</div>
620633
<div class="cf_column half right">
621634
<div class="spacer_left">

js/flightlog.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ function FlightLog(logData) {
115115
this.getSysConfig = function() {
116116
return parser.sysConfig;
117117
};
118-
118+
119+
this.setSysConfig = function(newSysConfig) {
120+
parser.sysConfig = newSysConfig;
121+
};
122+
123+
119124
/**
120125
* Get the index of the currently selected log.
121126
*/

js/flightlog_parser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ var FlightLogParser = function(logData) {
232232
gyro_cal_on_first_arm:null, // Gyro Calibrate on first arm
233233
vbat_pid_compensation:null, // VBAT PID compensation
234234
rc_smoothing:null, // RC Control Smoothing
235-
features:null // Activated features (e.g. MOTORSTOP etc)
235+
features:null, // Activated features (e.g. MOTORSTOP etc)
236+
unknownHeaders : [] // Unknown Extra Headers
236237
},
237238

238239
frameTypes,
@@ -609,6 +610,8 @@ var FlightLogParser = function(logData) {
609610
}
610611
} else {
611612
console.log("Ignoring unsupported header \"" + fieldName + "\"");
613+
if(that.sysConfig.unknownHeaders==null) that.sysConfig.unknownHeaders = new Array();
614+
that.sysConfig.unknownHeaders.push({ name: fieldName, value: fieldValue });// Save the unknown headers
612615
}
613616
break;
614617
}

js/graph_config_dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function GraphConfigurationDialog(dialog, onSave) {
5353
+ '</li>'
5454
),
5555
select = $('select', elem),
56-
selectedFieldName = field ? field.name : false,
56+
selectedFieldName = field ?field.name : false,
5757
i;
5858

5959
for (i = 0; i < offeredFieldNames.length; i++) {

js/grapher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, options)
992992
analyser = new FlightLogAnalyser(flightLog, graphConfig, canvas, craftCanvas, options);
993993

994994
//Handle dragging events
995-
$(canvas).on("mousedown", onMouseDown);
995+
$(canvas).on("mousedown",onMouseDown);
996996

997997
graphConfig.addListener(refreshGraphConfig);
998998
refreshGraphConfig();

js/header_dialog.js

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function HeaderDialog(dialog, onSave) {
150150
var feature_tip_html = '';
151151

152152
if (features[i].mode === 'group') {
153-
row_e = $('<tr><td style="width: 15px;"><input style="width: 13px;" class="feature" id="feature-'
153+
row_e = $('<tr><td><input class="feature" id="feature-'
154154
+ i
155155
+ '" value="'
156156
+ features[i].bit
@@ -210,6 +210,29 @@ function HeaderDialog(dialog, onSave) {
210210

211211
}
212212

213+
function renderUnknownHeaders(unknownHeaders) {
214+
// Build a table of unknown header entries
215+
try {
216+
if(unknownHeaders!=0) {
217+
var table = $('.unknown table');
218+
var elem = '';
219+
$("tr:not(:first)", table).remove(); // clear the entries (not the first row which has the title bar)
220+
221+
for(var i=0; i<unknownHeaders.length; i++) {
222+
elem += '<tr><td>' + unknownHeaders[i].name + '</td>' +
223+
'<td>' + unknownHeaders[i].value + '</td></tr>';
224+
}
225+
226+
table.append(elem);
227+
$('.unknown').show();
228+
} else {
229+
$('.unknown').hide();
230+
}
231+
} catch(e) {
232+
$('.unknown').hide();
233+
}
234+
}
235+
213236
function renderSysConfig(sysConfig) {
214237

215238
// Update the log header
@@ -311,20 +334,24 @@ function HeaderDialog(dialog, onSave) {
311334
setParameter('acc_cut_hz' ,sysConfig.acc_cut_hz,2);
312335
renderSelect('superExpoYawMode' ,sysConfig.superExpoYawMode, SUPER_EXPO_YAW);
313336

314-
/* Packed Flags */
337+
/* Packed Flags */
315338

316339
builtFeaturesList(sysConfig.features);
317340

318-
/* Hardware selections */
341+
/* Hardware selections */
319342

320343
renderSelect('acc_hardware' ,sysConfig.acc_hardware, ACC_HARDWARE);
321344
renderSelect('baro_hardware' ,sysConfig.baro_hardware, BARO_HARDWARE);
322345
renderSelect('mag_hardware' ,sysConfig.mag_hardware, MAG_HARDWARE);
323346

324-
/* Booleans */
347+
/* Booleans */
325348
setCheckbox('gyro_cal_on_first_arm' ,sysConfig.gyro_cal_on_first_arm);
326349
setCheckbox('vbat_pid_compensation' ,sysConfig.vbat_pid_compensation);
327350
setCheckbox('rc_smoothing' ,sysConfig.rc_smoothing);
351+
352+
/* Show Unknown Fields */
353+
renderUnknownHeaders(sysConfig.unknownHeaders);
354+
328355
}
329356

330357
function convertUIToSysConfig() {
@@ -396,6 +423,7 @@ function HeaderDialog(dialog, onSave) {
396423
this.show = function(sysConfig) {
397424
dialog.modal('show');
398425
renderSysConfig(sysConfig);
426+
399427
}
400428

401429
// Buttons

js/main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,10 @@ function BlackboxLogViewer() {
830830
newGraphConfig(newConfig);
831831
}),
832832

833-
headerDialog = new HeaderDialog($("#dlgHeaderDialog"), function(newSettings) {
834-
if(newSettings!=null) {
835-
prefs.set('lastHeaderData', newSettings);
833+
headerDialog = new HeaderDialog($("#dlgHeaderDialog"), function(newSysConfig) {
834+
if(newSysConfig!=null) {
835+
prefs.set('lastHeaderData', newSysConfig);
836+
//flightLog.setSysConfig(newSysConfig);
836837

837838
// Save Current Position then re-calculate all the log information
838839
var activePosition = (hasVideo)?video.currentTime:currentBlackboxTime;
@@ -894,7 +895,7 @@ function BlackboxLogViewer() {
894895
$(window).resize(updateCanvasSize);
895896

896897
$(document).on("mousewheel", function(e) {
897-
if (graph && $(e.target).parents('.modal').length == 0) {
898+
if (graph && $(e.target).parents('.modal').length == 0 && $(e.target).attr('id') == 'graphCanvas') {
898899
var delta = Math.max(-1, Math.min(1, (e.originalEvent.wheelDelta)));
899900
if(delta<0) { // scroll down (or left)
900901
if (e.altKey || e.shiftKey) {

0 commit comments

Comments
 (0)