[hamradio-commits] [dump1090] 339/389: Move the stats reset strictly after stats display, so the total message count is shown correctly.
Matthew Ernisse
mernisse-guest at moszumanska.debian.org
Wed Nov 5 00:20:12 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 b98c6856b3e5baad98ad82fc7f776226e3a0989f
Author: Oliver Jowett <oliver at mutability.co.uk>
Date: Thu Sep 25 22:02:52 2014 +0100
Move the stats reset strictly after stats display, so the total message count is shown correctly.
---
dump1090.c | 55 ++++++++++++++++++++++++++++++-------------------------
1 file changed, 30 insertions(+), 25 deletions(-)
diff --git a/dump1090.c b/dump1090.c
index 00f21d8..ee4ff40 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -492,10 +492,9 @@ static void display_stats(void) {
interactiveShowData();
printf("Statistics as at %s", ctime(&now));
+
printf("%d sample blocks processed\n", Modes.stat_blocks_processed);
printf("%d sample blocks dropped\n", Modes.stat_blocks_dropped);
- Modes.stat_blocks_processed =
- Modes.stat_blocks_dropped = 0;
printf("%d ModeA/C detected\n", Modes.stat_ModeAC);
printf("%d valid Mode-S preambles\n", Modes.stat_valid_preamble);
@@ -509,21 +508,8 @@ static void display_stats(void) {
printf("%d with bad crc\n", Modes.stat_badcrc);
printf("%d errors corrected\n", Modes.stat_fixed);
- Modes.stat_ModeAC =
- Modes.stat_valid_preamble =
- Modes.stat_DF_Len_Corrected =
- Modes.stat_DF_Type_Corrected =
- Modes.stat_demodulated0 =
- Modes.stat_demodulated1 =
- Modes.stat_demodulated2 =
- Modes.stat_demodulated3 =
- Modes.stat_goodcrc =
- Modes.stat_badcrc =
- Modes.stat_fixed = 0;
-
for (j = 0; j < MODES_MAX_BITERRORS; j++) {
printf(" %d with %d bit %s\n", Modes.stat_bit_fix[j], j+1, (j==0)?"error":"errors");
- Modes.stat_bit_fix[j] = 0;
}
if (Modes.phase_enhance) {
@@ -536,23 +522,42 @@ static void display_stats(void) {
printf("%d phase enhanced with bad crc\n", Modes.stat_ph_badcrc);
printf("%d phase enhanced errors corrected\n", Modes.stat_ph_fixed);
- Modes.stat_out_of_phase =
- Modes.stat_ph_demodulated0 =
- Modes.stat_ph_demodulated1 =
- Modes.stat_ph_demodulated2 =
- Modes.stat_ph_demodulated3 =
- Modes.stat_ph_goodcrc =
- Modes.stat_ph_badcrc =
- Modes.stat_ph_fixed = 0;
-
for (j = 0; j < MODES_MAX_BITERRORS; j++) {
printf(" %d with %d bit %s\n", Modes.stat_ph_bit_fix[j], j+1, (j==0)?"error":"errors");
- Modes.stat_ph_bit_fix[j] = 0;
}
}
printf("%d total usable messages\n", Modes.stat_goodcrc + Modes.stat_ph_goodcrc + Modes.stat_fixed + Modes.stat_ph_fixed);
fflush(stdout);
+
+ Modes.stat_blocks_processed =
+ Modes.stat_blocks_dropped = 0;
+
+ Modes.stat_ModeAC =
+ Modes.stat_valid_preamble =
+ Modes.stat_DF_Len_Corrected =
+ Modes.stat_DF_Type_Corrected =
+ Modes.stat_demodulated0 =
+ Modes.stat_demodulated1 =
+ Modes.stat_demodulated2 =
+ Modes.stat_demodulated3 =
+ Modes.stat_goodcrc =
+ Modes.stat_badcrc =
+ Modes.stat_fixed = 0;
+
+ Modes.stat_out_of_phase =
+ Modes.stat_ph_demodulated0 =
+ Modes.stat_ph_demodulated1 =
+ Modes.stat_ph_demodulated2 =
+ Modes.stat_ph_demodulated3 =
+ Modes.stat_ph_goodcrc =
+ Modes.stat_ph_badcrc =
+ Modes.stat_ph_fixed = 0;
+
+ for (j = 0; j < MODES_MAX_BITERRORS; j++) {
+ Modes.stat_ph_bit_fix[j] = 0;
+ Modes.stat_bit_fix[j] = 0;
+ }
}
--
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