Skip to content

Commit 1058b08

Browse files
Mark JessopMark Jessop
authored andcommitted
Slow update rate to 500ms, remove setTimeouts in redraw functions
1 parent 7fff923 commit 1058b08

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

js/tracker.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3670,7 +3670,7 @@ function liveData() {
36703670
setInterval(function(){
36713671
update(live_data_buffer);
36723672
live_data_buffer.positions.position=[];
3673-
}, 200)
3673+
}, 500)
36743674

36753675
function refreshSingle(serial) {
36763676
if(ajax_inprogress_single) {
@@ -4515,15 +4515,21 @@ function update(response, none) {
45154515
ctx.idx = max;
45164516

45174517
if(ctx.idx < ctx.max) {
4518-
setTimeout(function() { ctx.step(ctx); }, 4);
4518+
//setTimeout(function() {
4519+
ctx.step(ctx);
4520+
//}, 4);
45194521
} else {
45204522
ctx.list = Object.keys(vehicles);
4521-
setTimeout(function() { ctx.draw(ctx); }, 16);
4523+
//setTimeout(function() {
4524+
ctx.draw(ctx);
4525+
// }, 16);
45224526
}
45234527
},
45244528
draw: function(ctx) {
45254529
if(ctx.list.length < 1) {
4526-
setTimeout(function() { ctx.end(ctx); }, 16);
4530+
//setTimeout(function() {
4531+
ctx.end(ctx);
4532+
// }, 16);
45274533
return;
45284534
}
45294535

@@ -4550,7 +4556,9 @@ function update(response, none) {
45504556
}
45514557

45524558
// step to the next callsign
4553-
setTimeout(function() { ctx.draw(ctx); }, 16);
4559+
// setTimeout(function() {
4560+
ctx.draw(ctx);
4561+
//}, 16);
45544562
},
45554563
end: function(ctx) {
45564564

0 commit comments

Comments
 (0)