Playback
diff --git a/js/flightlog.js b/js/flightlog.js
index 515256cf..45054d73 100644
--- a/js/flightlog.js
+++ b/js/flightlog.js
@@ -913,15 +913,6 @@ FlightLog.prototype.rcCommandRawToDegreesPerSecond = function(value, axis) {
// Axis 0,1 refers to Roll and Pitch
// Axis 2 refers to Yaw.
- // ReWrite or LUXFloat only
-
-
-// if(axis==2 /*YAW*/) {
-// return ((this.settings[0].parameters[axis].value + 47) * value ) >> 7;
-// } else { /*ROLL or PITCH */
-// return ((this.settings[0].parameters[axis].value + 27) * value ) >> 6;
-// }
-
if(axis==2 /*YAW*/) {
return ((this.getSysConfig().yRate + 47) * value ) >> 7;
} else { /*ROLL or PITCH */
@@ -929,6 +920,11 @@ FlightLog.prototype.rcCommandRawToDegreesPerSecond = function(value, axis) {
}
};
+FlightLog.prototype.rcCommandRawToThrottle = function(value) {
+ // Throttle displayed as percentage
+ return ((value - this.getSysConfig().minthrottle) / (this.getSysConfig().maxthrottle - this.getSysConfig().minthrottle)) * 100.0;
+};
+
FlightLog.prototype.getReferenceVoltageMillivolts = function() {
return this.vbatADCToMillivolts(this.getSysConfig().vbatref);
};
diff --git a/js/flightlog_fields_presenter.js b/js/flightlog_fields_presenter.js
index e0c22f8f..ee8f6e6e 100644
--- a/js/flightlog_fields_presenter.js
+++ b/js/flightlog_fields_presenter.js
@@ -138,6 +138,11 @@ function FlightLogFieldPresenter() {
case 'gyroADC[2]':
return Math.round(flightLog.gyroRawToDegreesPerSecond(value)) + " deg/s";
+ case 'gyroADCs[0]':
+ case 'gyroADCs[1]':
+ case 'gyroADCs[2]':
+ return value.toFixed(0) + " deg/s";
+
case 'axisError[0]':
case 'axisError[1]':
case 'axisError[2]':
@@ -150,6 +155,14 @@ function FlightLogFieldPresenter() {
case 'rcCommand[2]':
return Math.round(flightLog.rcCommandRawToDegreesPerSecond(value,2)) + " deg/s";
+ case 'rcCommand[3]':
+ return Math.round(flightLog.rcCommandRawToThrottle(value)) + " %";
+
+ case 'rcCommands[0]':
+ case 'rcCommands[1]':
+ case 'rcCommands[2]':
+ return value.toFixed(0) + " deg/s";
+
case 'accSmooth[0]':
case 'accSmooth[1]':
case 'accSmooth[2]':
diff --git a/js/graph_legend.js b/js/graph_legend.js
index 79b0a7d5..a98e2dc5 100644
--- a/js/graph_legend.js
+++ b/js/graph_legend.js
@@ -20,14 +20,13 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
graphTitle.text(graph.label);
- for (j = 0; j < graph.fields.length; j++) {
+ for (j = 0; j < graph.fields.length; j++) {
var
field = graph.fields[j],
- li = $('
');
+ li = $('');
li.text(FlightLogFieldPresenter.fieldNameToFriendly(field.name));
li.css('border-bottom', "2px solid " + field.color);
-
fieldList.append(li);
}
@@ -65,6 +64,19 @@ function GraphLegend(targetElem, config, onVisibilityChange, onNewSelectionChang
// on first show, hide the analyser button
if(!config.selectedFieldName) $('.hide-analyser-window').hide();
}
+
+ this.updateValues = function(flightLog, frame) {
+ try {
+ // New function to show values on legend.
+ $(".graph-legend-field").each(function(index, value) {
+ var value = FlightLogFieldPresenter.decodeFieldToFriendly(flightLog, $(this).attr('name'), frame[flightLog.getMainFieldIndexByName($(this).attr('name'))]);
+ $(this).text(FlightLogFieldPresenter.fieldNameToFriendly($(this).attr('name')) + ((value)?' (' + value + ')':' ') );
+ $(this).append('');
+ });
+ } catch(e) {
+ console.log('Cannot update legend with values');
+ }
+ };
this.show = function() {
$('.log-graph-config').show();
diff --git a/js/grapher.js b/js/grapher.js
index 83420bfb..99652fa1 100755
--- a/js/grapher.js
+++ b/js/grapher.js
@@ -998,6 +998,11 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, options)
}
};
+ // Add option toggling
+ this.setDrawSticks = function(state) {
+ options.drawSticks = state;
+ };
+
// Use defaults for any options not provided
options = extend(defaultOptions, options || {});
diff --git a/js/main.js b/js/main.js
index a428fbb0..94562402 100644
--- a/js/main.js
+++ b/js/main.js
@@ -98,6 +98,10 @@ function BlackboxLogViewer() {
fieldPresenter = FlightLogFieldPresenter,
hasVideo = false, hasLog = false, hasMarker = false, // add measure feature
+ hasTable = true, hasCraft = true, hasSticks = true,
+
+ isFullscreen = false, // New fullscreen feature (to hide table)
+
video = $(".log-graph video")[0],
canvas = $("#graphCanvas")[0],
craftCanvas = $("#craftCanvas")[0],
@@ -168,41 +172,48 @@ function BlackboxLogViewer() {
fieldNames = flightLog.getMainFieldNames();
$("tr:not(:first)", table).remove();
-
+
if (frame) {
- var
- rows = [],
- rowCount = Math.ceil(fieldNames.length / 2);
-
- for (i = 0; i < rowCount; i++) {
+
+ if(hasTable) { // Only redraw the table if it is enabled
+
var
- row =
- "" +
- '' + fieldPresenter.fieldNameToFriendly(fieldNames[i]) + ' | ' +
- '' + atMost2DecPlaces(frame[i]) + ' | ' +
- '' + fieldPresenter.decodeFieldToFriendly(flightLog, fieldNames[i], frame[i]) + " | ",
-
- secondColumn = i + rowCount;
-
- if (secondColumn < fieldNames.length) {
- row +=
- '' + fieldPresenter.fieldNameToFriendly(fieldNames[secondColumn]) + ' | ' +
- '' + atMost2DecPlaces(frame[secondColumn]) + ' | ' +
- '' + fieldPresenter.decodeFieldToFriendly(flightLog, fieldNames[secondColumn], frame[secondColumn]) + ' | ';
+ rows = [],
+ rowCount = Math.ceil(fieldNames.length / 2);
+
+ for (i = 0; i < rowCount; i++) {
+ var
+ row =
+ "
" +
+ '' + fieldPresenter.fieldNameToFriendly(fieldNames[i]) + ' | ' +
+ '' + atMost2DecPlaces(frame[i]) + ' | ' +
+ '' + fieldPresenter.decodeFieldToFriendly(flightLog, fieldNames[i], frame[i]) + " | ",
+
+ secondColumn = i + rowCount;
+
+ if (secondColumn < fieldNames.length) {
+ row +=
+ '' + fieldPresenter.fieldNameToFriendly(fieldNames[secondColumn]) + ' | ' +
+ '' + atMost2DecPlaces(frame[secondColumn]) + ' | ' +
+ '' + fieldPresenter.decodeFieldToFriendly(flightLog, fieldNames[secondColumn], frame[secondColumn]) + ' | ';
+ }
+
+ row += "
";
+
+ rows.push(row);
}
-
- row += "";
-
- rows.push(row);
+
+ table.append(rows.join(""));
}
- table.append(rows.join(""));
-
// update time field on toolbar
$(".graph-time").val(formatTime((currentBlackboxTime-flightLog.getMinTime())/1000, true));
if(hasMarker) {
$(".graph-time-marker").val(formatTime((currentBlackboxTime-markerTime)/1000, true));
}
+
+ // Update the Legend Values
+ if(graphLegend) graphLegend.updateValues(flightLog, frame);
}
}
@@ -561,6 +572,8 @@ function BlackboxLogViewer() {
hasLog = true;
$("html").addClass("has-log");
+ (hasCraft)?$("html").addClass("has-craft"):$("html").removeClass("has-craft");
+ (hasTable)?$("html").addClass("has-table"):$("html").removeClass("has-table");
selectLog(null);
};
@@ -613,6 +626,11 @@ function BlackboxLogViewer() {
(state)?$("html").addClass("has-marker"):$("html").removeClass("has-marker");
}
+ function setFullscreen(state) { // update fullscreen status
+ isFullscreen = state;
+ (state)?$("html").addClass("is-fullscreen"):$("html").removeClass("is-fullscreen");
+ }
+
this.getMarker = function() { // get marker field
return {
state:hasMarker,
@@ -673,7 +691,27 @@ function BlackboxLogViewer() {
graphLegend.hide();
}
});
-
+
+ prefs.get('hasCraft', function(item) {
+ if (item) {
+ hasCraft = item;
+ (hasCraft)?$("html").addClass("has-craft"):$("html").removeClass("has-craft");
+ }
+ });
+
+ prefs.get('hasSticks', function(item) {
+ if (item) {
+ hasSticks = item;
+ }
+ });
+
+ prefs.get('hasTable', function(item) {
+ if (item) {
+ hasTable = item;
+ (hasTable)?$("html").addClass("has-table"):$("html").removeClass("has-table");
+ }
+ });
+
$(".file-open").change(function(e) {
var
files = e.target.files,
@@ -699,6 +737,25 @@ function BlackboxLogViewer() {
}
});
+ // New View Controls
+ $(".view-craft").click(function() {
+ hasCraft = !hasCraft;
+ (hasCraft)?$("html").addClass("has-craft"):$("html").removeClass("has-craft");
+ prefs.set('hasCraft', hasCraft);
+ });
+
+ $(".view-sticks").click(function() {
+ hasSticks = !hasSticks;
+ graph.setDrawSticks(hasSticks);
+ prefs.set('hasSticks', hasSticks);
+ invalidateGraph();
+ });
+
+ $(".view-table").click(function() {
+ hasTable = !hasTable;
+ (hasTable)?$("html").addClass("has-table"):$("html").removeClass("has-table");
+ prefs.set('hasTable', hasTable);
+ });
var logJumpBack = function() {
if (hasVideo) {