CW DTR-RTS

* generate CW on selected DTR/RTS signal line
  * CW DTR/RTS signals generated concurrent
    with AF counterparts and within a separate thread.
This commit is contained in:
David Freese 2020-01-27 17:44:02 -06:00
parent f77503a870
commit f4dd622c55
12 changed files with 664 additions and 340 deletions

View file

@ -60,6 +60,9 @@
using namespace std;
void start_cwio_thread();
void stop_cwio_thread();
#define XMT_FILT_LEN 256
#define QSK_DELAY_LEN 4*XMT_FILT_LEN
#define CW_FFT_SIZE 2048 // must be a factor of 2
@ -268,6 +271,7 @@ cw::~cw() {
if (cw_FFT_filter) delete cw_FFT_filter;
if (bitfilter) delete bitfilter;
if (trackingfilter) delete trackingfilter;
stop_cwio_thread();
}
cw::cw() : modem()
@ -349,6 +353,7 @@ cw::cw() : modem()
noise_floor = 1.0;
sig_avg = 0.0;
start_cwio_thread();
}
// SHOULD ONLY BE CALLED FROM THE rx_processing loop
@ -964,20 +969,6 @@ inline double cw::qsknco()
//=======================================================================
bool first_char = true;
/*
void appendfile(double *left, double *right, size_t count)
{
if (!count) {
FILE *ofile = fl_fopen("cwstream.txt", "w");
fclose(ofile);
return;
}
FILE *ofile = fl_fopen("cwstream.txt", "a");
for (size_t i = 0; i < count; i++)
fprintf(ofile,"%f,%f\n", left[i], right[i]);
fclose(ofile);
}
*/
enum {START, FIRST, MID, LAST, SPACE};
@ -992,8 +983,11 @@ void cw::send_symbol(int bit, int len, int state)
memset(qskbuf, 0, OUTBUFSIZE*sizeof(*qskbuf));
if (bit == 1) { // keydown
tx_frequency = get_txfreq_woffset();
if (CW_KEYLINE_isopen || progdefaults.CW_KEYLINE_on_cat_port)
tx_frequency = progdefaults.CWsweetspot;
for (int n = 0; n < len; n++) {
outbuf[n] = nco(get_txfreq_woffset());
outbuf[n] = nco(tx_frequency);
if (n < knum) outbuf[n] *= keyshape[n];
if (len - n < knum) outbuf[n] *= keyshape[len - n];
qskbuf[n] = qsk_amp * qsknco();
@ -1031,8 +1025,6 @@ void cw::send_symbol(int bit, int len, int state)
}
}
// appendfile(outbuf, qskbuf, len);
if (progdefaults.QSK)
ModulateStereo(outbuf, qskbuf, len);
else
@ -1132,9 +1124,6 @@ int cw::tx_process()
{
int c;
// if (first_char) {
// appendfile(NULL, NULL, 0);
// }
if (use_paren != progdefaults.CW_use_paren ||
prosigns != progdefaults.CW_prosigns) {
use_paren = progdefaults.CW_use_paren;
@ -1190,11 +1179,11 @@ int cw::tx_process()
acc_symbols = 0;
if (CW_KEYLINE_isopen || progdefaults.CW_KEYLINE_on_cat_port)
send_CW_KEYLINE(c);
else {
send_CW(c);
// else {
send_ch(c);
first_char = false;
}
// }
char_samples = acc_symbols;
return 0;
@ -1231,84 +1220,13 @@ void cw::toggleWPM()
update_Status();
}
// ---------------------------------------------------------------------
// TTY output on DTR/RTS signal lines
//----------------------------------------------------------------------
Cserial CW_KEYLINE_serial;
bool CW_KEYLINE_isopen = false;
void cw::CW_KEYLINE(bool on)
{
if (on) {
if (progdefaults.CW_KEYLINE == 2) {
if (progdefaults.CW_KEYLINE_on_cat_port)
rigio.SetDTR(1);
else
CW_KEYLINE_serial.SetDTR(1);
} else if (progdefaults.CW_KEYLINE == 1) {
if (progdefaults.CW_KEYLINE_on_cat_port)
rigio.SetRTS(1);
else
CW_KEYLINE_serial.SetRTS(1);
}
} else {
if (progdefaults.CW_KEYLINE == 2) {
if (progdefaults.CW_KEYLINE_on_cat_port)
rigio.SetDTR(0);
else
CW_KEYLINE_serial.SetDTR(0);
} else if (progdefaults.CW_KEYLINE == 1) {
if (progdefaults.CW_KEYLINE_on_cat_port)
rigio.SetRTS(0);
else
CW_KEYLINE_serial.SetRTS(0);
}
}
}
void cw::send_CW_KEYLINE(int c)
{
if (c == GET_TX_CHAR_NODATA || c == 0x0d) {
MilliSleep(50);
return;
}
float tc = 1200.0 / progdefaults.CWspeed;
float ta = 0.0;
float tch = 3 * tc, twd = 4 * tc;
if (progdefaults.CWusefarnsworth && (progdefaults.CWspeed > progdefaults.CWfarnsworth)) {
ta = 60000.0 / progdefaults.CWfarnsworth - 37200 / progdefaults.CWspeed;
tch = 3 * ta / 19;
twd = 4 * ta / 19;
}
if (c == 0x0a) c = ' ';
if (c == ' ') {
MilliSleep(twd);
put_echo_char(' ');
return;
}
string code = morse.tx_lookup(c);
for (size_t n = 0; n < code.length(); n++) {
CW_KEYLINE(1);
if (code[n] == '.')
MilliSleep(tc);
else
MilliSleep(3*tc);
CW_KEYLINE(0);
if (n == code.length() -1)
MilliSleep(tch);
else
MilliSleep(tc);
}
string prtstr = morse.tx_print();
for (size_t n = 0; n < prtstr.length(); n++)
put_echo_char(
prtstr[n],
prtstr[0] == '<' ? FTextBase::CTRL : FTextBase::XMIT);
return;
}
int open_CW_KEYLINE()
{
CW_KEYLINE_serial.Device(progdefaults.CW_KEYLINE_serial_port_name);
@ -1352,3 +1270,150 @@ void close_CW_KEYLINE()
CW_KEYLINE_serial.ClosePort();
CW_KEYLINE_isopen = false;
}
//----------------------------------------------------------------------
static pthread_t cwio_pthread;
static pthread_cond_t cwio_cond;
static pthread_mutex_t cwio_mutex = PTHREAD_MUTEX_INITIALIZER;
static bool cwio_thread_running = false;
static bool cwio_terminate_flag = false;
//----------------------------------------------------------------------
#define cwio_bit(bit, len) {if (progdefaults.CW_KEYLINE == 2) ser->SetDTR(bit);\
else ser->SetRTS(bit);\
MilliSleep((len));}
static int cwio_ch;
static cMorse cwio_morse;
static bool cwio_sending = false;
void send_cwio(int c)
{
cwio_sending = true;
if (c == GET_TX_CHAR_NODATA || c == 0x0d) {
cwio_sending = false;
return;
}
float tc = 1200.0 / progdefaults.CWspeed;
float ta = 0.0;
float tch = 3 * tc, twd = 4 * tc;
Cserial *ser = &CW_KEYLINE_serial;
if (progdefaults.CW_KEYLINE_on_cat_port)
ser = &rigio;
if (progdefaults.CWusefarnsworth && (progdefaults.CWspeed > progdefaults.CWfarnsworth)) {
ta = 60000.0 / progdefaults.CWfarnsworth - 37200 / progdefaults.CWspeed;
tch = 3 * ta / 19;
twd = 4 * ta / 19;
}
if (c == 0x0a) c = ' ';
if (c == ' ') {
cwio_bit(0, twd);
cwio_sending = false;
return;
}
string code;
code = cwio_morse.tx_lookup(c);
for (size_t n = 0; n < code.length(); n++) {
if (code[n] == '.') {
cwio_bit(1, tc);
} else {
cwio_bit(1, 3*tc);
}
if (n < code.length() -1) {
cwio_bit(0, tc);
} else {
cwio_bit(0, tch);
}
}
cwio_sending = false;
}
static void * cwio_loop(void *args)
{
// SET_THREAD_ID(AUDIO_ALERT_TID);
cwio_thread_running = true;
cwio_terminate_flag = false;
while(1) {
pthread_mutex_lock(&cwio_mutex);
pthread_cond_wait(&cwio_cond, &cwio_mutex);
pthread_mutex_unlock(&cwio_mutex);
if (cwio_terminate_flag)
break;
send_cwio(cwio_ch);
}
return (void *)0;
}
void stop_cwio_thread(void)
{
if(!cwio_thread_running) return;
cwio_terminate_flag = true;
pthread_cond_signal(&cwio_cond);
MilliSleep(10);
pthread_join(cwio_pthread, NULL);
pthread_mutex_destroy(&cwio_mutex);
pthread_cond_destroy(&cwio_cond);
memset((void *) &cwio_pthread, 0, sizeof(cwio_pthread));
memset((void *) &cwio_mutex, 0, sizeof(cwio_mutex));
cwio_thread_running = false;
cwio_terminate_flag = false;
}
void start_cwio_thread(void)
{
if (cwio_thread_running) return;
memset((void *) &cwio_pthread, 0, sizeof(cwio_pthread));
memset((void *) &cwio_mutex, 0, sizeof(cwio_mutex));
memset((void *) &cwio_cond, 0, sizeof(cwio_cond));
if(pthread_cond_init(&cwio_cond, NULL)) {
LOG_ERROR("Alert thread create fail (pthread_cond_init)");
return;
}
if(pthread_mutex_init(&cwio_mutex, NULL)) {
LOG_ERROR("AUDIO_ALERT thread create fail (pthread_mutex_init)");
return;
}
if (pthread_create(&cwio_pthread, NULL, cwio_loop, NULL) < 0) {
pthread_mutex_destroy(&cwio_mutex);
LOG_ERROR("AUDIO_ALERT thread create fail (pthread_create)");
}
LOG_VERBOSE("started audio cwio thread");
MilliSleep(10); // Give the CPU time to set 'cwio_thread_running'
}
void cw::send_CW(int c)
{
if (!cwio_thread_running)
start_cwio_thread();
int count = 400;
while (cwio_sending) {
MilliSleep(1);
if (--count <= 0) return;
}
cwio_ch = c;
cwio_morse.init();
pthread_cond_signal(&cwio_cond);
}

View file

@ -48,12 +48,17 @@ using namespace std;
#include "main.h"
#include "modem.h"
#include "threads.h"
#include "rtty.h"
#define FILTER_DEBUG 0
#define SHAPER_BAUD 150
//void start_fsk_thread();
//void stop_fsk_thread();
//=====================================================================
// Baudot support
//=====================================================================
@ -197,6 +202,9 @@ rtty::~rtty()
delete m_Osc2;
delete m_SymShaper1;
delete m_SymShaper2;
// EXPERIMENTAL FSK DTR/RTS
// stop_fsk_thread();
}
void rtty::reset_filters()
@ -236,6 +244,8 @@ void rtty::restart()
txmode = LETTERS;
rxmode = LETTERS;
symbollen = (int) (samplerate / rtty_baud + 0.5);
// part of an EXPERIMENTAL FSK implementation
// bitlen = 1000.0 / rtty_baud; // bit length in milliseconds
set_bandwidth(shift);
rtty_BW = progdefaults.RTTY_BW = rtty_baud * 2;
@ -331,6 +341,8 @@ rtty::rtty(trx_mode tty_mode)
restart();
// EXPERIMENT FSK on DTR/RTS
// start_fsk_thread();
}
void rtty::Update_syncscope()
@ -380,25 +392,25 @@ static int rparity(int c)
return p & 1;
}
int rtty::rttyparity(unsigned int c)
int rttyparity(unsigned int c, int nbits)
{
c &= (1 << nbits) - 1;
switch (rtty_parity) {
switch (progdefaults.rtty_parity) {
default:
case RTTY_PARITY_NONE:
case rtty::RTTY_PARITY_NONE:
return 0;
case RTTY_PARITY_ODD:
case rtty::RTTY_PARITY_ODD:
return rparity(c);
case RTTY_PARITY_EVEN:
case rtty::RTTY_PARITY_EVEN:
return !rparity(c);
case RTTY_PARITY_ZERO:
case rtty::RTTY_PARITY_ZERO:
return 0;
case RTTY_PARITY_ONE:
case rtty::RTTY_PARITY_ONE:
return 1;
}
}
@ -408,7 +420,7 @@ int rtty::decode_char()
unsigned int parbit, par, data;
parbit = (rxdata >> nbits) & 1;
par = rttyparity(rxdata);
par = rttyparity(rxdata, nbits);
if (rtty_parity != RTTY_PARITY_NONE && parbit != par)
return 0;
@ -865,130 +877,124 @@ double rtty::FSKnco()
}
extern Cserial CW_KEYLINE_serial;
extern bool CW_KEYLINE_isopen;
void rtty::send_symbol(int symbol, int len)
{
acc_symbols += len;
//#if !SHAPER_BAUD
if (!progStatus.shaped_rtty) {
//if (rtty_baud > SHAPER_BAUD) {
double freq;
if (reverse) symbol = !symbol;
if (symbol)
freq = get_txfreq_woffset() + shift / 2.0;
else
freq = get_txfreq_woffset() - shift / 2.0;
acc_symbols += len;
if (!progStatus.shaped_rtty) {
double freq;
for (int i = 0; i < len; i++) {
outbuf[i] = nco(freq);
if (symbol)
FSKbuf[i] = FSKnco();
freq = get_txfreq_woffset() + shift / 2.0;
else
FSKbuf[i] = 0.0 * FSKnco();
}
} else {
//#else
freq = get_txfreq_woffset() - shift / 2.0;
double const freq1 = get_txfreq_woffset() + shift / 2.0;
double const freq2 = get_txfreq_woffset() - shift / 2.0;
double mark = 0, space = 0;
double signal = 0;
for (int i = 0; i < len; i++) {
outbuf[i] = nco(freq);
if (symbol)
FSKbuf[i] = FSKnco();
else
FSKbuf[i] = 0.0;
}
} else {
double const freq1 = get_txfreq_woffset() + shift / 2.0;
double const freq2 = get_txfreq_woffset() - shift / 2.0;
double mark = 0, space = 0;
double signal = 0;
if (reverse)
symbol = !symbol;
if (maxamp == 0) {
int sym = 0;
for (int j = 0; j < 100; j++) {
if (sym) sym = 0;
else sym = 1;
for( int i = 0; i < 3*len; ++i ) {
mark = m_SymShaper1->Update( sym) * m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!sym) * m_Osc2->Update( freq2 );
signal = mark + space;
if (maxamp == 0) {
int sym = 0;
for (int j = 0; j < 100; j++) {
if (sym) sym = 0;
else sym = 1;
for( int i = 0; i < 3*len; ++i ) {
mark = m_SymShaper1->Update( sym) * m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!sym) * m_Osc2->Update( freq2 );
signal = mark + space;
if (maxamp < fabs(signal)) maxamp = fabs(signal);
if (maxamp < fabs(signal)) maxamp = fabs(signal);
}
}
}
}
for( int i = 0; i < len; ++i ) {
mark = m_SymShaper1->Update( symbol) * m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!symbol) * m_Osc2->Update( freq2 );
signal = mark + space;
for( int i = 0; i < len; ++i ) {
mark = m_SymShaper1->Update( symbol) * m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!symbol) * m_Osc2->Update( freq2 );
signal = mark + space;
if (maxamp < fabs(signal)) {
maxamp = fabs(signal);
if (maxamp < fabs(signal)) {
maxamp = fabs(signal);
}
outbuf[i] = maxamp ? (signal / maxamp) : 0.0;
if (symbol)
FSKbuf[i] = FSKnco();
else
FSKbuf[i] = 0.0 * FSKnco();
}
outbuf[i] = maxamp ? (0.99 * signal / maxamp) : 0.0;
if (symbol)
FSKbuf[i] = FSKnco();
else
FSKbuf[i] = 0.0 * FSKnco();
}
}
//#endif
if (progdefaults.PseudoFSK)
ModulateStereo(outbuf, FSKbuf, symbollen);
else
ModulateXmtr(outbuf, symbollen);
}
void rtty::send_stop()
{
//#if !SHAPER_BAUD
if (!progStatus.shaped_rtty) {
//if (rtty_baud >= SHAPER_BAUD) {
double freq;
bool invert = reverse;
if (!progStatus.shaped_rtty) {
double freq;
bool invert = reverse;
if (invert)
freq = get_txfreq_woffset() - shift / 2.0;
else
freq = get_txfreq_woffset() + shift / 2.0;
for (int i = 0; i < stoplen; i++) {
outbuf[i] = nco(freq);
if (invert)
FSKbuf[i] = 0.0 * FSKnco();
freq = get_txfreq_woffset() - shift / 2.0;
else
FSKbuf[i] = FSKnco();
}
} else {
//#else
freq = get_txfreq_woffset() + shift / 2.0;
double const freq1 = get_txfreq_woffset() + shift / 2.0;
double const freq2 = get_txfreq_woffset() - shift / 2.0;
double mark = 0, space = 0, signal = 0;
bool symbol = true;
if (reverse)
symbol = !symbol;
for( int i = 0; i < stoplen; ++i ) {
mark = m_SymShaper1->Update( symbol)*m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!symbol)*m_Osc2->Update( freq2 );
signal = mark + space;
if (maxamp < fabs(signal)) maxamp = fabs(signal);
outbuf[i] = maxamp ? (0.99 * signal / maxamp) : 0.0;
for (int i = 0; i < stoplen; i++) {
outbuf[i] = nco(freq);
if (invert)
FSKbuf[i] = 0.0;
else
FSKbuf[i] = FSKnco();
}
} else {
double const freq1 = get_txfreq_woffset() + shift / 2.0;
double const freq2 = get_txfreq_woffset() - shift / 2.0;
double mark = 0, space = 0, signal = 0;
bool symbol = true;
if (reverse)
FSKbuf[i] = 0.0 * FSKnco();
else
FSKbuf[i] = FSKnco();
symbol = !symbol;
for( int i = 0; i < stoplen; ++i ) {
mark = m_SymShaper1->Update( symbol)*m_Osc1->Update( freq1 );
space = m_SymShaper2->Update(!symbol)*m_Osc2->Update( freq2 );
signal = mark + space;
if (maxamp < fabs(signal))
maxamp = fabs(signal);
outbuf[i] = maxamp ? (signal / maxamp) : 0.0;
if (reverse)
FSKbuf[i] = 0.0;
else
FSKbuf[i] = FSKnco();
}
}
}
//#endif
if (progdefaults.PseudoFSK)
ModulateStereo(outbuf, FSKbuf, stoplen);
else
ModulateXmtr(outbuf, stoplen);
}
void rtty::flush_stream()
@ -1003,7 +1009,8 @@ void rtty::flush_stream()
signal = mark + space;
if (maxamp < fabs(signal)) maxamp = fabs(signal);
outbuf[i] = maxamp ? (0.99 * signal / maxamp) : 0.0;
outbuf[i] = maxamp ? (signal / maxamp) : 0.0;
FSKbuf[i] = 0.0;
}
@ -1017,8 +1024,13 @@ void rtty::flush_stream()
void rtty::send_char(int c)
{
int i;
// experimental code that fails to perform well on Windows, poorly on OS-X
// and perfectly on Linux!
// if (progdefaults.useFSK && (CW_KEYLINE_isopen || progdefaults.CW_KEYLINE_on_cat_port)) {
// send_FSK(c);
// }
int i;
if (nbits == 5) {
if (c == LETTERS)
c = 0x1F;
@ -1034,7 +1046,7 @@ void rtty::send_char(int c)
}
// parity bit
if (rtty_parity != RTTY_PARITY_NONE)
send_symbol(rttyparity(c), symbollen);
send_symbol(rttyparity(c, nbits), symbollen);
// stop bit(s)
send_stop();
@ -1050,6 +1062,7 @@ void rtty::send_char(int c)
}
else
put_echo_char(c);
}
void rtty::send_idle()
@ -1160,11 +1173,8 @@ int rtty::tx_process()
}
if (preamble) {
m_SymShaper1->reset();
m_SymShaper2->reset();
send_stop();
for (int i = 0; i < progdefaults.TTY_LTRS; i++)
send_idle();
send_char(LETTERS);
preamble = false;
}
@ -1313,6 +1323,143 @@ char rtty::baudot_dec(unsigned char data)
return out;
}
// ---------------------------------------------------------------------
// TTY output on DTR/RTS signal lines
//----------------------------------------------------------------------
// experimental code that performs perfect on Linux, OK on OS-X and
// fails on Windows-10 !!!
/*
static pthread_t fsk_pthread;
static pthread_cond_t fsk_cond;
static pthread_mutex_t fsk_mutex = PTHREAD_MUTEX_INITIALIZER;
static bool fsk_thread_running = false;
static bool fsk_terminate_flag = false;
#define fskbit(bit, len) {if (progdefaults.FSK_keyline == 2) ser->SetDTR(bit);\
else ser->SetRTS(bit);\
MilliSleep((len));}
static int fsk_ch;
static int fsk_nbits;
static int fsk_parity;
static bool fsk_sending = false;
void send_fsk(int c)
{
fsk_sending = true;
int bitlen = 1000.0 / rtty::BAUD[progdefaults.rtty_baud];
int stoplen = bitlen * (progdefaults.rtty_stop == 0 ? 1.0 : progdefaults.rtty_stop == 1 ? 1.5 : 2.0);
Cserial *ser = &CW_KEYLINE_serial;
if (progdefaults.CW_KEYLINE_on_cat_port)
ser = &rigio;
if (fsk_nbits == 5) {
if (c == LETTERS) c = 0x1F;
else if (c == FIGURES) c = 0x1B;
}
// start bit
fskbit(1, bitlen);
// data bits
for (int i = 0; i < fsk_nbits; i++)
fskbit(!((c >> i) & 1), bitlen);
// parity bit
if (fsk_parity != rtty::RTTY_PARITY_NONE)
fskbit(!rttyparity(c, fsk_nbits), bitlen);
// stop bits
fskbit(0, stoplen);
fsk_sending = false;
}
static void * fsk_loop(void *args)
{
// SET_THREAD_ID(AUDIO_ALERT_TID);
fsk_thread_running = true;
fsk_terminate_flag = false;
while(1) {
pthread_mutex_lock(&fsk_mutex);
pthread_cond_wait(&fsk_cond, &fsk_mutex);
pthread_mutex_unlock(&fsk_mutex);
if (fsk_terminate_flag)
break;
send_fsk(fsk_ch);
}
return (void *)0;
}
void stop_fsk_thread(void)
{
if(!fsk_thread_running) return;
fsk_terminate_flag = true;
pthread_cond_signal(&fsk_cond);
MilliSleep(10);
pthread_join(fsk_pthread, NULL);
pthread_mutex_destroy(&fsk_mutex);
pthread_cond_destroy(&fsk_cond);
memset((void *) &fsk_pthread, 0, sizeof(fsk_pthread));
memset((void *) &fsk_mutex, 0, sizeof(fsk_mutex));
fsk_thread_running = false;
fsk_terminate_flag = false;
}
void start_fsk_thread(void)
{
if (fsk_thread_running) return;
memset((void *) &fsk_pthread, 0, sizeof(fsk_pthread));
memset((void *) &fsk_mutex, 0, sizeof(fsk_mutex));
memset((void *) &fsk_cond, 0, sizeof(fsk_cond));
if(pthread_cond_init(&fsk_cond, NULL)) {
LOG_ERROR("Alert thread create fail (pthread_cond_init)");
return;
}
if(pthread_mutex_init(&fsk_mutex, NULL)) {
LOG_ERROR("AUDIO_ALERT thread create fail (pthread_mutex_init)");
return;
}
if (pthread_create(&fsk_pthread, NULL, fsk_loop, NULL) < 0) {
pthread_mutex_destroy(&fsk_mutex);
LOG_ERROR("AUDIO_ALERT thread create fail (pthread_create)");
}
LOG_VERBOSE("started audio fsk thread");
MilliSleep(10); // Give the CPU time to set 'fsk_thread_running'
}
void rtty::send_FSK(int c)
{
if (!fsk_thread_running)
start_fsk_thread();
int count = 100;
while (fsk_sending) {
MilliSleep(1);
if (--count <= 0) return;
}
fsk_ch = c;
fsk_nbits = nbits;
fsk_parity = rtty_parity;
pthread_cond_signal(&fsk_cond);
}
*/
//======================================================================
// methods for class Oscillator and class SymbolShaper
//======================================================================
@ -1459,3 +1606,4 @@ void SymbolShaper::print_sinc_table()
{
for (int i = 0; i < 1024; i++) printf("%f\n", m_SincTable[i]);
}

View file

@ -3250,12 +3250,6 @@ static void cb_btn_correction(Fl_Button*, void*) {
nanoIO_correction();
}
Fl_Check_Button *btn_CW_KEYLINE_catport=(Fl_Check_Button *)0;
static void cb_btn_CW_KEYLINE_catport(Fl_Check_Button* o, void*) {
progdefaults.CW_KEYLINE_on_cat_port = o->value();
}
Fl_ListBox *listbox_CW_KEYLINE=(Fl_ListBox *)0;
static void cb_listbox_CW_KEYLINE(Fl_ListBox* o, void*) {
@ -3263,6 +3257,28 @@ static void cb_listbox_CW_KEYLINE(Fl_ListBox* o, void*) {
progdefaults.changed = true;
}
Fl_ListBox *listbox_FSK_KEYLINE=(Fl_ListBox *)0;
static void cb_listbox_FSK_KEYLINE(Fl_ListBox* o, void*) {
progdefaults.FSK_keyline = o->index();
progdefaults.useFSK = (listbox_FSK_KEYLINE->index() > 0);
chkFSKkeying->value(progdefaults.useFSK);
progdefaults.changed = true;
}
Fl_ListBox *listbox_PTT_KEYLINE=(Fl_ListBox *)0;
static void cb_listbox_PTT_KEYLINE(Fl_ListBox* o, void*) {
progdefaults.PTT_KEYLINE = o->index();
progdefaults.changed = true;
}
Fl_Check_Button *chkFSKkeying=(Fl_Check_Button *)0;
static void cb_chkFSKkeying(Fl_Check_Button* o, void*) {
o->value(progdefaults.useFSK);
}
Fl_ComboBox *select_CW_KEYLINE_CommPort=(Fl_ComboBox *)0;
static void cb_select_CW_KEYLINE_CommPort(Fl_ComboBox* o, void*) {
@ -3282,6 +3298,12 @@ static void cb_btn_CW_KEYLINE_connect(Fl_Light_Button* o, void*) {
};
}
Fl_Check_Button *btn_CW_KEYLINE_catport=(Fl_Check_Button *)0;
static void cb_btn_CW_KEYLINE_catport(Fl_Check_Button* o, void*) {
progdefaults.CW_KEYLINE_on_cat_port = o->value();
}
Fl_Input2 *txtSecondary=(Fl_Input2 *)0;
static void cb_txtSecondary(Fl_Input2* o, void*) {
@ -4222,6 +4244,13 @@ if (o->value()) {
};
}
Fl_Counter *cnt_TTY_LTRS=(Fl_Counter *)0;
static void cb_cnt_TTY_LTRS(Fl_Counter* o, void*) {
progdefaults.TTY_LTRS = (int)o->value();
progdefaults.changed = true;
}
Fl_Counter *cntr_xcvr_FSK_MARK=(Fl_Counter *)0;
static void cb_cntr_xcvr_FSK_MARK(Fl_Counter* o, void*) {
@ -4237,13 +4266,6 @@ resetRTTY();
progdefaults.changed = true;
}
Fl_Counter *cnt_TTY_LTRS=(Fl_Counter *)0;
static void cb_cnt_TTY_LTRS(Fl_Counter* o, void*) {
progdefaults.TTY_LTRS = (int)o->value();
progdefaults.changed = true;
}
Fl_ComboBox *select_nanoIO_CommPort=(Fl_ComboBox *)0;
static void cb_select_nanoIO_CommPort(Fl_ComboBox* o, void*) {
@ -11262,7 +11284,7 @@ ded Morse characters."));
o->hide();
{ Fl_Group* o = new Fl_Group(205, 25, 590, 145);
o->box(FL_ENGRAVED_BOX);
{ Fl_Box* o = new Fl_Box(216, 50, 565, 90, _("DTR/RTS keying may share the RigCat serial port, or be assigned to separate\n\
{ Fl_Box* o = new Fl_Box(210, 38, 580, 116, _("DTR/RTS keying may share the RigCat serial port, or be assigned to separate\n\
serial port (typical of Yaesu transceiver FT-991A). If separate, the CAT cont\
rol\ncan be via flrig, RigCat or Hamlib. No settings for baud, stops bits, et\
c are\nneeded."));
@ -11270,30 +11292,63 @@ c are\nneeded."));
} // Fl_Box* o
o->end();
} // Fl_Group* o
{ Fl_Check_Button* o = btn_CW_KEYLINE_catport = new Fl_Check_Button(257, 184, 70, 15, _("Use RIGCAT serial port"));
btn_CW_KEYLINE_catport->down_box(FL_DOWN_BOX);
btn_CW_KEYLINE_catport->callback((Fl_Callback*)cb_btn_CW_KEYLINE_catport);
o->value(progdefaults.CW_KEYLINE_on_cat_port);
} // Fl_Check_Button* btn_CW_KEYLINE_catport
{ Fl_ListBox* o = listbox_CW_KEYLINE = new Fl_ListBox(580, 179, 110, 24, _("CW Keyline"));
listbox_CW_KEYLINE->box(FL_DOWN_BOX);
listbox_CW_KEYLINE->color(FL_BACKGROUND2_COLOR);
listbox_CW_KEYLINE->selection_color(FL_BACKGROUND_COLOR);
listbox_CW_KEYLINE->labeltype(FL_NORMAL_LABEL);
listbox_CW_KEYLINE->labelfont(0);
listbox_CW_KEYLINE->labelsize(14);
listbox_CW_KEYLINE->labelcolor(FL_FOREGROUND_COLOR);
listbox_CW_KEYLINE->callback((Fl_Callback*)cb_listbox_CW_KEYLINE);
listbox_CW_KEYLINE->align(Fl_Align(FL_ALIGN_LEFT));
listbox_CW_KEYLINE->when(FL_WHEN_RELEASE);
o->add("None|RTS|DTR");
o->index(progdefaults.CW_KEYLINE);
listbox_CW_KEYLINE->end();
} // Fl_ListBox* listbox_CW_KEYLINE
{ Fl_Group* o = new Fl_Group(205, 226, 589, 78, _("Keyline on separate serial port"));
{ Fl_Group* o = new Fl_Group(205, 170, 590, 129);
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP|FL_ALIGN_INSIDE));
{ Fl_ComboBox* o = select_CW_KEYLINE_CommPort = new Fl_ComboBox(210, 264, 485, 23, _("Ser. Port"));
{ Fl_ListBox* o = listbox_CW_KEYLINE = new Fl_ListBox(290, 182, 90, 24, _("CW Keyline"));
listbox_CW_KEYLINE->box(FL_DOWN_BOX);
listbox_CW_KEYLINE->color(FL_BACKGROUND2_COLOR);
listbox_CW_KEYLINE->selection_color(FL_BACKGROUND_COLOR);
listbox_CW_KEYLINE->labeltype(FL_NORMAL_LABEL);
listbox_CW_KEYLINE->labelfont(0);
listbox_CW_KEYLINE->labelsize(14);
listbox_CW_KEYLINE->labelcolor(FL_FOREGROUND_COLOR);
listbox_CW_KEYLINE->callback((Fl_Callback*)cb_listbox_CW_KEYLINE);
listbox_CW_KEYLINE->align(Fl_Align(FL_ALIGN_LEFT));
listbox_CW_KEYLINE->when(FL_WHEN_RELEASE);
o->add("None|RTS|DTR");
o->index(progdefaults.CW_KEYLINE);
listbox_CW_KEYLINE->end();
} // Fl_ListBox* listbox_CW_KEYLINE
{ Fl_ListBox* o = listbox_FSK_KEYLINE = new Fl_ListBox(693, 182, 90, 24, _("FSK Keyline"));
listbox_FSK_KEYLINE->box(FL_DOWN_BOX);
listbox_FSK_KEYLINE->color(FL_BACKGROUND2_COLOR);
listbox_FSK_KEYLINE->selection_color(FL_BACKGROUND_COLOR);
listbox_FSK_KEYLINE->labeltype(FL_NORMAL_LABEL);
listbox_FSK_KEYLINE->labelfont(0);
listbox_FSK_KEYLINE->labelsize(14);
listbox_FSK_KEYLINE->labelcolor(FL_FOREGROUND_COLOR);
listbox_FSK_KEYLINE->callback((Fl_Callback*)cb_listbox_FSK_KEYLINE);
listbox_FSK_KEYLINE->align(Fl_Align(FL_ALIGN_LEFT));
listbox_FSK_KEYLINE->when(FL_WHEN_RELEASE);
listbox_FSK_KEYLINE->hide();
o->add("None|RTS|DTR");
o->index(progdefaults.FSK_keyline);
listbox_FSK_KEYLINE->end();
} // Fl_ListBox* listbox_FSK_KEYLINE
{ Fl_ListBox* o = listbox_PTT_KEYLINE = new Fl_ListBox(471, 182, 90, 24, _("PTT keyline"));
listbox_PTT_KEYLINE->box(FL_DOWN_BOX);
listbox_PTT_KEYLINE->color(FL_BACKGROUND2_COLOR);
listbox_PTT_KEYLINE->selection_color(FL_BACKGROUND_COLOR);
listbox_PTT_KEYLINE->labeltype(FL_NORMAL_LABEL);
listbox_PTT_KEYLINE->labelfont(0);
listbox_PTT_KEYLINE->labelsize(14);
listbox_PTT_KEYLINE->labelcolor(FL_FOREGROUND_COLOR);
listbox_PTT_KEYLINE->callback((Fl_Callback*)cb_listbox_PTT_KEYLINE);
listbox_PTT_KEYLINE->align(Fl_Align(FL_ALIGN_LEFT));
listbox_PTT_KEYLINE->when(FL_WHEN_RELEASE);
o->add("None|RTS|DTR");
o->index(progdefaults.PTT_KEYLINE);
listbox_PTT_KEYLINE->end();
} // Fl_ListBox* listbox_PTT_KEYLINE
{ Fl_Check_Button* o = chkFSKkeying = new Fl_Check_Button(761, 210, 22, 22, _("Xcvr FSK keying"));
chkFSKkeying->tooltip(_("Transceiver h/l FSK keying"));
chkFSKkeying->down_box(FL_DOWN_BOX);
chkFSKkeying->callback((Fl_Callback*)cb_chkFSKkeying);
chkFSKkeying->align(Fl_Align(FL_ALIGN_LEFT));
chkFSKkeying->hide();
o->value(progdefaults.useFSK);
} // Fl_Check_Button* chkFSKkeying
{ Fl_ComboBox* o = select_CW_KEYLINE_CommPort = new Fl_ComboBox(210, 265, 485, 23, _("Use Separate Keying Serial Port"));
select_CW_KEYLINE_CommPort->tooltip(_("nanoIO serial port"));
select_CW_KEYLINE_CommPort->box(FL_DOWN_BOX);
select_CW_KEYLINE_CommPort->color((Fl_Color)55);
@ -11308,11 +11363,17 @@ c are\nneeded."));
o->value(progdefaults.CW_KEYLINE_serial_port_name.c_str());
select_CW_KEYLINE_CommPort->end();
} // Fl_ComboBox* select_CW_KEYLINE_CommPort
{ Fl_Light_Button* o = btn_CW_KEYLINE_connect = new Fl_Light_Button(705, 264, 80, 23, _("Connect"));
{ Fl_Light_Button* o = btn_CW_KEYLINE_connect = new Fl_Light_Button(705, 265, 80, 23, _("Connect"));
btn_CW_KEYLINE_connect->tooltip(_("Connect / Disconnect from nanoIO"));
btn_CW_KEYLINE_connect->callback((Fl_Callback*)cb_btn_CW_KEYLINE_connect);
o->value(progStatus.useCW_KEYLINE);
} // Fl_Light_Button* btn_CW_KEYLINE_connect
{ Fl_Check_Button* o = btn_CW_KEYLINE_catport = new Fl_Check_Button(357, 225, 23, 15, _("Share RIGCAT port"));
btn_CW_KEYLINE_catport->down_box(FL_DOWN_BOX);
btn_CW_KEYLINE_catport->callback((Fl_Callback*)cb_btn_CW_KEYLINE_catport);
btn_CW_KEYLINE_catport->align(Fl_Align(FL_ALIGN_LEFT));
o->value(progdefaults.CW_KEYLINE_on_cat_port);
} // Fl_Check_Button* btn_CW_KEYLINE_catport
o->end();
} // Fl_Group* o
CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Modem/CW/DTR-RTS keying"));
@ -12520,7 +12581,7 @@ ency"));
btnAUTOCRLF->callback((Fl_Callback*)cb_btnAUTOCRLF);
o->value(progdefaults.rtty_autocrlf);
} // Fl_Check_Button* btnAUTOCRLF
{ Fl_Counter2* o = cntrAUTOCRLF = new Fl_Counter2(643, 65, 65, 22, _("chars"));
{ Fl_Counter2* o = cntrAUTOCRLF = new Fl_Counter2(643, 65, 75, 22, _("chars"));
cntrAUTOCRLF->tooltip(_("Auto CRLF line length"));
cntrAUTOCRLF->type(1);
cntrAUTOCRLF->box(FL_UP_BOX);
@ -12565,11 +12626,23 @@ ency"));
chkPseudoFSK->callback((Fl_Callback*)cb_chkPseudoFSK);
o->value(progdefaults.PseudoFSK);
} // Fl_Check_Button* chkPseudoFSK
{ Fl_Counter* o = cnt_TTY_LTRS = new Fl_Counter(532, 231, 75, 22, _("LTRS at start"));
cnt_TTY_LTRS->tooltip(_("Insert NN LTRS bytes at start of each transmission"));
cnt_TTY_LTRS->type(1);
cnt_TTY_LTRS->minimum(0);
cnt_TTY_LTRS->maximum(10);
cnt_TTY_LTRS->step(1);
cnt_TTY_LTRS->value(1);
cnt_TTY_LTRS->callback((Fl_Callback*)cb_cnt_TTY_LTRS);
cnt_TTY_LTRS->align(Fl_Align(FL_ALIGN_RIGHT));
o->value(progdefaults.TTY_LTRS);
} // Fl_Counter* cnt_TTY_LTRS
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(205, 262, 590, 77, _("Transceiver FSK"));
o->box(FL_ENGRAVED_FRAME);
o->align(Fl_Align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE));
o->hide();
{ Fl_Counter* o = cntr_xcvr_FSK_MARK = new Fl_Counter(221, 297, 126, 23, _("Mark"));
cntr_xcvr_FSK_MARK->tooltip(_("Mark frequency in Hertz"));
cntr_xcvr_FSK_MARK->minimum(500);
@ -12597,17 +12670,6 @@ ency"));
o->index(progdefaults.rtty_shift);
sel_xcvr_FSK_shift->end();
} // Fl_ListBox* sel_xcvr_FSK_shift
{ Fl_Counter* o = cnt_TTY_LTRS = new Fl_Counter(611, 297, 80, 23, _("LTRS at start"));
cnt_TTY_LTRS->tooltip(_("Insert NN LTRS bytes at start of each transmission"));
cnt_TTY_LTRS->type(1);
cnt_TTY_LTRS->minimum(0);
cnt_TTY_LTRS->maximum(10);
cnt_TTY_LTRS->step(1);
cnt_TTY_LTRS->value(2);
cnt_TTY_LTRS->callback((Fl_Callback*)cb_cnt_TTY_LTRS);
cnt_TTY_LTRS->align(Fl_Align(FL_ALIGN_RIGHT));
o->value(progdefaults.TTY_LTRS);
} // Fl_Counter* cnt_TTY_LTRS
o->end();
} // Fl_Group* o
CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Modem/TTY/Tx"));

View file

@ -469,7 +469,7 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
static const char szProsigns[] = "~|%|&|+|=|{|}|<|>|[|]| ";} {}
Fl_Window {} {
label {Fldigi configuration} open
xywh {671 24 800 380} type Double color 45 selection_color 51 labelsize 18 align 80 resizable size_range {750 380 0 380} visible
xywh {649 24 800 380} type Double color 45 selection_color 51 labelsize 18 align 80 resizable size_range {750 380 0 380} visible
} {
Fl_Group {} {open
xywh {0 0 201 385} resizable
@ -4161,32 +4161,51 @@ nanoIO_set_cw_ptt();}
serial port (typical of Yaesu transceiver FT-991A). If separate, the CAT control
can be via flrig, RigCat or Hamlib. No settings for baud, stops bits, etc are
needed.}
xywh {216 50 565 90} align 20
xywh {210 38 580 116} align 20
}
}
Fl_Check_Button btn_CW_KEYLINE_catport {
label {Use RIGCAT serial port}
callback {progdefaults.CW_KEYLINE_on_cat_port = o->value();}
xywh {257 184 70 15} down_box DOWN_BOX
code0 {o->value(progdefaults.CW_KEYLINE_on_cat_port);}
}
Fl_Group listbox_CW_KEYLINE {
label {CW Keyline}
callback {progdefaults.CW_KEYLINE = o->index();
progdefaults.changed = true;} open
xywh {580 179 110 24} box DOWN_BOX color 7 align 4
code0 {o->add("None|RTS|DTR");}
code1 {o->index(progdefaults.CW_KEYLINE);}
class Fl_ListBox
} {}
Fl_Group {} {
label {Keyline on separate serial port} open
xywh {205 226 589 78} box ENGRAVED_FRAME align 17
Fl_Group {} {open
xywh {205 170 590 129} box ENGRAVED_FRAME
} {
Fl_Group listbox_CW_KEYLINE {
label {CW Keyline}
callback {progdefaults.CW_KEYLINE = o->index();
progdefaults.changed = true;} open
xywh {290 182 90 24} box DOWN_BOX color 7 align 4
code0 {o->add("None|RTS|DTR");}
code1 {o->index(progdefaults.CW_KEYLINE);}
class Fl_ListBox
} {}
Fl_Group listbox_FSK_KEYLINE {
label {FSK Keyline}
callback {progdefaults.FSK_keyline = o->index();
progdefaults.useFSK = (listbox_FSK_KEYLINE->index() > 0);
chkFSKkeying->value(progdefaults.useFSK);
progdefaults.changed = true;} open
xywh {693 182 90 24} box DOWN_BOX color 7 align 4 hide
code0 {o->add("None|RTS|DTR");}
code1 {o->index(progdefaults.FSK_keyline);}
class Fl_ListBox
} {}
Fl_Group listbox_PTT_KEYLINE {
label {PTT keyline}
callback {progdefaults.PTT_KEYLINE = o->index();
progdefaults.changed = true;} open
xywh {471 182 90 24} box DOWN_BOX color 7 align 4
code0 {o->add("None|RTS|DTR");}
code1 {o->index(progdefaults.PTT_KEYLINE);}
class Fl_ListBox
} {}
Fl_Check_Button chkFSKkeying {
label {Xcvr FSK keying}
callback {o->value(progdefaults.useFSK);}
tooltip {Transceiver h/l FSK keying} xywh {761 210 22 22} down_box DOWN_BOX align 4 hide
code0 {o->value(progdefaults.useFSK);}
}
Fl_Group select_CW_KEYLINE_CommPort {
label {Ser. Port}
label {Use Separate Keying Serial Port}
callback {progdefaults.CW_KEYLINE_serial_port_name = o->value();} open
tooltip {nanoIO serial port} xywh {210 264 485 23} box DOWN_BOX color 55 align 5
tooltip {nanoIO serial port} xywh {210 265 485 23} box DOWN_BOX color 55 align 5
code0 {\#include "combo.h"}
code1 {\#include "nanoIO.h"}
code2 {o->value(progdefaults.CW_KEYLINE_serial_port_name.c_str());}
@ -4202,9 +4221,15 @@ progdefaults.changed = true;} open
close_CW_KEYLINE();
progStatus.useCW_KEYLINE = 0;
}}
tooltip {Connect / Disconnect from nanoIO} xywh {705 264 80 23}
tooltip {Connect / Disconnect from nanoIO} xywh {705 265 80 23}
code0 {o->value(progStatus.useCW_KEYLINE);}
}
Fl_Check_Button btn_CW_KEYLINE_catport {
label {Share RIGCAT port}
callback {progdefaults.CW_KEYLINE_on_cat_port = o->value();}
xywh {357 225 23 15} down_box DOWN_BOX align 4
code0 {o->value(progdefaults.CW_KEYLINE_on_cat_port);}
}
}
}
Fl_Group {} {
@ -5328,14 +5353,14 @@ progdefaults.BELL_RING_MENU = o->value();} open
}
}
Fl_Group {} {
label {Modem/TTY/Tx}
label {Modem/TTY/Tx} open selected
xywh {200 0 601 350} box FLAT_BOX align 21 hide
code0 {CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Modem/TTY/Tx"));}
code1 {config_pages.push_back(p);}
code2 {tab_tree->add(_("Modem/TTY/Tx"));}
} {
Fl_Group {} {
label {Sound Card FSK}
label {Sound Card FSK} open
xywh {205 32 590 229} box ENGRAVED_FRAME align 21
} {
Fl_Group selShift {
@ -5419,7 +5444,7 @@ progdefaults.changed = true;}
label chars
callback {progdefaults.rtty_autocount = (int)o->value();
progdefaults.changed = true;}
tooltip {Auto CRLF line length} xywh {643 65 65 22} type Simple align 8 minimum 68 maximum 80 step 1 value 72
tooltip {Auto CRLF line length} xywh {643 65 75 22} type Simple align 8 minimum 68 maximum 80 step 1 value 72
code0 {o->labelsize(FL_NORMAL_SIZE);}
class Fl_Counter2
}
@ -5457,10 +5482,17 @@ if (o->value()) {
tooltip {Create keyed square wave on right audio channel} xywh {532 164 212 22} down_box DOWN_BOX
code0 {o->value(progdefaults.PseudoFSK);}
}
Fl_Counter cnt_TTY_LTRS {
label {LTRS at start}
callback {progdefaults.TTY_LTRS = (int)o->value();
progdefaults.changed = true;}
tooltip {Insert NN LTRS bytes at start of each transmission} xywh {532 231 75 22} type Simple align 8 minimum 0 maximum 10 step 1 value 1
code0 {o->value(progdefaults.TTY_LTRS);}
}
}
Fl_Group {} {
label {Transceiver FSK}
xywh {205 262 590 77} box ENGRAVED_FRAME align 21
label {Transceiver FSK} open
xywh {205 262 590 77} box ENGRAVED_FRAME align 21 hide
} {
Fl_Counter cntr_xcvr_FSK_MARK {
label Mark
@ -5480,13 +5512,6 @@ progdefaults.changed = true;} open
code1 {o->index(progdefaults.rtty_shift);}
class Fl_ListBox
} {}
Fl_Counter cnt_TTY_LTRS {
label {LTRS at start}
callback {progdefaults.TTY_LTRS = (int)o->value();
progdefaults.changed = true;}
tooltip {Insert NN LTRS bytes at start of each transmission} xywh {611 297 80 23} type Simple align 8 minimum 0 maximum 10 step 1 value 2
code0 {o->value(progdefaults.TTY_LTRS);}
}
}
}
Fl_Group {} {
@ -8477,7 +8502,7 @@ progdefaults.changed = true;}
}
}
Fl_Group {} {
label {Soundcard/Alerts} open selected
label {Soundcard/Alerts}
xywh {200 0 600 350} box ENGRAVED_BOX color 50 selection_color 50 align 21 hide
code0 {CONFIG_PAGE *p = new CONFIG_PAGE(o, _("Soundcard/Alerts"));}
code1 {config_pages.push_back(p);}

View file

@ -370,10 +370,13 @@ extern Fl_Button *btn_cal_variable;
extern Fl_Value_Input *corr_var_wpm;
extern Fl_Value_Input *usec_correc;
extern Fl_Button *btn_correction;
extern Fl_Check_Button *btn_CW_KEYLINE_catport;
extern Fl_ListBox *listbox_CW_KEYLINE;
extern Fl_ListBox *listbox_FSK_KEYLINE;
extern Fl_ListBox *listbox_PTT_KEYLINE;
extern Fl_Check_Button *chkFSKkeying;
extern Fl_ComboBox *select_CW_KEYLINE_CommPort;
extern Fl_Light_Button *btn_CW_KEYLINE_connect;
extern Fl_Check_Button *btn_CW_KEYLINE_catport;
extern Fl_Input2 *txtSecondary;
extern Fl_Check_Button *valDominoEX_FILTER;
extern Fl_Counter2 *valDominoEX_BW;
@ -480,9 +483,9 @@ extern Fl_Check_Button *btnCRCRLF;
extern Fl_Check_Button *chkUOStx;
extern Fl_Check_Button *chk_shaped_rtty;
extern Fl_Check_Button *chkPseudoFSK;
extern Fl_Counter *cnt_TTY_LTRS;
extern Fl_Counter *cntr_xcvr_FSK_MARK;
extern Fl_ListBox *sel_xcvr_FSK_shift;
extern Fl_Counter *cnt_TTY_LTRS;
extern Fl_ComboBox *select_nanoIO_CommPort;
extern Fl_Light_Button *btn_nanoIO_connect;
extern Fl_ListBox *sel_nanoIO_baud;

View file

@ -208,7 +208,10 @@
"") \
ELEM_(int, CW_KEYLINE, "CWKEYLINE", \
"0 - none, 1 - RTS, 2 - DTR", \
2) \
0) \
ELEM_(int, PTT_KEYLINE, "PTTKEYLINE", \
"0 - none, 1 - RTS, 2 - DTR", \
0) \
ELEM_(bool, CW_KEYLINE_on_cat_port, "CW_KEYLINE_on_cat_port", \
"DTR/RTS keying shares RigCat serial port", \
false) \
@ -356,10 +359,18 @@
"AFC tracking speed. Values are as follows:\n" \
" 0: slow; 1: normal; 2: fast", \
1) /* normal */ \
ELEM_(bool, useFSKkeyline, "", "", false) \
ELEM_(bool, useFSKkeylineDTR, "", "", false) \
ELEM_(bool, FSKisLSB, "", "", true) \
ELEM_(bool, useUART, "", "", false) \
ELEM_(bool, useFSK, "USEFSK", \
"TRUE if DTR/RTS keying for RTTY EXPERIMENTAL - NOT USED", \
false) \
ELEM_(std::string, FSK_serial_port_name, "RTTY_SERIAL_PORT_NAME", \
"Independent serial port EXPERIMENTAL - NOT USED", \
"") \
ELEM_(int, FSK_keyline, "FSK_KEYLINE", \
"0 - none, 1 - RTS, 2 - DTR EXPERIMENTAL -NOT USED", \
0) \
ELEM_(bool, FSK_on_cat_port, "FSK_on_cat_port", \
"DTR/RTS keying shares RigCat serial port EXPERIMENTAL - NOT USED", \
false) \
ELEM_(bool, PreferXhairScope, "PREFERXHAIRSCOPE", \
"Default to crosshair digiscope", \
false) \

View file

@ -221,8 +221,7 @@ protected:
void sync_transmit_parameters();
void flush_audio();
void send_CW_KEYLINE(int);
void CW_KEYLINE(bool);
void send_CW(int);
view_cw viewcw;

View file

@ -38,6 +38,7 @@
#include "fftfilt.h"
#include "digiscope.h"
#include "view_rtty.h"
#include "serial.h"
#define RTTY_SampleRate 8000
//#define RTTY_SampleRate 11025
@ -137,7 +138,6 @@ private:
int nbits;
int stoplen;
int msb;
bool useFSK;
double phaseacc;
double rtty_squelch;
@ -218,7 +218,6 @@ private:
unsigned char Bit_reverse(unsigned char in, int n);
int decode_char();
int rttyparity(unsigned int);
bool rx(bool bit);
view_rtty *rttyviewer;
@ -237,6 +236,14 @@ private:
bool is_mark_space(int &);
bool is_mark();
//----------------------------------------------------------------------
// experimental FSK generator
// bool useFSK;
// double bitlen;
// Cserial *fsk_serial;
// inline void send_FSK(int c);
//----------------------------------------------------------------------
public:
rtty(trx_mode mode);
~rtty();
@ -258,4 +265,6 @@ public:
};
int rttyparity(unsigned int, int);
#endif

View file

@ -154,12 +154,7 @@ struct status {
int rtty_autocount;
int rtty_afcspeed;
bool rtty_filter_changed;
bool useFSKkeyline;
bool useFSKkeylineDTR;
bool FSKisLSB;
bool useUART;
bool PreferXhairScope;
bool PseudoFSK;
bool shaped_rtty;
bool UOSrx;
bool UOStx;

View file

@ -165,6 +165,7 @@ void save_signals(void);
void restore_signals(void);
void MilliSleep(long msecs);
void NanoSleep(double msecs);
#ifdef __cplusplus
} // extern "C"

View file

@ -197,12 +197,7 @@ status progStatus = {
progdefaults.rtty_autocount,
progdefaults.rtty_afcspeed,
false, // bool rtty_filter_changed
progdefaults.useFSKkeyline,
progdefaults.useFSKkeylineDTR,
progdefaults.FSKisLSB,
progdefaults.useUART,
progdefaults.PreferXhairScope,
progdefaults.PseudoFSK,
true, // bool shaped_rtty
progdefaults.UOSrx,
progdefaults.UOStx,
@ -400,12 +395,7 @@ void status::saveLastState()
rtty_autocrlf = progdefaults.rtty_autocrlf;
rtty_autocount = progdefaults.rtty_autocount;
rtty_afcspeed = progdefaults.rtty_afcspeed;
useFSKkeyline = progdefaults.useFSKkeyline;
useFSKkeylineDTR = progdefaults.useFSKkeylineDTR;
FSKisLSB = progdefaults.FSKisLSB;
useUART = progdefaults.useUART;
PreferXhairScope = progdefaults.PreferXhairScope;
PseudoFSK = progdefaults.PseudoFSK;
UOSrx = progdefaults.UOSrx;
UOStx = progdefaults.UOStx;
@ -576,12 +566,7 @@ if (!bWF_only) {
spref.set("rtty_autocrlf", rtty_autocrlf);
spref.set("rtty_autocount", rtty_autocount);
spref.set("rtty_afcspeed", rtty_afcspeed);
spref.set("rtty_useFSKkeyline", useFSKkeyline);
spref.set("rtty_useFSK_DTR", useFSKkeylineDTR);
spref.set("rtty_FSKisLSB", FSKisLSB);
spref.set("rtty_useUART", useUART);
spref.set("preferxhairscope", PreferXhairScope);
spref.set("psaudofsk", PseudoFSK);
spref.set("shaped_rtty", shaped_rtty);
spref.set("uosrx", UOSrx);
spref.set("uostx", UOStx);
@ -856,12 +841,7 @@ void status::loadLastState()
spref.get("rtty_autocrlf", i, rtty_autocrlf); rtty_autocrlf = i;
spref.get("rtty_autocount", rtty_autocount, rtty_autocount);
spref.get("rtty_afcspeed", rtty_afcspeed, rtty_afcspeed);
spref.get("rtty_useFSKkeyline", i, useFSKkeyline); useFSKkeyline = i;
spref.get("rtty_useFSK_DTR", i, useFSKkeylineDTR); useFSKkeylineDTR = i;
spref.get("rtty_FSKisLSB", i, FSKisLSB); FSKisLSB = i;
spref.get("rtty_useUART", i, useUART); useUART = i;
spref.get("preferxhairscope", i, PreferXhairScope); PreferXhairScope = i;
spref.get("psaudofsk", i, PseudoFSK); PseudoFSK = i;
spref.get("shaped_rtty", i, shaped_rtty); shaped_rtty = i;
spref.get("uosrx", i, UOSrx); UOSrx = i;
spref.get("uostx", i, UOStx); UOStx = i;
@ -1015,15 +995,12 @@ void status::initLastState()
btnCRCRLF->value(progdefaults.rtty_crcrlf = rtty_crcrlf);
btnAUTOCRLF->value(progdefaults.rtty_autocrlf = rtty_autocrlf);
cntrAUTOCRLF->value(progdefaults.rtty_autocount = rtty_autocount);
chkPseudoFSK->value(progdefaults.PseudoFSK = PseudoFSK);
chkUOSrx->value(progdefaults.UOSrx = UOSrx);
chkUOStx->value(progdefaults.UOStx = UOStx);
// chkXagc->value(progdefaults.Xagc = Xagc);
i_listbox_rtty_afc_speed->index(progdefaults.rtty_afcspeed = rtty_afcspeed);
btnPreferXhairScope->value(progdefaults.PreferXhairScope = PreferXhairScope);
if (mvsquelch) {
//printf("init rtty squelch %f\n", VIEWER_rttysquelch);
mvsquelch->range(-12.0, 6.0);
mvsquelch->value(VIEWER_rttysquelch);
}

View file

@ -34,6 +34,8 @@
#include <config.h>
#include <iostream>
#include <unistd.h>
#include <sys/types.h>
#if HAVE_SYS_SELECT_H
@ -71,6 +73,7 @@ LOG_FILE_SOURCE(debug::LOG_RIGCONTROL);
using namespace std;
extern Cserial CW_KEYLINE_serial;
PTT::PTT(ptt_t dev) : pttdev(PTT_INVALID), oldtio(0)
{
@ -120,24 +123,50 @@ void PTT::reset(ptt_t dev)
void PTT::set(bool ptt)
{
string ptt_temp =
pttdev == PTT_NONE ? "NONE" :
pttdev == PTT_HAMLIB ? "HAMLIB" :
pttdev == PTT_RIGCAT ? "RIGCAT" :
pttdev == PTT_TTY ? "TTY" :
pttdev == PTT_GPIO ? "GPIO" :
pttdev == PTT_PARPORT ? "PARPORT" :
pttdev == PTT_UHROUTER ? "UHROUTER" : "UNKNOWN";
LOG_VERBOSE("PTT via %s : %s", ptt_temp.c_str(), ptt ? "ON" : "OFF");
// add milliseconds - no audio to clear virtual audio card used by Flex systems
if (!ptt && progdefaults.PTT_off_delay)
MilliSleep(progdefaults.PTT_off_delay);
if (progdefaults.PTT_KEYLINE > 0 && active_modem == rtty_modem) {
ptt_temp.assign("PTT ").append(ptt ? "ON :" : "OFF:");
if (progdefaults.PTT_KEYLINE == 2) { // DTR signalling
if (progdefaults.CW_KEYLINE_on_cat_port) {
rigio.SetDTR(ptt);
ptt_temp.append("rigio DTR");
} else {
CW_KEYLINE_serial.SetDTR(ptt);
ptt_temp.append("cw_serial DTR");
}
} else { // RTS signalling
if (progdefaults.CW_KEYLINE_on_cat_port) {
rigio.SetRTS(ptt);
ptt_temp.append("rigio RTS");
} else {
CW_KEYLINE_serial.SetRTS(ptt);
ptt_temp.append("cw_serial RTS");
}
}
LOG_VERBOSE("%s", ptt_temp.c_str());
if (ptt) start_tx_timer();
else stop_tx_timer();
return;
}
if (active_modem == cw_modem &&
((progdefaults.useCWkeylineRTS) || progdefaults.useCWkeylineDTR == true))
return;
//{ // uncomment block for debugging
// string sport =
// pttdev == PTT_NONE ? "NONE" :
// pttdev == PTT_HAMLIB ? "HAMLIB" :
// pttdev == PTT_RIGCAT ? "RIGCAT" :
// pttdev == PTT_TTY ? "TTY" :
// pttdev == PTT_GPIO ? "GPIO" :
// pttdev == PTT_PARPORT ? "PARPORT" :
// pttdev == PTT_UHROUTER ? "UHROUTER" : "UNKNOWN";
// LOG_INFO("PTT via %s : %s", sport.c_str(), ptt ? "ON" : "OFF");
//}
switch (pttdev) {
case PTT_NONE: default:
noCAT_setPTT(ptt);
@ -147,7 +176,7 @@ void PTT::set(bool ptt)
hamlib_set_ptt(ptt);
break;
#endif
case PTT_RIGCAT:
case PTT_RIGCAT:
rigCAT_set_ptt(ptt);
break;
case PTT_TTY:
@ -301,7 +330,7 @@ void PTT::close_gpio(void)
void PTT::set_gpio(bool ptt)
{
#define VALUE_MAX 30
#define VALUE_MAX 30
static const char s_values_str[] = "01";
string portname = "/sys/class/gpio/gpio";
@ -337,7 +366,7 @@ void PTT::set_gpio(bool ptt)
}
}
if (ok)
LOG_INFO("Set GPIO ptt on %s %s%s",
LOG_INFO("Set GPIO ptt on %s %s%s",
ctrlport.c_str(),
(progdefaults.gpio_pulse_width > 0) ?
"pulsed " : "",