Log fields

* add MY_STATE
  * trim leading/trailing blanks
  * add UK counties to counties list
  * changed short form to blank when NIL selected for state
  * store fldigi version number in SQSO.txt file
    . regenerate list from internal string if version number
      does not match with executing binary
This commit is contained in:
dave-w1hkj 2023-11-09 14:21:41 -06:00
parent 49b38e31d5
commit 80882af131
11 changed files with 252 additions and 136 deletions

View file

@ -16947,7 +16947,7 @@ i.e. localhost"));
inpMyAntenna->when(FL_WHEN_RELEASE);
inpMyAntenna->labelsize(FL_NORMAL_SIZE);
} // Fl_Input2* inpMyAntenna
{ Fl_Input2* o = inpMyQth = new Fl_Input2(386, 176, 320, 24, _("Station QTH:"));
{ Fl_Input2* o = inpMyQth = new Fl_Input2(386, 176, 320, 24, _("Station City:"));
inpMyQth->tooltip(_("Operators QTH"));
inpMyQth->box(FL_DOWN_BOX);
inpMyQth->color(FL_BACKGROUND2_COLOR);
@ -16976,7 +16976,7 @@ i.e. localhost"));
inpMyLocator->when(FL_WHEN_RELEASE);
inpMyLocator->labelsize(FL_NORMAL_SIZE);
} // Fl_Input2* inpMyLocator
{ Fl_ListBox* o = listbox_states = new Fl_ListBox(386, 237, 319, 24, _("State / Provinces"));
{ Fl_ListBox* o = listbox_states = new Fl_ListBox(386, 237, 319, 24, _("State/Prov./Country"));
listbox_states->tooltip(_("US States / Canadian Provinces"));
listbox_states->box(FL_DOWN_BOX);
listbox_states->color(FL_BACKGROUND2_COLOR);

View file

@ -130,7 +130,7 @@ decl {\#include <vector>} {private local
decl {\#if USE_HAMLIB
\#include "hamlib.h"
\#endif} {selected private local
\#endif} {private local
}
decl {extern void WefaxDestDirSet(Fl_File_Chooser *w, void *userdata);} {private local
@ -7084,7 +7084,7 @@ WKFSK_init();} open
}
}
Fl_Group {} {
label {Modem/Thor} open
label {Modem/Thor}
xywh {200 0 600 350} box ENGRAVED_BOX align 21 hide
code0 {CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Modem/Thor"));}
code1 {config_pages.push_back(p);}
@ -8528,7 +8528,7 @@ number to the default value.} xywh {624 313 73 22}
}
}
Fl_Group grpOperator {
label {Operator-Station}
label {Operator-Station} open selected
xywh {200 0 600 350} box ENGRAVED_BOX color 50 align 21 hide
code0 {CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Operator-Station"));}
code1 {config_pages.push_back(p);}
@ -8603,7 +8603,7 @@ progdefaults.changed = true;}
class Fl_Input2
}
Fl_Input inpMyQth {
label {Station QTH:}
label {Station City:}
callback {progdefaults.myQth = o->value();
inpMyFSQQth->value(o->value());
progdefaults.changed = true;}
@ -8621,7 +8621,7 @@ progdefaults.changed = true;}
class Fl_Input2
}
Fl_Group listbox_states {
label {State / Provinces}
label {State/Prov./Country}
callback {listbox_counties->clear();
listbox_counties->add(states.counties(o->value()).c_str());
listbox_counties->index(0);
@ -9680,7 +9680,7 @@ hamlib_get_defaults();
}
}
Fl_Group grpRigHardware {
label {Rig Control/Hardware PTT} open
label {Rig Control/Hardware PTT}
xywh {200 0 600 350} box ENGRAVED_BOX align 21 hide
code0 {CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Rig Control/Hardware PTT"));}
code1 {config_pages.push_back(p);}

View file

@ -69,6 +69,7 @@ OP_CALL,
STA_CALL,
MY_GRID,
MY_CITY,
MY_STATE,
SS_SERNO,
SS_PREC,
SS_CHK,

View file

@ -138,4 +138,6 @@ extern std::string last_adif_record();
extern std::string all_adif_records();
extern void writeLog(std::string fname, cQsoDb *db);
extern const char* log_power();
#endif

View file

@ -109,6 +109,7 @@ FIELD fields[] = {
{STA_CALL, 30, "STATION_CALLSIGN", &btnSelectStaCall}, // Callsign of transmitting station
{MY_GRID, 8, "MY_GRIDSQUARE", &btnSelectStaGrid}, // Xmt station locator
{MY_CITY, 60, "MY_CITY", &btnSelectStaCity}, // Xmt station location
{MY_STATE, 8, "MY_STATE", NULL}, // Xmt station location
{SS_SEC, 20, "CWSS_SECTION", &btnSelect_cwss_section}, // CW sweepstakes
{SS_SERNO, 20, "CWSS_SERNO", &btnSelect_cwss_serno},

View file

@ -148,9 +148,19 @@ void load_SQSO()
std::string cnty_file = DATA_dir;
cnty_file.append("SQSO.txt");
std::ifstream csvfile(cnty_file.c_str());
std::string str = szSQSO;
if (!csvfile) {
std::string str = szSQSO;
load_from_string( str, vec_SQSO );
return;
}
char line[1024];
csvfile.getline(line, 1024);
std::string sline = line;
std::string vertest = "Version ";
vertest.append(FLDIGI_VERSION);
if (sline.find(vertest) == std::string::npos) {
csvfile.close();
load_from_string( str, vec_SQSO );
return;
}
@ -195,10 +205,10 @@ void save_SQSO()
std::ofstream csvfile(cnty_file.c_str());
if (!csvfile) {
// std::cout << "cannot create " << cnty_file << std::endl;
return;
}
csvfile << "State/Province, ST/PR, County/City/Disrict, CCD" << std::endl;
csvfile << "State/Province, ST/PR, County/City/District, CCD -- Version ";
csvfile << FLDIGI_VERSION << std::endl;
for (size_t n = 0; n < vec_SQSO.size(); n++ )
csvfile << vec_SQSO[n].state << ","
@ -208,8 +218,6 @@ void save_SQSO()
<< std::endl;
csvfile.close();
//std::cout << vec_SQSO.size() << " records written to " << cnty_file << std::endl;
}
void save_7qp()
@ -331,6 +339,7 @@ const std::string Cstates::names()
const std::string Cstates::state_short(std::string ST) // ST can be either short or long form
{
if (ST == "NIL") return "";
for (size_t n = 0; n < vec_SQSO.size(); n++)
if (ST == vec_SQSO[n].ST || ST == vec_SQSO[n].state)
return vec_SQSO[n].ST;
@ -339,6 +348,7 @@ const std::string Cstates::state_short(std::string ST) // ST can be either shor
const std::string Cstates::state(std::string ST) // ST can be either short or long form
{
if (ST == "NIL") return "";
for (size_t n = 0; n < vec_SQSO.size(); n++)
if (ST == vec_SQSO[n].ST || ST == vec_SQSO[n].state)
return vec_SQSO[n].state;

View file

@ -27,76 +27,23 @@
#include "counties.h"
//std::string strSQSO
// US entries:
// State, <short state>, <county name>, <abbreviated county name>
// <short state>, <county name>, <abbreviated county name>
// Canadian entries:
// Province, <short province>, <county name>, <abbreviated county name>
// , <short province>, <county name>, <abbreviated county name>
// United Kingdom entries:
// United Kingom, UK, <county name>, <abbreviated county name>
// , UK, <county name>, <abbreviated county name>
const char *szSQSO = "\
State/Province, ST/PR, County/City/District, CCD\n\
NIL,--,none,none\n\
NIL, ,none,none\n\
Alaska,AK,AK1st (SE),SE\n\
,AK,AK2nd (NW),NW\n\
,AK,AK3rd (SC),SC\n\
,AK,AK4th (C),C\n\
Alberta,AB,MD of Acadia No. 34,ACAD\n\
,AB,Athabasca County,ATHA\n\
,AB,County of Barrhead No. 11,BARR\n\
,AB,Beaver County,BEAV\n\
,AB,Big Lakes County,BIGL\n\
,AB,MD of Bighorn No. 8,BIGH\n\
,AB,Birch Hills County,BIRC\n\
,AB,MD of Bonnyville No. 87,BONN\n\
,AB,Brazeau County,BRAZ\n\
,AB,Camrose County,CAMR\n\
,AB,Cardston County,CARD\n\
,AB,Clear Hills County,CLHI\n\
,AB,Clearwater County,CLWA\n\
,AB,Cypress County,CYPR\n\
,AB,MD of Fairview No. 136,FAIR\n\
,AB,Flagstaff County,FLAG\n\
,AB,Foothills County,FOOT\n\
,AB,County of Forty Mile No. 8,FORT\n\
,AB,County of Grande Prairie No. 1,GRAN\n\
,AB,MD of Greenview No. 16,GREE\n\
,AB,Kneehill County,KNEE\n\
,AB,Lac Ste. Anne County,LACS\n\
,AB,Lacombe County,LACO\n\
,AB,Lamont County,LAMO\n\
,AB,Leduc County,LEDU\n\
,AB,MD of Lesser Slave River No. 124,LESS\n\
,AB,Lethbridge County,LETH\n\
,AB,County of Minburn No. 27,MINB\n\
,AB,Mountain View County,MOUN\n\
,AB,County of Newell,NEWE\n\
,AB,County of Northern Lights,NOLI\n\
,AB,Northern Sunrise County,NOSU\n\
,AB,MD of Opportunity No. 17,OPPO\n\
,AB,County of Paintearth No. 18,PAIN\n\
,AB,Parkland County,PARK\n\
,AB,MD of Peace No. 135,PEAC\n\
,AB,MD of Pincher Creek No. 9,PINC\n\
,AB,Ponoka County,PONO\n\
,AB,MD of Provost No. 52,PROV\n\
,AB,MD of Ranchland No. 66,RANC\n\
,AB,Red Deer County,RDDR\n\
,AB,Rocky View County,ROCK\n\
,AB,Saddle Hills County,SADD\n\
,AB,Smoky Lake County,SMLA\n\
,AB,MD of Smoky River No. 130,SMRI\n\
,AB,MD of Spirit River No. 133,SPRI\n\
,AB,County of St. Paul No. 19,STPA\n\
,AB,Starland County,STAR\n\
,AB,County of Stettler No. 6,STET\n\
,AB,Sturgeon County,STUR\n\
,AB,MD of Taber,TABR\n\
,AB,Thorhild County,THOR\n\
,AB,County of Two Hills No. 21,TWHI\n\
,AB,County of Vermilion River,VERM\n\
,AB,Vulcan County,VULC\n\
,AB,MD of Wainwright No. 61,WAIN\n\
,AB,County of Warner No. 5,WARN\n\
,AB,Westlock County,WEST\n\
,AB,County of Wetaskiwin No. 10,WETA\n\
,AB,Wheatland County,WHEA\n\
,AB,MD of Willow Creek No. 26,WILL\n\
,AB,Woodlands County,WOOD\n\
,AB,Yellowhead County,YELL\n\
Alabama,AL,Autauga,AUTA\n\
,AL,Baldwin,BALD\n\
,AL,Barbour,BARB\n\
@ -164,6 +111,69 @@ Alabama,AL,Autauga,AUTA\n\
,AL,Washington,WASH\n\
,AL,Wilcox,WLCX\n\
,AL,Winston,WINS\n\
Alberta,AB,MD of Acadia No. 34,ACAD\n\
,AB,Athabasca County,ATHA\n\
,AB,County of Barrhead No. 11,BARR\n\
,AB,Beaver County,BEAV\n\
,AB,Big Lakes County,BIGL\n\
,AB,MD of Bighorn No. 8,BIGH\n\
,AB,Birch Hills County,BIRC\n\
,AB,MD of Bonnyville No. 87,BONN\n\
,AB,Brazeau County,BRAZ\n\
,AB,Camrose County,CAMR\n\
,AB,Cardston County,CARD\n\
,AB,Clear Hills County,CLHI\n\
,AB,Clearwater County,CLWA\n\
,AB,Cypress County,CYPR\n\
,AB,MD of Fairview No. 136,FAIR\n\
,AB,Flagstaff County,FLAG\n\
,AB,Foothills County,FOOT\n\
,AB,County of Forty Mile No. 8,FORT\n\
,AB,County of Grande Prairie No. 1,GRAN\n\
,AB,MD of Greenview No. 16,GREE\n\
,AB,Kneehill County,KNEE\n\
,AB,Lac Ste. Anne County,LACS\n\
,AB,Lacombe County,LACO\n\
,AB,Lamont County,LAMO\n\
,AB,Leduc County,LEDU\n\
,AB,MD of Lesser Slave River No. 124,LESS\n\
,AB,Lethbridge County,LETH\n\
,AB,County of Minburn No. 27,MINB\n\
,AB,Mountain View County,MOUN\n\
,AB,County of Newell,NEWE\n\
,AB,County of Northern Lights,NOLI\n\
,AB,Northern Sunrise County,NOSU\n\
,AB,MD of Opportunity No. 17,OPPO\n\
,AB,County of Paintearth No. 18,PAIN\n\
,AB,Parkland County,PARK\n\
,AB,MD of Peace No. 135,PEAC\n\
,AB,MD of Pincher Creek No. 9,PINC\n\
,AB,Ponoka County,PONO\n\
,AB,MD of Provost No. 52,PROV\n\
,AB,MD of Ranchland No. 66,RANC\n\
,AB,Red Deer County,RDDR\n\
,AB,Rocky View County,ROCK\n\
,AB,Saddle Hills County,SADD\n\
,AB,Smoky Lake County,SMLA\n\
,AB,MD of Smoky River No. 130,SMRI\n\
,AB,MD of Spirit River No. 133,SPRI\n\
,AB,County of St. Paul No. 19,STPA\n\
,AB,Starland County,STAR\n\
,AB,County of Stettler No. 6,STET\n\
,AB,Sturgeon County,STUR\n\
,AB,MD of Taber,TABR\n\
,AB,Thorhild County,THOR\n\
,AB,County of Two Hills No. 21,TWHI\n\
,AB,County of Vermilion River,VERM\n\
,AB,Vulcan County,VULC\n\
,AB,MD of Wainwright No. 61,WAIN\n\
,AB,County of Warner No. 5,WARN\n\
,AB,Westlock County,WEST\n\
,AB,County of Wetaskiwin No. 10,WETA\n\
,AB,Wheatland County,WHEA\n\
,AB,MD of Willow Creek No. 26,WILL\n\
,AB,Woodlands County,WOOD\n\
,AB,Yellowhead County,YELL\n\
Arizona,AZ,Apache,APH\n\
,AZ,Cochise,CHS\n\
,AZ,Coconino,CNO\n\
@ -2024,21 +2034,21 @@ Nebraska,NE,Adams,ADMS\n\
,NE,Webster,WEBS\n\
,NE,Wheeler,WHEE\n\
,NE,York,YORK\n\
New Brunswick,NB,Albert,\
,NB,Carleton,\
,NB,Charlotte,\
,NB,Gloucester,\
,NB,Kent,\
,NB,Kings,\
,NB,Madawaska,\
,NB,Northumberland,\
,NB,Queens,\
,NB,Restigouche,\
,NB,Saint John,\
,NB,Sunbury,\
,NB,Victoria,\
,NB,Westmorland,\
,NB,York,\
New Brunswick,NB,Albert,\n\
,NB,Carleton,\n\
,NB,Charlotte,\n\
,NB,Gloucester,\n\
,NB,Kent,\n\
,NB,Kings,\n\
,NB,Madawaska,\n\
,NB,Northumberland,\n\
,NB,Queens,\n\
,NB,Restigouche,\n\
,NB,Saint John,\n\
,NB,Sunbury,\n\
,NB,Victoria,\n\
,NB,Westmorland,\n\
,NB,York,\n\
Newfoundland and Labrador,NL,Avalon Peninsula-St. John's,\n\
,NL,Burin Peninsula-Marystown,\n\
,NL,South Coast-Channel-Port aux Basques,\n\
@ -2207,8 +2217,8 @@ Nova Scotia,NS,Halifax,\n\
,NS,Shelburne,\n\
,NS,Yarmouth,\n\
Nunavut,NU,Kitikmeot,\n\
NU,Qikiqtaaluk,\n\
NU,Kivalliq,\n\
,NU,Qikiqtaaluk,\n\
,NU,Kivalliq,\n\
Ohio,OH,Adams,ADAM\n\
,OH,Allen,ALLE\n\
,OH,Ashland,ASHL\n\
@ -2644,24 +2654,24 @@ Rhode Island,RI,Bristol,BRI\n\
,RI,Providence,PRO\n\
,RI,Washington,WAR\n\
Saskatchewan,SA,,\n\
,SA,Assiniboia,,\n\
,SA,Battleford,,\n\
,SA,Estevan,,\n\
,SA,Kindersley,,\n\
,SA,La Ronge,,\n\
,SA,Lloydminster,,\n\
,SA,Maple Creek,,\n\
,SA,Melfort,,\n\
,SA,Melville,,\n\
,SA,Moose Jaw,,\n\
,SA,North Battleford,,\n\
,SA,Prince Albert,,\n\
,SA,Regina,,\n\
,SA,Saskatoon,,\n\
,SA,Swift Current,,\n\
,SA,Weyburn,,\n\
,SA,Wynyard,,\n\
,SA,Yorkton,,\n\
,SA,Assiniboia,\n\
,SA,Battleford,\n\
,SA,Estevan,\n\
,SA,Kindersley,\n\
,SA,La Ronge,\n\
,SA,Lloydminster,\n\
,SA,Maple Creek,\n\
,SA,Melfort,\n\
,SA,Melville,\n\
,SA,Moose Jaw,\n\
,SA,North Battleford,\n\
,SA,Prince Albert,\n\
,SA,Regina,\n\
,SA,Saskatoon,\n\
,SA,Swift Current,\n\
,SA,Weyburn,\n\
,SA,Wynyard,\n\
,SA,Yorkton,\n\
South Carolina,SC,Abbeville,ABBE\n\
,SC,Aiken,AIKE\n\
,SC,Allendale,ALLE\n\
@ -3499,7 +3509,84 @@ Yukon,YT,Carmacks,\n\
,YT,Mayo,\n\
,YT,Teslin,\n\
,YT,Watson Lake,\n\
,YT,Whitehorse,\n";
,YT,Whitehorse,\n\
United Kingdom,UK,Alderney,ALD\n\
,UK,County Antrim,ATM\n\
,UK,County Armagh,ARM\n\
,UK,Avon,AVN\n\
,UK,Bedfordshire,BFD\n\
,UK,Berkshire,BRK,\n\
,UK,Borders,BDS\n\
,UK,Buckinghamshire,BUX\n\
,UK,Cambridgeshire,CBE\n\
,UK,Central,CTR\n\
,UK,Cheshire,CHS\n\
,UK,Cleveland,CVE\n\
,UK,Clwyd,CLD\n\
,UK,Cornwall,CNL\n\
,UK,Cumbria,CBA\n\
,UK,Derbyshire,DYS\n\
,UK,Devon,DVN\n\
,UK,Dorse,DOR\n\
,UK,County Down,DWN\n\
,UK,Dumfries and Galloway,DGL\n\
,UK,County Durham,DHM\n\
,UK,Dyfed,DFD\n\
,UK,Essex,ESX\n\
,UK,County Fermanagh,FMH\n\
,UK,Fife,FFE\n\
,UK,Mid Glamorgan,GNM\n\
,UK,South Glamorgan,GNS\n\
,UK,West Glamorgan,GNW\n\
,UK,Gloucester,GLR\n\
,UK,Grampian,GRN\n\
,UK,Guernsey,GUR\n\
,UK,Gwent,GWT\n\
,UK,Gwynedd,GDD\n\
,UK,Hampshire,HPH\n\
,UK,Hereford and Worcester,HWR\n\
,UK,Hertfordshire,HFD\n\
,UK,Highlands,HLD\n\
,UK,Humberside,HBS\n\
,UK,Isle of Man,IOM\n\
,UK,Isle of Wight,IOW\n\
,UK,Jersey,JER\n\
,UK,Kent,KNT\n\
,UK,Lancashire,LNH\n\
,UK,Leicestershire,LEC\n\
,UK,Lincolnshire,LCN\n\
,UK,Greater London,LDN\n\
,UK,County Londonderry,LDR\n\
,UK,Lothian,LTH\n\
,UK,Greater Manchester,MCH\n\
,UK,Merseyside,MSY\n\
,UK,Norfolk,NOR\n\
,UK,Northamptonshire,NHM\n\
,UK,Northumberland,NLD\n\
,UK,Nottinghamshire,NOT\n\
,UK,Orkney,ORK\n\
,UK,Oxfordshire,OFE\n\
,UK,Powys,PWS\n\
,UK,Shropshire,SPE\n\
,UK,Sark,SRK\n\
,UK,Shetland,SLD\n\
,UK,Somerset,SOM\n\
,UK,Staffordshire,SFD\n\
,UK,Strathclyde,SCD\n\
,UK,Suffolk,SFK\n\
,UK,Surrey,SRY\n\
,UK,East Sussex,SXE\n\
,UK,West Sussex,SXW\n\
,UK,Tayside,TYS\n\
,UK,Tyne and Wear,TWR\n\
,UK,County Tyrone,TYR\n\
,UK,Warwickshire,WKS\n\
,UK,Western Isles,WIL\n\
,UK,West Midlands,WMD\n\
,UK,Wiltshire,WLT\n\
,UK,North Yorkshire,YSN\n\
,UK,South Yorkshire,YSS\n\
,UK,West Yorkshire,YSW";
//std::string strNEQP
const char *szNEQP = "\
@ -3833,5 +3920,5 @@ Wyoming,WY,Albany,WYALB\n\
,WY,Teton,WYTET\n\
,WY,Uinta,WYUIN\n\
,WY,Washakie,WYWAS\n\
,WY,Weston,WYWES\n";
,WY,Weston,WYWES";

View file

@ -51,6 +51,7 @@
#include "fd_logger.h"
#include "fl_digi.h"
#include "confdialog.h"
#include "fileselect.h"
#include "configuration.h"
#include "main.h"
@ -1684,11 +1685,12 @@ void saveRecord() {
rec.putField(CONT, inpCONT_log->value());
rec.putField(CQZ, inpCQZ_log->value());
rec.putField(ITUZ, inpITUZ_log->value());
rec.putField(TX_PWR, inpTX_pwr_log->value());
rec.putField(TX_PWR, log_power());
rec.putField(STA_CALL, inp_log_sta_call->value());
rec.putField(OP_CALL, inp_log_op_call->value());
rec.putField(MY_CITY, inp_log_sta_qth->value());
rec.putField(MY_STATE, inp_QP_state_short->value());
rec.putField(MY_GRID, inp_log_sta_loc->value());
rec.putField(SS_SERNO, inp_log_cwss_serno->value());
@ -1776,7 +1778,7 @@ void updateRecord() {
rec.putField(CONT, inpCONT_log->value());
rec.putField(CQZ, inpCQZ_log->value());
rec.putField(ITUZ, inpITUZ_log->value());
rec.putField(TX_PWR, inpTX_pwr_log->value());
rec.putField(TX_PWR, log_power());
rec.putField(STA_CALL, inp_log_sta_call->value());
rec.putField(OP_CALL, inp_log_op_call->value());
@ -1903,6 +1905,19 @@ std::string sTime_on = "";
std::string sDate_off = "";
std::string sTime_off = "";
const char *log_power()
{
static std::string stemp;
if (progdefaults.log_power_meter) {
static char sval[20];
snprintf(sval, sizeof(sval), "%3.0f", pwrmeter->peak());
stemp = sval;
strtrim(stemp);
} else
stemp = progdefaults.mytxpower;
return stemp.c_str();
}
void AddRecord ()
{
inpCall_log->value(inpCall->value());
@ -1951,12 +1966,7 @@ void AddRecord ()
inpNotes_log->value (inpNotes->value());
if (progdefaults.log_power_meter) {
static char sval[20];
snprintf(sval, sizeof(sval), "%3.0f", pwrmeter->peak());
inpTX_pwr_log->value(sval);
} else
inpTX_pwr_log->value (progdefaults.mytxpower.c_str());
if (progdefaults.log_power_meter) inpTX_pwr_log->value(log_power());
inpIOTA_log->value("");
inpDXCC_log->value("");

View file

@ -47,6 +47,7 @@
#include "modem.h"
#include "trx.h"
#include "status.h"
#include "strutil.h"
#include "configuration.h"
@ -244,12 +245,7 @@ void xml_add_record()
adif_str(ADIF_MODE, mode_info[active_modem->get_mode()].adif_name);
adif_str(RST_SENT, inpRstOut->value());
adif_str(RST_RCVD, inpRstIn->value());
if (progdefaults.log_power_meter) {
static char sval[20];
snprintf(sval, sizeof(sval), "%3.0f", pwrmeter->peak());
adif_str(TX_PWR, sval);
} else
adif_str(TX_PWR, progdefaults.mytxpower.c_str());
adif_str(TX_PWR, log_power());
adif_str(NAME, inpName->value());
adif_str(QTH, inpQth->value());
@ -294,10 +290,8 @@ void xml_add_record()
adif_str(OP_CALL, progdefaults.operCall.c_str());
adif_str(STA_CALL, progdefaults.myCall.c_str());
adif_str(MY_CITY,
std::string(progdefaults.myQth).
append(", ").
append(inp_QP_state_short->value()).c_str());
adif_str(MY_CITY, std::string(progdefaults.myQth).c_str());
adif_str(MY_STATE, inp_QP_state_short->value());
adif_str(MY_GRID, progdefaults.myLocator.c_str());
adif.append("<eor>");

View file

@ -70,7 +70,7 @@ void loadBrowser(Fl_Widget *widget) {
w->add(_("<MYCALL>\tmy call"));
w->add(_("<MYLOC>\tmy locator"));
w->add(_("<MYNAME>\tmy name"));
w->add(_("<MYQTH>\tmy QTH"));
w->add(_("<MYQTH>\tmy QTH (city)"));
w->add(_("<MYRST>\tmy RST"));
w->add(_("<MYCLASS>\tmy FD class"));
w->add(_("<MYSECTION>\tmy FD section"));
@ -80,6 +80,7 @@ void loadBrowser(Fl_Widget *widget) {
w->add(_("<MYCNTY>\tmy CNTY"));
w->add(_("<ANTENNA>\tmy antenna"));
w->add(_("<BAND>\toperating band"));
w->add(_("<TX_PWR>\ttransmit power"));
w->add(_("<VER>\tFldigi version"));
w->add(_("<DIGI>\tdigital mode (adif)"));
@ -316,7 +317,7 @@ void loadBrowser(Fl_Widget *widget) {
const char* p;
if ((p = strrchr(gbuf.gl_pathv[i], '/'))) {
snprintf(s, sizeof(s), "<EXEC>%s</EXEC>", p+1);
snprintf(s, sizeof(s), "<EXEC>%s</EXEC>", p+1);
w->add(s);
}
}

View file

@ -1768,6 +1768,11 @@ static void pBAND(std::string &s, size_t &i, size_t endbracket)
s.replace( i, 6, band_name( band( wf->rfcarrier() ) ) );
}
static void pTX_PWR(std::string &s, size_t &i, size_t endbracket)
{
s.replace( i, 8, log_power() );
}
static void pLOC(std::string &s, size_t &i, size_t endbracket)
{
s.replace( i, 5, inpLoc->value() );
@ -3944,6 +3949,7 @@ void set_macro_env(void)
FLDIGI_DIAL_FREQUENCY,
FLDIGI_AUDIO_FREQUENCY,
FLDIGI_FREQUENCY,
FLDIGI_TX_PWR,
FLDIGI_MACRO_FILE,
@ -4041,6 +4047,7 @@ void set_macro_env(void)
{ "FLDIGI_DIAL_FREQUENCY", "" },
{ "FLDIGI_AUDIO_FREQUENCY", "" },
{ "FLDIGI_FREQUENCY", "" },
{ "FLDIGI_TX_PWR", log_power() },
// logging frame
{ "FLDIGI_MACRO_FILE", progStatus.LastMacroFile.c_str() },
@ -4095,7 +4102,7 @@ void set_macro_env(void)
{ "FLDIGI_LOGBOOK_LOCATOR", inpLoc_log->value() },
{ "FLDIGI_LOGBOOK_QSL_R", inpQSLrcvddate_log->value() },
{ "FLDIGI_LOGBOOK_QSL_S", inpQSLsentdate_log->value() },
{ "FLDIGI_LOGBOOK_TX_PWR", inpTX_pwr_log->value() },
{ "FLDIGI_LOGBOOK_TX_PWR", log_power() },
{ "FLDIGI_LOGBOOK_COUNTY", inpCNTY_log->value() },
{ "FLDIGI_LOGBOOK_IOTA", inpIOTA_log->value() },
{ "FLDIGI_LOGBOOK_DXCC", inpDXCC_log->value() },
@ -4293,7 +4300,9 @@ static void pEXEC(std::string& s, size_t& i, size_t endbracket)
memset(&pi, 0, sizeof(pi));
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi))
LOG_ERROR("CreateProcess failed with error code %ld", GetLastError());
CloseHandle(pi.hProcess);
WaitForSingleObject( pi.hProcess, INFINITE );
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
free(cmd);
@ -4697,6 +4706,7 @@ static const MTAGS mtags[] = {
{"<CALL>", pCALL},
{"<FREQ>", pFREQ},
{"<BAND>", pBAND},
{"<TX_PWR>", pTX_PWR},
{"<LOC>", pLOC},
{"<MODE>", pMODE},
{"<NAME>", pNAME},