Rearrangements to clock layout.

Provide UTC and last-receiver-update clocks.
This commit is contained in:
Oliver Jowett 2015-01-07 18:39:19 +00:00
parent e6a70345b5
commit b2b0aa9afe
2 changed files with 50 additions and 19 deletions

View file

@ -24,27 +24,26 @@
<div id="sidebar_container">
<div id="sidebar_canvas">
<div id="timestamps" style="align: center">
<table width="100%"><tr>
<td>Local Time</td>
<td>
<canvas id="localclock" class="CoolClock:classic:40"></canvas>
</td>
<td>UTC Time</td>
<td>
<canvas id="gmtclock" class="CoolClock:classic:40::0"></canvas>
</td>
</tr></table>
<table width="100%">
<tr>
<td align="center"> <canvas id="utcclock"></canvas> </td>
<td align="center"> <canvas id="receiverclock"></canvas> </td>
</tr>
<tr>
<td align="center">UTC</td>
<td align="center">Last Update</td>
</tr>
</table>
</div>
<div id="sudo_buttons">
<table width="100%"><tr>
<table width="100%">
<tr>
<td width="150" style="text-align: center;" class="pointer">
[ <span onclick="resetMap();">Reset Map</span> ]
</td>
<td>&nbsp;</td>
<td width="150" style="text-align: center;" id="setings_button" class="pointer">
&nbsp;
</td>
</tr></table>
</tr>
</table>
</div>
<div id="dump1090_infoblock">

View file

@ -28,6 +28,7 @@ var TrackedHistorySize = 0;
var SitePosition = null;
var ReceiverClock = null;
function fetchData() {
$.getJSON('data/aircraft.json', function(data) {
// Loop through all the planes in the data packet
@ -65,6 +66,11 @@ function fetchData() {
refreshTableInfo();
refreshSelected();
if (ReceiverClock) {
var rcv = new Date(now * 1000);
ReceiverClock.render(rcv.getUTCHours(),rcv.getUTCMinutes(),rcv.getUTCSeconds());
}
});
}
@ -73,6 +79,32 @@ function initialize() {
if (!ShowClocks) {
$('#timestamps').css('display','none');
} else {
// Create the clocks.
new CoolClock({
canvasId: "utcclock",
skinId: "classic",
displayRadius: 40,
showSecondHand: true,
gmtOffset: 0,
showDigital: false,
logClock: false,
logClockRev: false
});
ReceiverClock = new CoolClock({
canvasId: "receiverclock",
skinId: "classic",
displayRadius: 40,
showSecondHand: true,
gmtOffset: 0,
showDigital: false,
logClock: false,
logClockRev: false
});
// disable ticking on the receiver clock, we will update it ourselves
ReceiverClock.tick = (function(){})
}
// Get receiver metadata, reconfigure using it, then continue