Skip to content

Commit

Permalink
Improved marker timespan and frequency notation (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
egonl authored and pmattila committed Dec 8, 2024
1 parent 52bbbae commit 9bad6a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/grapher.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,12 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, stickCanvas, craftWrap
}, sequenceNum++);
};

var markerFrequency = ((windowCenterTime-markerEvent.time).toFixed(0)!=0)?((1000000/(windowCenterTime-markerEvent.time)).toFixed(0) + "Hz") : '';
var markerFrequency = ((windowCenterTime-markerEvent.time).toFixed(0)!=0) ? ' (' + ((1000000/(windowCenterTime-markerEvent.time)).toFixed(1) + "Hz)") : '';
drawEvent(
{
event:FlightLogEvent.CUSTOM_BLANK, // Blank doesnt show a vertical line
time:windowCenterTime,
label: formatTime((windowCenterTime-markerEvent.time)/1000, true) + 'ms ' + markerFrequency,
label: formatTime((windowCenterTime-markerEvent.time)/1000, true) + markerFrequency,
align:(markerEvent.time<windowCenterTime)?'right':'left',
}, sequenceNum++);
};
Expand Down
4 changes: 2 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function BlackboxLogViewer() {
// update time field on status bar
$(".graph-time").val(formatTime((currentBlackboxTime-flightLog.getMinTime())/1000, true));
if(hasMarker) {
$(".marker-offset", statusBar).text('Marker Offset ' + formatTime((currentBlackboxTime-markerTime)/1000, true) + 'ms ' + (1000000/(currentBlackboxTime-markerTime)).toFixed(0) + "Hz");
$(".marker-offset", statusBar).text('Marker Offset ' + formatTime((currentBlackboxTime-markerTime)/1000, true) + ' (' + (1000000/(currentBlackboxTime-markerTime)).toFixed(0) + "Hz)");
}

// Update the Legend Values
Expand Down Expand Up @@ -1792,7 +1792,7 @@ function BlackboxLogViewer() {
} else { // Add a marker to graph window
markerTime = currentBlackboxTime;
setMarker(!hasMarker);
$(".marker-offset", statusBar).text('Marker Offset ' + formatTime(0) + 'ms').css('visibility', (hasMarker)?'visible':'hidden');
$(".marker-offset", statusBar).text('Marker Offset ' + formatTime(0)).css('visibility', (hasMarker)?'visible':'hidden');
invalidateGraph();
}
e.preventDefault();
Expand Down

0 comments on commit 9bad6a8

Please sign in to comment.