Add first cut of SWR conversion for Yaesu rigs

https://github.com/Hamlib/Hamlib/issues/354
pull/356/head
Michael Black W9MDB 2020-07-29 16:03:54 -05:00
rodzic 23d4cc73dc
commit 8aa5126650
2 zmienionych plików z 25 dodań i 2 usunięć

Wyświetl plik

@ -40,6 +40,7 @@
#include "iofunc.h"
#include "serial.h"
#include "misc.h"
#include "cal.h"
#include "newcat.h"
/* global variables */
@ -93,6 +94,19 @@ typedef struct _yaesu_newcat_commands
ncboolean ft101;
} yaesu_newcat_commands_t;
const cal_table_float_t yaesu_default_swr_cal =
{
4,
{ // first cut at generic Yaesu table, need more points probably
// based on testing by Adam M7OTP on FT-991
{12, 1.0f},
{39, 1.35f},
{89, 2.0f},
{242, 5.0f}
}
};
// Easy reference to rig model -- it is set in newcat_valid_command
static ncboolean is_ft450;
static ncboolean is_ft891;
@ -3346,11 +3360,20 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
val->f = (float)atoi(retlvl) / scale;
break;
case RIG_LEVEL_SWR:
if (rig->caps->swr_cal.size == 0)
{
val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_swr_cal);
}
else
{
val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->swr_cal);
}
break;
case RIG_LEVEL_AF:
case RIG_LEVEL_MICGAIN:
case RIG_LEVEL_RF:
case RIG_LEVEL_SQL:
case RIG_LEVEL_SWR:
case RIG_LEVEL_ALC:
val->f = (float)atoi(retlvl) / 255.;
break;

Wyświetl plik

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