kopia lustrzana https://github.com/Hamlib/Hamlib
Add first cut of SWR conversion for Yaesu rigs
https://github.com/Hamlib/Hamlib/issues/354pull/356/head
rodzic
23d4cc73dc
commit
8aa5126650
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue