aboutsummaryrefslogtreecommitdiffstats
path: root/src/nmt
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-09-25 18:46:50 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2017-10-12 19:46:30 +0200
commitba036de22680c5f46983f30144c23d212245842f (patch)
treef511133326644feb457810c524a2ff317aa945c3 /src/nmt
parente84d7a082c20b591a06fdfd38ccdbe458e276631 (diff)
Add function to display measurements on screen
Use 'm' key to toggle display.
Diffstat (limited to 'src/nmt')
-rw-r--r--src/nmt/dsp.c7
-rw-r--r--src/nmt/nmt.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/nmt/dsp.c b/src/nmt/dsp.c
index 6086d62..b95191b 100644
--- a/src/nmt/dsp.c
+++ b/src/nmt/dsp.c
@@ -152,6 +152,9 @@ int dsp_init_sender(nmt_t *nmt, double deviation_factor)
/* dtmf */
dtmf_init(&nmt->dtmf, 8000);
+ nmt->dmp_frame_level = display_measurements_add(&nmt->sender, "Frame Level", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 150.0, 100.0);
+ nmt->dmp_frame_quality = display_measurements_add(&nmt->sender, "Frame Quality", "%.1f %% (last)", DISPLAY_MEAS_LAST, DISPLAY_MEAS_LEFT, 0.0, 100.0, 100.0);
+
return 0;
}
@@ -242,6 +245,10 @@ static void fsk_receive_bit(void *inst, int bit, double quality, double level)
}
level /= 140.0; quality /= 140.0;
+ /* update measurements */
+ display_measurements_update(nmt->dmp_frame_level, level * 100.0, 0.0);
+ display_measurements_update(nmt->dmp_frame_quality, quality * 100.0, 0.0);
+
/* send telegramm */
frames_elapsed = (nmt->rx_bits_count_current - nmt->rx_bits_count_last + 83) / 166; /* round to nearest frame */
/* convert level so that received level at TX_PEAK_FSK results in 1.0 (100%) */
diff --git a/src/nmt/nmt.h b/src/nmt/nmt.h
index ae871e6..4d472d2 100644
--- a/src/nmt/nmt.h
+++ b/src/nmt/nmt.h
@@ -90,6 +90,10 @@ typedef struct nmt {
char dialing[33]; /* dialed digits */
int mft_num; /* counter for digit for MFT */
+ /* display measurements */
+ dispmeasparam_t *dmp_frame_level;
+ dispmeasparam_t *dmp_frame_quality;
+
/* features */
int compandor; /* if compandor shall be used */
int supervisory; /* if set, use supervisory signal 1..4 */