kopia lustrzana https://github.com/cyoung/stratux
Tower signal strength, other bug fixes
rodzic
70abc35514
commit
1a5172e596
|
@ -906,7 +906,7 @@ func parseInput(buf string) ([]byte, uint16) {
|
||||||
thisMsg.TimeReceived = stratuxClock.Time
|
thisMsg.TimeReceived = stratuxClock.Time
|
||||||
thisMsg.Data = frame
|
thisMsg.Data = frame
|
||||||
thisMsg.Signal_amplitude = thisSignalStrength
|
thisMsg.Signal_amplitude = thisSignalStrength
|
||||||
thisMsg.Signal_strength = 20 * math.Log10(float64(thisSignalStrength/1000))
|
thisMsg.Signal_strength = 20 * math.Log10((float64(thisSignalStrength))/1000)
|
||||||
thisMsg.Products = make([]uint32, 0)
|
thisMsg.Products = make([]uint32, 0)
|
||||||
if msgtype == MSGTYPE_UPLINK {
|
if msgtype == MSGTYPE_UPLINK {
|
||||||
// Parse the UAT message.
|
// Parse the UAT message.
|
||||||
|
|
|
@ -151,7 +151,10 @@ func handleTowersRequest(w http.ResponseWriter, r *http.Request) {
|
||||||
setNoCache(w)
|
setNoCache(w)
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
towersJSON, _ := json.Marshal(&ADSBTowers)
|
towersJSON, err := json.Marshal(&ADSBTowers)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error sending tower JSON data: %s\n", err.Error())
|
||||||
|
}
|
||||||
// for testing purposes, we can return a fixed reply
|
// for testing purposes, we can return a fixed reply
|
||||||
// towersJSON = []byte(`{"(38.490880,-76.135554)":{"Lat":38.49087953567505,"Lng":-76.13555431365967,"Signal_strength_last_minute":100,"Signal_strength_max":67,"Messages_last_minute":1,"Messages_total":1059},"(38.978698,-76.309276)":{"Lat":38.97869825363159,"Lng":-76.30927562713623,"Signal_strength_last_minute":495,"Signal_strength_max":32,"Messages_last_minute":45,"Messages_total":83},"(39.179285,-76.668413)":{"Lat":39.17928457260132,"Lng":-76.66841268539429,"Signal_strength_last_minute":50,"Signal_strength_max":24,"Messages_last_minute":1,"Messages_total":16},"(39.666309,-74.315300)":{"Lat":39.66630935668945,"Lng":-74.31529998779297,"Signal_strength_last_minute":9884,"Signal_strength_max":35,"Messages_last_minute":4,"Messages_total":134}}`)
|
// towersJSON = []byte(`{"(38.490880,-76.135554)":{"Lat":38.49087953567505,"Lng":-76.13555431365967,"Signal_strength_last_minute":100,"Signal_strength_max":67,"Messages_last_minute":1,"Messages_total":1059},"(38.978698,-76.309276)":{"Lat":38.97869825363159,"Lng":-76.30927562713623,"Signal_strength_last_minute":495,"Signal_strength_max":32,"Messages_last_minute":45,"Messages_total":83},"(39.179285,-76.668413)":{"Lat":39.17928457260132,"Lng":-76.66841268539429,"Signal_strength_last_minute":50,"Signal_strength_max":24,"Messages_last_minute":1,"Messages_total":16},"(39.666309,-74.315300)":{"Lat":39.66630935668945,"Lng":-74.31529998779297,"Signal_strength_last_minute":9884,"Signal_strength_max":35,"Messages_last_minute":4,"Messages_total":134}}`)
|
||||||
fmt.Fprintf(w, "%s\n", towersJSON)
|
fmt.Fprintf(w, "%s\n", towersJSON)
|
||||||
|
|
|
@ -23,7 +23,7 @@ function TowersCtrl($rootScope, $scope, $state, $http, $interval) {
|
||||||
new_tower.power_last_min = obj.Signal_strength_last_minute.toFixed(2);
|
new_tower.power_last_min = obj.Signal_strength_last_minute.toFixed(2);
|
||||||
new_tower.power_max = obj.Signal_strength_max.toFixed(2);
|
new_tower.power_max = obj.Signal_strength_max.toFixed(2);
|
||||||
// Messages_last_minute uint64
|
// Messages_last_minute uint64
|
||||||
new_tower.messages = obj.Messages_total;
|
new_tower.messages = obj.Messages_last_minute;
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadTowers(data) {
|
function loadTowers(data) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
CACHE MANIFEST
|
CACHE MANIFEST
|
||||||
|
|
||||||
/index.html
|
/index.html
|
||||||
/maui/fonts/fontawesome-webfont.woff
|
/maui/fonts/fontawesome-webfont.woff
|
||||||
/maui/js/mobile-angular-ui.gestures.min.js
|
/maui/js/mobile-angular-ui.gestures.min.js
|
||||||
|
@ -50,3 +51,6 @@ CACHE MANIFEST
|
||||||
/img/screen-640x920.png
|
/img/screen-640x920.png
|
||||||
/css/addtohomescreen.css
|
/css/addtohomescreen.css
|
||||||
/css/main.css
|
/css/main.css
|
||||||
|
|
||||||
|
NETWORK:
|
||||||
|
*
|
||||||
|
|
Ładowanie…
Reference in New Issue