Skip to content

Commit

Permalink
Merge branch 'rcCurvesAnalyser'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Keeble authored and Gary Keeble committed May 9, 2016
2 parents 14f1f8e + f3f44d9 commit 459343d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
14 changes: 5 additions & 9 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -307,22 +307,18 @@ html .view-craft,
html .view-sticks,
html .view-table,
html .view-analyser,
html .view-analyser-sticks,
html .view-analyser-fullscreen {
color:black;
}

html.has-analyser-sticks .view-analyser-sticks,
html.has-analyser .view-analyser,
html.has-table .view-table,
html.has-sticks .view-sticks,
html.has-craft .view-craft {
color:green;
}
html.has-sticks .view-sticks {
color:green;
}
html.has-table .view-table {
color:green;
}
html.has-analyser .view-analyser {
color:green;
}

html:not(.has-analyser-fullscreen) .glyphicon-resize-small {
display:none;
Expand Down
13 changes: 10 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ <h3 class="log-filename"></h3>
<h4>View</h4>
<div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-default open-keys-dialog" title="View/hide keyboard shortcuts">
<span class="glyphicon glyphicon-question-sign"></span>
</button>
<button type="button" class="btn btn-default open-header-dialog" title="View/hide header">
<span class="glyphicon glyphicon-info-sign"></span>
</button>
<button type="button" class="btn btn-default view-craft" title="View/hide craft display">
<span class="glyphicon glyphicon-plane"></span>
</button>
Expand All @@ -169,6 +175,9 @@ <h4>View</h4>
<button type="button" class="btn btn-default view-table" title="View/hide statistics display">
<span class="glyphicon glyphicon-list-alt"></span>
</button>
<button type="button" class="btn btn-default view-analyser-sticks" style="display:none" title="View/hide stick analyser">
<span class="glyphicon glyphicon-screenshot"></span>
</button>
<button type="button" class="btn btn-default view-analyser" title="View/hide analyser display">
<span class="glyphicon glyphicon-equalizer"></span>
</button>
Expand Down Expand Up @@ -262,15 +271,13 @@ <h4>Log sync</h4>
<canvas width="200" height="100" id="graphCanvas"></canvas>
<canvas width="0" height="0" id="craftCanvas"></canvas>
<canvas width="0" height="0" id="analyserCanvas"></canvas>
<canvas width="0" height="0" id="analyserStickCanvas"></canvas>
<span class="log-open-legend-dialog glyphicon glyphicon-cog"></span>
</div>
<div class="log-graph-config">
<h2>Legend <span class="log-close-legend-dialog glyphicon glyphicon-remove"></span></h2>
<div class="log-graph-legend">
</div>
<button type="button" class="btn btn-default btn-block hide-analyser-window">Hide Analyser</button>
<button type="button" class="btn btn-default btn-block open-keys-dialog">Keyboard Shortcuts</button>
<button type="button" class="btn btn-default btn-block open-header-dialog">Log Header</button>
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog">Graph setup</button>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ function BlackboxLogViewer() {

hasVideo = false, hasLog = false, hasMarker = false, // add measure feature
hasTable = true, hasCraft = true, hasSticks = true, hasAnalyser, hasAnalyserFullscreen,
hasAnalyserSticks = false,

isFullscreen = false, // New fullscreen feature (to hide table)

video = $(".log-graph video")[0],
canvas = $("#graphCanvas")[0],
analyserCanvas = $("#analyserCanvas")[0],
analyserStickCanvas = $("#analyserStickCanvas")[0],
craftCanvas = $("#craftCanvas")[0],
videoURL = false,
videoOffset = 0.0,
Expand Down Expand Up @@ -756,6 +758,12 @@ function BlackboxLogViewer() {
prefs.set('hasTable', hasTable);
});

$(".view-analyser-sticks").click(function() {
hasAnalyserSticks = !hasAnalyserSticks;
(hasAnalyserSticks)?$("html").addClass("has-analyser-sticks"):$("html").removeClass("has-analyser-sticks");
prefs.set('hasAnalyserSticks', hasAnalyserSticks);
});

$(".view-analyser").click(function() {
if(activeGraphConfig.selectedFieldName != null) {
hasAnalyser = !hasAnalyser;
Expand Down
10 changes: 5 additions & 5 deletions js/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ function formatTime(msec, displayMsec) {

function stringTimetoMsec(input) {
try {
var matches = input.match(/([+-]?[0-9]+)(\D)*([0-9]+)*\D*([0-9]+)*/);
var matches = input.match(/([-])?([0-9]+)(\D)*([0-9]+)*\D*([0-9]+)*/);

if(matches.length>2) { // there is a placeholder - either : or .
if(matches[2] == ':'){ // time has been entered MM:SS.SSS
return matches[1] * 60 * 1000000 + ((matches[3])?matches[3]:0) * 1000000 + ((matches[4])?(matches[4] + "00").slice(0,3):0) * 1000
if(matches[3] == ':'){ // time has been entered MM:SS.SSS
return ((matches[1])?-1:1) * (matches[2] * 60 * 1000000 + ((matches[4])?matches[4]:0) * 1000000 + ((matches[5])?(matches[5] + "00").slice(0,3):0) * 1000);
} else {
return matches[1] * 1000000 + ((matches[3])?(matches[3] + "00").slice(0,3):0) * 1000;
return ((matches[1])?-1:1) * (matches[2] * 1000000 + ((matches[4])?(matches[4] + "00").slice(0,3):0) * 1000);
}
} else return matches[1] * 1000000;
} else return ((matches[1])?-1:1) * (matches[2] * 1000000);
} catch(e) {
return 0;
}
Expand Down

0 comments on commit 459343d

Please sign in to comment.