One bug fix, and some changes to the --interactive output format
I messed up merging the Squawk display in interactive mode into my master. However, the original source posted by terribl causes a print line length greater than 80 characters. This in turn causes the lines to spill over on a terminal display. I have therefore re-formatted some of the output so that it fits within 80 characters.
This commit is contained in:
parent
43c648448f
commit
3113223029
11
dump1090.c
11
dump1090.c
|
@ -1825,12 +1825,13 @@ void interactiveShowData(void) {
|
||||||
|
|
||||||
printf("\x1b[H\x1b[2J"); /* Clear the screen */
|
printf("\x1b[H\x1b[2J"); /* Clear the screen */
|
||||||
printf(
|
printf(
|
||||||
"Hex Squawk Flight Altitude Speed Lat Lon Track Messages Seen %s\n"
|
"Hex Sqwk Flight Alt Speed Lat Lon Track Msgs Seen %s\n"
|
||||||
"----------------------------------------------------------------------------------------\n",
|
"-------------------------------------------------------------------------------\n",
|
||||||
progress);
|
progress);
|
||||||
|
|
||||||
while(a && count < Modes.interactive_rows) {
|
while(a && count < Modes.interactive_rows) {
|
||||||
int altitude = a->altitude, speed = a->speed;
|
int altitude = a->altitude, speed = a->speed;
|
||||||
|
char squawk[5] = "0";
|
||||||
|
|
||||||
/* Convert units to metric if --metric was specified. */
|
/* Convert units to metric if --metric was specified. */
|
||||||
if (Modes.metric) {
|
if (Modes.metric) {
|
||||||
|
@ -1838,7 +1839,11 @@ void interactiveShowData(void) {
|
||||||
speed *= 1.852;
|
speed *= 1.852;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%-6s %-4s %-8s %-9d %-7d %-7.03f %-7.03f %-3d %-9ld %d sec\n",
|
if (a->squawk > 0 && a->squawk <= 7777) {
|
||||||
|
sprintf(squawk, "%04d", a->squawk);
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%-6s %-4s %-8s %-7d %-5d %-7.03f %-7.03f %-3d %-7ld %d sec\n",
|
||||||
a->hexaddr, squawk, a->flight, altitude, speed,
|
a->hexaddr, squawk, a->flight, altitude, speed,
|
||||||
a->lat, a->lon, a->track, a->messages,
|
a->lat, a->lon, a->track, a->messages,
|
||||||
(int)(now - a->seen));
|
(int)(now - a->seen));
|
||||||
|
|
Loading…
Reference in a new issue