NCurses Display Group Labels in P25 and DMR; Tweak

This commit is contained in:
lwvmobile 2022-11-20 07:31:02 -05:00
parent 61cefa6a87
commit 136ed75342
5 changed files with 60 additions and 16 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
*.so*
*.dylib
build
*.sh
*.csv

View File

@ -77,7 +77,7 @@ void
noCarrier (dsd_opts * opts, dsd_state * state)
{
//tune back to last knwon CC when using trunking after x second hangtime
//tune back to last known CC when using trunking after x second hangtime
if (opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && time(NULL) - state->last_cc_sync_time > opts->trunk_hangtime)
{
if (state->p25_cc_freq != 0)
@ -147,7 +147,7 @@ noCarrier (dsd_opts * opts, dsd_state * state)
}
//zero out after x second hangtime when trunking to prevent premature zeroing on these variables
//mainly bugfix for ncurses and per call wavs (edacs)
//mainly bugfix for ncurses and per call wavs (edacs) and also signal fade, etc
if (opts->p25_trunk == 1 && opts->p25_is_tuned == 1 && time(NULL) - state->last_cc_sync_time > opts->trunk_hangtime)
{
state->lasttg = 0;

View File

@ -2441,7 +2441,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
attron(COLOR_PAIR(3));
}
}
//Frequency Display
if (state->p25_vc_freq[0] != 0)
{
attron(COLOR_PAIR(5));
@ -2451,6 +2452,25 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
attron(COLOR_PAIR(3));
}
}
//Group Name Labels from CSV import
if (state->dmrburstL == 16 || state->dmrburstL > 19)
{
for (int k = 0; k < state->group_tally; k++)
{
if (state->group_array[k].groupNumber == state->lasttg)
{
attron(COLOR_PAIR(5));
printw (" [%s]", state->group_array[k].groupName);
printw ("[%s] ", state->group_array[k].groupMode);
if (state->carrier == 1)
{
attron(COLOR_PAIR(3));
}
}
}
}
printw ("\n");
//Slot 2 [1]
@ -2587,6 +2607,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
attron(COLOR_PAIR(3));
}
}
//LRRP
if(state->dmrburstR != 16) //only during data
{
@ -2601,6 +2622,8 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
attron(COLOR_PAIR(3));
}
}
//Frequency Display
if (state->p25_vc_freq[0] != 0)
{
attron(COLOR_PAIR(5));
@ -2610,6 +2633,25 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
attron(COLOR_PAIR(3));
}
}
//Group Name Labels from CSV import
if (state->dmrburstR == 16 || state->dmrburstR > 19)
{
for (int k = 0; k < state->group_tally; k++)
{
if (state->group_array[k].groupNumber == state->lasttgR)
{
attron(COLOR_PAIR(5));
printw (" [%s]", state->group_array[k].groupName);
printw ("[%s] ", state->group_array[k].groupMode);
}
if (state->carrier == 1)
{
attron(COLOR_PAIR(3));
}
}
}
printw ("\n");
} // end if not MS
} //end DMR BS Types
@ -2656,7 +2698,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
//shim 443 afs in here for display purposes
int a = (call_matrix[i][3] >> 7) & 0xF;
int fs = call_matrix[i][3] & 0x7F;
printw ("| - LCN [%02d][%.06lf]", i, (double)state->trunk_lcn_freq[i-1]/1000000);
printw ("| - LCN [%02d][%.06lf] MHz", i, (double)state->trunk_lcn_freq[i-1]/1000000);
//print Control Channel on LCN line with the current Control Channel
if ( (i) == state->edacs_cc_lcn)

View File

@ -193,8 +193,8 @@ void process_FACCHc (dsd_opts * opts, dsd_state * state)
else
{
fprintf (stderr, " R-S ERR Fc");
if (state->currentslot == 0) state->dmrburstL = 13;
else state->dmrburstR = 13;
//if (state->currentslot == 0) state->dmrburstL = 13;
//else state->dmrburstR = 13;
}
}
@ -247,8 +247,8 @@ void process_FACCHs (dsd_opts * opts, dsd_state * state)
else
{
fprintf (stderr, " R-S ERR Fs");
if (state->currentslot == 0) state->dmrburstL = 13;
else state->dmrburstR = 13;
//if (state->currentslot == 0) state->dmrburstL = 13;
//else state->dmrburstR = 13;
}
}
@ -752,8 +752,8 @@ void process_P2_DUID (dsd_opts * opts, dsd_state * state)
else
{
fprintf (stderr, " DUID ERR %d", duid_decoded);
if (state->currentslot == 0) state->dmrburstL = 12;
else state->dmrburstR = 12;
//if (state->currentslot == 0) state->dmrburstL = 12;
//else state->dmrburstR = 12;
err_counter++;
}
if (err_counter > 1) //&& opts->aggressive_framesync == 1

View File

@ -57,8 +57,8 @@ void process_SACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[180]
else
{
fprintf (stderr, " CRC12 ERR S");
if (state->currentslot == 0) state->dmrburstL = 14;
else state->dmrburstR = 14;
//if (state->currentslot == 0) state->dmrburstL = 14;
//else state->dmrburstR = 14;
goto END_SMAC;
}
}
@ -84,8 +84,8 @@ void process_SACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[180]
{
fprintf (stderr, " CRC16 ERR L");
state->p2_is_lcch = 0; //turn flag off here
if (state->currentslot == 0) state->dmrburstL = 14;
else state->dmrburstR = 14;
//if (state->currentslot == 0) state->dmrburstL = 14;
//else state->dmrburstR = 14;
goto END_SMAC;
}
}
@ -303,8 +303,8 @@ void process_FACCH_MAC_PDU (dsd_opts * opts, dsd_state * state, int payload[156]
else
{
fprintf (stderr, " CRC12 ERR F");
if (state->currentslot == 0) state->dmrburstL = 14;
else state->dmrburstR = 14;
//if (state->currentslot == 0) state->dmrburstL = 14;
//else state->dmrburstR = 14;
goto END_FMAC;
}
}