kopia lustrzana https://github.com/cyoung/stratux
Add timestamps and metadata to output for signal performance work.
@Axtel4.pull/243/head
rodzic
41b091f78b
commit
1e8ae2e6f8
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
cat $1 | grep -a -v ^START | grep -a -v ^PAUSE | grep -a -v ^UNPAUSE | grep -a PUBX,00 | cut -d, -f1,5,6,7,8,9
|
|
@ -10,7 +10,18 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
reader := bufio.NewReader(os.Stdin)
|
if len(os.Args) < 2 {
|
||||||
|
fmt.Printf("%s <uat log>\n", os.Args[0])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fp, err := os.Open(os.Args[1])
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("can't open '%s'.\n", os.Args[1])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer fp.Close()
|
||||||
|
|
||||||
|
reader := bufio.NewReader(fp)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
buf, err := reader.ReadString('\n')
|
buf, err := reader.ReadString('\n')
|
||||||
|
@ -19,9 +30,11 @@ func main() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
uatMsg, err := uatparse.New(buf)
|
x := strings.Split(buf, ",")
|
||||||
|
|
||||||
|
uatMsg, err := uatparse.New(x[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("err %s\n", err.Error())
|
// fmt.Printf("err %s\n", err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +47,7 @@ func main() {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fmt.Printf("(%f,%f,%d,%d) says: ", uatMsg.Lat, uatMsg.Lon, uatMsg.RS_Err, uatMsg.SignalStrength)
|
fmt.Printf("%s,%f,%f,%d,%d, says: ", x[0], uatMsg.Lat, uatMsg.Lon, uatMsg.RS_Err, uatMsg.SignalStrength)
|
||||||
types := make(map[string]int)
|
types := make(map[string]int)
|
||||||
for _, uatframe := range uatMsg.Frames {
|
for _, uatframe := range uatMsg.Frames {
|
||||||
if uatframe.Product_id == 413 {
|
if uatframe.Product_id == 413 {
|
||||||
|
@ -57,7 +70,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(types) == 0 {
|
if len(types) == 0 {
|
||||||
fmt.Printf("nothing\n")
|
fmt.Printf("(unimplemented)\n")
|
||||||
} else {
|
} else {
|
||||||
for thisType, thisNum := range types {
|
for thisType, thisNum := range types {
|
||||||
fmt.Printf("%s(%d) ", thisType, thisNum)
|
fmt.Printf("%s(%d) ", thisType, thisNum)
|
||||||
|
|
Ładowanie…
Reference in New Issue