[hamradio-commits] [dump1090] 08/389: Interactive mode: new switch --interactive-rows for max # of rows.
Matthew Ernisse
mernisse-guest at moszumanska.debian.org
Wed Nov 5 00:19:35 UTC 2014
This is an automated email from the git hooks/post-receive script.
mernisse-guest pushed a commit to branch master
in repository dump1090.
commit f01324cea4e484844c7a4524ca7a54f763281926
Author: antirez <antirez at gmail.com>
Date: Sat Jan 5 21:41:09 2013 +0100
Interactive mode: new switch --interactive-rows for max # of rows.
---
dump1090.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dump1090.c b/dump1090.c
index 0f087cf..cf117e6 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -72,6 +72,7 @@
#define MODES_DEBUG_NOPREAMBLE_LEVEL 25
#define MODES_INTERACTIVE_REFRESH_TIME 250 /* Milliseconds */
+#define MODES_INTERACTIVE_ROWS 15
#define MODES_NOTUSED(V) ((void) V)
@@ -116,6 +117,7 @@ struct {
int raw; /* Raw output format */
int debug; /* Debugging mode */
int interactive; /* Interactive mode */
+ int interactive_rows; /* Interactive mode: max number of rows */
/* Interactive mode */
struct aircraft *aircrafts;
@@ -194,6 +196,7 @@ void modesInitConfig(void) {
Modes.raw = 0;
Modes.debug = 0;
Modes.interactive = 0;
+ Modes.interactive_rows = MODES_INTERACTIVE_ROWS;
}
void modesInit(void) {
@@ -1194,7 +1197,7 @@ void interactiveShowData(void) {
printf("Hex Flight Altitude Speed Messages Seen %s\n",
progress);
printf("----------------------------------------------------\n");
- while(a && count < 15) {
+ while(a && count < Modes.interactive_rows) {
printf("%-6s %-8s %-9d %-9d %-9ld %d sec ago\n",
a->hexaddr, a->flight, a->altitude, a->speed, a->messages,
(int)(now - a->seen));
@@ -1233,6 +1236,7 @@ void showHelp(void) {
"--freq <hz> Set frequency (default: 1090 Mhz).\n"
"--ifile <filename> Read data from file (use '-' for stdin).\n"
"--interactive Interactive mode refreshing data on screen.\n"
+"--interactive-rows <num> Max number of rows in interactive mode (default: 15).\n"
"--raw Show only messages hex values.\n"
"--no-fix Disable single-bits error correction using CRC.\n"
"--no-crc-check Disable messages with broken CRC.\n"
@@ -1269,6 +1273,8 @@ int main(int argc, char **argv) {
Modes.raw = 1;
} else if (!strcmp(argv[j],"--interactive")) {
Modes.interactive = 1;
+ } else if (!strcmp(argv[j],"--interactive-rows")) {
+ Modes.interactive_rows = atoi(argv[++j]);
} else if (!strcmp(argv[j],"--debug") && more) {
Modes.debug = atoi(argv[++j]);
} else if (!strcmp(argv[j],"--snip") && more) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git
More information about the pkg-hamradio-commits
mailing list