kopia lustrzana https://github.com/Hamlib/Hamlib
Revert "TS-890S query rig to find out which meter type the operator has selected"
Committed a bit too much
This reverts commit 2fc1d157ba
.
pull/1215/head
rodzic
2fc1d157ba
commit
712564a2ae
|
@ -17,12 +17,10 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include <hamlib/config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <hamlib/rig.h>
|
||||
#include "kenwood.h"
|
||||
|
@ -368,59 +366,6 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
#endif
|
||||
return -RIG_ENIMPL;
|
||||
|
||||
case RIG_LEVEL_STRENGTH:
|
||||
{
|
||||
cal_table_float_t *table;
|
||||
/* Values taken from the TS-890S In-Depth Manual (IDM), p. 8
|
||||
* 0.03 - 21.5 MHz, Preamp 1
|
||||
*/
|
||||
/* Meter Type 1 - Kenwood specific, factory default */
|
||||
static cal_table_float_t meter_type1 =
|
||||
{
|
||||
9, { { 0, -28.4f}, { 3, -26}, {11, -19.5f},
|
||||
{19, -13}, {27, -6.5f}, {35, 0},
|
||||
{48, 20}, {59, 40}, {70, 60}
|
||||
} };
|
||||
/* Meter Type 2 - IARU recommended */
|
||||
static cal_table_float_t meter_type2 =
|
||||
{
|
||||
9, { { 0, -54}, { 3, -48}, {11, -36},
|
||||
{19, -24}, {27, -12}, {35, 0},
|
||||
{48, 20}, {59, 40}, {70, 60}
|
||||
} };
|
||||
/* Find out which meter type is in use */
|
||||
retval = kenwood_safe_transaction(rig, "EX00011", ackbuf, sizeof(ackbuf), 11);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
if (strncmp(ackbuf + 8, "000", 3) == 0)
|
||||
{
|
||||
table = &meter_type1;
|
||||
}
|
||||
else if (strncmp(ackbuf + 8, "001", 3) == 0)
|
||||
{
|
||||
table = &meter_type2;
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unexpected meter type: %s\n",
|
||||
__func__, ackbuf);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
retval = kenwood_safe_transaction(rig, "SM", ackbuf, 10, 6);
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
sscanf(ackbuf + 2, "%d", &val->i);
|
||||
/* Convert reading back to dB (rounded) */
|
||||
val->i = (int)floorf(rig_raw2val_float(val->i, table) + 0.5f);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
default:
|
||||
return kenwood_get_level(rig, vfo, level, val);
|
||||
}
|
||||
|
@ -433,6 +378,39 @@ static struct kenwood_priv_caps ts890s_priv_caps =
|
|||
.cmdtrm = EOM_KEN,
|
||||
};
|
||||
|
||||
/* S-meter calibration table
|
||||
* The TS-890S has two distinct S-meter curves, selectable
|
||||
* by menu option. Define both, but since Hamlib has only
|
||||
* one slot, use the the IARU one.
|
||||
* Values taken from TS-890S In-Depth Manual, p. 8
|
||||
*/
|
||||
/* Meter Type 1 - Kenwood specific (default) */
|
||||
#define TS890_SM_CAL2 { 9, \
|
||||
{ \
|
||||
{ 0, -28 }, \
|
||||
{ 3, -26 }, \
|
||||
{ 11, -20 }, \
|
||||
{ 19, -13 }, \
|
||||
{ 27, -7 }, \
|
||||
{ 35, 0 }, \
|
||||
{ 48, 20 }, \
|
||||
{ 59, 40 }, \
|
||||
{ 70, 60 }, \
|
||||
} }
|
||||
/* Meter Type 2 - IARU Standard */
|
||||
#define TS890_SM_CAL1 { 9, \
|
||||
{ \
|
||||
{ 0, -54 }, \
|
||||
{ 3, -48 }, \
|
||||
{ 11, -36 }, \
|
||||
{ 19, -24 }, \
|
||||
{ 27, -12 }, \
|
||||
{ 35, 0 }, \
|
||||
{ 48, 20 }, \
|
||||
{ 59, 40 }, \
|
||||
{ 70, 60 }, \
|
||||
} }
|
||||
|
||||
/* SWR meter calibration table */
|
||||
/* The full scale value reads infinity, so arbitrary */
|
||||
#define TS890_SWR_CAL { 5, \
|
||||
|
@ -454,7 +432,7 @@ const struct rig_caps ts890s_caps =
|
|||
RIG_MODEL(RIG_MODEL_TS890S),
|
||||
.model_name = "TS-890S",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = BACKEND_VER ".11",
|
||||
.version = BACKEND_VER ".10",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -565,6 +543,7 @@ const struct rig_caps ts890s_caps =
|
|||
},
|
||||
.vfo_ops = TS890_VFO_OPS,
|
||||
|
||||
.str_cal = TS890_SM_CAL1,
|
||||
.swr_cal = TS890_SWR_CAL,
|
||||
|
||||
.priv = (void *)& ts890s_priv_caps,
|
||||
|
|
|
@ -14,7 +14,7 @@ endif
|
|||
|
||||
DISTCLEANFILES = rigctl.log rigctl.sum testbcd.log testbcd.sum
|
||||
|
||||
bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp ampctl ampctld $(TESTLIBUSB)
|
||||
bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom ampctl ampctld $(TESTLIBUSB)
|
||||
|
||||
#check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid testsecurity
|
||||
check_PROGRAMS = dumpmem testrig testrigopen testrigcaps testtrn testbcd testfreq listrigs testloc rig_bench testcache cachetest cachetest2 testcookie testgrid
|
||||
|
@ -26,7 +26,6 @@ AMPCOMMONSRC = ampctl_parse.c ampctl_parse.h dumpcaps_amp.c uthash.h
|
|||
rigctl_SOURCES = rigctl.c $(RIGCOMMONSRC)
|
||||
rigctld_SOURCES = rigctld.c $(RIGCOMMONSRC)
|
||||
rigctlcom_SOURCES = rigctlcom.c $(RIGCOMMONSRC)
|
||||
rigctltcp_SOURCES = rigctltcp.c $(RIGCOMMONSRC)
|
||||
rotctl_SOURCES = rotctl.c $(ROTCOMMONSRC)
|
||||
rotctld_SOURCES = rotctld.c $(ROTCOMMONSRC)
|
||||
ampctl_SOURCES = ampctl.c $(AMPCOMMONSRC)
|
||||
|
@ -51,7 +50,6 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
|||
ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
|
||||
rigctltcp_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
|
||||
if HAVE_LIBUSB
|
||||
rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS)
|
||||
endif
|
||||
|
@ -65,7 +63,6 @@ ampctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
|
|||
ampctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
|
||||
rigmem_LDADD = $(LIBXML2_LIBS) $(LDADD)
|
||||
rigctlcom_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
|
||||
rigctltcp_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
|
||||
if HAVE_LIBUSB
|
||||
rigtestlibusb_LDADD = $(LIBUSB_LIBS)
|
||||
endif
|
||||
|
@ -81,7 +78,6 @@ rigctld_LDFLAGS = $(WINEXELDFLAGS)
|
|||
rotctld_LDFLAGS = $(WINEXELDFLAGS)
|
||||
ampctld_LDFLAGS = $(WINEXELDFLAGS)
|
||||
rigctlcom_LDFLAGS = $(WINEXELDFLAGS)
|
||||
rigctltcp_LDFLAGS = $(WINEXELDFLAGS)
|
||||
if HAVE_LIBUSB
|
||||
rigtestlibusb_LDFLAGS = $(WINEXELDFLAGS)
|
||||
endif
|
||||
|
|
Ładowanie…
Reference in New Issue