kopia lustrzana https://github.com/Hamlib/Hamlib
Change L METER to allow meter names in addition to numeric
Change l METER to return meter number=name instead of just number Hopefully doesn't mess up anybody using this function via rigctl/rigctld uf they parsing the number correctly. It's easier for users with to use/see text names for both set/get https://github.com/Hamlib/Hamlib/issues/1369pull/1349/head
rodzic
1b0f0ec422
commit
cca3891362
2
NEWS
2
NEWS
|
@ -13,6 +13,8 @@ Version 5.x -- future
|
|||
* Change FT1000MP Mark V model names to align with FT1000MP
|
||||
|
||||
Version 4.6
|
||||
* rig set level METER can now take SWR,COMP,ALC,IC/ID,DB,PO,VDD,TEMP arguments to set which meter to display
|
||||
* reg get level displays meter number=name now
|
||||
* Added parm BANDSELECT for Yaesu rigs
|
||||
'p BANDSELECT' returns current band of VFOA
|
||||
'P BANDSELECT BAND160M' example selects the 160M band
|
||||
|
|
|
@ -985,6 +985,8 @@ Lookup - if level shows 0/0/0 then it's probably a lookup value
|
|||
SPECTRUM_MODE 0=None, 1=Center, 2=Fixed, 3=Center Scroll, 4=Fixed Scroll
|
||||
SPECTRUM_AVG rig specific
|
||||
|
||||
METER -- SWR,COMP,ALC,IC/ID,DB,PO,VDD,TEMP or can use the numbers above in Lookup l METER returns the meter number=name
|
||||
|
||||
Watts
|
||||
RFPOWER_METER_WATTS
|
||||
|
||||
|
|
|
@ -198,19 +198,17 @@ void frameParse(int fd, unsigned char *frame, int len)
|
|||
break;
|
||||
|
||||
case 0x0f:
|
||||
if (frame[5] == 0) { split = 0; }
|
||||
else if (frame[5] == 1) { split = 1; }
|
||||
else { frame[6] = split; }
|
||||
|
||||
if (frame[5] == 0xfd)
|
||||
{
|
||||
printf("get split %d\n", split);
|
||||
frame[7] = 0xfd;
|
||||
n = write(fd, frame, 8);
|
||||
frame[5] = split;
|
||||
frame[6] = 0xfd;
|
||||
n = write(fd, frame, 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("set split %d\n", 1);
|
||||
split = frame[5];
|
||||
frame[4] = 0xfb;
|
||||
frame[5] = 0xfd;
|
||||
n = write(fd, frame, 6);
|
||||
|
|
|
@ -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 rigctlsync ampctl ampctld rigtestmcast rigtestmcastrx $(TESTLIBUSB)
|
||||
bin_PROGRAMS = rigctl rigctld rigmem rigsmtr rigswr rotctl rotctld rigctlcom rigctltcp rigctlsync ampctl ampctld rigtestmcast rigtestmcastrx $(TESTLIBUSB) rigfreqwalk
|
||||
|
||||
#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 hamlibmodels testmW2power
|
||||
|
|
|
@ -3272,6 +3272,13 @@ declare_proto_rig(set_level)
|
|||
|
||||
level = rig_parse_level(arg1);
|
||||
|
||||
if ((!strcmp(arg2, "?") || arg2[0]==0) && level == RIG_LEVEL_METER)
|
||||
{
|
||||
fprintf(fout, "COMP ALC SWR ID/IC VDD DB PO TEMP%c", resp_sep);
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
// some Java apps send comma in international setups so substitute period
|
||||
char *p = strchr(arg2, ',');
|
||||
|
||||
|
@ -3288,6 +3295,7 @@ declare_proto_rig(set_level)
|
|||
RETURNFUNC2(-RIG_ENAVAIL); /* no such parameter */
|
||||
}
|
||||
|
||||
|
||||
switch (cfp->type)
|
||||
{
|
||||
case RIG_CONF_BUTTON:
|
||||
|
@ -3315,6 +3323,23 @@ declare_proto_rig(set_level)
|
|||
RETURNFUNC2(rig_set_ext_level(rig, vfo, cfp->token, val));
|
||||
}
|
||||
|
||||
int dummy;
|
||||
if (level == RIG_LEVEL_METER && sscanf(arg2,"%d",&dummy)==0)
|
||||
{
|
||||
if (strcmp(arg2,"COMP")==0) arg2 = "2";
|
||||
else if (strcmp(arg2,"ALC")==0) arg2 = "4";
|
||||
else if (strcmp(arg2,"SWR")==0) arg2 = "1";
|
||||
else if (strcmp(arg2,"ID")==0 || strcmp(arg2,"IC")==0) arg2 = "8";
|
||||
else if (strcmp(arg2,"VDD")==0) arg2 = "64";
|
||||
else if (strcmp(arg2, "DB")==0) arg2 = "16";
|
||||
else if (strcmp(arg2, "PO")==0) arg2 = "32";
|
||||
else if (strcmp(arg2, "TEMP")==0) arg2 = "128";
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown meter=%s, only know COMP,ALC,SWR,ID/IC,VDD,DB,PO,TEMP\n", __func__, arg2);
|
||||
RETURNFUNC2(-RIG_EINVAL);
|
||||
}
|
||||
}
|
||||
if (RIG_LEVEL_IS_FLOAT(level))
|
||||
{
|
||||
CHKSCN1ARG(sscanf(arg2, "%f", &val.f));
|
||||
|
@ -3352,7 +3377,6 @@ declare_proto_rig(get_level)
|
|||
//fputc('\n', fout);
|
||||
RETURNFUNC2(RIG_OK);
|
||||
}
|
||||
|
||||
level = rig_parse_level(arg1);
|
||||
|
||||
if (!rig_has_get_level(rig, level))
|
||||
|
@ -3416,6 +3440,26 @@ declare_proto_rig(get_level)
|
|||
{
|
||||
fprintf(fout, "%s: ", cmd->arg2);
|
||||
}
|
||||
if (level == RIG_LEVEL_METER && interactive && prompt)
|
||||
{
|
||||
// we will show text answers as they make morse sense for rigtl
|
||||
switch(val.i)
|
||||
{
|
||||
case RIG_METER_COMP: fprintf(fout, "%d=%s%c", val.i, "COMP", resp_sep);break;
|
||||
case RIG_METER_ALC: fprintf(fout, "%d=%s%c", val.i, "ALC", resp_sep);break;
|
||||
case RIG_METER_SWR: fprintf(fout, "%d=%s%c", val.i, "SWR", resp_sep);break;
|
||||
case RIG_METER_IC: fprintf(fout, "%d=%s%c", val.i, "IC", resp_sep);break;
|
||||
case RIG_METER_VDD: fprintf(fout, "%d=%s%c", val.i, "VDD", resp_sep);break;
|
||||
case RIG_METER_DB: fprintf(fout, "%d=%s%c", val.i, "DB", resp_sep);break;
|
||||
case RIG_METER_PO: fprintf(fout, "%d=%s%c", val.i, "PO", resp_sep);break;
|
||||
case RIG_METER_TEMP: fprintf(fout, "%d=%s%c", val.i, "TEMP", resp_sep);break;
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown meter=%d, only know COMP,ALC,SWR,ID/IC,VDD,DB,PO,TEMP\n", __func__, val.i);
|
||||
RETURNFUNC2(-RIG_EINVAL);
|
||||
}
|
||||
RETURNFUNC(RIG_OK);
|
||||
}
|
||||
|
||||
|
||||
if (RIG_LEVEL_IS_FLOAT(level))
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue