Skip to content

Commit 459343d

Browse files
Gary KeebleGary Keeble
authored andcommitted
Merge branch 'rcCurvesAnalyser'
2 parents 14f1f8e + f3f44d9 commit 459343d

File tree

4 files changed

+28
-17
lines changed

4 files changed

+28
-17
lines changed

css/main.css

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,22 +307,18 @@ html .view-craft,
307307
html .view-sticks,
308308
html .view-table,
309309
html .view-analyser,
310+
html .view-analyser-sticks,
310311
html .view-analyser-fullscreen {
311312
color:black;
312313
}
313314

315+
html.has-analyser-sticks .view-analyser-sticks,
316+
html.has-analyser .view-analyser,
317+
html.has-table .view-table,
318+
html.has-sticks .view-sticks,
314319
html.has-craft .view-craft {
315320
color:green;
316321
}
317-
html.has-sticks .view-sticks {
318-
color:green;
319-
}
320-
html.has-table .view-table {
321-
color:green;
322-
}
323-
html.has-analyser .view-analyser {
324-
color:green;
325-
}
326322

327323
html:not(.has-analyser-fullscreen) .glyphicon-resize-small {
328324
display:none;

index.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ <h3 class="log-filename"></h3>
160160
<h4>View</h4>
161161
<div>
162162
<div class="btn-group" role="group">
163+
<button type="button" class="btn btn-default open-keys-dialog" title="View/hide keyboard shortcuts">
164+
<span class="glyphicon glyphicon-question-sign"></span>
165+
</button>
166+
<button type="button" class="btn btn-default open-header-dialog" title="View/hide header">
167+
<span class="glyphicon glyphicon-info-sign"></span>
168+
</button>
163169
<button type="button" class="btn btn-default view-craft" title="View/hide craft display">
164170
<span class="glyphicon glyphicon-plane"></span>
165171
</button>
@@ -169,6 +175,9 @@ <h4>View</h4>
169175
<button type="button" class="btn btn-default view-table" title="View/hide statistics display">
170176
<span class="glyphicon glyphicon-list-alt"></span>
171177
</button>
178+
<button type="button" class="btn btn-default view-analyser-sticks" style="display:none" title="View/hide stick analyser">
179+
<span class="glyphicon glyphicon-screenshot"></span>
180+
</button>
172181
<button type="button" class="btn btn-default view-analyser" title="View/hide analyser display">
173182
<span class="glyphicon glyphicon-equalizer"></span>
174183
</button>
@@ -262,15 +271,13 @@ <h4>Log sync</h4>
262271
<canvas width="200" height="100" id="graphCanvas"></canvas>
263272
<canvas width="0" height="0" id="craftCanvas"></canvas>
264273
<canvas width="0" height="0" id="analyserCanvas"></canvas>
274+
<canvas width="0" height="0" id="analyserStickCanvas"></canvas>
265275
<span class="log-open-legend-dialog glyphicon glyphicon-cog"></span>
266276
</div>
267277
<div class="log-graph-config">
268278
<h2>Legend <span class="log-close-legend-dialog glyphicon glyphicon-remove"></span></h2>
269279
<div class="log-graph-legend">
270280
</div>
271-
<button type="button" class="btn btn-default btn-block hide-analyser-window">Hide Analyser</button>
272-
<button type="button" class="btn btn-default btn-block open-keys-dialog">Keyboard Shortcuts</button>
273-
<button type="button" class="btn btn-default btn-block open-header-dialog">Log Header</button>
274281
<button type="button" class="btn btn-default btn-block open-graph-configuration-dialog">Graph setup</button>
275282
</div>
276283
</div>

js/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ function BlackboxLogViewer() {
5555

5656
hasVideo = false, hasLog = false, hasMarker = false, // add measure feature
5757
hasTable = true, hasCraft = true, hasSticks = true, hasAnalyser, hasAnalyserFullscreen,
58+
hasAnalyserSticks = false,
5859

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

6162
video = $(".log-graph video")[0],
6263
canvas = $("#graphCanvas")[0],
6364
analyserCanvas = $("#analyserCanvas")[0],
65+
analyserStickCanvas = $("#analyserStickCanvas")[0],
6466
craftCanvas = $("#craftCanvas")[0],
6567
videoURL = false,
6668
videoOffset = 0.0,
@@ -756,6 +758,12 @@ function BlackboxLogViewer() {
756758
prefs.set('hasTable', hasTable);
757759
});
758760

761+
$(".view-analyser-sticks").click(function() {
762+
hasAnalyserSticks = !hasAnalyserSticks;
763+
(hasAnalyserSticks)?$("html").addClass("has-analyser-sticks"):$("html").removeClass("has-analyser-sticks");
764+
prefs.set('hasAnalyserSticks', hasAnalyserSticks);
765+
});
766+
759767
$(".view-analyser").click(function() {
760768
if(activeGraphConfig.selectedFieldName != null) {
761769
hasAnalyser = !hasAnalyser;

js/tools.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,15 @@ function formatTime(msec, displayMsec) {
189189

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

194194
if(matches.length>2) { // there is a placeholder - either : or .
195-
if(matches[2] == ':'){ // time has been entered MM:SS.SSS
196-
return matches[1] * 60 * 1000000 + ((matches[3])?matches[3]:0) * 1000000 + ((matches[4])?(matches[4] + "00").slice(0,3):0) * 1000
195+
if(matches[3] == ':'){ // time has been entered MM:SS.SSS
196+
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);
197197
} else {
198-
return matches[1] * 1000000 + ((matches[3])?(matches[3] + "00").slice(0,3):0) * 1000;
198+
return ((matches[1])?-1:1) * (matches[2] * 1000000 + ((matches[4])?(matches[4] + "00").slice(0,3):0) * 1000);
199199
}
200-
} else return matches[1] * 1000000;
200+
} else return ((matches[1])?-1:1) * (matches[2] * 1000000);
201201
} catch(e) {
202202
return 0;
203203
}

0 commit comments

Comments
 (0)