Conflicts:
	src/filters/fftfilt.cxx
pull/1/head
James Coxon 2015-08-23 13:56:08 +01:00
commit bb2cbd72dc
42 zmienionych plików z 2125 dodań i 1305 usunięć

Wyświetl plik

@ -1,5 +1,45 @@
2013-10-30 David Freese <w1hkj@w1hkj.com>
2014-01-28 Kamal Mostafa <kamal@whence.com>
58aeb6a: Avoid nitems fltk kfreebsd collision
2014-01-13 David Freese <w1hkj@w1hkj.com>
3b9ace3: modem timing test
1af2407: XMLRPC seg fault
2817731: Mailing address
2014-01-11 John Phelps <kl4yfd@gmail.com>
aad3a84: 64 bit stacktrace
2014-01-11 David Freese <w1hkj@w1hkj.com>
b778b42: Developer update
440c65f: CW timing
=Version 3.21.78=
05e0bfc: SKED macro
52ba259: FreeBSD issues
c0ba6f8: WF max size
4e085ba: PSKR softbits
2013-11-09 Andrej Lajovic <s57ln@hamradio.si>
0621261: CharsetDistiller
8f5640b: UTF-8
2013-11-08 Arvo Järve <arvo@softshark.ee>
3425ce0: RigCAT close
74c6533: Save Wordwrap
2013-11-05 David Freese <w1hkj@w1hkj.com>
0d1a309: ARQ timeouts
eeacf5e: Deutsch
c474790: DTMF
1cca53a: WF latency

Wyświetl plik

@ -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, [.77])
m4_define(FLDIGI_PATCH, [.78])
m4_define(FLARQ_MAJOR, [4])
m4_define(FLARQ_MINOR, [3])
m4_define(FLARQ_PATCH, [.4])

1773
po/de.po

Plik diff jest za duży Load Diff

Wyświetl plik

@ -48,6 +48,7 @@
#include "status.h"
#include "debug.h"
#include "FTextRXTX.h"
#include "modem.h"
#include "qrunner.h"
@ -181,6 +182,10 @@ void cw::tx_init(SoundBase *sc)
phaseacc = 0;
lastsym = 0;
qskphase = 0;
symbols = 0;
acc_symbols = 0;
ovhd_symbols = 0;
}
void cw::rx_init()
@ -259,8 +264,8 @@ cw::cw() : modem()
cw_noise_spike_threshold = cw_adaptive_receive_threshold / 4;
cw_send_dot_length = DOT_MAGIC / cw_send_speed;
cw_send_dash_length = 3 * cw_send_dot_length;
symbollen = (int)(samplerate * 1.2 / progdefaults.CWspeed);
fsymlen = (int)(samplerate * 1.2 / progdefaults.CWfarnsworth);
symbollen = (int)round(samplerate * 1.2 / progdefaults.CWspeed);
fsymlen = (int)round(samplerate * 1.2 / progdefaults.CWfarnsworth);
memset(rx_rep_buf, 0, sizeof(rx_rep_buf));
@ -353,8 +358,8 @@ void cw::reset_rx_filter()
cw_noise_spike_threshold = cw_adaptive_receive_threshold / 4;
cw_send_dot_length = DOT_MAGIC / cw_send_speed;
cw_send_dash_length = 3 * cw_send_dot_length;
symbollen = (int)(samplerate * 1.2 / progdefaults.CWspeed);
fsymlen = (int)(samplerate * 1.2 / progdefaults.CWfarnsworth);
symbollen = (int)round(samplerate * 1.2 / progdefaults.CWspeed);
fsymlen = (int)round(samplerate * 1.2 / progdefaults.CWfarnsworth);
phaseacc = 0.0;
FFTphase = 0.0;
@ -393,8 +398,8 @@ void cw::sync_parameters()
cw_send_dash_length = 3 * cw_send_dot_length;
nusymbollen = (int)(samplerate * 1.2 / wpm);
nufsymlen = (int)(samplerate * 1.2 / fwpm);
nusymbollen = (int)round(samplerate * 1.2 / wpm);
nufsymlen = (int)round(samplerate * 1.2 / fwpm);
if (symbollen != nusymbollen ||
nufsymlen != fsymlen ||
@ -950,6 +955,8 @@ void cw::send_symbol(int bits, int len)
float dsymlen = 0.0;
int currsym = bits & 1;
acc_symbols += len;
freq = get_txfreq_woffset();
delta = (int) (len * (progdefaults.CWweight - 50) / 100.0);
@ -1191,11 +1198,20 @@ int cw::tx_process()
c = get_tx_char();
if (c == GET_TX_CHAR_ETX || stopflag) {
send_symbol(0, symbollen);
stopflag = false;
return -1;
}
acc_symbols = 0;
send_ch(c);
xmt_samples = char_samples = acc_symbols;
printf("%5s %d samples, overhead %d, %f sec's\n",
ascii3[c & 0xff],
char_samples,
ovhd_samples,
1.0 * char_samples / samplerate);
return 0;
}

Wyświetl plik

@ -3,7 +3,7 @@
//
// Copyright (C) 2012
// Dave Freese, W1HKJ
// Stefan Fendt, DO2SMF
// Stefan Fendt, DL1SMF
//
// This file is part of fldigi.
//
@ -46,6 +46,7 @@ using namespace std;
#include "debug.h"
#include "synop.h"
#include "main.h"
#include "modem.h"
#include "dl_fldigi/hbtint.h"
@ -89,6 +90,10 @@ void rtty::tx_init(SoundBase *sc)
phaseacc = 0;
preamble = true;
videoText();
symbols = 0;
acc_symbols = 0;
ovhd_symbols = 0;
}
// Customizes output of Synop decoded data.
@ -276,7 +281,8 @@ void rtty::restart()
snprintf(msg1, sizeof(msg1), "%-4.2f/%-4.0f", rtty_baud, rtty_shift);
put_Status1(msg1);
put_MODEstatus(mode);
for (int i = 0; i < MAXPIPE; i++) QI[i].real() = QI[i].imag() = 0.0;
for (int i = 0; i < MAXPIPE; i++)
QI[i] = cmplx(0.0, 0.0);
sigpwr = 0.0;
noisepwr = 0.0;
sigsearch = 0;
@ -633,7 +639,6 @@ double value;
if (snum < 2 * filter_length) {
frequency = 1000.0;
ook(snum);
// z.real() = z.imag() = (snum/symbollen % 2 == 0) ? 1.0 : 0.0;
z = complex(value, value);
ook_signal << snum << "," << z.real() << ",";
// snum++;
@ -752,17 +757,23 @@ if (mnum < 2 * filter_length)
//----------------------------------------------------------------------
// get the baseband-signal and...
xy.real() = zp_mark[i].real() * cos(xy_phase) + zp_mark[i].imag() * sin(xy_phase);
xy.imag() = zp_space[i].real() * cos(xy_phase) + zp_space[i].imag() * sin(xy_phase);
xy = cmplx(
zp_mark[i].real() * cos(xy_phase) + zp_mark[i].imag() * sin(xy_phase),
zp_space[i].real() * cos(xy_phase) + zp_space[i].imag() * sin(xy_phase) );
// if mark-tone has a higher magnitude than the space-tone,
// further reduce the scope's space-amplitude and vice versa
// this makes the scope looking a little bit nicer, too...
// aka: less noisy...
if( abs(zp_mark[i]) > abs(zp_space[i]) ) {
xy.imag() *= abs(zp_space[i])/abs(zp_mark[i]);
// note ox x complex lib does not support xy.real(double) or xy.imag(double)
xy = cmplx( xy.real(),
xy.imag() * abs(zp_space[i])/abs(zp_mark[i]) );
// xy.imag() *= abs(zp_space[i])/abs(zp_mark[i]);
} else {
xy.real() /= abs(zp_space[i])/abs(zp_mark[i]);
xy = cmplx( xy.real() / ( abs(zp_space[i])/abs(zp_mark[i]) ),
xy.imag() );
// xy.real() /= abs(zp_space[i])/abs(zp_mark[i]);
}
// now normalize the scope
@ -839,7 +850,8 @@ if (mnum < 2 * filter_length)
if (clear_zdata) {
clear_zdata = false;
Clear_syncscope();
for (int i = 0; i < MAXPIPE; i++) QI[i].real() = QI[i].imag() = 0.0;
for (int i = 0; i < MAXPIPE; i++)
QI[i] = cmplx(0.0, 0.0);
}
}
if (!--showxy) {
@ -883,6 +895,7 @@ double rtty::FSKnco()
void rtty::send_symbol(int symbol, int len)
{
acc_symbols += len;
#if 0
double freq;
@ -1090,7 +1103,16 @@ int rtty::tx_process()
// if NOT Baudot
if (nbits != 5) {
///
acc_symbols = 0;
send_char(c);
xmt_samples = char_samples = acc_symbols;
printf("%5s %d samples, overhead %d, %f sec's\n",
ascii3[c & 0xff],
char_samples,
ovhd_samples,
1.0 * char_samples / samplerate);
return 0;
}
@ -1148,8 +1170,16 @@ int rtty::tx_process()
txmode = FIGURES;
}
}
///
acc_symbols = 0;
send_char(c & 0x1F);
xmt_samples = char_samples = acc_symbols;
printf("%5s %d samples, overhead %d, %f sec's\n",
ascii3[c & 0xff],
char_samples,
ovhd_samples,
1.0 * char_samples / samplerate);
return 0;
}

Wyświetl plik

@ -4653,6 +4653,13 @@ inpQRZuserpassword->redraw();
o->label((inpQRZuserpassword->type() & FL_SECRET_INPUT) ? "Show" : "Hide");
}
Fl_Check_Button *btn_notes_address=(Fl_Check_Button *)0;
static void cb_btn_notes_address(Fl_Check_Button* o, void*) {
progdefaults.notes_address = o->value();
progdefaults.changed = true;
}
Fl_Input2 *inpEQSL_id=(Fl_Input2 *)0;
static void cb_inpEQSL_id(Fl_Input2* o, void*) {
@ -5363,6 +5370,7 @@ Fl_Double_Window* ConfigureDialog() {
{ tabsUI = new Fl_Tabs(0, 25, 540, 346);
tabsUI->selection_color(FL_LIGHT1);
{ tabBrowser = new Fl_Group(0, 50, 540, 320, _("Browser"));
tabBrowser->hide();
{ Fl_Group* o = new Fl_Group(24, 59, 496, 300);
o->box(FL_ENGRAVED_FRAME);
{ Fl_Spinner2* o = cntChannels = new Fl_Spinner2(40, 69, 50, 24, _("Channels, first channel starts at waterfall lower limit"));
@ -5750,7 +5758,6 @@ ndow decoration close button pressed."));
tabUserInterface->end();
} // Fl_Group* tabUserInterface
{ tabLogServer = new Fl_Group(0, 50, 540, 320, _("Logging"));
tabLogServer->hide();
{ Fl_Group* o = new Fl_Group(25, 313, 496, 55, _("Client/Server Logbook"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
@ -6681,7 +6688,7 @@ ab and newline are automatically included."));
cntrWfheight->labelsize(14);
cntrWfheight->labelcolor(FL_FOREGROUND_COLOR);
cntrWfheight->minimum(100);
cntrWfheight->maximum(160);
cntrWfheight->maximum(250);
cntrWfheight->step(5);
cntrWfheight->value(120);
cntrWfheight->callback((Fl_Callback*)cb_cntrWfheight);
@ -8923,7 +8930,7 @@ nce.\nYou may change the state from either location.\n..."));
mnuWavSampleRate->down_box(FL_BORDER_BOX);
mnuWavSampleRate->callback((Fl_Callback*)cb_mnuWavSampleRate);
mnuWavSampleRate->align(Fl_Align(FL_ALIGN_TOP_LEFT));
o->add("22050|24000|44100|48000");
o->add("8000|11025|16000|22050|24000|44100|48000");
o->value(progdefaults.wavSampleRate);
} // Fl_Choice* mnuWavSampleRate
tabWavFile->end();
@ -9555,7 +9562,7 @@ igured on the\n\"Notifications\" configure dialog."));
{ tabDTMF = new Fl_Group(0, 50, 540, 320, _("DTMF"));
tabDTMF->hide();
{ Fl_Check_Button* o = chkDTMFdecode = new Fl_Check_Button(187, 103, 175, 20, _("Decode DTMF tones"));
chkDTMFdecode->tooltip(_("Send rx text to file: textout.txt"));
chkDTMFdecode->tooltip(_("Decode received DTMF tones"));
chkDTMFdecode->down_box(FL_DOWN_BOX);
chkDTMFdecode->callback((Fl_Callback*)cb_chkDTMFdecode);
o->value(progdefaults.DTMFdecode);
@ -9777,7 +9784,7 @@ and restarted if needed."));
{ Fl_Group* o = new Fl_Group(27, 176, 490, 190, _("Data base lookup"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
{ Fl_Round_Button* o = btnQRZXMLnotavailable = new Fl_Round_Button(49, 199, 337, 20, _("None"));
{ Fl_Round_Button* o = btnQRZXMLnotavailable = new Fl_Round_Button(49, 199, 64, 20, _("None"));
btnQRZXMLnotavailable->tooltip(_("Do not use callsign database"));
btnQRZXMLnotavailable->down_box(FL_DOWN_BOX);
btnQRZXMLnotavailable->value(1);
@ -9864,6 +9871,11 @@ and restarted if needed."));
btnQRZpasswordShow->tooltip(_("Show password in plain text"));
btnQRZpasswordShow->callback((Fl_Callback*)cb_btnQRZpasswordShow);
} // Fl_Button* btnQRZpasswordShow
{ Fl_Check_Button* o = btn_notes_address = new Fl_Check_Button(174, 201, 207, 15, _("Add address to notes field"));
btn_notes_address->down_box(FL_DOWN_BOX);
btn_notes_address->callback((Fl_Callback*)cb_btn_notes_address);
o->value(progdefaults.notes_address);
} // Fl_Check_Button* btn_notes_address
o->end();
} // Fl_Group* o
o->end();

Wyświetl plik

@ -417,7 +417,7 @@ btnApplyConfig->activate();}
} {
Fl_Group tabBrowser {
label Browser
xywh {0 50 540 320}
xywh {0 50 540 320} hide
} {
Fl_Group {} {open
xywh {24 59 496 300} box ENGRAVED_FRAME
@ -867,7 +867,7 @@ progdefaults.changed = true;}
}
Fl_Group tabLogServer {
label Logging
xywh {0 50 540 320} hide
xywh {0 50 540 320}
} {
Fl_Group {} {
label {Client/Server Logbook} open
@ -2490,7 +2490,7 @@ progdefaults.changed = true;}
label {Waterfall height in pixels}
callback {progdefaults.wfheight = (int)o->value();
progdefaults.changed = true;}
tooltip {CPU usage increases with waterfall height} xywh {72 251 95 22} type Simple align 8 minimum 100 maximum 160 step 5 value 120
tooltip {CPU usage increases with waterfall height} xywh {72 251 95 22} type Simple align 8 minimum 100 maximum 250 step 5 value 120
code0 {o->value(progdefaults.wfheight);}
code1 {o->labelsize(FL_NORMAL_SIZE);}
class Fl_Counter2
@ -4805,7 +4805,7 @@ if (o->value()) {
callback {progdefaults.wavSampleRate = o->value();
progdefaults.changed = true;} open
tooltip {Pick baud rate from list} xywh {60 96 150 24} down_box BORDER_BOX align 5
code0 {o->add("22050|24000|44100|48000");}
code0 {o->add("8000|11025|16000|22050|24000|44100|48000");}
code1 {o->value(progdefaults.wavSampleRate);}
} {}
}
@ -5404,7 +5404,7 @@ progdefaults.changed = true;}
Fl_Check_Button chkDTMFdecode {
label {Decode DTMF tones}
callback {progdefaults.DTMFdecode = o->value();}
tooltip {Send rx text to file: textout.txt} xywh {187 103 175 20} down_box DOWN_BOX
tooltip {Decode received DTMF tones} xywh {187 103 175 20} down_box DOWN_BOX
code0 {o->value(progdefaults.DTMFdecode);}
}
}
@ -5606,7 +5606,7 @@ progdefaults.changed = true;}
}
}
Fl_Group tabQRZ {
label Web
label Web open
tooltip {Callsign database} xywh {0 25 540 349} hide
} {
Fl_Tabs tabsQRZ {open
@ -5662,7 +5662,7 @@ progdefaults.changed = true;}
callback {set_qrzxml_buttons(o);
progdefaults.QRZXML = QRZXMLNONE;
progdefaults.changed = true;}
tooltip {Do not use callsign database} xywh {49 199 337 20} down_box DOWN_BOX value 1
tooltip {Do not use callsign database} xywh {49 199 64 20} down_box DOWN_BOX value 1
code0 {o->value(progdefaults.QRZXML == QRZXMLNONE);}
}
Fl_Round_Button btnQRZcdrom {
@ -5744,6 +5744,13 @@ inpQRZuserpassword->redraw();
o->label((inpQRZuserpassword->type() & FL_SECRET_INPUT) ? "Show" : "Hide");}
tooltip {Show password in plain text} xywh {417 281 70 20}
}
Fl_Check_Button btn_notes_address {
label {Add address to notes field}
callback {progdefaults.notes_address = o->value();
progdefaults.changed = true;}
xywh {174 201 207 15} down_box DOWN_BOX
code0 {o->value(progdefaults.notes_address);}
}
}
}
Fl_Group {} {

Wyświetl plik

@ -444,10 +444,10 @@ Pixmap fldigi_icon_pixmap;
#endif
// for character set conversion
int rxtx_charset = 0;
static CharsetDistiller rx_chd(charset_list[rxtx_charset].tiniconv_id);
static CharsetDistiller echo_chd(charset_list[rxtx_charset].tiniconv_id);
static OutputEncoder tx_encoder(charset_list[rxtx_charset].tiniconv_id);
int rxtx_charset;
static CharsetDistiller rx_chd;
static CharsetDistiller echo_chd;
static OutputEncoder tx_encoder;
Fl_Menu_Item *getMenuItem(const char *caption, Fl_Menu_Item* submenu = 0);
void UI_select();
@ -1372,28 +1372,33 @@ void init_modem_sync(trx_mode m, int f)
{
ENSURE_THREAD(FLMAIN_TID);
int count = 500;
int count = 2000;
if (trx_state != STATE_RX) {
LOG_INFO("%s", "Waiting for STATE_RX");
LOG_INFO("Waiting for %s", mode_info[active_modem->get_mode()].name);
abort_tx();
while (trx_state != STATE_RX && count) {
LOG_VERBOSE("%d msecs remaining", count * 10);
LOG_DEBUG("%0.2f secs remaining", count / 100.0);
Fl::awake();
MilliSleep(10);
count--;
}
if (!count) LOG_ERROR("%s", "trx wait for RX timeout");
if (count == 0) {
LOG_ERROR("%s", "TIMED OUT!!");
return; // abort modem selection
}
}
LOG_INFO("Call init_modem %d, %d", (int)m, f);
init_modem(m, f);
count = 500;
if (trx_state != STATE_RX) {
while (trx_state != STATE_RX && count) {
Fl::awake();
MilliSleep(10);
count--;
}
LOG_INFO("Waited %.2f sec for RX state", (500 - count) * 0.01);
if (count == 0)
LOG_ERROR("%s", "Wait for STATE_RX timed out");
}
REQ_FLUSH(TRX_TID);
@ -7211,7 +7216,12 @@ int get_tx_char(void)
if (Qidle_time) { return GET_TX_CHAR_NODATA; }
if (macro_idle_on) { return GET_TX_CHAR_NODATA; }
if (idling) { return GET_TX_CHAR_NODATA; }
if (xmltest_char_available) {
num_cps_chars++;
return xmltest_char();
}
if (arq_text_available) {
return arq_get_char();
}
@ -7247,6 +7257,7 @@ int get_tx_char(void)
}
c = TransmitText->nextChar();
if (c == GET_TX_CHAR_ETX) {
return c;
}
@ -7330,7 +7341,10 @@ int get_tx_char(void)
void put_echo_char(unsigned int data, int style)
{
trx_mode mode = active_modem->get_mode();
// suppress print to rx widget when making timing tests
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) return;
trx_mode mode = active_modem->get_mode();
if (mode == MODE_CW && progdefaults.QSKadjust)
return;
@ -7346,6 +7360,8 @@ void put_echo_char(unsigned int data, int style)
asc = ascii2;
else if (mode == MODE_RTTY || mode == MODE_CW)
asc = ascii;
else if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST)
asc = ascii3;
// assign a style to the data
if (asc == ascii2 && iscntrl(data))

Wyświetl plik

@ -49,7 +49,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
&nbsp; &nbsp; &nbsp;Stelios Bounanos, M0GLD<br>\n\
&nbsp; &nbsp; &nbsp;Rem\355 Chateauneu, F4ECW<br>\n\
&nbsp; &nbsp; &nbsp;John Douyere, VK2ETA<br>\n\
&nbsp; &nbsp; &nbsp;Stefan Fendt, DO2SMF<br>\n\
&nbsp; &nbsp; &nbsp;Stefan Fendt, DL1SMF<br>\n\
&nbsp; &nbsp; &nbsp;Leigh Klotz, WA5ZNU<br>\n\
&nbsp; &nbsp; &nbsp;John Phelps, KL4YFD<br>\n\
&nbsp; &nbsp; &nbsp;Andrej Lajovic, S57LN\n\

Wyświetl plik

@ -267,8 +267,17 @@ void fftfilt::rtty_filter(double f)
// amplitude equalized nyquist-channel response
dht /= sinc(2.0 * i * f);
filter[i].real() = dht*cos((double)i* - 0.5*M_PI);
filter[i].imag() = dht*sin((double)i* - 0.5*M_PI);
// amplitude equalized nyquist-channel response
dht /= sinc(2.0 * i * f);
filter[i] =
cmplx( dht*cos((double)i* - 0.5*M_PI),
dht*sin((double)i* - 0.5*M_PI) );
filter[(flen-i)%flen] =
cmplx( dht*cos((double)i*+0.5*M_PI),
dht*sin((double)i*+0.5*M_PI) );
}
filter[(flen-i)%flen].real() = dht*cos((double)i*+0.5*M_PI);
filter[(flen-i)%flen].imag() = dht*sin((double)i*+0.5*M_PI);

Wyświetl plik

@ -58,7 +58,7 @@ public:
virtual void handle_context_menu(void) { }
virtual void clear(void);//{ tbuf->text(""); sbuf->text(""); }
void set_word_wrap(bool b);
void set_word_wrap(bool b, bool b2 = false);
bool get_word_wrap(void) { return wrap; }
virtual void setFont(Fl_Font f, int attr = NATTR);

Wyświetl plik

@ -30,6 +30,7 @@
extern const char *ascii[];
extern const char *ascii2[];
extern const char *ascii3[];
#define SOH 0x01 // SOH ascii character
#define EOT 0x04 // EOT ascii character

Wyświetl plik

@ -29,7 +29,7 @@
class CharsetDistiller
{
public:
CharsetDistiller(const int charset_in);
CharsetDistiller(const int charset_in = TINICONV_CHARSET_UTF_8);
int set_input_encoding(const int charset_in);
void rx(const unsigned char c);
void rx(const unsigned char *c);

Wyświetl plik

@ -582,6 +582,7 @@ extern Fl_Input2 *txtQRZpathname;
extern Fl_Input2 *inpQRZusername;
extern Fl_Input2 *inpQRZuserpassword;
extern Fl_Button *btnQRZpasswordShow;
extern Fl_Check_Button *btn_notes_address;
extern Fl_Input2 *inpEQSL_id;
extern Fl_Input2 *inpEQSL_pwd;
extern Fl_Button *btnEQSL_pwd_show;

Wyświetl plik

@ -813,6 +813,9 @@
ELEM_(std::string, QRZuserpassword, "QRZPASSWORD", \
"QRZ or HamCall subscriber password", \
"") \
ELEM_(bool, notes_address, "NOTES_ADDRESS", \
"Populate logbook notes (comment) field with mailing address", \
false) \
ELEM_(bool, QRZchanged, "", "", false) \
/* eQSL */ \
ELEM_(std::string, eqsl_id, "EQSL_ID", \
@ -1055,8 +1058,9 @@
0) \
ELEM_(int, wavSampleRate, "WAV_SAMPLERATE", \
"Wave file record sample rate\n" \
"0 - 22050, 1 - 24000, 2 - 44100, 3 - 48000", \
3) \
"0 - 8000, 1 - 11025, 2 - 16000, 3 - 22050\n" \
"4 - 24000, 5 - 44100, 6 - 48000", \
0) \
ELEM_(bool, loop_playback, "LOOPPLAYBACK", \
"true = continuous loop of sound file playback\n" \
"false = single pass through playback file.", \

Wyświetl plik

@ -7,7 +7,13 @@
#include <FL/Fl_Double_Window.H>
extern Fl_Double_Window *wExport;
#include <FL/Fl_Group.H>
// Avoid 'nitems' macro collision between FreeBSD's sys/params.h and fltk's
// FL/Fl_Check_Browser.H (http://www.fltk.org/str.php?L2984)
#undef nitems
#include <FL/Fl_Check_Browser.H>
#define FLTK_nitems nitems
#undef nitems
// ^^^ Avoid 'nitems' macro collision
extern Fl_Check_Browser *chkExportBrowser;
#include <FL/Fl_Button.H>
extern Fl_Button *btnClearAll;

Wyświetl plik

@ -9,14 +9,7 @@
#include "qso_db.h"
#include "adif_io.h"
// Avoid 'nitems' macro collision in FreeBSD's sys/params.h
// with fltk's FL/Fl_Check_Browser.H
// ->nitems() is called by functions in this file
#undef nitems
#include "lgbook.h"
#define FLTK_nitems nitems
#undef nitems
#ifdef __WOE32__
# define ADIF_SUFFIX "adi"

Wyświetl plik

@ -8,6 +8,12 @@
#define MAXKEYROWS 4
#define MAXMACROS (MAXKEYROWS * NUMMACKEYS)
extern void CPS_report(int);
extern bool PERFORM_CPS_TEST;
extern int num_cps_chars;
extern struct timeval tv_cps_start;
struct CONTESTCNTR {
int count;
char szCount[20];

Wyświetl plik

@ -11,6 +11,7 @@
#include "digiscope.h"
#include "globals.h"
#include "morse.h"
#include "ascii.h"
#define OUTBUFSIZE 16384
// Constants for signal searching & s/n threshold
@ -23,6 +24,9 @@ public:
static double frequency;
static double tx_frequency;
static bool freqlock;
static unsigned long tx_sample_count;
static unsigned int tx_sample_rate;
static bool XMLRPC_CPS_TEST;
protected:
cMorse morse;
trx_mode mode;
@ -191,6 +195,20 @@ private:
protected:
virtual void s2nreport(void);
// JD & DF for multiple carriers
public:
int numcarriers; //Number of parallel carriers for M CAR PSK and PSKR and QPSKR
int symbols; //JD for multiple carriers
int acc_symbols;
int char_symbols;
int xmt_symbols;
int ovhd_symbols;
int acc_samples;
int char_samples;
int xmt_samples;
int ovhd_samples;
};
extern modem *null_modem;

Wyświetl plik

@ -29,7 +29,7 @@
class OutputEncoder
{
public:
OutputEncoder(const int charset_out, unsigned int buffer_size = 32);
OutputEncoder(const int charset_out = TINICONV_CHARSET_UTF_8, unsigned int buffer_size = 32);
~OutputEncoder(void);
void set_output_encoding(const int charset_out);
void push(std::string s);

Wyświetl plik

@ -63,8 +63,7 @@ private:
unsigned int shreg;
//FEC: 2nd stream
unsigned int shreg2;
int numinterleavers; //interleaver size (speed dependant)
double numcarriers; //Number of parallel carriers for M CAR PSK and PSKR and QPSKR
int numinterleavers; //interleaver size (speed dependant)
double inter_carrier; // Frequency gap betweeb carriers
// rx variables & functions
@ -141,11 +140,11 @@ private:
// cmplx thirdorder;
// tx variables & functions
int accumulated_bits; //JD for multiple carriers
int txsymbols[MAX_CARRIERS];
int txsymbols[MAX_CARRIERS];
double *tx_shape;
int preamble;
void tx_carriers();
void tx_symbol(int sym);
void tx_bit(int bit);
void tx_char(unsigned char c);
@ -177,6 +176,7 @@ public:
int tx_process();
void searchDown();
void searchUp();
};
#endif

Wyświetl plik

@ -3,7 +3,7 @@
//
// Copyright (C) 2012
// Dave Freese, W1HKJ
// Stefan Fendt, DO2SMF
// Stefan Fendt, DL1SMF
//
// This file is part of fldigi.
//

Wyświetl plik

@ -2,6 +2,7 @@
#define XMLRPC_H
#include <iosfwd>
#include <string>
class XmlRpcImpl;
@ -25,6 +26,8 @@ private:
XmlRpcImpl* server_impl;
};
void xmlrpc_set_qsy(long long rfc);
extern void xmlrpc_set_qsy(long long rfc);
extern int xmltest_char();
extern bool xmltest_char_available;
extern int number_of_samples(std::string s);
#endif // XMLRPC_H

Wyświetl plik

@ -450,16 +450,18 @@ void QRZ_CD_query()
lookup_qth = qCall->GetCity();
lookup_state = qCall->GetState();
lookup_grid.clear();
if (!notes.empty()) notes.append("\n");
notes.append(lookup_fname).append(" ").append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
if (!lookup_state.empty())
notes.append(", ").append(lookup_state).append(" ").append(lookup_zip);
else if (!lookup_province.empty())
notes.append(", ").append(lookup_province).append(" ").append(lookup_zip);
else
notes.append(" ").append(lookup_country);
if (progdefaults.notes_address) {
if (!notes.empty()) notes.append("\n");
notes.append(lookup_fname).append(" ").append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
if (!lookup_state.empty())
notes.append(", ").append(lookup_state).append(" ").append(lookup_zip);
else if (!lookup_province.empty())
notes.append(", ").append(lookup_province).append(" ").append(lookup_zip);
else
notes.append(" ").append(lookup_country);
}
} else {
lookup_fname.clear();
lookup_qth.clear();
@ -579,16 +581,18 @@ void QRZquery()
string notes;
notes.assign(inpNotes->value());
if (!notes.empty()) notes.append("\n");
notes.append(lookup_fname).append(" ").append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
if (!lookup_state.empty())
notes.append(", ").append(lookup_state).append(" ").append(lookup_zip);
else if (!lookup_province.empty())
notes.append(", ").append(lookup_province).append(" ").append(lookup_zip);
else
notes.append(" ").append(lookup_country);
if (progdefaults.notes_address) {
if (!notes.empty()) notes.append("\n");
notes.append(lookup_fname).append(" ").append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
if (!lookup_state.empty())
notes.append(", ").append(lookup_state).append(" ").append(lookup_zip);
else if (!lookup_province.empty())
notes.append(", ").append(lookup_province).append(" ").append(lookup_zip);
else
notes.append(" ").append(lookup_country);
}
lookup_notes = notes;
REQ(QRZ_disp_result);
}
@ -650,10 +654,12 @@ void parse_callook(string& xmlpage)
string notes;
notes.assign(inpNotes->value());
if (!notes.empty()) notes.append("\n");
notes.append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
if (progdefaults.notes_address) {
if (!notes.empty()) notes.append("\n");
notes.append(lookup_name).append("\n");
notes.append(lookup_addr1).append("\n");
notes.append(lookup_addr2);
}
lookup_notes = notes;
size_t p = lookup_addr2.find(",");
@ -890,44 +896,46 @@ void parse_HAMQTH_html(const string& htmlpage)
lookup_notes.append("QSL via: ").append(tempstr).append("\n");
}
}
if ((p = htmlpage.find("<adr_name>")) != string::npos) {
p += 10;
p1 = htmlpage.find("</adr_name>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr).append("\n");
if (progdefaults.notes_address) {
if ((p = htmlpage.find("<adr_name>")) != string::npos) {
p += 10;
p1 = htmlpage.find("</adr_name>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr).append("\n");
}
}
}
if ((p = htmlpage.find("<adr_street1>")) != string::npos) {
p += 13;
p1 = htmlpage.find("</adr_street1>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr).append("\n");
if ((p = htmlpage.find("<adr_street1>")) != string::npos) {
p += 13;
p1 = htmlpage.find("</adr_street1>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr).append("\n");
}
}
}
if ((p = htmlpage.find("<adr_city>")) != string::npos) {
p += 10;
p1 = htmlpage.find("</adr_city>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr);
if (!lookup_state.empty())
lookup_notes.append(", ").append(lookup_state);
else if (!lookup_province.empty())
lookup_notes.append(", ").append(lookup_province);
if ((p = htmlpage.find("<adr_city>")) != string::npos) {
p += 10;
p1 = htmlpage.find("</adr_city>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(tempstr);
if (!lookup_state.empty())
lookup_notes.append(", ").append(lookup_state);
else if (!lookup_province.empty())
lookup_notes.append(", ").append(lookup_province);
}
}
}
if ((p = htmlpage.find("<adr_zip>")) != string::npos) {
p += 9;
p1 = htmlpage.find("</adr_zip>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(" ").append(tempstr);
if ((p = htmlpage.find("<adr_zip>")) != string::npos) {
p += 9;
p1 = htmlpage.find("</adr_zip>", p);
if (p1 != string::npos) {
tempstr.assign(htmlpage.substr(p, p1 - p));
if (!tempstr.empty())
lookup_notes.append(" ").append(tempstr);
}
}
}
}

Wyświetl plik

@ -163,9 +163,6 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
mode = mfsk_mode;
depth = 10;
//VK2ETA high speed modes
preamble = 107;
// CAP_IMG is set in cap iff image transfer supported
switch (mode) {
@ -176,6 +173,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 5;
basetone = 256;
numtones = 32;
preamble = 107; // original mfsk modes
break;
case MODE_MFSK8:
samplerate = 8000;
@ -184,6 +182,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 5;
basetone = 128;
numtones = 32;
preamble = 107; // original mfsk modes
break;
case MODE_MFSK31:
samplerate = 8000;
@ -192,7 +191,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 10;
basetone = 32;
numtones = 8;
// cap |= CAP_IMG;
preamble = 107; // original mfsk modes
break;
case MODE_MFSK32:
samplerate = 8000;
@ -201,6 +200,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 10;
basetone = 32;
numtones = 16;
preamble = 107; // original mfsk modes
cap |= CAP_IMG;
break;
case MODE_MFSK64:
@ -250,7 +250,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 10;
basetone = 93;
numtones = 16;
// cap |= CAP_IMG;
preamble = 107;
break;
case MODE_MFSK22:
samplerate = 11025;
@ -259,7 +259,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 10;
basetone = 46;
numtones = 16;
// cap |= CAP_IMG;
preamble = 107;
break;
case MODE_MFSK16:
@ -270,6 +270,7 @@ mfsk::mfsk(trx_mode mfsk_mode) : modem()
depth = 10;
basetone = 64;
numtones = 16;
preamble = 107;
cap |= CAP_IMG;
break;
}
@ -1068,6 +1069,15 @@ int mfsk::tx_process()
case TX_STATE_DATA:
xmtbyte = get_tx_char();
if(active_modem->XMLRPC_CPS_TEST) {
if(startpic) startpic = false;
if(xmtbyte == 0x05) {
sendchar(0x04); // 0x4 has the same symbol count as 0x5
break;
}
}
if (xmtbyte == 0x05 || startpic == true) {
put_status("Tx pic: start");
int len = (int)strlen(picheader);
@ -1081,11 +1091,8 @@ int mfsk::tx_process()
txstate = TX_STATE_FLUSH;
else if (xmtbyte == GET_TX_CHAR_NODATA)
sendidle();
else {
if (xmtbyte & 0x8000) // UTF-8 character send two bytes
sendchar((xmtbyte >> 8) & 0xFF);
else
sendchar(xmtbyte);
}
break;
case TX_STATE_FLUSH:
@ -1093,8 +1100,6 @@ int mfsk::tx_process()
sendchar(4); // EOT
sendchar('\r');
flushtx(preamble);
// clearbits();
// send_epilogue();
rxstate = RX_STATE_DATA;
txstate = TX_STATE_PREAMBLE;
stopflag = false;

Wyświetl plik

@ -90,8 +90,6 @@ static size_t pText; // Protected by arq_rx_mutex
bool arq_text_available = false; // Protected by arq_rx_mutex
// Beware 'arq_text_available' is accessed by other modules.
static bool bSend0x06 = false; // Protected by arq_rx_mutex
// =====================================================================
static const char *asc[128] = {
@ -246,10 +244,8 @@ static string strSubCmd;
idxCmd = toparse.find("<cmd>");
idxCmdEnd = toparse.find("</cmd>");
if (idxCmd != string::npos && debug_pskmail)
LOG_INFO("Parsing: %s", noctrl(toparse).c_str());
while ( idxCmd != string::npos && idxCmdEnd != string::npos && idxCmdEnd > idxCmd ) {
LOG_INFO("Parsing: %s", noctrl(toparse.substr(idxCmd, idxCmdEnd - idxCmd + 6)).c_str());
strCmdText = toparse.substr(idxCmd + 5, idxCmdEnd - idxCmd - 5);
if (strCmdText == "server" && mailserver == false && mailclient == false) {
@ -599,7 +595,6 @@ void arq_reset()
arqmode = mailserver = mailclient = false;
txstring.clear();
arqtext.clear();
bSend0x06 = false;
pText = 0;
}
@ -743,20 +738,16 @@ bool Socket_arqRx()
{
if (bSend0x06 || txstring.empty()) return false;
if (txstring.empty()) return false;
if (arqtext.empty()) {
arqtext.assign(txstring);
// if (debug_pskmail)
// LOG_INFO("Assigned tx text: %s", noctrl(txstring).c_str());
pText = 0;
if (mailserver && progdefaults.PSKmailSweetSpot)
active_modem->set_freq(progdefaults.PSKsweetspot);
start_tx();
} else {
arqtext.append(txstring);
// if (debug_pskmail)
// LOG_INFO("Appended tx text: %s", noctrl(txstring).c_str());
if (trx_state != STATE_TX) {
if (debug_pskmail)
LOG_INFO("%s","Restarting TX");
@ -790,7 +781,6 @@ void WriteARQ(const char *data)
static void *arq_loop(void *args)
{
static unsigned char szACK = 0x06;
SET_THREAD_ID(ARQ_TID);
for (;;) {
@ -814,12 +804,6 @@ static void *arq_loop(void *args)
}
}
if (bSend0x06) {
WriteARQsocket(&szACK, 1);
bSend0x06 = false;
}
// order of precedence; Socket, Wrap autofile, TLF autofile
if (!Socket_arqRx())
if (!WRAP_auto_arqRx())
@ -876,7 +860,6 @@ int arq_get_char()
} else {
arqtext.clear();
pText = 0;
bSend0x06 = true;
arq_text_available = false;
c = GET_TX_CHAR_ETX;
}
@ -896,7 +879,7 @@ void AbortARQ() {
txstring.clear();
pText = 0;
arq_text_available = false;
bSend0x06 = true;
// bSend0x06 = true;
}
//======================================================================

Wyświetl plik

@ -4,7 +4,7 @@
// Copyright (C) 2006
// Dave Freese, W1HKJ
//
// This file is part of fldigi. Adapted from code contained in gmfsk source code
// This file is part of fldigi. Adapted from code contained in gmfsk source code
// distribution.
// gmfsk Copyright (C) 2001, 2002, 2003
// Tomi Manninen (oh2bns@sral.fi)
@ -32,35 +32,35 @@
const char *ascii[256] = {
"", "", "", "",
"", "", "", "",
"\b", "\t", "\n", "",
"\b", "\t", "\n", "",
"", "\r", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
" ", "!", "\"", "#",
"$", "%", "&", "\'",
"(", ")", "*", "+",
",", "-", ".", "/",
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9", ":", ";",
"<", "=", ">", "?",
"@", "A", "B", "C",
"D", "E", "F", "G",
"H", "I", "J", "K",
"L", "M", "N", "O",
"P", "Q", "R", "S",
"T", "U", "V", "W",
"X", "Y", "Z", "[",
"\\", "]", "^", "_",
"`", "a", "b", "c",
"d", "e", "f", "g",
"h", "i", "j", "k",
"l", "m", "n", "o",
"p", "q", "r", "s",
"t", "u", "v", "w",
"x", "y", "z", "{",
" ", "!", "\"", "#",
"$", "%", "&", "\'",
"(", ")", "*", "+",
",", "-", ".", "/",
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9", ":", ";",
"<", "=", ">", "?",
"@", "A", "B", "C",
"D", "E", "F", "G",
"H", "I", "J", "K",
"L", "M", "N", "O",
"P", "Q", "R", "S",
"T", "U", "V", "W",
"X", "Y", "Z", "[",
"\\", "]", "^", "_",
"`", "a", "b", "c",
"d", "e", "f", "g",
"h", "i", "j", "k",
"l", "m", "n", "o",
"p", "q", "r", "s",
"t", "u", "v", "w",
"x", "y", "z", "{",
"|", "}", "~", "",
"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-",
"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-",
@ -75,35 +75,35 @@ const char *ascii[256] = {
const char *ascii2[256] = {
"<NUL>", "<SOH>", "<STX>", "<ETX>",
"<EOT>", "<ENQ>", "<ACK>", "<BEL>",
"\b", "\t", "\n", "<VT>",
"\b", "\t", "\n", "<VT>",
"<FF>", "\r", "<SO>", "<SI>",
"<DLE>", "<DC1>", "<DC2>", "<DC3>",
"<DC4>", "<NAK>", "<SYN>", "<ETB>",
"<CAN>", "<EM>", "<SUB>", "<ESC>",
"<FS>", "<GS>", "<RS>", "<US>",
" ", "!", "\"", "#",
"$", "%", "&", "\'",
"(", ")", "*", "+",
",", "-", ".", "/",
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9", ":", ";",
"<", "=", ">", "?",
"@", "A", "B", "C",
"D", "E", "F", "G",
"H", "I", "J", "K",
"L", "M", "N", "O",
"P", "Q", "R", "S",
"T", "U", "V", "W",
"X", "Y", "Z", "[",
"\\", "]", "^", "_",
"`", "a", "b", "c",
"d", "e", "f", "g",
"h", "i", "j", "k",
"l", "m", "n", "o",
"p", "q", "r", "s",
"t", "u", "v", "w",
"x", "y", "z", "{",
" ", "!", "\"", "#",
"$", "%", "&", "\'",
"(", ")", "*", "+",
",", "-", ".", "/",
"0", "1", "2", "3",
"4", "5", "6", "7",
"8", "9", ":", ";",
"<", "=", ">", "?",
"@", "A", "B", "C",
"D", "E", "F", "G",
"H", "I", "J", "K",
"L", "M", "N", "O",
"P", "Q", "R", "S",
"T", "U", "V", "W",
"X", "Y", "Z", "[",
"\\", "]", "^", "_",
"`", "a", "b", "c",
"d", "e", "f", "g",
"h", "i", "j", "k",
"l", "m", "n", "o",
"p", "q", "r", "s",
"t", "u", "v", "w",
"x", "y", "z", "{",
"|", "}", "~", "<DEL>",
"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-",
"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-",
@ -115,3 +115,38 @@ const char *ascii2[256] = {
"-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"
};
const char *ascii3[256] = {
"<NUL>", "<SOH>", "<STX>", "<ETX>", "<EOT>", "<ENQ>", "<ACK>", "<BEL>",
"<BS>", "<TAB>", "<LF>", "<VT>", "<FF>", "<CR>", "<SO>", "<SI>",
"<DLE>", "<DC1>", "<DC2>", "<DC3>", "<DC4>", "<NAK>", "<SYN>", "<ETB>",
"<CAN>", "<EM>", "<SUB>", "<ESC>", "<FS>", "<GS>", "<RS>", "<US>",
" ", "!", "\"", "#", "$", "%", "&", "\'",
"(", ")", "*", "+", ",", "-", ".", "/",
"0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", ":", ";", "<", "=", ">", "?",
"@", "A", "B", "C", "D", "E", "F", "G",
"H", "I", "J", "K", "L", "M", "N", "O",
"P", "Q", "R", "S", "T", "U", "V", "W",
"X", "Y", "Z", "[", "\\", "]", "^", "_",
"`", "a", "b", "c", "d", "e", "f", "g",
"h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w",
"x", "y", "z", "{", "|", "}", "~", "<DEL>",
"<128>", "<129>", "<130>", "<131>", "<132>", "<133>", "<134>", "<135>",
"<136>", "<137>", "<138>", "<139>", "<140>", "<141>", "<142>", "<143>",
"<144>", "<145>", "<146>", "<147>", "<148>", "<149>", "<150>", "<151>",
"<152>", "<153>", "<154>", "<155>", "<156>", "<157>", "<158>", "<159>",
"<160>", "<161>", "<162>", "<163>", "<164>", "<165>", "<166>", "<167>",
"<168>", "<169>", "<170>", "<171>", "<172>", "<173>", "<174>", "<175>",
"<176>", "<177>", "<178>", "<179>", "<180>", "<181>", "<182>", "<183>",
"<184>", "<185>", "<186>", "<187>", "<188>", "<189>", "<190>", "<191>",
"<192>", "<193>", "<194>", "<195>", "<196>", "<197>", "<198>", "<199>",
"<200>", "<201>", "<202>", "<203>", "<204>", "<205>", "<206>", "<207>",
"<208>", "<209>", "<210>", "<211>", "<212>", "<213>", "<214>", "<215>",
"<216>", "<217>", "<218>", "<219>", "<220>", "<221>", "<222>", "<223>",
"<224>", "<225>", "<226>", "<227>", "<228>", "<229>", "<230>", "<231>",
"<232>", "<233>", "<234>", "<235>", "<236>", "<237>", "<238>", "<239>",
"<240>", "<241>", "<242>", "<243>", "<244>", "<245>", "<246>", "<247>",
"<248>", "<249>", "<250>", "<251>", "<252>", "<253>", "<254>", "<255>"
};

Wyświetl plik

@ -167,7 +167,7 @@ void loadBrowser(Fl_Widget *widget) {
w->add(_("<TUNE:NN>\ttune signal for NN sec"));
w->add(_("<WAIT:NN>\tdelay xmt for NN sec"));
w->add(_("<REPEAT>\trepeat macro continuously"));
w->add(_("<SKED:hhmm[:YYYYDDMM]>\tschedule execution"));
w->add(_("<SKED:hhmm[ss][:YYYYMMDD]>\tschedule execution"));
w->add(LINE_SEP);
w->add(_("<TXATTEN:nn.n>\t set xmt attenuator"));
@ -202,6 +202,16 @@ void loadBrowser(Fl_Widget *widget) {
w->add(LINE_SEP);
w->add(_("<COMMENT:text>\tuntransmitted comment"));
w->add(LINE_SEP);
w->add(_("<CPS_TEST>\tmodem timing test internal string"));
w->add(_("<CPS_FILE:>\tmodem timing test, spec' file"));
w->add(_("<CPS_STRING:s>\tmodem timing test, string 's'"));
w->add(LINE_SEP);
w->add(_("<WAV_TEST>\tWAV file; internal string"));
w->add(_("<WAV_FILE:>\tWAV file; spec' file"));
w->add(_("<WAV_STRING:s>\tWAV file; string 's'"));
w->add(LINE_SEP);
assert(MODE_CONTESTIA < MODE_OLIVIA);
char s[256];
@ -321,6 +331,14 @@ void cbInsertMacro(Fl_Widget *, void *)
text.insert(6, p);
} else
text = "";
} else if ((text == "<CPS_FILE:>") || (text == "<WAV_FILE:>")) {
string filters = "Text\t*." "txt";
const char* p = FSEL::select(_("Test text file"), filters.c_str(),
"text." "txt");
if (p) {
text.insert(10, p);
} else
text = "";
} else if (text == "<IMAGE:>") {
string filters = "Text\t*." "txt";
const char *p = FSEL::select(_("MFSK image file"), "*.{png,jpg,bmp}\t*", "");

Wyświetl plik

@ -25,6 +25,7 @@
// ----------------------------------------------------------------------------
#include <config.h>
#include <sys/time.h>
#include "macros.h"
@ -51,6 +52,7 @@
#include "icons.h"
#include "weather.h"
#include "utf8file_io.h"
#include "xmlrpc.h"
#include <FL/Fl.H>
#include <FL/filename.H>
@ -132,6 +134,343 @@ static size_t mystrftime( char *s, size_t max, const char *fmt, const struct tm
return strftime(s, max, fmt, tm);
}
static string CPSstring = "\
=============================================\n\
ABCDEFGHIJKLMN OPQRSTUVWXYZ\n\
abcdefghijklmn opqrstuvwxyz\n\
0123456789 9876543210\n\
!@#$%&*()_+-=[]{}\\|;:'\",.<>/?\n\
=============================================\n\
\n\
The Jaberwocky\n\
\n\
'Twas brillig, and the slithy toves\n\
Did gyre and gimble in the wabe;\n\
All mimsy were the borogoves,\n\
And the mome raths outgrabe.\n\
\n\
\"Beware the Jabberwock, my son!\n\
The jaws that bite, the claws that catch!\n\
Beware the Jubjub bird, and shun\n\
The frumious Bandersnatch!\"\n\
\n\
He took his vorpal sword in hand:\n\
Long time the manxome foe he sought-\n\
So rested he by the Tumtum tree,\n\
And stood awhile in thought.\n\
\n\
And as in uffish thought he stood,\n\
The Jabberwock, with eyes of flame,\n\
Came whiffling through the tulgey wood,\n\
And burbled as it came!\n\
\n\
One, two! One, two! and through and through\n\
The vorpal blade went snicker-snack!\n\
He left it dead, and with its head\n\
He went galumphing back.\n\
\n\
\"And hast thou slain the Jabberwock?\n\
Come to my arms, my beamish boy!\n\
O frabjous day! Callooh! Callay!\"\n\
He chortled in his joy.\n\
\n\
'Twas brillig, and the slithy toves\n\
Did gyre and gimble in the wabe;\n\
All mimsy were the borogoves,\n\
And the mome raths outgrabe.\n";
bool PERFORM_CPS_TEST = false;
int num_cps_chars = 0;
string testfilename;
void CPS_report(int samples, int prepost)
{
char results[1000];
double xmttime = 1.0 * samples / active_modem->get_samplerate();
double datatime = 1.0 * (samples - prepost) / active_modem->get_samplerate();
num_cps_chars--;
snprintf(results, sizeof(results), "\n\
CPS test\n\
text: %s\n\
mode: %s\n\
# chars: %d\n\
xmt time: %f\n\
data time: %f\n\
xmt samples: %d\n\
prepost: %d\n\
data samples: %d\n\
sample rate: %d\n\
chars/sec: %f\n\
~WPM: %f\n",
testfilename.c_str(),
mode_info[active_modem->get_mode()].name,
num_cps_chars,
xmttime,
datatime,
samples,
prepost,
samples - prepost,
active_modem->get_samplerate(),
num_cps_chars / datatime,
10 * num_cps_chars / datatime);
ReceiveText->add(results, FTextBase::ALTR);
LOG_INFO("%s", results);
PERFORM_CPS_TEST = false;
}
static void pCPS_TEST(std::string &s, size_t &i, size_t endbracket)
{
s.clear();
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
return;
}
testfilename = "internal string";
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
int s0 = number_of_samples("");
int s1 = 0;
int start_stop_samples = 0;
int j = 0;
for(j = 1; j < 32; j++) {
s1 = number_of_samples(string(j, 'e'));
if(s1 > s0) break;
}
start_stop_samples = 2*s0 - s1;
num_cps_chars = 0;
CPS_report(number_of_samples(CPSstring), start_stop_samples);
PERFORM_CPS_TEST = false;
}
static void pCPS_FILE(std::string &s, size_t &i, size_t endbracket)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
s.clear();
return;
}
std::string fname = s.substr(i+10, endbracket - i - 10);
if (fname.length() > 0 && !within_exec) {
FILE *toadd = fopen(fname.c_str(), "r");
if (toadd) {
std::string buffer;
char c = getc(toadd);
while (c && !feof(toadd)) {
if (c != '\r') buffer += c; // damn MSDOS txt files
c = getc(toadd);
}
s.clear();
fclose(toadd);
TransmitText->clear();
testfilename = fname;
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
int s0 = number_of_samples("");
int s1 = 0;
int start_stop_samples = 0;
int j = 0;
for(j = 1; j < 32; j++) {
s1 = number_of_samples(string(j, 'e'));
if(s1 > s0) break;
}
start_stop_samples = 2*s0 - s1;
num_cps_chars = 0;
CPS_report(number_of_samples(buffer), start_stop_samples);
PERFORM_CPS_TEST = false;
} else {
string resp = "Could not locate ";
resp.append(fname).append("\n");
ReceiveText->add(resp.c_str(), FTextBase::ALTR);
LOG_WARN("%s not found", fname.c_str());
s.replace(i, endbracket - i + 1, "");
PERFORM_CPS_TEST = false;
}
} else {
PERFORM_CPS_TEST = false;
s.clear();
}
}
static void pCPS_STRING(std::string &s, size_t &i, size_t endbracket)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
s.clear();
return;
}
std::string buffer = s.substr(i+12, endbracket - i - 12);
std::string txtbuf = buffer;
s.clear();
size_t p = buffer.find("\\n");
while (p != string::npos) {
buffer.replace(p,2,"\n");
p = buffer.find("\\n");
}
if (buffer.length()) {
TransmitText->clear();
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
int s0 = number_of_samples("");
printf("j %d: s %d\n", 0, s0);
int s1 = 0;
int start_stop_samples = 0;
int j = 0;
for(j = 1; j < 32; j++) {
s1 = number_of_samples(string(j, 'e'));
printf("j %d: s %d\n", j, s1);
if(s1 > s0) break;
}
start_stop_samples = 2*s0 - s1;
num_cps_chars = 0;
testfilename = txtbuf;
CPS_report(number_of_samples(buffer), start_stop_samples);
PERFORM_CPS_TEST = false;
} else {
string resp = "Text not specified";
LOG_WARN("%s", resp.c_str());
resp.append("\n");
ReceiveText->add(resp.c_str(), FTextBase::ALTR);
PERFORM_CPS_TEST = false;
}
}
static void pWAV_TEST(std::string &s, size_t &i, size_t endbracket)
{
s.clear();
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
return;
}
testfilename = "internal string";
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
number_of_samples(CPSstring);
PERFORM_CPS_TEST = false;
}
static void pWAV_FILE(std::string &s, size_t &i, size_t endbracket)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
s.clear();
return;
}
std::string fname = s.substr(i+10, endbracket - i - 10);
if (fname.length() > 0 && !within_exec) {
FILE *toadd = fopen(fname.c_str(), "r");
if (toadd) {
std::string buffer;
char c = getc(toadd);
while (c && !feof(toadd)) {
if (c != '\r') buffer += c; // damn MSDOS txt files
c = getc(toadd);
}
s.clear();
fclose(toadd);
TransmitText->clear();
testfilename = fname;
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
number_of_samples(buffer);
PERFORM_CPS_TEST = false;
} else {
string resp = "Could not locate ";
resp.append(fname).append("\n");
ReceiveText->add(resp.c_str(), FTextBase::ALTR);
LOG_WARN("%s not found", fname.c_str());
s.replace(i, endbracket - i + 1, "");
PERFORM_CPS_TEST = false;
}
} else {
PERFORM_CPS_TEST = false;
s.clear();
}
}
static void pWAV_STRING(std::string &s, size_t &i, size_t endbracket)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
ReceiveText->add("Mode not supported\n", FTextBase::ALTR);
s.clear();
return;
}
std::string buffer = s.substr(i+12, endbracket - i - 12);
std::string txtbuf = buffer;
s.clear();
size_t p = buffer.find("\\n");
while (p != string::npos) {
buffer.replace(p,2,"\n");
p = buffer.find("\\n");
}
if (buffer.length()) {
TransmitText->clear();
stopMacroTimer();
active_modem->set_stopflag(false);
PERFORM_CPS_TEST = true;
trx_transmit();
testfilename = txtbuf;
number_of_samples(buffer);
PERFORM_CPS_TEST = false;
} else {
string resp = "Text not specified";
LOG_WARN("%s", resp.c_str());
resp.append("\n");
ReceiveText->add(resp.c_str(), FTextBase::ALTR);
PERFORM_CPS_TEST = false;
}
}
static void pCOMMENT(std::string &s, size_t &i, size_t endbracket)
{
s.replace(i, endbracket - i + 1, "");
@ -2174,6 +2513,7 @@ static void pSKED(std::string &s, size_t &i, size_t endbracket)
exec_time = data.substr(0, p);
exec_date = data.substr(p+1);
}
if (exec_time.length() == 4) exec_time.append("00");
timed_exec = true;
s.replace(i, endbracket - i + 1, "");
}
@ -2225,6 +2565,14 @@ static std::string rxcmds = "<!MOD<!WAI<!GOH<!QSY<!GOF<!RIG<!FIL";
struct MTAGS { const char *mTAG; void (*fp)(std::string &, size_t&, size_t );};
static const MTAGS mtags[] = {
{"<CPS_FILE:", pCPS_FILE},
{"<CPS_STRING:",pCPS_STRING},
{"<CPS_TEST", pCPS_TEST},
{"<WAV_FILE:", pWAV_FILE},
{"<WAV_STRING:",pWAV_STRING},
{"<WAV_TEST", pWAV_TEST},
{"<COMMENT:", pCOMMENT},
{"<CALL>", pCALL},
{"<FREQ>", pFREQ},

Wyświetl plik

@ -47,10 +47,11 @@ using namespace std;
// TODO: figure out the percentage automatically; hopefully not in a horribly kludgy way
struct lang_def_t ui_langs[] = {
{ "en", "en_US", "English", 100 },
{ "de", "de_DE", "Deutsch", 99 },
{ "fr", "fr_FR", "Fran\347ais", 38 },
{ "it", "it_IT", "Italiano", 100 },
{ "es", "es_ES", "Espa\361ol", 97 },
{ "pl", "pl_PL", "Polish", 97},
{ "it", "it_IT", "Italiano", 99 },
{ "es", "es_ES", "Espa\361ol", 99 },
{ "pl", "pl_PL", "Polish", 90},
{ NULL, NULL, NULL, 0 }
};

Wyświetl plik

@ -8,7 +8,7 @@
#include <ostream>
#include <iostream>
#include <cassert>
#include <cstring>
#include "stack.h"
#if defined(_WIN32)
@ -37,7 +37,7 @@ namespace
std::string ret = name;
try { if ((d = abi::__cxa_demangle(name, 0, 0, &status))) ret = d; }
catch(...) { }
std::free(d);
free(d);
return ret;
}
#endif
@ -298,7 +298,7 @@ namespace
}
}
#elif defined(__GNUC__)
#if defined(__i386__)
#if defined(__i386__) || defined(__x86_64__)
void fill_frames(std::list<dbg::stack_frame> &frames, dbg::stack::depth_type limit)
{

Wyświetl plik

@ -698,8 +698,8 @@ void status::initLastState()
ReceiveText->set_quick_entry(quick_entry);
ReceiveText->set_scroll_hints(rx_scroll_hints);
ReceiveText->set_word_wrap(rx_word_wrap);
TransmitText->set_word_wrap(tx_word_wrap);
ReceiveText->set_word_wrap(rx_word_wrap, true);
TransmitText->set_word_wrap(tx_word_wrap, true);
// set_server_label(xml_logbook);

Wyświetl plik

@ -64,6 +64,7 @@
#include "wefax.h"
#include "wefax-pic.h"
#include "navtex.h"
#include "ascii.h"
#if USE_HAMLIB
#include "hamlib.h"
@ -236,7 +237,7 @@ XML_RPC_Server::XML_RPC_Server()
XML_RPC_Server::~XML_RPC_Server()
{
// run = false;
// the xmlrpc server is closed and deleted when
// the xmlrpc server is closed and deleted when
// XML_RPC_Server::stop();
// is called from main
// delete methods;
@ -1564,6 +1565,207 @@ public:
}
};
static string xmlchars;
bool xmltest_char_available;
static size_t pxmlchar = 0;
int xmltest_char()
{
if (pxmlchar >= xmlchars.length() ) return -3;
return xmlchars[pxmlchar++] & 0xFF;
}
int number_of_samples( string s)
{
active_modem->XMLRPC_CPS_TEST = true;
xmlchars = s;
pxmlchar = 0;
xmltest_char_available = true;
active_modem->set_stopflag(false);
trx_transmit();
MilliSleep(10);
while(trx_state != STATE_RX) {
MilliSleep(10);
Fl::awake();
}
xmltest_char_available = false;
active_modem->XMLRPC_CPS_TEST = false;
return active_modem->tx_sample_count;
}
class Main_get_char_rates : public xmlrpc_c::method
{
public:
Main_get_char_rates()
{
_signature = "s:n";
_help = "Returns table of char rates.";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ) {
*retval = xmlrpc_c::value_string("0:1:0");
return;
}
XMLRPC_LOCK;
REQ(stopMacroTimer);
int s0 = 0;//number_of_samples("");
int s1 = 0;
string xmlbuf;
static char result[100];
static string line;
int chsamples = 0;
int i = 0;
for (int m = 0; m < 32; m++) {
line.clear();
for (int n = 0; n < 8; n++) {
i = m*8+n;
if ( (id >= MODE_PSK31 && id <= MODE_PSK1000R) ||
(id >= MODE_4X_PSK63R && id <= MODE_2X_PSK1000R) ||
id == MODE_CW || id == MODE_RTTY ) {
s1 = number_of_samples(string(1,i));
chsamples = active_modem->char_samples;
} else {
s0 = number_of_samples(string(1, i));
int j;
for(j = 2; j < 32; j++) {
s1 = number_of_samples(string(j, i));
if(s1 > s0) break;
}
chsamples = (s1 - s0) / (j-1);
}
snprintf(result, sizeof(result),
n == 7 ? " %.8f\n" : n == 0 ? "%.8f," : " %.8f,",
1.0 * chsamples / active_modem->get_samplerate());
line.append(result);
}
xmlbuf.append(line);
}
*retval = xmlrpc_c::value_string(xmlbuf);
}
};
class Main_get_char_timing : public xmlrpc_c::method
{
public:
Main_get_char_timing()
{
_signature = "n:6";
_help = "Input: value of character. Returns transmit duration for specified character (samples:sample rate).";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ) {
*retval = xmlrpc_c::value_string("0,1,0,0,0.0");
return;
}
XMLRPC_LOCK;
REQ(stopMacroTimer);
vector<unsigned char> bytes = params.getBytestring(0);
bytes.push_back(0);
std::string totest = (const char*)&bytes[0];
if (totest.empty() || !active_modem) {
*retval = xmlrpc_c::value_string("0:1:0");
return;
}
static std::string xmlbuf;
char result[64];
int character = 0;
int count = sscanf(totest.c_str(), "%d", &character);
if(count != 1) {
*retval = xmlrpc_c::value_string("0:1:0");
return;
}
unsigned int s0 = 0, chsamples = 0, over_head = 0;
if ( (id >= MODE_4X_PSK63R && id <= MODE_2X_PSK1000R) ||
(id >= MODE_PSK31 && id <= MODE_PSK1000R) ||
id == MODE_CW || id == MODE_RTTY ) {
s0 = number_of_samples(string(1,character));
chsamples = active_modem->char_samples;
over_head = active_modem->ovhd_samples;
} else {
unsigned int s1 = 0, s2 = 0;
unsigned int temp = 0, no_of_chars = 1, k = 0;
s0 = s1 = s2 = number_of_samples(string(no_of_chars, character));
for(int i = no_of_chars + 1; i < 32; i++) {
s2 = number_of_samples(string(i, character));
if(s2 > s1 && temp++ > 2) {
break;
}
s0 = s2;
no_of_chars++;
}
k = no_of_chars * 4;
s1 = number_of_samples(string(k, character));
chsamples = (s1 - s0) / (k - no_of_chars);
over_head = s1 - (chsamples * k);
}
snprintf(result, sizeof(result), "%5u:%6u:%6u", chsamples,
active_modem->get_samplerate(),
over_head);
xmlbuf.assign(result);
*retval = xmlrpc_c::value_string(xmlbuf);
}
};
class Main_get_tx_timing : public xmlrpc_c::method
{
public:
Main_get_tx_timing()
{
_signature = "n:6";
_help = "Returns transmit duration for test string (samples:sample rate:secs).";
}
void execute(const xmlrpc_c::paramList& params, xmlrpc_c::value* retval)
{
trx_mode id = active_modem->get_mode();
if ( id == MODE_SSB || id == MODE_WWV || id == MODE_ANALYSIS ||
id == MODE_WEFAX_576 || id == MODE_WEFAX_288 ||
id == MODE_SITORB || id == MODE_NAVTEX ) {
*retval = xmlrpc_c::value_string("0:1:0.0");
return;
}
XMLRPC_LOCK;
vector<unsigned char> bytes = params.getBytestring(0);
bytes.push_back(0);
std::string totest = (const char*)&bytes[0];
if (totest.empty() || !active_modem) {
*retval = xmlrpc_c::value_string("0:1:0.0");
return;
}
int chsamples = number_of_samples(totest);// - start_stop_samples;
std::string xmlbuf;
char buf[64];
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf) - 1, "%u : %u : %.9f", \
chsamples, active_modem->tx_sample_rate,
1.0 * chsamples / active_modem->tx_sample_rate);
xmlbuf.assign(buf);
*retval = xmlrpc_c::value_string(xmlbuf);
}
};
class Rig_set_name : public xmlrpc_c::method
{
public:
@ -2854,46 +3056,46 @@ struct Navtex_send_message : public xmlrpc_c::method
// method list: ELEM_(class_name, "method_name")
#undef ELEM_
#define METHOD_LIST \
ELEM_(Fldigi_list, "fldigi.list") \
ELEM_(Fldigi_name, "fldigi.name") \
#define METHOD_LIST \
ELEM_(Fldigi_list, "fldigi.list") \
ELEM_(Fldigi_name, "fldigi.name") \
ELEM_(Fldigi_version_struct, "fldigi.version_struct") \
ELEM_(Fldigi_version_string, "fldigi.version") \
ELEM_(Fldigi_name_version, "fldigi.name_version") \
ELEM_(Fldigi_config_dir, "fldigi.config_dir") \
ELEM_(Fldigi_name_version, "fldigi.name_version") \
ELEM_(Fldigi_config_dir, "fldigi.config_dir") \
ELEM_(Fldigi_terminate, "fldigi.terminate") \
\
\
ELEM_(Modem_get_name, "modem.get_name") \
ELEM_(Modem_get_names, "modem.get_names") \
ELEM_(Modem_get_names, "modem.get_names") \
ELEM_(Modem_get_id, "modem.get_id") \
ELEM_(Modem_get_max_id, "modem.get_max_id") \
ELEM_(Modem_set_by_name, "modem.set_by_name") \
ELEM_(Modem_set_by_id, "modem.set_by_id") \
\
ELEM_(Modem_set_carrier, "modem.set_carrier") \
ELEM_(Modem_inc_carrier, "modem.inc_carrier") \
ELEM_(Modem_get_carrier, "modem.get_carrier") \
\
ELEM_(Modem_get_afc_sr, "modem.get_afc_search_range") \
ELEM_(Modem_set_afc_sr, "modem.set_afc_search_range") \
ELEM_(Modem_inc_afc_sr, "modem.inc_afc_search_range") \
\
ELEM_(Modem_get_bw, "modem.get_bandwidth") \
ELEM_(Modem_set_bw, "modem.set_bandwidth") \
ELEM_(Modem_inc_bw, "modem.inc_bandwidth") \
\
ELEM_(Modem_get_quality, "modem.get_quality") \
ELEM_(Modem_search_up, "modem.search_up") \
ELEM_(Modem_search_down, "modem.search_down") \
\
ELEM_(Modem_set_by_name, "modem.set_by_name") \
ELEM_(Modem_set_by_id, "modem.set_by_id") \
\
ELEM_(Modem_set_carrier, "modem.set_carrier") \
ELEM_(Modem_inc_carrier, "modem.inc_carrier") \
ELEM_(Modem_get_carrier, "modem.get_carrier") \
\
ELEM_(Modem_get_afc_sr, "modem.get_afc_search_range") \
ELEM_(Modem_set_afc_sr, "modem.set_afc_search_range") \
ELEM_(Modem_inc_afc_sr, "modem.inc_afc_search_range") \
\
ELEM_(Modem_get_bw, "modem.get_bandwidth") \
ELEM_(Modem_set_bw, "modem.set_bandwidth") \
ELEM_(Modem_inc_bw, "modem.inc_bandwidth") \
\
ELEM_(Modem_get_quality, "modem.get_quality") \
ELEM_(Modem_search_up, "modem.search_up") \
ELEM_(Modem_search_down, "modem.search_down") \
\
ELEM_(Modem_olivia_set_bandwidth, "modem.olivia.set_bandwidth") \
ELEM_(Modem_olivia_get_bandwidth, "modem.olivia.get_bandwidth") \
ELEM_(Modem_olivia_set_tones, "modem.olivia.set_tones") \
ELEM_(Modem_olivia_get_tones, "modem.olivia.get_tones") \
\
\
ELEM_(Main_get_status1, "main.get_status1") \
ELEM_(Main_get_status2, "main.get_status2") \
\
\
ELEM_(Main_get_sb, "main.get_sideband") \
ELEM_(Main_set_sb, "main.set_sideband") \
ELEM_(Main_get_wf_sideband, "main.get_wf_sideband") \
@ -2901,124 +3103,127 @@ struct Navtex_send_message : public xmlrpc_c::method
ELEM_(Main_get_freq, "main.get_frequency") \
ELEM_(Main_set_freq, "main.set_frequency") \
ELEM_(Main_inc_freq, "main.inc_frequency") \
\
\
ELEM_(Main_get_afc, "main.get_afc") \
ELEM_(Main_set_afc, "main.set_afc") \
ELEM_(Main_toggle_afc, "main.toggle_afc") \
\
ELEM_(Main_toggle_afc, "main.toggle_afc") \
\
ELEM_(Main_get_sql, "main.get_squelch") \
ELEM_(Main_set_sql, "main.set_squelch") \
ELEM_(Main_toggle_sql, "main.toggle_squelch") \
\
ELEM_(Main_toggle_sql, "main.toggle_squelch") \
\
ELEM_(Main_get_sql_level, "main.get_squelch_level") \
ELEM_(Main_set_sql_level, "main.set_squelch_level") \
ELEM_(Main_inc_sql_level, "main.inc_squelch_level") \
\
\
ELEM_(Main_get_rev, "main.get_reverse") \
ELEM_(Main_set_rev, "main.set_reverse") \
ELEM_(Main_toggle_rev, "main.toggle_reverse") \
\
ELEM_(Main_get_lock, "main.get_lock") \
ELEM_(Main_set_lock, "main.set_lock") \
ELEM_(Main_toggle_rev, "main.toggle_reverse") \
\
ELEM_(Main_get_lock, "main.get_lock") \
ELEM_(Main_set_lock, "main.set_lock") \
ELEM_(Main_toggle_lock, "main.toggle_lock") \
\
ELEM_(Main_get_rsid, "main.get_rsid") \
ELEM_(Main_set_rsid, "main.set_rsid") \
\
ELEM_(Main_get_rsid, "main.get_rsid") \
ELEM_(Main_set_rsid, "main.set_rsid") \
ELEM_(Main_toggle_rsid, "main.toggle_rsid") \
\
ELEM_(Main_get_trx_status, "main.get_trx_status") \
ELEM_(Main_tx, "main.tx") \
ELEM_(Main_tune, "main.tune") \
ELEM_(Main_rsid, "main.rsid") \
ELEM_(Main_rx, "main.rx") \
\
ELEM_(Main_get_trx_status, "main.get_trx_status") \
ELEM_(Main_tx, "main.tx") \
ELEM_(Main_tune, "main.tune") \
ELEM_(Main_rsid, "main.rsid") \
ELEM_(Main_rx, "main.rx") \
ELEM_(Main_abort, "main.abort") \
\
\
ELEM_(Main_get_trx_state, "main.get_trx_state") \
ELEM_(Main_set_rig_name, "main.set_rig_name") \
ELEM_(Main_get_tx_timing, "main.get_tx_timing") \
ELEM_(Main_get_char_rates, "main.get_char_rates") \
ELEM_(Main_get_char_timing, "main.get_char_timing") \
ELEM_(Main_set_rig_name, "main.set_rig_name") \
ELEM_(Main_set_rig_frequency, "main.set_rig_frequency") \
ELEM_(Main_set_rig_modes, "main.set_rig_modes") \
ELEM_(Main_set_rig_mode, "main.set_rig_mode") \
ELEM_(Main_set_rig_mode, "main.set_rig_mode") \
ELEM_(Main_get_rig_modes, "main.get_rig_modes") \
ELEM_(Main_get_rig_mode, "main.get_rig_mode") \
ELEM_(Main_get_rig_mode, "main.get_rig_mode") \
ELEM_(Main_set_rig_bandwidths, "main.set_rig_bandwidths") \
ELEM_(Main_set_rig_bandwidth, "main.set_rig_bandwidth") \
ELEM_(Main_get_rig_bandwidth, "main.get_rig_bandwidth") \
ELEM_(Main_get_rig_bandwidths, "main.get_rig_bandwidths") \
\
\
ELEM_(Main_run_macro, "main.run_macro") \
ELEM_(Main_get_max_macro_id, "main.get_max_macro_id") \
\
\
ELEM_(Rig_set_name, "rig.set_name") \
ELEM_(Rig_get_name, "rig.get_name") \
ELEM_(Rig_set_frequency, "rig.set_frequency") \
ELEM_(Rig_set_modes, "rig.set_modes") \
ELEM_(Rig_set_frequency, "rig.set_frequency") \
ELEM_(Rig_set_modes, "rig.set_modes") \
ELEM_(Rig_set_mode, "rig.set_mode") \
ELEM_(Rig_get_modes, "rig.get_modes") \
ELEM_(Rig_get_modes, "rig.get_modes") \
ELEM_(Rig_get_mode, "rig.get_mode") \
ELEM_(Rig_set_bandwidths, "rig.set_bandwidths") \
ELEM_(Rig_set_bandwidth, "rig.set_bandwidth") \
ELEM_(Rig_get_bandwidth, "rig.get_bandwidth") \
ELEM_(Rig_set_bandwidth, "rig.set_bandwidth") \
ELEM_(Rig_get_bandwidth, "rig.get_bandwidth") \
ELEM_(Rig_get_bandwidths, "rig.get_bandwidths") \
ELEM_(Rig_get_notch, "rig.get_notch") \
ELEM_(Rig_set_notch, "rig.set_notch") \
ELEM_(Rig_get_notch, "rig.get_notch") \
ELEM_(Rig_set_notch, "rig.set_notch") \
ELEM_(Rig_take_control, "rig.take_control") \
ELEM_(Rig_release_control, "rig.release_control") \
\
ELEM_(Log_get_freq, "log.get_frequency") \
ELEM_(Log_get_time_on, "log.get_time_on") \
ELEM_(Rig_release_control, "rig.release_control") \
\
ELEM_(Log_get_freq, "log.get_frequency") \
ELEM_(Log_get_time_on, "log.get_time_on") \
ELEM_(Log_get_time_off, "log.get_time_off") \
ELEM_(Log_get_call, "log.get_call") \
ELEM_(Log_get_name, "log.get_name") \
ELEM_(Log_get_rst_in, "log.get_rst_in") \
ELEM_(Log_get_rst_out, "log.get_rst_out") \
ELEM_(Log_get_rst_out, "log.get_rst_out") \
ELEM_(Log_get_serial_number, "log.get_serial_number") \
ELEM_(Log_set_serial_number, "log.set_serial_number") \
ELEM_(Log_get_serial_number_sent, "log.get_serial_number_sent") \
ELEM_(Log_get_exchange, "log.get_exchange") \
ELEM_(Log_set_exchange, "log.set_exchange") \
ELEM_(Log_get_state, "log.get_state") \
ELEM_(Log_get_state, "log.get_state") \
ELEM_(Log_get_province, "log.get_province") \
ELEM_(Log_get_country, "log.get_country") \
ELEM_(Log_get_qth, "log.get_qth") \
ELEM_(Log_get_country, "log.get_country") \
ELEM_(Log_get_qth, "log.get_qth") \
ELEM_(Log_get_band, "log.get_band") \
ELEM_(Log_get_sb, "log.get_sideband") \
ELEM_(Log_get_notes, "log.get_notes") \
ELEM_(Log_get_locator, "log.get_locator") \
ELEM_(Log_get_sb, "log.get_sideband") \
ELEM_(Log_get_notes, "log.get_notes") \
ELEM_(Log_get_locator, "log.get_locator") \
ELEM_(Log_get_az, "log.get_az") \
ELEM_(Log_clear, "log.clear") \
ELEM_(Log_clear, "log.clear") \
ELEM_(Log_set_call, "log.set_call") \
ELEM_(Log_set_name, "log.set_name") \
ELEM_(Log_set_qth, "log.set_qth") \
ELEM_(Log_set_locator, "log.set_locator") \
\
ELEM_(Text_get_rx_length, "text.get_rx_length") \
ELEM_(Text_get_rx, "text.get_rx") \
ELEM_(Text_clear_rx, "text.clear_rx") \
ELEM_(Text_add_tx, "text.add_tx") \
ELEM_(Text_add_tx_bytes, "text.add_tx_bytes") \
ELEM_(Text_clear_tx, "text.clear_tx") \
\
ELEM_(RXTX_get_data, "rxtx.get_data") \
ELEM_(RX_get_data, "rx.get_data") \
ELEM_(TX_get_data, "tx.get_data") \
\
ELEM_(Spot_get_auto, "spot.get_auto") \
ELEM_(Spot_set_auto, "spot.set_auto") \
ELEM_(Spot_toggle_auto, "spot.toggle_auto") \
ELEM_(Spot_pskrep_get_count, "spot.pskrep.get_count") \
ELEM_(Log_set_qth, "log.set_qth") \
ELEM_(Log_set_locator, "log.set_locator") \
\
ELEM_(Wefax_state_string, "wefax.state_string") \
ELEM_(Wefax_skip_apt, "wefax.skip_apt") \
ELEM_(Wefax_skip_phasing, "wefax.skip_phasing") \
ELEM_(Wefax_set_tx_abort_flag, "wefax.set_tx_abort_flag") \
ELEM_(Text_get_rx_length, "text.get_rx_length") \
ELEM_(Text_get_rx, "text.get_rx") \
ELEM_(Text_clear_rx, "text.clear_rx") \
ELEM_(Text_add_tx, "text.add_tx") \
ELEM_(Text_add_tx_bytes, "text.add_tx_bytes") \
ELEM_(Text_clear_tx, "text.clear_tx") \
\
ELEM_(RXTX_get_data, "rxtx.get_data") \
ELEM_(RX_get_data, "rx.get_data") \
ELEM_(TX_get_data, "tx.get_data") \
\
ELEM_(Spot_get_auto, "spot.get_auto") \
ELEM_(Spot_set_auto, "spot.set_auto") \
ELEM_(Spot_toggle_auto, "spot.toggle_auto") \
ELEM_(Spot_pskrep_get_count, "spot.pskrep.get_count") \
\
ELEM_(Wefax_state_string, "wefax.state_string") \
ELEM_(Wefax_skip_apt, "wefax.skip_apt") \
ELEM_(Wefax_skip_phasing, "wefax.skip_phasing") \
ELEM_(Wefax_set_tx_abort_flag, "wefax.set_tx_abort_flag") \
ELEM_(Wefax_end_reception, "wefax.end_reception") \
ELEM_(Wefax_start_manual_reception, "wefax.start_manual_reception") \
ELEM_(Wefax_set_adif_log, "wefax.set_adif_log") \
ELEM_(Wefax_set_adif_log, "wefax.set_adif_log") \
ELEM_(Wefax_set_max_lines, "wefax.set_max_lines") \
ELEM_(Wefax_get_received_file, "wefax.get_received_file") \
ELEM_(Wefax_get_received_file, "wefax.get_received_file") \
ELEM_(Wefax_send_file, "wefax.send_file") \
\
ELEM_(Navtex_get_message, "navtex.get_message") \
ELEM_(Navtex_get_message, "navtex.get_message") \
ELEM_(Navtex_send_message, "navtex.send_message") \
struct rm_pred

Wyświetl plik

@ -33,6 +33,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <iomanip>
#include <iostream>
#include "psk.h"
#include "main.h"
@ -44,8 +45,9 @@
#include "status.h"
#include "viewpsk.h"
#include "pskeval.h"
#include "ascii.h"
#include "modem.h"
#include "Viewer.h"
#include "macros.h"
extern waterfall *wf;
@ -95,8 +97,9 @@ void psk::tx_init(SoundBase *sc)
bitshreg = 0;
startpreamble = true;
//Multiple carriers handling
accumulated_bits = 0;
symbols = 0;
acc_symbols = 0;
ovhd_symbols = 0;
}
@ -129,6 +132,8 @@ void psk::rx_init()
// interleaver, split incoming bit stream into two, one late by one bit
rxbitstate = 0;
fecmet = fecmet2 = 0;
if (Rxinlv) Rxinlv->flush();
if (Rxinlv2) Rxinlv2->flush();
}
@ -559,7 +564,7 @@ psk::psk(trx_mode pskmode) : modem()
numcarriers = 1;
}
//printf("%s: symlen %d, dcdbits %d, _qpsk %d, _pskr %d, numc %f\n",
//printf("%s: symlen %d, dcdbits %d, _qpsk %d, _pskr %d, numc %d\n",
//mode_info[mode].sname,
//symbollen, dcdbits, _qpsk, _pskr, numcarriers);
@ -820,7 +825,7 @@ void psk::rx_pskr(unsigned char symbol)
int c;
//In the case of multiple carriers, if even number of carriers then we
// know the bit-order and don't need voting otherwise
// know the bit-order and don't need voting otherwise
// we accumulate the soft bits for the interleaver THEN submit to Viterbi
// decoder in alternance so that each one is processed one bit later.
// Only two possibilities for sync: current bit or previous one since
@ -835,7 +840,7 @@ void psk::rx_pskr(unsigned char symbol)
rxbitstate++;
//Only use one decoder is using even carriers (we know the bits order)
// if (((int)numcarriers) % 2 == 0) {
// fecmet2 = -9999.0;
// fecmet2 = -9999.0;
// return;
// }
// copy to avoid scrambling symbolpair for the next bit
@ -969,12 +974,12 @@ void psk::findsignal()
}
}
//JD: disable for multiple carriers as we are running as modem and
//JD: disable for multiple carriers as we are running as modem and
// therefore use other strategies for frequency alignment like RSID
void psk::phaseafc()
{
double error;
if (afcmetric < 0.05 ||
if (afcmetric < 0.05 ||
mode == MODE_PSK500 ||
mode == MODE_QPSK500 ||
numcarriers > 1 ) return;
@ -1027,32 +1032,30 @@ static double averageamp;
} else { // bpsk and pskr
bits = (((int) (phase / M_PI + 0.5)) & 1) << 1;
// hard decode if needed
// softbit = (bits & 2) ? 0 : 255;
// softbit = (bits & 2) ? 0 : 255;
// reversed as we normally pass "!bits" when hard decoding
// Soft decode section below
// Soft decode section below
averageamp = decayavg(averageamp, sigamp, SQLDECAY);
if (sigamp > 0 && averageamp > 0) {
softamp = clamp( averageamp / sigamp, 1.0, 1e6);
if (sigamp > averageamp) {
softamp = clamp( sqrt(sigamp / averageamp), 1.0, 1e6);
} else {
softamp = clamp( sqrt(averageamp / sigamp), 1.0, 1e6);
}
} else {
softamp = 1; // arbritary number (50% impact)
softamp = 2; // arbritary number (50% impact)
}
// Compute values between -128 and +127 for phase value only
if (phase > M_PI) {
softangle = (127 - (((2 * M_PI - phase) / M_PI) * (double) 255));
} else {
softangle = (127 - ((phase / M_PI) * (double) 255));
}
// Then apply impact of amplitude. Fanally, re-centre on 127-128
// as the decoder needs values between 0-255
softbit = (unsigned char) ((softangle / (1 + softamp)) - 127);
// Compute values between -128 and +127 for phase value only
double alpha = phase / M_PI;
if (alpha > 1.0) alpha = 2.0 - alpha;
softangle = 127.0 - 255.0 * alpha;
softbit = (unsigned char) ((softangle / ( 1.0 + softamp / 2.0)) + 128);
n = 2;
}
// simple low pass filter for quality of signal
// quality.re = decayavg(quality.re, cos(n*phase), _pskr ? SQLDECAY * 5 : SQLDECAY);
// quality.im = decayavg(quality.im, sin(n*phase), _pskr ? SQLDECAY * 5 : SQLDECAY);
// quality.re = decayavg(quality.re, cos(n*phase), _pskr ? SQLDECAY * 10 : SQLDECAY);
// quality.im = decayavg(quality.im, sin(n*phase), _pskr ? SQLDECAY * 10 : SQLDECAY);
quality = cmplx(
decayavg(quality.real(), cos(n*phase), _pskr ? SQLDECAY * 10 : SQLDECAY),
decayavg(quality.imag(), sin(n*phase), _pskr ? SQLDECAY * 10 : SQLDECAY));
@ -1107,7 +1110,7 @@ static double averageamp;
}
break;
case 0: // DCD off by postamble. Not for PSKR modes as this is not unique to postamble.
case 0: // DCD off by postamble. Not for PSKR modes as this is not unique to postamble.
if (!_pskr) {
dcd = false;
acquire = 0;
@ -1219,7 +1222,7 @@ int psk::rx_process(const double *buf, int len)
fir2[car]->run( z, z2[car] ); // fir2 returns value on every sample
//On last carrier processing
if (car == numcarriers - 1) {
if (car == numcarriers - 1) {
calcSN_IMD(z); //JD OR all carriers together check logic???
@ -1229,9 +1232,9 @@ int psk::rx_process(const double *buf, int len)
* expected to have been modified to a fairly symmetric shape. The
* magnitude of the samples are taken, thus rectifying the signal to
* positive values. "bitclk" is a counter that is very close in rate to
* (samples / symbol). Its purpose is to repeatedly "draw" one symbol
* (samples / symbol). Its purpose is to repeatedly "draw" one symbol
* waveform in the syncbuf array, according to its amplitude (not phase).
*/
*/
int idx = (int) bitclk;
double sum = 0.0;
@ -1257,11 +1260,11 @@ int psk::rx_process(const double *buf, int len)
/**
* Here we sum up the difference between each sample's magnitude in the
* lower half of the array with its counterpart on the upper half of the
* array, or the other side of the waveform. Each pair's difference is
* array, or the other side of the waveform. Each pair's difference is
* divided by their sum, scaling it so that the signal amplitude does not
* affect the result. When the differences are summed, it gives an
* indication of which side is larger than the other.
*/
*/
for (int i = 0; i < symsteps; i++) {
sum += (syncbuf[i] - syncbuf[i+symsteps]);
@ -1276,11 +1279,11 @@ int psk::rx_process(const double *buf, int len)
* be a little faster, so that the next drawing of the waveform in syncbuf
* will be shifted right. Conversely, if the sum is positive, then it needs
* to slow down bitclk so that the waveform is shifted left. Thus the
* error is subtracted from bitclk, rather than added. The goal is to
* error is subtracted from bitclk, rather than added. The goal is to
* get the error as close to zero as possible, so that the receiver is
* exactly synced with the transmitter and the waveform is exactly in
* the middle of syncbuf.
*/
* the middle of syncbuf.
*/
// bitclk -= sum / 5.0;
bitclk -= sum / (5.0 * 16 / bitsteps);
@ -1290,11 +1293,11 @@ int psk::rx_process(const double *buf, int len)
* When bitclock reaches the end of the buffer, then a complete waveform
* has been received. It is time to output the current sample and wrap
* around to the next cycle.
*
*
* There is a complete symbol waveform in syncbuf, so that each
* sample[0..N/2-1] is very close in amplitude with the corresponding
* sample in [N/2..N-1].
*
*
* | ******** ******** |
* | **** **** **** **** |
* | *** *** *** *** |
@ -1304,9 +1307,9 @@ int psk::rx_process(const double *buf, int len)
* |* * *|
* |_______________________________________________________________|
* 0 N/2 N-1
*
*
* === or some variation of it .... ===
*
*
* |**** ******** *****|
* | **** **** **** **** |
* | *** *** *** *** |
@ -1321,7 +1324,7 @@ int psk::rx_process(const double *buf, int len)
* have the maximum phase difference, if any, from the previous symbol's
* phase.
*
*/
*/
// if (bitclk < 0) bitclk += 16.0;
// if (bitclk >= 16.0) {
@ -1372,30 +1375,24 @@ int psk::rx_process(const double *buf, int len)
// transmit processes
//=====================================================================
void psk::tx_symbol(int sym)
void psk::tx_carriers()
{
double delta[MAX_CARRIERS];
double ival, qval, shapeA, shapeB;
cmplx symbol;
double frequencies[MAX_CARRIERS];
txsymbols[accumulated_bits] = sym;
if (++accumulated_bits < numcarriers) {
return;
}
//Process all carrier's symbols, then submit to sound card
accumulated_bits = 0; //reset
frequencies[0] = get_txfreq_woffset() + ((-1 * numcarriers) + 1) * inter_carrier / 2;
delta[0] = TWOPI * frequencies[0] / samplerate;
for (int car = 1; car < numcarriers; car++) {
for (int car = 1; car < symbols; car++) {
frequencies[car] = frequencies[car - 1] + inter_carrier;
delta[car] = TWOPI * frequencies[car] / samplerate;
}
double maxamp = 0;
for (int car = 0; car < numcarriers; car++) {
double maxamp = 0;
int sym;
for (int car = 0; car < symbols; car++) {
sym = txsymbols[car];
if (_qpsk && !reverse)
@ -1427,7 +1424,7 @@ double maxamp = 0;
qval = shapeA * prevsymbol[car].imag() + shapeB * symbol.imag();
if (car != 0) {
outbuf[i] += (ival * cos(phaseacc[car]) + qval * sin(phaseacc[car]));// / numcarriers;
outbuf[i] += (ival * cos(phaseacc[car]) + qval * sin(phaseacc[car]));// / numcarriers;
} else {
outbuf[i] = (ival * cos(phaseacc[car]) + qval * sin(phaseacc[car]));// / numcarriers;
}
@ -1442,12 +1439,23 @@ double maxamp = 0;
prevsymbol[car] = symbol;
}
if (maxamp)
for (int i = 0; i < symbollen; i++) outbuf[i] /= maxamp;
ModulateXmtr(outbuf, symbollen);
}
void psk::tx_symbol(int sym)
{
acc_symbols++;
txsymbols[symbols] = sym;
if (++symbols < numcarriers) {
return;
}
tx_carriers();
symbols = 0; //reset
}
void psk::tx_bit(int bit)
{
unsigned int sym;
@ -1455,35 +1463,33 @@ void psk::tx_bit(int bit)
// qpsk transmission
if (_qpsk) {
sym = enc->encode(bit);
//JD add interleaver
// Txinlv->bits(&sym);
sym = sym & 3;//JD just to make sure
tx_symbol(sym);
// else pskr (fec + interleaver) transmission
} else if (_pskr) {
// Encode into two bits
// Encode into two bits
bitshreg = enc->encode(bit);
// pass through interleaver
// pass through interleaver
if (mode != MODE_PSK63F) Txinlv->bits(&bitshreg);
// Send low bit first. tx_symbol expects 0 or 2 for BPSK
// Send low bit first. tx_symbol expects 0 or 2 for BPSK
sym = (bitshreg & 1) << 1;
tx_symbol(sym);
sym = bitshreg & 2;
tx_symbol(sym);
// else normal bpsk tranmission
// else normal bpsk tranmission
} else {
sym = bit << 1;
tx_symbol(sym);
}
}
unsigned char ch;
void psk::tx_char(unsigned char c)
{
ch = c;
const char *code;
char_symbols = acc_symbols;
if (_pskr) {
// acc_symbols = 0;
// ARQ varicode instead of MFSK for PSK63FEC
code = varienc(c);
} else {
@ -1499,21 +1505,18 @@ void psk::tx_char(unsigned char c)
tx_bit(0);
tx_bit(0);
}
char_symbols = acc_symbols - char_symbols;
}
void psk::tx_flush()
{
if (_pskr) {
//VK2ETA replace with a more effective flushing sequence (avoids cutting the last characters in low s/n)
/* for (int i = 0; i < dcdbits; i++)
tx_bit(0);
}
*/
for (int i = 0; i < dcdbits / 2; i++) {
tx_bit(1);
tx_bit(1);
}
ovhd_symbols = ((numcarriers - symbols) % numcarriers);
//VK2ETA replace with a more effective flushing sequence (avoids cutting the last characters in low s/n)
for (int i = 0; i < ovhd_symbols/2; i++) tx_bit(0);
for (int i = 0; i < dcdbits; i++) tx_bit(0);
return;
}
// QPSK - flush the encoder
if (_qpsk) {
@ -1539,8 +1542,6 @@ void psk::clearbits()
}
}
int psk::tx_process()
{
int c;
@ -1556,9 +1557,10 @@ int psk::tx_process()
preamble--;
tx_bit(1);
tx_bit(0);
// FEC: Mark start of first character with a double zero
// FEC: Mark start of first character with a double zero
// to ensure sync at end of preamble
if (preamble == 0) tx_bit(0);
if (preamble == 0)
while (acc_symbols % numcarriers) tx_bit(0);
return 0;
} else {
//JD for QPSK500R
@ -1576,6 +1578,11 @@ int psk::tx_process()
tx_flush();
stopflag = false;
cwid();
char_samples = char_symbols * symbollen / numcarriers;
xmt_samples = acc_symbols * symbollen / numcarriers;
ovhd_samples = (acc_symbols - char_symbols - ovhd_symbols) * symbollen / numcarriers;
return -1; // we're done
}

Wyświetl plik

@ -1173,6 +1173,8 @@ void rigCAT_close(void)
if ( rigCAT_open == false || rigCAT_exit == true)
return;
rigCAT_sendINIT("CLOSE");
{
guard_lock ser_guard( &rigCAT_mutex );
rigCAT_exit = true;
@ -1182,12 +1184,10 @@ void rigCAT_close(void)
pthread_join(rigCAT_thread, NULL);
rigCAT_sendINIT("CLOSE");
rigio.ClosePort();
rigCAT_open = false;
rigCAT_exit = false;
rigCAT_open = false;
rigCAT_bypass = false;
wf->USB(true);

Wyświetl plik

@ -71,6 +71,7 @@
#include "debug.h"
#include "qrunner.h"
#include "icons.h"
#include "macros.h"
#define SND_BUF_LEN 65536
#define SND_RW_LEN (8 * SND_BUF_LEN)
@ -79,7 +80,7 @@
// We never write duplicate/QSK/PTT tone/PseudoFSK data to the sound files
#define SNDFILE_CHANNELS 1
int sndfile_samplerate[4] = {22050, 24000, 44100, 48000};
int sndfile_samplerate[7] = {8000, 11025, 16000, 22050, 24000, 44100, 48000};
using namespace std;
@ -376,7 +377,8 @@ LOG_INFO("src ratio %f", play_src_data->src_ratio);
// ---------------------------------------------------------------------
// write_file
// All sound buffer data is resampled to 48000 samples/sec
// All sound buffer data is resampled to a specified sample rate
// progdefaults.wavSampleRate
// resultant data (left channel only) is written to a wav file
//----------------------------------------------------------------------
void SoundBase::write_file(SNDFILE* file, float* buf, size_t count)
@ -384,7 +386,7 @@ void SoundBase::write_file(SNDFILE* file, float* buf, size_t count)
int err;
if (modem_wr_sr != sample_frequency) {
modem_wr_sr = sample_frequency;
writ_src_data->src_ratio = sndfile_samplerate[progdefaults.wavSampleRate] / modem_wr_sr;
writ_src_data->src_ratio = 1.0 * sndfile_samplerate[progdefaults.wavSampleRate] / modem_wr_sr;
src_set_ratio(writ_src_state, writ_src_data->src_ratio);
}
writ_src_data->data_in = buf;
@ -742,6 +744,11 @@ size_t SoundOSS::Write(double *buf, size_t count)
write_file(ofGenerate, buf, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
if (txppm != progdefaults.TX_corr) {
txppm = progdefaults.TX_corr;
tx_src_data->src_ratio = 1.0 + txppm/1e6;
@ -806,6 +813,10 @@ size_t SoundOSS::Write_stereo(double *bufleft, double *bufright, size_t count)
write_file(ofGenerate, bufleft, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
if (txppm != progdefaults.TX_corr) {
txppm = progdefaults.TX_corr;
tx_src_data->src_ratio = 1.0 + txppm/1e6;
@ -1241,6 +1252,10 @@ size_t SoundPort::Write(double *buf, size_t count)
write_file(ofGenerate, buf, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
// copy input to both channels if right channel enabled
for (size_t i = 0; i < count; i++)
if (progdefaults.mono_audio)
@ -1270,6 +1285,10 @@ size_t SoundPort::Write_stereo(double *bufleft, double *bufright, size_t count)
write_file(ofCapture, bufleft, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
// interleave into fbuf
for (size_t i = 0; i < count; i++) {
if (progdefaults.ReverseAudio) {
@ -1895,6 +1914,10 @@ size_t SoundPulse::Write(double* buf, size_t count)
write_file(ofGenerate, buf, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
// copy input to both channels
for (size_t i = 0; i < count; i++)
if (progdefaults.mono_audio)
@ -1924,6 +1947,10 @@ size_t SoundPulse::Write_stereo(double* bufleft, double* bufright, size_t count)
write_file(ofGenerate, bufleft, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
for (size_t i = 0; i < count; i++) {
if (progdefaults.ReverseAudio) {
fbuf[sd[1].stream_params.channels * i + 1] = bufleft[i];
@ -2061,6 +2088,10 @@ size_t SoundNull::Write(double* buf, size_t count)
write_file(ofGenerate, buf, count);
#endif
if (PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST) {
return count;
}
MilliSleep((long)ceil((1e3 * count) / sample_frequency));
return count;

Wyświetl plik

@ -36,6 +36,7 @@
#include "configuration.h"
#include "waterfall.h"
#include "qrunner.h"
#include "macros.h"
#include "status.h"
#include "debug.h"
@ -181,6 +182,11 @@ double modem::frequency = 1000;
double modem::tx_frequency = 1000;
bool modem::freqlock = false;
// For xml socket command
unsigned long modem::tx_sample_count = 0;
unsigned int modem::tx_sample_rate = 0;
bool modem::XMLRPC_CPS_TEST = false;
modem::modem()
{
scptr = 0;
@ -449,6 +455,8 @@ void modem::ModulateXmtr(double *buffer, int len)
{
if (unlikely(!scard)) return;
tx_sample_count += len;
if (progdefaults.PTTrightchannel) {
for (int i = 0; i < len; i++)
PTTchannel[i] = PTTnco();
@ -456,7 +464,8 @@ void modem::ModulateXmtr(double *buffer, int len)
return;
}
if (progdefaults.viewXmtSignal)
if (progdefaults.viewXmtSignal &&
!(PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST))
trx_xmit_wfall_queue(samplerate, buffer, (size_t)len);
if (withnoise && progdefaults.noise) add_noise(buffer, len);
@ -486,7 +495,10 @@ void modem::ModulateStereo(double *left, double *right, int len)
{
if (unlikely(!scard)) return;
if (progdefaults.viewXmtSignal)
tx_sample_count += len;
if (progdefaults.viewXmtSignal &&
!(PERFORM_CPS_TEST || active_modem->XMLRPC_CPS_TEST))
trx_xmit_wfall_queue(samplerate, left, (size_t)len);
if (withnoise && progdefaults.noise) add_noise(left, len);
@ -722,7 +734,7 @@ struct mfntchr { char c; int byte[MAXROWS]; };
extern mfntchr idch1[]; // original id font definition
extern mfntchr idch2[]; // extended id font definition
static int symbols[MAXCHARS];
static int id_symbols[MAXCHARS];
static C_FIR_filter vidfilt;
@ -751,7 +763,7 @@ void modem::wfid_send(int numchars)
for (i = 0; i < IDSYMLEN; i++) {
val = 0.0;
for (k = 0; k < numchars; k++) {
sym = symbols[numchars - k - 1];
sym = id_symbols[numchars - k - 1];
for (j = 0; j < NUMCOLS; j++) {
if (sym & 1)
val += sin(wfid_w[j + k * NUMCOLS] * i);
@ -787,9 +799,9 @@ void modem::wfid_sendchars(string s)
for (int row = 0; row < NUMROWS; row++) {
for (int i = 0; i < len; i++) {
if (useIDSMALL)
symbols[i] = idch1[n[i]].byte[NUMROWS - 1 - row];
id_symbols[i] = idch1[n[i]].byte[NUMROWS - 1 - row];
else
symbols[i] = idch2[n[i]].byte[NUMROWS - 1 - row];
id_symbols[i] = idch2[n[i]].byte[NUMROWS - 1 - row];
}
wfid_send(len);
if (stopflag)
@ -879,7 +891,7 @@ void modem::wfid_text(const string& s)
break;
}
// blank lines
for (int i = 0; i < vidwidth; i++) symbols[i] = 0;
for (int i = 0; i < vidwidth; i++) id_symbols[i] = 0;
wfid_send(vidwidth);
wfid_send(vidwidth);

Wyświetl plik

@ -25,6 +25,7 @@
#include <config.h>
#include <sys/time.h>
#include <fcntl.h>
#include <semaphore.h>
#include <cstdlib>
@ -310,6 +311,7 @@ void trx_trx_transmit_loop()
return;
}
if (active_modem) {
try {
current_samplerate = active_modem->get_samplerate();
scard->Open(O_WRONLY, current_samplerate);
@ -321,7 +323,10 @@ void trx_trx_transmit_loop()
return;
}
if (active_modem != ssb_modem && active_modem != anal_modem) {
if ((active_modem != ssb_modem) &&
(active_modem != anal_modem) &&
!active_modem->XMLRPC_CPS_TEST &&
!PERFORM_CPS_TEST ) {
push2talk->set(true);
REQ(&waterfall::set_XmtRcvBtn, wf, true);
}
@ -348,10 +353,17 @@ void trx_trx_transmit_loop()
}
if (progStatus.n_rsids >= 0) {
// if(trx_state == STATE_TX) {
active_modem->tx_sample_count = 0;
active_modem->tx_sample_rate = active_modem->get_samplerate();
// }
while (trx_state == STATE_TX) {
try {
if (active_modem->tx_process() < 0)
if (active_modem->tx_process() < 0) {
trx_state = STATE_RX;
}
}
catch (const SndException& e) {
scard->Close();
@ -384,6 +396,7 @@ void trx_trx_transmit_loop()
REQ(&waterfall::set_XmtRcvBtn, wf, false);
if (progStatus.timer)
REQ(startMacroTimer);
WriteARQ(0x06);
}
//=============================================================================

Wyświetl plik

@ -2188,11 +2188,11 @@ void waterfall::handle_mouse_wheel(int what, int d)
bool changed_save = progdefaults.changed;
val->do_callback();
progdefaults.changed = changed_save;
if (val == cntServerOffset || val == cntSearchRange)
if (val == cntServerOffset || val == cntSearchRange) {
if (active_modem) active_modem->set_sigsearch(SIGSEARCH);
else if (val == sldrSquelch) // sldrSquelch gives focus to TransmitText
} else if (val == sldrSquelch) { // sldrSquelch gives focus to TransmitText
take_focus();
}
if (msg_fmt) {
char msg[60];
snprintf(msg, sizeof(msg), msg_fmt, msg_label, val->value());

Wyświetl plik

@ -613,8 +613,7 @@ void FTextRX::menu_cb(size_t item)
break;
case RX_MENU_WRAP:
set_word_wrap(!wrap);
restore_wrap = wrap;
set_word_wrap(!wrap, true);
break;
case RX_MENU_SCROLL_HINTS:
@ -1274,8 +1273,7 @@ void FTextTX::menu_cb(size_t item)
break;
}
case TX_MENU_WRAP:
set_word_wrap(!wrap);
restore_wrap = wrap;
set_word_wrap(!wrap, true);
break;
}
}

Wyświetl plik

@ -140,9 +140,10 @@ void FTextBase::add(unsigned char c, int attr)
insert(s);
}
void FTextBase::set_word_wrap(bool b)
void FTextBase::set_word_wrap(bool b, bool b2)
{
wrap_mode((wrap = b), wrap_col);
if (b2) restore_wrap = wrap;
show_insert_position();
}
@ -580,8 +581,7 @@ void FTextView::menu_cb(size_t item)
saveFile();
break;
case VIEW_MENU_WRAP:
set_word_wrap(!wrap);
restore_wrap = wrap;
set_word_wrap(!wrap, true);
break;
}
}
@ -858,8 +858,7 @@ void FTextEdit::menu_cb(size_t item)
readFile();
break;
case EDIT_MENU_WRAP:
set_word_wrap(!wrap);
restore_wrap = wrap;
set_word_wrap(!wrap, true);
break;
}
}

Wyświetl plik

@ -81,7 +81,7 @@ pskBrowser::pskBrowser(int x, int y, int w, int h, const char *l)
bline = freqformat(i);
if ( i < progdefaults.VIEWERchannels) add(bline.c_str());
linechars[i] = 0;
new(&cdistiller[i]) CharsetDistiller(rxtx_charset);
new(&cdistiller[i]) CharsetDistiller;
}
nchars = (w - cols[0] - (sbarwidth + 2*BWSR_BORDER)) / cwidth;
nchars = nchars < 1 ? 1 : nchars;