kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Merge tag 'v3.21.74' of git://git.berlios.de/fldigi
Conflicts: src/main.cxxpull/1/head
commit
184e5adf6f
12
ChangeLog
12
ChangeLog
|
@ -1,9 +1,17 @@
|
|||
|
||||
|
||||
=Version 3.21.74=
|
||||
|
||||
2013-08-13 David Freese <w1hkj@w1hkj.com>
|
||||
|
||||
d17f1b1: initialize active_modem
|
||||
bdbaf78: XML parser
|
||||
6fcf6bd: 64 bit compile warnings
|
||||
1a870d9: Automake bug
|
||||
|
||||
|
||||
=Version 3.21.73=
|
||||
|
||||
2013-07-28 David Freese <w1hkj@w1hkj.com>
|
||||
|
||||
627bddc: qrunner mod
|
||||
98b61eb: Pskmail-test
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ dnl major and minor must be integers; patch may
|
|||
dnl contain other characters or be empty
|
||||
m4_define(FLDIGI_MAJOR, [3])
|
||||
m4_define(FLDIGI_MINOR, [21])
|
||||
m4_define(FLDIGI_PATCH, [.73])
|
||||
m4_define(FLDIGI_PATCH, [.74])
|
||||
m4_define(FLARQ_MAJOR, [4])
|
||||
m4_define(FLARQ_MINOR, [3])
|
||||
m4_define(FLARQ_PATCH, [.4])
|
||||
|
|
|
@ -253,7 +253,8 @@ hamlib-static: $(dl_fldigi_OBJECTS)
|
|||
endif
|
||||
endif
|
||||
|
||||
TESTS = $(srcdir)/../scripts/tests/config-h.sh $(srcdir)/../scripts/tests/cr.sh
|
||||
tmp_srcdir_var=$(srcdir)
|
||||
TESTS = $(tmp_srcdir_var)/../scripts/tests/config-h.sh $(tmp_srcdir_var)/../scripts/tests/cr.sh
|
||||
|
||||
if HAVE_ASCIIDOC
|
||||
$(builddir)/../doc/guide.html: $(builddir)/../doc/guide.txt
|
||||
|
|
|
@ -3514,7 +3514,7 @@ Fl_Button *btnInitHAMLIB=(Fl_Button *)0;
|
|||
static void cb_btnInitHAMLIB(Fl_Button* o, void*) {
|
||||
progdefaults.initInterface();
|
||||
o->labelcolor(FL_FOREGROUND_COLOR);
|
||||
btnRevertHAMLIB->deactivate();
|
||||
//btnRevertHAMLIB->activate();
|
||||
progdefaults.changed = true;
|
||||
}
|
||||
|
||||
|
@ -8166,8 +8166,9 @@ le Earth)"));
|
|||
o->value(progdefaults.RigCatRestoreTIO);
|
||||
} // Fl_Check_Button* chk_restore_tio
|
||||
{ btnRevertRIGCAT = new Fl_Button(385, 289, 113, 24, _("Revert"));
|
||||
btnRevertRIGCAT->tooltip(_("Initialize hamlib interface"));
|
||||
btnRevertRIGCAT->tooltip(_("Reset rigCAT interface"));
|
||||
btnRevertRIGCAT->callback((Fl_Callback*)cb_btnRevertRIGCAT);
|
||||
btnRevertRIGCAT->hide();
|
||||
btnRevertRIGCAT->deactivate();
|
||||
} // Fl_Button* btnRevertRIGCAT
|
||||
{ Fl_Check_Button* o = chkRigCatVSP = new Fl_Check_Button(276, 300, 100, 25, _("VSP Enable"));
|
||||
|
@ -8381,8 +8382,9 @@ le Earth)"));
|
|||
o->value(progdefaults.HamlibXONXOFFflow);
|
||||
} // Fl_Check_Button* chkHamlibXONXOFFflow
|
||||
{ btnRevertHAMLIB = new Fl_Button(383, 289, 113, 24, _("Revert"));
|
||||
btnRevertHAMLIB->tooltip(_("Initialize hamlib interface"));
|
||||
btnRevertHAMLIB->tooltip(_("Reset hamlib interface"));
|
||||
btnRevertHAMLIB->callback((Fl_Callback*)cb_btnRevertHAMLIB);
|
||||
btnRevertHAMLIB->hide();
|
||||
btnRevertHAMLIB->deactivate();
|
||||
} // Fl_Button* btnRevertHAMLIB
|
||||
grpHamlib->end();
|
||||
|
|
|
@ -3841,7 +3841,7 @@ progdefaults.changed = true;}
|
|||
}
|
||||
}
|
||||
Fl_Group tabRig {
|
||||
label Rig
|
||||
label Rig open
|
||||
tooltip {Transceiver control} xywh {0 23 540 345} hide
|
||||
} {
|
||||
Fl_Tabs tabsRig {open
|
||||
|
@ -3985,7 +3985,7 @@ progdefaults.changed = true;}
|
|||
}
|
||||
}
|
||||
Fl_Group {} {
|
||||
label RigCAT
|
||||
label RigCAT open
|
||||
tooltip {Rig Control using xml spec file} xywh {0 48 540 320} hide
|
||||
} {
|
||||
Fl_Check_Button chkUSERIGCAT {
|
||||
|
@ -4167,7 +4167,7 @@ btnRevertRIGCAT->activate();}
|
|||
callback {btnInitRIGCAT->labelcolor(FL_FOREGROUND_COLOR);
|
||||
btnInitRIGCAT->redraw_label();
|
||||
rigCAT_restore_defaults();}
|
||||
tooltip {Initialize hamlib interface} xywh {385 289 113 24} deactivate
|
||||
tooltip {Reset rigCAT interface} xywh {385 289 113 24} hide deactivate
|
||||
code0 {\#include "rigio.h"}
|
||||
}
|
||||
Fl_Check_Button chkRigCatVSP {
|
||||
|
@ -4306,7 +4306,7 @@ in format: param=val ...} xywh {32 321 320 22} align 5
|
|||
label Initialize
|
||||
callback {progdefaults.initInterface();
|
||||
o->labelcolor(FL_FOREGROUND_COLOR);
|
||||
btnRevertHAMLIB->deactivate();
|
||||
//btnRevertHAMLIB->activate();
|
||||
progdefaults.changed = true;}
|
||||
tooltip {Initialize hamlib interface} xywh {383 320 113 24}
|
||||
}
|
||||
|
@ -4375,7 +4375,7 @@ btnInitHAMLIB->redraw_label();
|
|||
\#if USE_HAMLIB
|
||||
hamlib_restore_defaults();
|
||||
\#endif}
|
||||
tooltip {Initialize hamlib interface} xywh {383 289 113 24} deactivate
|
||||
tooltip {Reset hamlib interface} xywh {383 289 113 24} hide deactivate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1380,7 +1380,7 @@ void init_modem_sync(trx_mode m, int f)
|
|||
if (!count) LOG_ERROR("%s", "trx wait for RX timeout");
|
||||
}
|
||||
|
||||
LOG_INFO("Call init_modem %d, %d", m, f);
|
||||
LOG_INFO("Call init_modem %d, %d", (int)m, f);
|
||||
init_modem(m, f);
|
||||
|
||||
count = 500;
|
||||
|
@ -1426,7 +1426,8 @@ void cb_charset_menu(Fl_Widget *, void *charset)
|
|||
void populate_charset_menu(void)
|
||||
{
|
||||
for (unsigned int i = 0; i < number_of_charsets; i++)
|
||||
CHARSETstatus->add(charset_list[i].name, 0, cb_charset_menu, (void *)charset_list[i].tiniconv_id);
|
||||
CHARSETstatus->add(charset_list[i].name, 0, cb_charset_menu,
|
||||
reinterpret_cast<void *>(charset_list[i].tiniconv_id));
|
||||
}
|
||||
|
||||
// find the position of the default charset in charset_list[] and trigger the callback
|
||||
|
@ -1434,7 +1435,8 @@ void set_default_charset(void)
|
|||
{
|
||||
for (unsigned int i = 0; i < number_of_charsets; i++) {
|
||||
if (strcmp(charset_list[i].name, progdefaults.charset_name.c_str()) == 0) {
|
||||
cb_charset_menu(0, (void *)charset_list[i].tiniconv_id);
|
||||
cb_charset_menu(0,
|
||||
reinterpret_cast<void *>(charset_list[i].tiniconv_id));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5129,7 +5131,7 @@ void create_fl_digi_main_primary() {
|
|||
}
|
||||
btnMacro[NUMMACKEYS + i] = new Fl_Button(xpos, ypos, Wmacrobtn, Hmacrobtn,
|
||||
macros.name[NUMMACKEYS + i].c_str());
|
||||
btnMacro[NUMMACKEYS + i]->callback(macro_cb, (void *)(NUMMACKEYS + i));
|
||||
btnMacro[NUMMACKEYS + i]->callback(macro_cb, reinterpret_cast<void *>(NUMMACKEYS + i));
|
||||
btnMacro[NUMMACKEYS + i]->tooltip(
|
||||
_("Left Click - execute\nShift-Fkey - execute\nRight Click - edit"));
|
||||
colorize_macro(NUMMACKEYS + i);
|
||||
|
@ -5308,7 +5310,7 @@ void create_fl_digi_main_primary() {
|
|||
}
|
||||
btnMacro[i] = new Fl_Button(xpos, ypos, Wmacrobtn, Hmacrobtn,
|
||||
macros.name[i].c_str());
|
||||
btnMacro[i]->callback(macro_cb, (void *)(i));
|
||||
btnMacro[i]->callback(macro_cb, reinterpret_cast<void *>(i));
|
||||
btnMacro[i]->tooltip(_("Left Click - execute\nFkey - execute\nRight Click - edit"));
|
||||
colorize_macro(i);
|
||||
xpos += Wmacrobtn;
|
||||
|
|
|
@ -104,13 +104,13 @@ void Font_Browser::FontNameSelect()
|
|||
//
|
||||
for (int i = !*sizes; i < nsizes; i++)
|
||||
if ((size_t)snprintf(buf, sizeof(buf), "%d", sizes[i]) < sizeof(buf))
|
||||
lst_Size->add(buf, (void*)sizes[i]);
|
||||
lst_Size->add(buf, reinterpret_cast<void*>(sizes[i]));
|
||||
|
||||
// scalable font with no suggested sizes
|
||||
if (!lst_Size->size()) {
|
||||
for (int i = 1; i <= 48; i++) {
|
||||
snprintf(buf, sizeof(buf), "%d", i);
|
||||
lst_Size->add(buf, (void*)i);
|
||||
lst_Size->add(buf, reinterpret_cast<void*>(i));
|
||||
}
|
||||
}
|
||||
fontSize(fontsize);
|
||||
|
@ -169,7 +169,7 @@ Font_Browser::Font_Browser(int x, int y, int w, int h, const char *lbl )
|
|||
for(int i = 0; i < numfonts; i++) {
|
||||
name = Fl::get_font_name((Fl_Font)i);
|
||||
if (isalpha(*name))
|
||||
lst_Font->add(name, (void *)i);
|
||||
lst_Font->add(name, reinterpret_cast<void *>(i));
|
||||
}
|
||||
FontSort();
|
||||
|
||||
|
|
|
@ -1036,7 +1036,6 @@ string nextFileName(string fname)
|
|||
void saveEmailFile()
|
||||
{
|
||||
static char xfrmsg[80];
|
||||
int fnum;
|
||||
string tempname;
|
||||
|
||||
time(&EndTime_t);
|
||||
|
@ -1045,7 +1044,6 @@ void saveEmailFile()
|
|||
|
||||
string savetoname = ARQ_mail_in_dir;
|
||||
|
||||
fnum = 1;
|
||||
if (rxfname.find(".eml") == string::npos)
|
||||
rxfname.append(".eml");
|
||||
savetoname.append(rxfname);
|
||||
|
@ -1117,7 +1115,8 @@ void payloadText(string s)
|
|||
sscanf(sizechars.c_str(), "%" PRIuSZ, &arqPayloadSize);
|
||||
rxARQhavesize = true;
|
||||
char statusmsg[40];
|
||||
snprintf(statusmsg, sizeof(statusmsg), "Rcvg: %" PRIuSZ, arqPayloadSize);
|
||||
snprintf(statusmsg, sizeof(statusmsg), "Rcvg: %d",
|
||||
static_cast<int>(arqPayloadSize));
|
||||
txtStatus->value(statusmsg);
|
||||
}
|
||||
}
|
||||
|
@ -1267,7 +1266,8 @@ void sendEmailFile()
|
|||
txtsize = textin.length();
|
||||
arqPayloadSize = txtsize;
|
||||
blocksSent = 0;
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%" PRIuSZ "\n", txtsize);
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%d\n",
|
||||
static_cast<int>(txtsize));
|
||||
TX.append(sizemsg);
|
||||
TX.append(arqstart);
|
||||
TX.append(textin);
|
||||
|
@ -1321,7 +1321,8 @@ void sendAsciiFile()
|
|||
txtsize = textin.length();
|
||||
arqPayloadSize = txtsize;
|
||||
blocksSent = 0;
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%" PRIuSZ "\n", txtsize);
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%d\n",
|
||||
static_cast<int>(txtsize));
|
||||
TX.append(sizemsg);
|
||||
TX.append(arqstart);
|
||||
TX.append(textin);
|
||||
|
@ -1347,7 +1348,7 @@ void sendImageFile()
|
|||
}
|
||||
const char *p = FSEL::select("ARQ image file", "*.{png,jpg,bmp}\t*", "");
|
||||
char cin;
|
||||
size_t txtsize, b64size;
|
||||
size_t b64size;
|
||||
string textin = "";
|
||||
string b64text;
|
||||
base64 b64(true);
|
||||
|
@ -1365,10 +1366,10 @@ void sendImageFile()
|
|||
while (textfile.get(cin))
|
||||
textin += cin;
|
||||
textfile.close();
|
||||
txtsize = textin.length();
|
||||
b64text = b64.encode(textin);
|
||||
b64size = b64text.length();
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%" PRIuSZ "\n", b64size);
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%d\n",
|
||||
static_cast<int>(b64size));
|
||||
arqPayloadSize = b64size;
|
||||
blocksSent = 0;
|
||||
TX.append(sizemsg);
|
||||
|
@ -1396,7 +1397,7 @@ void sendBinaryFile()
|
|||
}
|
||||
const char *p = FSEL::select("ARQ file", "*", "");
|
||||
char cin;
|
||||
size_t txtsize, b64size;
|
||||
size_t b64size;
|
||||
string textin = "";
|
||||
string b64text;
|
||||
base64 b64(true);
|
||||
|
@ -1414,10 +1415,10 @@ void sendBinaryFile()
|
|||
while (textfile.get(cin))
|
||||
textin += cin;
|
||||
textfile.close();
|
||||
txtsize = textin.length();
|
||||
b64text = b64.encode(textin);
|
||||
b64size = b64text.length();
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%" PRIuSZ "\n", b64size);
|
||||
snprintf(sizemsg, sizeof(sizemsg), "ARQ:SIZE::%d\n",
|
||||
static_cast<int>(b64size));
|
||||
arqPayloadSize = b64size;
|
||||
blocksSent = 0;
|
||||
TX.append(sizemsg);
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#define TWOPI (2.0 * M_PI)
|
||||
|
||||
class modem {
|
||||
public:
|
||||
static double frequency;
|
||||
static double tx_frequency;
|
||||
static bool freqlock;
|
||||
protected:
|
||||
cMorse morse;
|
||||
trx_mode mode;
|
||||
|
@ -30,13 +34,10 @@ protected:
|
|||
bool reverse;
|
||||
int sigsearch;
|
||||
|
||||
bool freqlock;
|
||||
double bandwidth;
|
||||
double frequency;
|
||||
double freqerr;
|
||||
double rx_corr;
|
||||
double tx_corr;
|
||||
double tx_frequency;
|
||||
double PTTphaseacc;
|
||||
double PTTchannel[OUTBUFSIZE];
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
#include "icons.h"
|
||||
|
||||
#include "dl_fldigi/dl_fldigi.h"
|
||||
#include "nullmodem.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -230,6 +231,10 @@ void delayed_startup(void *)
|
|||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
// null_modem = new NULLMODEM;
|
||||
// active_modem = null_modem;
|
||||
active_modem = new NULLMODEM;
|
||||
|
||||
appname = argv[0];
|
||||
string appdir;
|
||||
string test_file_name;
|
||||
|
|
|
@ -75,9 +75,10 @@ void cLogfile::log_to_file(log_t type, const string& s)
|
|||
gmtime_r(&t, &tm);
|
||||
strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%MZ", &tm);
|
||||
char freq[20];
|
||||
snprintf(freq, sizeof(freq), "%" PRId64, wf->rfcarrier() + (wf->USB()
|
||||
? active_modem->get_freq()
|
||||
: -active_modem->get_freq()));
|
||||
snprintf(freq, sizeof(freq), "%d",
|
||||
static_cast<int>( wf->rfcarrier() +
|
||||
(wf->USB() ? active_modem->get_freq()
|
||||
: -active_modem->get_freq() ) ) );
|
||||
const char *logmode = mode_info[active_modem->get_mode()].adif_name;
|
||||
|
||||
fprintf(logfile, "%s %s : %s (%s): ", lognames[type], freq, logmode, timestr);
|
||||
|
|
|
@ -94,7 +94,7 @@ int RecordLoaderInterface::LoadAndRegister()
|
|||
}
|
||||
ifs.close();
|
||||
LOG_INFO( "Read:%s with %d records in %d seconds",
|
||||
filnam.c_str(), nbRec, (int)( time(NULL) - cntTim ) );
|
||||
filnam.c_str(), static_cast<int>(nbRec), static_cast<int>( time(NULL) - cntTim ) );
|
||||
return nbRec ;
|
||||
}
|
||||
|
||||
|
|
|
@ -692,18 +692,18 @@ public:
|
|||
|
||||
const NavtexRecord * ptrNavRec = NavtexCatalog::InstCatalog().FindStation(currFreq, m_origin, progdefaults.myLocator, *this );
|
||||
if( ptrNavRec != NULL ) {
|
||||
LOG_INFO("Locator=%s Origin=%c freq=%" PRId64 " name=%s lon=%lf lat=%lf",
|
||||
LOG_INFO("Locator=%s Origin=%c freq=%d name=%s lon=%lf lat=%lf",
|
||||
progdefaults.myLocator.c_str(),
|
||||
m_origin,
|
||||
currFreq,
|
||||
static_cast<int>(currFreq),
|
||||
ptrNavRec->name().c_str(),
|
||||
ptrNavRec->coordinates().longitude().angle(),
|
||||
ptrNavRec->coordinates().latitude().angle() );
|
||||
} else {
|
||||
LOG_INFO("Locator=%s Origin=%c freq=%" PRId64 " Navtex station not found",
|
||||
LOG_INFO("Locator=%s Origin=%c freq=%d Navtex station not found",
|
||||
progdefaults.myLocator.c_str(),
|
||||
m_origin,
|
||||
currFreq );
|
||||
static_cast<int>(currFreq) );
|
||||
}
|
||||
|
||||
if( progdefaults.NVTX_AdifLog ) {
|
||||
|
|
|
@ -111,7 +111,7 @@ cFreqControl::cFreqControl(int x, int y, int w, int h, const char *lbl):
|
|||
Digit[n]->labelcolor(ONCOLOR);
|
||||
Digit[n]->color(OFFCOLOR, SELCOLOR);
|
||||
Digit[n]->labelsize(fcHeight-4);
|
||||
Digit[n]->callback(cbSelectDigit, (void *) n);
|
||||
Digit[n]->callback(cbSelectDigit, reinterpret_cast<void *>(n) );
|
||||
mult[n] = max;
|
||||
max *= 10;
|
||||
}
|
||||
|
|
|
@ -387,7 +387,7 @@ long long rigCAT_getfreq(int retries, bool &failed)
|
|||
if (len2) {
|
||||
for (size_t i = 0; i < len2; i++)
|
||||
if ((char)rTemp.str2[i] != (char)replybuff[p + i]) {
|
||||
LOG_VERBOSE("failed post data string test @ %" PRIuSZ, i);
|
||||
LOG_VERBOSE("failed post data string test @ %d", static_cast<int>(i));
|
||||
goto retry_get_freq;
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ long long rigCAT_getfreq(int retries, bool &failed)
|
|||
f = fm_freqdata(rTemp.data, pData);
|
||||
if ( f >= rTemp.data.min && f <= rTemp.data.max)
|
||||
return f;
|
||||
LOG_VERBOSE("freq: %" PRId64, f);
|
||||
LOG_VERBOSE("freq: %d", static_cast<int>(f));
|
||||
retry_get_freq: ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,9 +43,11 @@
|
|||
#include "fileselect.h"
|
||||
#include "confdialog.h"
|
||||
|
||||
#include "icons.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
//#define DEBUGXML
|
||||
//#define DEBUGXML 1
|
||||
|
||||
void parseRIGDEF(size_t &);
|
||||
void parseRIG(size_t &);
|
||||
|
@ -59,7 +61,6 @@ void parseMODECMD(size_t &);
|
|||
void parseMODEREPLY(size_t &);
|
||||
void parseTITLE(size_t &);
|
||||
void parseLSBMODES(size_t &);
|
||||
void parseCOMMENTS(size_t &);
|
||||
void parseDISCARD(size_t &);
|
||||
|
||||
void parseWRITE_DELAY(size_t &);
|
||||
|
@ -130,7 +131,6 @@ TAGS rigdeftags[] = {
|
|||
{"<MODE-REPLY", parseMODEREPLY},
|
||||
{"<TITLE", parseTITLE},
|
||||
{"<LSBMODES", parseLSBMODES},
|
||||
{"<!--", parseCOMMENTS},
|
||||
{"<PROGRAMMER", parseDISCARD},
|
||||
{"<STATUS", parseDISCARD},
|
||||
{"<WRITE_DELAY", parseWRITE_DELAY},
|
||||
|
@ -197,7 +197,7 @@ void print(size_t &p0, int indent)
|
|||
#ifdef DEBUGXML
|
||||
std::string istr(indent, '\t');
|
||||
size_t tend = strXML.find(">", p0);
|
||||
LOG_VERBOSE("%s%s", istr.c_str(), strXML.substr(p0, tend - p0 + 1).c_str());
|
||||
LOG_INFO("%s%s", istr.c_str(), strXML.substr(p0, tend - p0 + 1).c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -433,38 +433,50 @@ void parseBWdefs(size_t &p0, list<BW> &lbw)
|
|||
string strELEMENT;
|
||||
string stemp;
|
||||
if (pend == string::npos) {
|
||||
LOG_ERROR("Unmatched tag %s", strXML.substr(p0, 10).c_str());
|
||||
p0++;
|
||||
return;
|
||||
}
|
||||
print(p0,0);
|
||||
p0 = nextTag(p0);
|
||||
while (p0 != string::npos && p0 < pend && tagIs(p0, "<ELEMENT")) {
|
||||
elend = tagEnd(p0);
|
||||
p0 = nextTag(p0);
|
||||
if (isSymbol(p0, strELEMENT)) {
|
||||
p0 = tagEnd(p0);
|
||||
p0 = nextTag(p0);
|
||||
while (p0 != string::npos && p0 < elend) {
|
||||
print(p0,1);
|
||||
if ( isBytes(p0, stemp) ) {
|
||||
size_t p1 = nextTag(p0);
|
||||
while (p1 != string::npos && p1 < pend && tagIs(p1, "<ELEMENT")) {
|
||||
elend = tagEnd(p1);
|
||||
if (elend == string::npos || elend > pend) {
|
||||
LOG_ERROR("Unmatched tag %s", "<ELEMENT");
|
||||
p0 = pend;
|
||||
return;
|
||||
}
|
||||
p1 = nextTag(p1);
|
||||
if (isSymbol(p1, strELEMENT)) {
|
||||
p1 = tagEnd(p1);
|
||||
p1 = nextTag(p1);
|
||||
while (p1 != string::npos && p1 < elend) {
|
||||
print(p1,1);
|
||||
if ( isBytes(p1, stemp) ) {
|
||||
lbw.push_back(BW(strELEMENT,stemp));
|
||||
p1 = tagEnd(p1);
|
||||
}
|
||||
else if ( isByte(p0, ch) ) {
|
||||
else if ( isByte(p1, ch) ) {
|
||||
stemp = ch;
|
||||
lbw.push_back(BW(strELEMENT,stemp));
|
||||
p1 = tagEnd(p1);
|
||||
}
|
||||
else if ( isInt(p0, n) ) {
|
||||
else if ( isInt(p1, n) ) {
|
||||
stemp = (char)(n & 0xFF);
|
||||
lbw.push_back(BW(strELEMENT, stemp));
|
||||
p1 = tagEnd(p1);
|
||||
}
|
||||
else if ( isString(p0, stemp) ) {
|
||||
else if ( isString(p1, stemp) ) {
|
||||
lbw.push_back(BW(strELEMENT,stemp));
|
||||
p1 = tagEnd(p1);
|
||||
} else {
|
||||
LOG_ERROR("Invalid tag: %s", strXML.substr(p1, 10).c_str());
|
||||
parseDISCARD(p1);
|
||||
}
|
||||
p0 = tagEnd(p0);
|
||||
p0 = nextTag(p0);
|
||||
p1 = nextTag(p1);
|
||||
}
|
||||
}
|
||||
p0 = nextTag(p0);
|
||||
p1 = nextTag(p1);
|
||||
}
|
||||
p0 = pend;
|
||||
}
|
||||
|
@ -722,15 +734,18 @@ void parseIOSdata(size_t &p0)
|
|||
while (p1 < pend) {
|
||||
pv = datatags;
|
||||
while (pv->tag) {
|
||||
if (strXML.find(pv->tag, p1) == p1) {
|
||||
print(p1, 1);
|
||||
if (pv->fp)
|
||||
(pv->fp)(p1);
|
||||
if (strXML.find(pv->tag, p1) == p1)
|
||||
break;
|
||||
}
|
||||
pv++;
|
||||
}
|
||||
p1 = tagEnd(p1);
|
||||
if (pv->fp) {
|
||||
print(p1, 1);
|
||||
(pv->fp)(p1);
|
||||
p1 = tagEnd(p1);
|
||||
} else {
|
||||
LOG_ERROR("Invalid tag: %s", strXML.substr(p1, 10).c_str());
|
||||
parseDISCARD(p1);
|
||||
}
|
||||
p1 = nextTag(p1);
|
||||
}
|
||||
}
|
||||
|
@ -786,17 +801,19 @@ bool parseIOS(size_t &p0, TAGS *valid)
|
|||
while (p1 < pend) {
|
||||
pv = valid;
|
||||
while (pv->tag) {
|
||||
if (strXML.find(pv->tag, p1) == p1) {
|
||||
print(p1, 1);
|
||||
if (pv->fp)
|
||||
(pv->fp)(p1);
|
||||
if (strXML.find(pv->tag, p1) == p1)
|
||||
break;
|
||||
}
|
||||
pv++;
|
||||
}
|
||||
p1 = tagEnd(p1);
|
||||
if (pv->fp) {
|
||||
print(p1, 1);
|
||||
(pv->fp)(p1);
|
||||
p1 = tagEnd(p1);
|
||||
} else {
|
||||
LOG_ERROR("Invalid tag: %s", strXML.substr(p1, 10).c_str());
|
||||
parseDISCARD(p1);
|
||||
}
|
||||
p1 = nextTag(p1);
|
||||
// if (pv->tag == 0) p1 = pend;
|
||||
}
|
||||
p0 = pend;
|
||||
return (!iosTemp.SYMBOL.empty());
|
||||
|
@ -814,14 +831,12 @@ void parseREPLY(size_t &p0)
|
|||
reply.push_back(iosTemp);
|
||||
}
|
||||
|
||||
void parseCOMMENTS(size_t &p0)
|
||||
{
|
||||
p0 = strXML.find("-->",p0);
|
||||
}
|
||||
|
||||
void parseRIGDEF(size_t &p0)
|
||||
{
|
||||
p0 = nextTag(p0);
|
||||
print(p0,0);
|
||||
size_t p1 = tagEnd(p0);
|
||||
if (p1 != string::npos)
|
||||
strXML.erase(p1);
|
||||
}
|
||||
|
||||
void parseDISCARD(size_t &p0)
|
||||
|
@ -833,10 +848,10 @@ void parseDISCARD(size_t &p0)
|
|||
|
||||
void parseXML()
|
||||
{
|
||||
size_t p0;
|
||||
p0 = 0;
|
||||
p0 = nextTag(p0);
|
||||
TAGS *pValid;
|
||||
size_t p0 = 0;
|
||||
TAGS *pValid = rigdeftags;
|
||||
|
||||
p0 = strXML.find("<");
|
||||
while (p0 != string::npos) {
|
||||
pValid = rigdeftags;
|
||||
while (pValid->tag) {
|
||||
|
@ -844,14 +859,44 @@ void parseXML()
|
|||
break;
|
||||
pValid++;
|
||||
}
|
||||
if (pValid->tag)
|
||||
if (pValid->tag) {
|
||||
(pValid->fp)(p0);
|
||||
else
|
||||
} else {
|
||||
LOG_ERROR("Invalid tag: %s", strXML.substr(p0, 10).c_str());
|
||||
parseDISCARD(p0);
|
||||
}
|
||||
p0 = nextTag(p0);
|
||||
}
|
||||
}
|
||||
|
||||
bool remove_comments()
|
||||
{
|
||||
size_t p0 = 0;
|
||||
size_t p1 = 0;
|
||||
|
||||
// remove comments from xml text
|
||||
while ((p0 = strXML.find("<!--")) != string::npos) {
|
||||
p1 = strXML.find("-->", p0);
|
||||
if (p1 == string::npos) {
|
||||
fl_alert2("Corrupt rig XML defintion file\nMismatched comment tags!");
|
||||
return false;
|
||||
}
|
||||
strXML.erase(p0, p1 - p0 + 3);
|
||||
}
|
||||
if (strXML.find("-->") != string::npos) {
|
||||
fl_alert2("Corrupt rig XML defintion file\nMismatched comment tags!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool testXML()
|
||||
{
|
||||
if (!remove_comments()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool readRigXML()
|
||||
{
|
||||
char szLine[256];
|
||||
|
@ -877,8 +922,10 @@ bool readRigXML()
|
|||
strXML.append(szLine);
|
||||
}
|
||||
xmlfile.close();
|
||||
parseXML();
|
||||
return true;
|
||||
if (testXML()) {
|
||||
parseXML();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -404,8 +404,9 @@ void pskrep::append(string call, const char* loc, long long freq, trx_mode mode,
|
|||
band_map_t& bandq = queue[call][band(freq)];
|
||||
if (bandq.empty() || rtime - bandq.back().rtime >= DUP_INTERVAL) { // add new
|
||||
bandq.push_back(rcpt_report_t(mode, freq, rtime, rtype, loc));
|
||||
LOG_VERBOSE("Added (call=\"%s\", loc=\"%s\", mode=\"%s\", freq=%" PRId64 ", time=%" PRIdMAX ", type=%u)",
|
||||
call.c_str(), loc, mode_info[mode].adif_name, freq, (intmax_t)rtime, rtype);
|
||||
LOG_VERBOSE("Added (call=\"%s\", loc=\"%s\", mode=\"%s\", freq=%d, time=%" PRIdMAX ", type=%u)",
|
||||
call.c_str(), loc, mode_info[mode].adif_name,
|
||||
static_cast<int>(freq), (intmax_t)rtime, rtype);
|
||||
new_count++;
|
||||
save_queue();
|
||||
}
|
||||
|
@ -414,8 +415,10 @@ void pskrep::append(string call, const char* loc, long long freq, trx_mode mode,
|
|||
if (r.status != PSKR_STATUS_SENT && *loc && r.locator != loc) { // update last
|
||||
r.locator = loc;
|
||||
r.rtype = rtype;
|
||||
LOG_VERBOSE("Updated (call=\"%s\", loc=\"%s\", mode=\"%s\", freq=%" PRId64 ", time=%" PRIdMAX ", type=%u)",
|
||||
call.c_str(), loc, mode_info[r.mode].adif_name, r.freq, (intmax_t)r.rtime, rtype);
|
||||
LOG_VERBOSE("Updated (call=\"%s\", loc=\"%s\", mode=\"%s\", freq=%d, time=%d, type=%u)",
|
||||
call.c_str(), loc, mode_info[r.mode].adif_name,
|
||||
static_cast<int>(r.freq),
|
||||
static_cast<int>(r.rtime), rtype);
|
||||
save_queue();
|
||||
}
|
||||
}
|
||||
|
@ -732,8 +735,10 @@ bool pskrep_sender::append(const string& callsign, const band_map_t::value_type&
|
|||
return false;
|
||||
|
||||
|
||||
LOG_INFO("Appending report (call=%s mode=%s freq=%" PRId64 " time=%" PRIdMAX " type=%u)",
|
||||
callsign.c_str(), mode_info[r.mode].adif_name, r.freq, (intmax_t)r.rtime, r.rtype);
|
||||
LOG_INFO("Appending report (call=%s mode=%s freq=%d time=%d type=%u)",
|
||||
callsign.c_str(), mode_info[r.mode].adif_name,
|
||||
static_cast<int>(r.freq),
|
||||
static_cast<int>(r.rtime), r.rtype);
|
||||
|
||||
unsigned char* start = dgram + dgram_size;
|
||||
unsigned char* p = start;
|
||||
|
|
|
@ -5204,7 +5204,8 @@ class synop_impl
|
|||
// Quick check if the message is very short. Beware, it it the total
|
||||
// number of tokens, not the number of sections.
|
||||
if(m_nbTokens <= 2 ) {
|
||||
LOG_DEBUG("No publish1 m_nbTokens=%d:%s",m_nbTokens, TstToStr().c_str() );
|
||||
LOG_DEBUG("No publish1 m_nbTokens=%d:%s",
|
||||
static_cast<int>(m_nbTokens), TstToStr().c_str() );
|
||||
return ;
|
||||
}
|
||||
|
||||
|
|
|
@ -175,24 +175,26 @@ modem *wwv_modem = 0;
|
|||
modem *anal_modem = 0;
|
||||
modem *ssb_modem = 0;
|
||||
|
||||
double modem::frequency = 1000;
|
||||
double modem::tx_frequency = 1000;
|
||||
bool modem::freqlock = false;
|
||||
|
||||
modem::modem()
|
||||
{
|
||||
scptr = 0;
|
||||
freqlock = false;
|
||||
frequency = 1000.0;
|
||||
|
||||
if(progdefaults.retain_freq_lock) {
|
||||
if(active_modem) {
|
||||
frequency = active_modem->get_freq();
|
||||
tx_frequency = active_modem->get_txfreq();
|
||||
freqlock = active_modem->freqlocked();
|
||||
}
|
||||
if( !progdefaults.retain_freq_lock ) {
|
||||
freqlock = false;
|
||||
frequency = tx_frequency = 1000;
|
||||
}
|
||||
|
||||
sigsearch = 0;
|
||||
bool wfrev = wf->Reverse();
|
||||
bool wfsb = wf->USB();
|
||||
reverse = wfrev ^ !wfsb;
|
||||
if (wf) {
|
||||
bool wfrev = wf->Reverse();
|
||||
bool wfsb = wf->USB();
|
||||
reverse = wfrev ^ !wfsb;
|
||||
} else
|
||||
reverse = false;
|
||||
historyON = false;
|
||||
cap = CAP_RX | CAP_TX;
|
||||
PTTphaseacc = 0.0;
|
||||
|
@ -204,6 +206,9 @@ modem::modem()
|
|||
// modem types CW and RTTY do not use the base init()
|
||||
void modem::init()
|
||||
{
|
||||
stopflag = false;
|
||||
if (!wf) return;
|
||||
|
||||
bool wfrev = wf->Reverse();
|
||||
bool wfsb = wf->USB();
|
||||
reverse = wfrev ^ !wfsb;
|
||||
|
@ -217,7 +222,6 @@ void modem::init()
|
|||
#endif
|
||||
} else
|
||||
set_freq(wf->Carrier());
|
||||
stopflag = false;
|
||||
}
|
||||
|
||||
double modem::track_freq(double freq)
|
||||
|
@ -286,7 +290,10 @@ void modem::set_bandwidth(double bw)
|
|||
|
||||
void modem::set_reverse(bool on)
|
||||
{
|
||||
reverse = on ^ (!wf->USB());
|
||||
if (likely(wf))
|
||||
reverse = on ^ (!wf->USB());
|
||||
else
|
||||
reverse = false;
|
||||
}
|
||||
|
||||
void modem::set_metric(double m)
|
||||
|
@ -437,6 +444,8 @@ void modem::s2nreport(void)
|
|||
|
||||
void modem::ModulateXmtr(double *buffer, int len)
|
||||
{
|
||||
if (unlikely(!scard)) return;
|
||||
|
||||
if (progdefaults.PTTrightchannel) {
|
||||
for (int i = 0; i < len; i++)
|
||||
PTTchannel[i] = PTTnco();
|
||||
|
@ -472,6 +481,8 @@ void modem::ModulateXmtr(double *buffer, int len)
|
|||
using namespace std;
|
||||
void modem::ModulateStereo(double *left, double *right, int len)
|
||||
{
|
||||
if (unlikely(!scard)) return;
|
||||
|
||||
if (progdefaults.viewXmtSignal)
|
||||
trx_xmit_wfall_queue(samplerate, left, (size_t)len);
|
||||
|
||||
|
@ -785,9 +796,9 @@ void modem::wfid_sendchars(string s)
|
|||
|
||||
void modem::pretone()
|
||||
{
|
||||
int sr = active_modem->get_samplerate();
|
||||
int sr = get_samplerate();
|
||||
int symlen = sr / 10;
|
||||
double phaseincr = 2.0 * M_PI * active_modem->get_txfreq() / sr;
|
||||
double phaseincr = 2.0 * M_PI * get_txfreq() / sr;
|
||||
double phase = 0.0;
|
||||
double outbuf[symlen];
|
||||
|
||||
|
@ -796,7 +807,7 @@ void modem::pretone()
|
|||
phase += phaseincr;
|
||||
if (phase > 2.0 * M_PI) phase -= 2.0 * M_PI;
|
||||
}
|
||||
active_modem->ModulateXmtr(outbuf, symlen);
|
||||
ModulateXmtr(outbuf, symlen);
|
||||
|
||||
for (int i = 0; i < progdefaults.pretone * 10 - 2; i++) {
|
||||
for (int j = 0; j < symlen; j++) {
|
||||
|
@ -804,7 +815,7 @@ void modem::pretone()
|
|||
phase += phaseincr;
|
||||
if (phase > 2.0 * M_PI) phase -= 2.0 * M_PI;
|
||||
}
|
||||
active_modem->ModulateXmtr(outbuf, symlen);
|
||||
ModulateXmtr(outbuf, symlen);
|
||||
}
|
||||
|
||||
for (int j = 0; j < symlen; j++) {
|
||||
|
@ -812,10 +823,10 @@ void modem::pretone()
|
|||
phase += phaseincr;
|
||||
if (phase > 2.0 * M_PI) phase -= 2.0 * M_PI;
|
||||
}
|
||||
active_modem->ModulateXmtr(outbuf, symlen);
|
||||
ModulateXmtr(outbuf, symlen);
|
||||
|
||||
memset(outbuf, 0, symlen * sizeof(*outbuf));
|
||||
active_modem->ModulateXmtr(outbuf, symlen);
|
||||
ModulateXmtr(outbuf, symlen);
|
||||
|
||||
}
|
||||
|
||||
|
@ -847,8 +858,8 @@ void modem::wfid_text(const string& s)
|
|||
vidwidth = 500 / (TONESPACING * (NUMCOLS + CHARSPACE));
|
||||
}
|
||||
if (progdefaults.vidmodelimit) {
|
||||
if ((vidwidth * TONESPACING * (NUMCOLS + CHARSPACE)) > active_modem->get_bandwidth())
|
||||
vidwidth = (int)ceil(active_modem->get_bandwidth() / (TONESPACING * (NUMCOLS + CHARSPACE)));
|
||||
if ((vidwidth * TONESPACING * (NUMCOLS + CHARSPACE)) > get_bandwidth())
|
||||
vidwidth = (int)ceil(get_bandwidth() / (TONESPACING * (NUMCOLS + CHARSPACE)));
|
||||
}
|
||||
|
||||
put_status(video.c_str());
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
|
||||
#define null_bw 1
|
||||
|
||||
// a NULLMODEM and will be instantiated before the dynamic member wf,
|
||||
// digiscope, and fl_digi_main, the main dialog
|
||||
|
||||
NULLMODEM:: NULLMODEM() : modem()
|
||||
{
|
||||
mode = MODE_NULL;
|
||||
|
@ -50,19 +53,21 @@ void NULLMODEM::tx_init(SoundBase *sc)
|
|||
|
||||
void NULLMODEM::rx_init()
|
||||
{
|
||||
put_MODEstatus(mode);
|
||||
if (fl_digi_main)
|
||||
put_MODEstatus(mode);
|
||||
}
|
||||
|
||||
void NULLMODEM::init()
|
||||
{
|
||||
modem::init();
|
||||
rx_init();
|
||||
digiscope->mode(Digiscope::SCOPE);
|
||||
if (digiscope)
|
||||
digiscope->mode(Digiscope::SCOPE);
|
||||
}
|
||||
|
||||
void NULLMODEM::restart()
|
||||
{
|
||||
set_bandwidth(null_bw);
|
||||
if (wf) set_bandwidth(null_bw);
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,9 +88,12 @@ int NULLMODEM::rx_process(const double *buf, int len)
|
|||
int NULLMODEM::tx_process()
|
||||
{
|
||||
MilliSleep(10);
|
||||
if (!fl_digi_main) return 0;
|
||||
|
||||
if ( get_tx_char() == GET_TX_CHAR_ETX || stopflag) {
|
||||
stopflag = false;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "ringbuffer.h"
|
||||
#include "qrunner.h"
|
||||
#include "debug.h"
|
||||
#include "nullmodem.h"
|
||||
|
||||
#if BENCHMARK_MODE
|
||||
# include "benchmark.h"
|
||||
|
|
|
@ -847,7 +847,8 @@ public:
|
|||
/// If the delay is exceeded, returns with an error message.
|
||||
std::string send_file( const std::string & filnam, double max_seconds )
|
||||
{
|
||||
LOG_INFO("%s rf_carried=%" PRId64 " carrier=%d", filnam.c_str(), wf->rfcarrier(), m_carrier );
|
||||
LOG_INFO("%s rf_carried=%d carrier=%d", filnam.c_str(),
|
||||
static_cast<int>(wf->rfcarrier()), m_carrier );
|
||||
|
||||
bool is_acquired = transmit_lock_acquire(filnam, max_seconds);
|
||||
if( ! is_acquired ) return "Timeout sending " + filnam ;
|
||||
|
@ -1238,8 +1239,8 @@ public:
|
|||
{
|
||||
/// Displays the messages once only.
|
||||
if( total_img_rows != 0 ) {
|
||||
LOG_INFO("Setting m_carrier=%d curr_rfcarr=%" PRId64 " total_img_rows=%d",
|
||||
m_carrier, curr_rfcarr, total_img_rows );
|
||||
LOG_INFO("Setting m_carrier=%d curr_rfcarr=%d total_img_rows=%d",
|
||||
m_carrier, static_cast<int>(curr_rfcarr), total_img_rows );
|
||||
}
|
||||
total_img_rows = 0 ;
|
||||
stable_carrier = m_carrier ;
|
||||
|
@ -1681,14 +1682,14 @@ std::string fax_implementation::generate_filename( const char *extra_msg ) const
|
|||
char buf_fil_nam[256] ;
|
||||
long long tmp_fl = wf->rfcarrier() ;
|
||||
snprintf( buf_fil_nam, sizeof(buf_fil_nam),
|
||||
"wefax_%04d%02d%02d_%02d%02d%02d_%" PRId64 "_%s.png",
|
||||
"wefax_%04d%02d%02d_%02d%02d%02d_%d_%s.png",
|
||||
1900 + tmp_tm.tm_year,
|
||||
1 + tmp_tm.tm_mon,
|
||||
tmp_tm.tm_mday,
|
||||
tmp_tm.tm_hour,
|
||||
tmp_tm.tm_min,
|
||||
tmp_tm.tm_sec,
|
||||
tmp_fl,
|
||||
static_cast<int>(tmp_fl),
|
||||
extra_msg );
|
||||
|
||||
return buf_fil_nam ;
|
||||
|
|
Ładowanie…
Reference in New Issue