kopia lustrzana https://github.com/cyoung/stratux
Merge branch 'master' of https://www.github.com/cyoung/stratux
commit
2c973ece39
|
@ -1,4 +1,6 @@
|
|||
dependencies:
|
||||
cache_directories:
|
||||
- "~/go"
|
||||
pre:
|
||||
- sudo apt-get update; sudo apt-get install libusb-1.0-0-dev; cd /tmp; git clone git://git.osmocom.org/rtl-sdr.git; cd rtl-sdr; mkdir build; cd build; cmake ../; make; sudo make install; sudo ldconfig ; cd ~; wget https://storage.googleapis.com/golang/go1.5.1.src.tar.gz; tar -zxvf go1.5.1.src.tar.gz; cd go/src ; export GOROOT_BOOTSTRAP=/usr/local/go; ./all.bash
|
||||
override:
|
||||
|
|
20
main/sdr.go
20
main/sdr.go
|
@ -235,6 +235,24 @@ func uatReader() {
|
|||
}
|
||||
}
|
||||
|
||||
func (u *UAT) writeID() error {
|
||||
info, err := u.dev.GetHwInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info.Serial = "stratux:978"
|
||||
return u.dev.SetHwInfo(info)
|
||||
}
|
||||
|
||||
func (e *ES) writeID() error {
|
||||
info, err := e.dev.GetHwInfo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info.Serial = "stratux:1090"
|
||||
return e.dev.SetHwInfo(info)
|
||||
}
|
||||
|
||||
func (u *UAT) shutdown() {
|
||||
log.Println("Entered UAT shutdown() ...")
|
||||
close(uat_shutdown) // signal to shutdown
|
||||
|
@ -261,7 +279,7 @@ func sdrWatcher() {
|
|||
time.Sleep(1 * time.Second)
|
||||
count := rtl.GetDeviceCount()
|
||||
atomic.StoreUint32(&globalStatus.Devices, uint32(count))
|
||||
log.Println("DeviceCount...", count)
|
||||
// log.Println("DeviceCount...", count)
|
||||
|
||||
// support two and only two dongles
|
||||
if count > 2 {
|
||||
|
|
|
@ -82,22 +82,26 @@ function WeatherCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
}
|
||||
|
||||
|
||||
function utcTimeString(epoc) {
|
||||
function deltaTimeString(epoc) {
|
||||
var time = "";
|
||||
var val;
|
||||
var d = new Date(epoc);
|
||||
val = d.getUTCDate() - 1; // Date starts at 1.
|
||||
val = d.getUTCDate() - 1; // we got here by subtrracting two dates so we have a delta, not a day of month
|
||||
if (val > 0)
|
||||
time += (val < 10 ? "0" + val : "" + val) + "d ";
|
||||
val = d.getUTCHours();
|
||||
if (val > 0)
|
||||
if (val > 0) {
|
||||
time += (val < 10 ? "0" + val : "" + val) + "h ";
|
||||
} else {
|
||||
if (time.length > 0)
|
||||
time += "00h ";
|
||||
}
|
||||
val = d.getUTCMinutes();
|
||||
time += (val < 10 ? "0" + val : "" + val) + "m ";
|
||||
val = d.getUTCSeconds();
|
||||
time += (val < 10 ? "0" + val : "" + val) + "s";
|
||||
// ADS-B weather is only accurate to minutes
|
||||
// val = d.getUTCSeconds();
|
||||
// time += (val < 10 ? "0" + val : "" + val) + "s";
|
||||
|
||||
// time += "Z";
|
||||
return time;
|
||||
}
|
||||
|
||||
|
@ -108,7 +112,11 @@ function WeatherCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
return 0;
|
||||
d.setUTCDate(parseInt(s.substring(0, 2)));
|
||||
d.setUTCHours(parseInt(s.substring(2, 4)));
|
||||
d.setUTCMinutes(parseInt(s.substring(4, 6)));
|
||||
if (s.length > 7) { // TAF datetime range
|
||||
d.setUTCMinutes(0);
|
||||
} else {
|
||||
d.setUTCMinutes(parseInt(s.substring(4, 6)));
|
||||
}
|
||||
d.setUTCSeconds(0);
|
||||
d.setUTCMilliseconds(0);
|
||||
return d;
|
||||
|
@ -132,8 +140,8 @@ function WeatherCtrl($rootScope, $scope, $state, $http, $interval) {
|
|||
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.time = deltaTimeString(dNow - dThen) + " old";
|
||||
// data_item.received = utcTimeString(obj.LocaltimeReceived);
|
||||
data_item.data = obj.Data;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue