skyspy: fix whitespace, counting time with sat view should now work

master
Pavel Machek 2024-12-03 14:02:02 +01:00
parent 7161aac53e
commit e78f566e96
1 changed files with 51 additions and 49 deletions

View File

@ -638,7 +638,7 @@ let sky = {
// Return the SNR of the n-th strongest satellite // Return the SNR of the n-th strongest satellite
return sortedSats[n - 1].snr; return sortedSats[n - 1].snr;
}, },
qualest: function() { qualest: function() {
// Sort the satellites by snr in descending order // Sort the satellites by snr in descending order
let sortedSats = this.snrSort(); let sortedSats = this.snrSort();
@ -669,7 +669,7 @@ let sky = {
} }
} }
this.satVisibility = newVisibility; this.satVisibility = newVisibility;
}, },
getnthLowestStartTimeSat: function(n) { getnthLowestStartTimeSat: function(n) {
// Collect all satellites from visibility // Collect all satellites from visibility
let satellites = Object.values(this.satVisibility); let satellites = Object.values(this.satVisibility);
@ -683,10 +683,12 @@ let sky = {
// Return the satellite with the 5th lowest start time // Return the satellite with the 5th lowest start time
return satellites[n-1]; // 0-based index, so 5th is index 4 return satellites[n-1]; // 0-based index, so 5th is index 4
}, },
goodest: function () { goodest: function () {
let s = this.getnthLowestStartTimeSat(5); let s = this.getnthLowestStartTimeSat(5);
let t = getTime() - s; if (s==-1)
return "none";
let t = getTime() - s.start;
return "" + t; return "" + t;
}, },
messageEnd: function() { messageEnd: function() {