Normalize Yaesu RFPOWER_METER_LEVELS to 100W

This is a quick fix for most Yaesu rigs
We need a new RIG_LEVEL_RFPOWER_METER_WATTS to return watts instead of 0-1.0
https://github.com/Hamlib/Hamlib/issues/462
pull/468/head
Michael Black W9MDB 2020-12-12 08:24:33 -06:00
rodzic 44baf44dcc
commit ffe7184970
2 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -163,7 +163,7 @@ const cal_table_float_t yaesu_default_comp_meter_cal =
2,
{
{0, 0.0f},
{255, 1.0f},
{255, 100.0f},
}
};
@ -4372,7 +4372,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (retlvl_len > 3)
{
// Some rigs like FTDX101 have 6-byte return so we just truncate
rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl of %s getting truncated\n", __func__, retlvl);
retlvl[3] = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl truncated to %s\n", __func__, retlvl);
}
if (rig->caps->rfpower_meter_cal.size == 0)
@ -4383,6 +4385,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->rfpower_meter_cal);
}
rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", __func__, retlvl, val->f);
if (val->f > 1.0)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: val->f(%f) clipped at 1.0\n", __func__, val->f);
val->f = 1.0;
}
break;
@ -4395,11 +4403,11 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (rig->caps->comp_meter_cal.size == 0)
{
val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal);
val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal)/100;
}
else
{
val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal);
val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal)/100;
}
break;

Wyświetl plik

@ -50,7 +50,7 @@
typedef char ncboolean;
/* shared function version */
#define NEWCAT_VER "20201211"
#define NEWCAT_VER "20201212"
/* Hopefully large enough for future use, 128 chars plus '\0' */
#define NEWCAT_DATA_LEN 129