compute age of weather reports relative to mobile device time; also fixed typos in tower-help

pull/104/head
bradanlane 2015-11-07 10:25:39 -05:00
rodzic d6da11c29c
commit e9a2d73cd3
2 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -125,13 +125,13 @@ function WeatherCtrl($rootScope, $scope, $state, $http, $interval) {
data_item.flight_condition = parseFlightCondition(obj.Type, obj.Data);
data_item.location = obj.Location;
s = obj.Time;
data_item.time = s.substring(0, 2) + '-' + s.substring(2, 4) + ':' + s.substring(4, 6) + 'Z';
// we can not accurately determime the current time on the Stratux
// calculating age of a weather report is indeterminate
// var dThen = parseShortDatetime(obj.Time);
// var dNow = new Date(obj.LocaltimeReceived);
// data_item.age = dThen.getTime();
// data_item.time = utcTimeString(Math.abs(dNow - dThen)) + " old";
// data_item.time = s.substring(0, 2) + '-' + s.substring(2, 4) + ':' + s.substring(4, 6) + 'Z';
// we may not get an accurate base time on the stratux device so we use the device time as our base
// var dNow = new Date(obj.LocaltimeReceived);
var dNow = new Date();
var dThen = parseShortDatetime(obj.Time);
data_item.age = dThen.getTime();
data_item.time = utcTimeString(dNow - dThen) + " old";
data_item.received = utcTimeString(obj.LocaltimeReceived);
data_item.data = obj.Data;
}

Wyświetl plik

@ -3,7 +3,7 @@
<p>For each tower, the list includes the following details:</p>
<ul class="list-simple">
<li><strong>Location</strong> - the latitude and longitude of the tower</li>
<li><strong>Signal</strong> - teh signal strength reported by the tower</li>
<li><strong>Msgs</strong> - the number of messages (traffic or weather) received from teh tower in the last minute</li>
<li><strong>Signal</strong> - the signal strength reported by the tower</li>
<li><strong>Msgs</strong> - the number of messages (traffic or weather) received from the tower in the last minute</li>
</ul>
</div>