From aa2f01a12f11fbe302bf04ca5fc8e1076671c6a5 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Thu, 30 Nov 2023 19:24:09 +0530 Subject: [PATCH] fix the problem with displaying nb --- vfo.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/vfo.c b/vfo.c index 3236ca9..1ad35b9 100644 --- a/vfo.c +++ b/vfo.c @@ -1041,6 +1041,21 @@ int get_nr(RECEIVER *rx) return -1; } +int get_nb(RECEIVER *rx) +{ + if (rx->nb == 0 && rx->nb2 == 0) { + return 0; + } + if (rx->nb == 1 && rx->nb2 == 0) { + return 1; + } + if (rx->nb == 0 && rx->nb2 == 1) { + return 2; + } + + return -1; +} + void vfo_update(void) { int id = active_receiver->id; int txvfo = get_tx_vfo(); @@ -1236,7 +1251,12 @@ void vfo_update(void) { // NB and NB2 are mutually exclusive, therefore // they are put to the same place in order to save // some space - draw_item(cr, SCR_NB, active_receiver->nb); + int which_nb = get_nb(active_receiver); + if (which_nb < 0) { + g_print("RIGCTL: ERROR in NR determination used for display\n"); + which_nb = 0; + } + draw_item(cr, SCR_NB, which_nb); // NR // NR, NR2, NR3 and NR4 are mutually exclusive -- 2.45.2