Skip to content

Commit

Permalink
Merge branch 'wiedehopf:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
rkarikari authored Dec 8, 2024
2 parents c11d14e + 9043ebe commit 13f1b05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions html/early.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,16 +454,16 @@ if (uuid) {

let heatmapLoadingState = {};
function loadHeatChunk() {
if (heatmapLoadingState.index > heatChunks.length) {
if (heatmapLoadingState.index >= heatChunks.length) {
heatmapDefer.resolve();
return; // done, stop recursing
}


let time = new Date(heatmapLoadingState.start + heatmapLoadingState.index * heatmapLoadingState.interval);
let sDate = sDateString(time);
let index = 2 * time.getUTCHours() + Math.floor(time.getUTCMinutes() / 30);


let base = "globe_history/";

let URL = base + sDate + "/heatmap/" +
Expand All @@ -474,6 +474,11 @@ function loadHeatChunk() {
num: heatmapLoadingState.index,
xhr: arraybufferRequest,
});
heatmapLoadingState.index++;

const sliceEnd = new Date(time.getTime() + (30 * 60 - 1) * 1000);
console.log(zDateString(time) + ' ' + zuluTime(time) + ' - ' + zuluTime(sliceEnd) + ' ' + URL);

{req.done(function (responseData) {
heatmapLoadingState.completed++;
jQuery("#loader_progress").attr('value', heatmapLoadingState.completed);
Expand All @@ -483,17 +488,18 @@ function loadHeatChunk() {
{req.fail(function(jqxhr, status, error) {
loadHeatChunk();
});}
heatmapLoadingState.index++;
}

if (!heatmap) {
heatmapDefer.resolve();
} else {
// round heatmap end to half hour
heatmap.end = Math.floor(heatmap.end / (1800 * 1000)) * (1800 * 1000);
let end = heatmap.end;
let start = end - heatmap.duration * 3600 * 1000; // timestamp in ms
let interval = 1800 * 1000;
let numChunks = Math.round((end - start) / interval);
console.log('numChunks: ' + numChunks + ' heatDuration: ' + heatmap.duration + ' heatEnd: ' + new Date(heatmap.end));
console.log('numChunks: ' + numChunks + ' heatDuration: ' + heatmap.duration + ' heatEnd: ' + new Date(heatmap.end) + ' / ' + new Date(heatmap.end).toUTCString());
heatChunks = Array(numChunks).fill(null);
heatPoints = Array(numChunks).fill(null);
// load chunks sequentially via recursion:
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14.1689
3.14.1690

0 comments on commit 13f1b05

Please sign in to comment.