Add AGC levels to ts2000.c and fix AGC Level printout to show index number instead of enumeration number.

Add RIG_AGC_LONG and RIG_AGC_ON levels to match rig's capabilities better
Still need to allow setting AGC level using mnemonics instead of level value to make it more usable
pull/1161/head
Mike Black W9MDB 2022-11-24 09:47:12 -06:00
rodzic ca4814c472
commit f8a5b92bc7
4 zmienionych plików z 7 dodań i 3 usunięć
include/hamlib
rigs/kenwood

Wyświetl plik

@ -341,6 +341,7 @@ enum agc_level_e {
RIG_AGC_MEDIUM,
RIG_AGC_AUTO,
RIG_AGC_LONG,
RIG_AGC_ON /*< Turns AGC ON -- Kenwood -- restores last level set */
};

Wyświetl plik

@ -167,6 +167,8 @@ const struct rig_caps ts2000_caps =
.max_ifshift = kHz(1),
.targetable_vfo = RIG_TARGETABLE_FREQ,
.transceive = RIG_TRN_RIG,
.agc_level_count = 5,
.agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_ON },
.bank_qty = 0,
.chan_desc_sz = 7,

Wyświetl plik

@ -1282,6 +1282,8 @@ static const struct
{ RIG_AGC_USER, "USER" },
{ RIG_AGC_MEDIUM, "MEDIUM" },
{ RIG_AGC_AUTO, "AUTO" },
{ RIG_AGC_LONG, "LONG" },
{ RIG_AGC_ON, "ON" },
{ -1, "" },
};

Wyświetl plik

@ -919,8 +919,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr)
{
if (strlen(str) > 0) { strcat(str, " "); }
sprintf(tmpbuf, "%d=%s", priv_caps->agc_levels[i].level,
rig_stragclevel(priv_caps->agc_levels[i].level));
sprintf(tmpbuf, "%d=%s", priv_caps->agc_levels[i].icom_level, rig_stragclevel(priv_caps->agc_levels[i].level));
if (strlen(str) + strlen(tmpbuf) < lenstr - 1)
{
@ -939,7 +938,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr)
{
if (strlen(str) > 0) { strcat(str, " "); }
sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i],
sprintf(tmpbuf, "%d=%s", i,
rig_stragclevel(rig->caps->agc_levels[i]));
if (strlen(str) + strlen(tmpbuf) < lenstr - 1)