diff --git a/html/doalles.js b/html/doalles.js index 7dd0664..c88171f 100644 --- a/html/doalles.js +++ b/html/doalles.js @@ -14,7 +14,7 @@ function maketable(str, arr) enter(). append("tr"); - var columns = ["sv", "best-tle", "iod", "aodc/e", "eph-age-m", "latest-disco", "time-disco", "sisa", "health", "tle-dist", "alma-dist", "delta-utc", "delta-gps", "sources", "db", "delta_hz_corr","prres", "elev", "last-seen-s"]; + var columns = ["sv", "best-tle", "iod", "eph-age-m", "latest-disco", "time-disco", "sisa", "health", "tle-dist", "alma-dist", "delta-utc", "delta-gps", "sources", "db", "delta_hz_corr","prres", "elev", "last-seen-s"]; // append the header row thead.append("tr") @@ -163,28 +163,13 @@ function maketable(str, arr) var sats={}; var lastseen=null; -function update() + +function updateSats() { - var seconds = 2; - clearTimeout(repeat); - repeat=setTimeout(update, 1000.0*seconds); - - if(lastseen != null) - d3.select("#freshness").html(lastseen.fromNow()); - - - d3.json("global.json", function(d) { - d3.select('#facts').html("Galileo-UTC offset: "+d["utc-offset-ns"].toFixed(2)+" ns, Galileo-GPS offset: "+d["gps-offset-ns"].toFixed(2)+" ns, GPS UTC offset: "+d["gps-utc-offset-ns"].toFixed(2)+". "+d["leap-seconds"]+" leap seconds"); - lastseen = moment(1000*d["last-seen"]); - d3.select("#freshness").html(lastseen.fromNow()); - }); - - d3.json("svs.json", function(d) { - // put data in an array - sats=d; - var arr=[]; - Object.keys(d).forEach(function(e) { - var o = d[e]; + var arr=[]; + setButtonSettings(); + Object.keys(sats).forEach(function(e) { + var o = sats[e]; o.sv=e; o.sources=""; o.db=""; @@ -233,7 +218,26 @@ function update() var livearr=[], stalearr=[]; for(n = 0 ; n < arr.length; n++) { -// if(arr[n]["gnssid"]) continue; + let wantIt = false; + if(d3.select("#GalE1").property("checked") && arr[n].gnssid==2 && arr[n].sigid == 1) + wantIt = true; + if(d3.select("#GalE5b").property("checked") && arr[n].gnssid==2 && arr[n].sigid == 5) + wantIt = true; + if(d3.select("#GPSL1CA").property("checked") && arr[n].gnssid==0 && arr[n].sigid == 0) + wantIt = true; + if(d3.select("#GPSL2C").property("checked") && arr[n].gnssid==0 && arr[n].sigid == 4) + wantIt = true; + if(d3.select("#BeiDouB1I").property("checked") && arr[n].gnssid==3 && arr[n].sigid == 0) + wantIt = true; + if(d3.select("#BeiDouB2I").property("checked") && arr[n].gnssid==3 && arr[n].sigid == 2) + wantIt = true; + if(d3.select("#GlonassL1").property("checked") && arr[n].gnssid==6 && arr[n].sigid == 0) + wantIt = true; + if(d3.select("#GlonassL2").property("checked") && arr[n].gnssid==6 && arr[n].sigid == 2) + wantIt = true; + + if(!wantIt) + continue; if(arr[n]["last-seen-s"] < 600) livearr.push(arr[n]); else @@ -242,10 +246,66 @@ function update() maketable("#svs", livearr); maketable("#svsstale", stalearr); + +} + +function update() +{ + var seconds = 20; + clearTimeout(repeat); + repeat=setTimeout(update, 1000.0*seconds); + + if(lastseen != null) + d3.select("#freshness").html(lastseen.fromNow()); + + + d3.json("global.json", function(d) { + d3.select('#facts').html("Galileo-UTC offset: "+d["utc-offset-ns"].toFixed(2)+" ns, Galileo-GPS offset: "+d["gps-offset-ns"].toFixed(2)+" ns, GPS UTC offset: "+d["gps-utc-offset-ns"].toFixed(2)+". "+d["leap-seconds"]+" leap seconds"); + lastseen = moment(1000*d["last-seen"]); + d3.select("#freshness").html(lastseen.fromNow()); + }); + + d3.json("svs.json", function(d) { + // put data in an array + sats=d; + updateSats(); }); } +function getButtonSettings(name, def) +{ + let itemName = "want"+name; + let value = localStorage.getItem(itemName); + if(value == null) { + console.log("Defaulting "+itemName+" to "+def); + localStorage.setItem(itemName, def); + } +// else + // console.log("Found "+itemName+" set to '"+value+"'"); + d3.select("#"+name).property("checked", localStorage.getItem(itemName)=="true"); +} + +function setButtonSetting(name) +{ +// console.log("Storing button state want"+name+" as "+d3.select("#"+name).property("checked")); + localStorage.setItem("want"+name, d3.select("#"+name).property("checked")); +} + +var modes=["GalE1", "GalE5b", "GPSL1CA", "GPSL2C", "BeiDouB1I", "BeiDouB2I", "GlonassL1", "GlonassL2"]; + +function setButtonSettings() +{ + modes.forEach(function(d) { + setButtonSetting(d); + }); +} + +getButtonSettings("GalE1", true); +modes.forEach(function(d) { + getButtonSettings(d, false); +});; + repeat=update(); diff --git a/html/index.html b/html/index.html index 4e80e15..f2bd98d 100644 --- a/html/index.html +++ b/html/index.html @@ -42,6 +42,18 @@ tr:nth-child(odd) {background: #FFF} Last update: . More information about this Galileo/GPS/BeiDou/Glonass open source monitor can be found here. Live map here!. Contact me if you want access to the Grafana dashboard.
+
+
+   +   +   +   +   +   +   + +
+

@@ -50,7 +62,7 @@ tr:nth-child(odd) {background: #FFF} Stale:

- This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States. + This table shows live output from four Galileo/GPS/BeiDou/GLONASS receivers hosted in Nootdorp, The Netherlands and California, United States, Tonga, Brazil, Singapore, Austria ans Uruguay. It is very much a work in progress, and will not be available at all times. Extremely rough code is on GitHub. diff --git a/navdump.cc b/navdump.cc index a1bc58d..8cd13ce 100644 --- a/navdump.cc +++ b/navdump.cc @@ -57,6 +57,30 @@ double utcFromGPS(int wn, double tow) return (315964800 + wn * 7*86400 + tow - 18); } +static double utcFromGST(int wn, double tow) +{ + return (935280000.0 + wn * 7*86400 + tow - 18); +} + +// GALILEO ONLY!! +template +void doOrbitDump(int gnss, int sv, int wn, const T& oldEph, const T& newEph, int time_start, int time_end) +{ + ofstream orbitcsv("orbit."+to_string(gnss)+"."+to_string(sv)+"."+to_string(oldEph.iodnav)+"-"+to_string(newEph.iodnav)+".csv"); + + orbitcsv << "timestamp x y z oldx oldy oldz\n"; + orbitcsv << fixed; + for(int t = time_start; t < time_end; t += 30) { + Point p, oldp; + getCoordinates(t, newEph, &p); + getCoordinates(t, oldEph, &oldp); + time_t posix = utcFromGST(wn, t); + orbitcsv << posix <<" " + < "<