kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Upstream version 2.10D
rodzic
66bbde2415
commit
a458af58ac
|
@ -7,6 +7,7 @@ Change Log:
|
|||
4) The volume sliders will now be hidden if the mixer is disabled
|
||||
5) Rename some classes so that fldigi builds on Mac OSX.
|
||||
Many thanks to Justin Burket and Diane Bruce.
|
||||
6) Added a <MODEM> macro that changes the current modem
|
||||
|
||||
2.09 1) Modified src/Makefile.am for FreeBSD name space clash
|
||||
2) Added psk multi-channel viewer with regex search capability
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
AC_COPYRIGHT([Copyright (C) 2007 Stelios Bounanos, M0GLD (m0gld AT enotty DOT net)])
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT([fldigi], [2.10C], [w1hkj AT w1hkj DOT com])
|
||||
AC_INIT([fldigi], [2.10D], [w1hkj AT w1hkj DOT com])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
# define build, build_cpu, build_vendor, build_os
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "macros.h"
|
||||
#include "macroedit.h"
|
||||
#include "globals.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
@ -20,35 +21,57 @@ Fl_Hold_Browser *macroDefs=(Fl_Hold_Browser *)0;
|
|||
|
||||
static int iMacro;
|
||||
|
||||
// fl_color(0) is always the foreground colour
|
||||
#define LINE_SEP "@B0"
|
||||
|
||||
void loadBrowser(Fl_Widget *widget) {
|
||||
Fl_Browser *w = (Fl_Browser *)widget;
|
||||
w->add("<CALL>\tother call");
|
||||
w->add("<FREQ>\tmy frequency");
|
||||
w->add("<LOC>\tother locator");
|
||||
w->add("<MODE>\tmode");
|
||||
w->add("<NAME>\tremote name");
|
||||
w->add("<QTH>\tother qth");
|
||||
w->add("<RST>\tother RST");
|
||||
w->add("<MYCALL>\tmy call");
|
||||
w->add("<MYLOC>\tmy locator");
|
||||
w->add("<MYNAME>\tmy name");
|
||||
w->add("<MYQTH>\tmy qth");
|
||||
w->add("<MYRST>\tmy RST");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<CALL>\tother call");
|
||||
w->add("<LOC>\tother locator");
|
||||
w->add("<NAME>\tremote name");
|
||||
w->add("<QTH>\tother qth");
|
||||
w->add("<RST>\tother RST");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<FREQ>\tmy frequency");
|
||||
w->add("<MODE>\tmode");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<LDT>\tLocal datetime");
|
||||
w->add("<ILDT>\tLocal datetime in iso-8601");
|
||||
w->add("<ILDT>\tLDT in iso-8601 format");
|
||||
w->add("<ZDT>\tZulu datetime");
|
||||
w->add("<IZDT>\tZulu datetime in iso-8601");
|
||||
w->add("<ID>\tMode ID'r");
|
||||
w->add("<TEXT>\tVideo text");
|
||||
w->add("<CWID>\tCW identifier");
|
||||
w->add("<RX>\treceive");
|
||||
w->add("<TX>\ttransmit");
|
||||
w->add("<VER>\tFldigi + version");
|
||||
w->add("<IZDT>\tZDT in iso-8601 format");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<CNTR>\tcontest cnt");
|
||||
w->add("<DECR>\tdecr cnt");
|
||||
w->add("<INCR>\tincr cnt");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<ID>\tMode ID'r");
|
||||
w->add("<TEXT>\tVideo text");
|
||||
w->add("<CWID>\tCW identifier");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
w->add("<RX>\treceive");
|
||||
w->add("<TX>\ttransmit");
|
||||
w->add("<LOG>\tsave QSO data");
|
||||
w->add("<VER>\tFldigi + version");
|
||||
w->add("<TIMER>\trepeat every NNN sec");
|
||||
|
||||
w->add(LINE_SEP);
|
||||
char s[48];
|
||||
for (size_t i = 0; i < NUM_MODES; i++) {
|
||||
snprintf(s, sizeof(s), "<MODEM>%s", mode_info[i].sname);
|
||||
w->add(s);
|
||||
}
|
||||
}
|
||||
|
||||
void cbMacroEditOK(Fl_Widget *w, void *)
|
||||
|
@ -76,7 +99,10 @@ void cbInsertMacro(Fl_Widget *, void *)
|
|||
string edittext = macrotext->value();
|
||||
string text = macroDefs->text(nbr);
|
||||
size_t tab = text.find('\t');
|
||||
if (tab != string::npos)
|
||||
text.erase(tab);
|
||||
if (text == LINE_SEP)
|
||||
return;
|
||||
macrotext->insert(text.c_str());
|
||||
macrotext->take_focus();
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "confdialog.h"
|
||||
#include "logger.h"
|
||||
#include "newinstall.h"
|
||||
#include "globals.h"
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include "File_Selector.h"
|
||||
|
@ -52,6 +53,7 @@ void pDECR(string &, size_t &);
|
|||
void pINCR(string &, size_t &);
|
||||
void pLOG(string &, size_t &);
|
||||
void pTIMER(string &, size_t &);
|
||||
void pMODEM(string &, size_t &);
|
||||
|
||||
MTAGS mtags[] = {
|
||||
{"<CALL>", pCALL},
|
||||
|
@ -81,6 +83,7 @@ MTAGS mtags[] = {
|
|||
{"<INCR>", pINCR},
|
||||
{"<LOG>", pLOG},
|
||||
{"<TIMER>", pTIMER},
|
||||
{"<MODEM>", pMODEM},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
@ -282,6 +285,31 @@ void pTIMER(string &s, size_t &i)
|
|||
progdefaults.useTimer = true;
|
||||
}
|
||||
|
||||
void pMODEM(string &s, size_t &i)
|
||||
{
|
||||
if ((i = s.find('>', i)) == string::npos)
|
||||
return;
|
||||
|
||||
size_t len = s.length();
|
||||
while (++i < len)
|
||||
if (!isspace(s[i]))
|
||||
break;
|
||||
size_t j = i;
|
||||
while (++j < len)
|
||||
if (isspace(s[j]))
|
||||
break;
|
||||
|
||||
string name = s.substr(i, j-i);
|
||||
for (j = 0; j < NUM_MODES; j++) {
|
||||
if (name == mode_info[j].sname) {
|
||||
if (active_modem->get_mode() != mode_info[j].mode)
|
||||
init_modem(mode_info[j].mode);
|
||||
s.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int MACROTEXT::loadMacros(string filename)
|
||||
{
|
||||
string mLine;
|
||||
|
@ -453,6 +481,9 @@ string mtext =
|
|||
// <RX> retn to receive\n\
|
||||
// <TX> start transmit\n\
|
||||
// <VERSION> Fldigi + version\n\
|
||||
// <MODEM> name changes the current modem to name. name is the short modem name\n\
|
||||
// as it appears in the status/quick change box at the bottom left corner\n\
|
||||
// of the main window\n\
|
||||
//\n\
|
||||
// Contest macro definitions:\n\
|
||||
// <CNTR> substitute the contest counter - no change in value\n\
|
||||
|
|
|
@ -49,7 +49,7 @@ extern waterfall *wf;
|
|||
|
||||
// Change the following for DCD low pass filter adjustment
|
||||
#define SQLCOEFF 0.01
|
||||
#define SQLDECAY 100
|
||||
#define SQLDECAY 50
|
||||
|
||||
//=====================================================================
|
||||
|
||||
|
@ -347,6 +347,7 @@ void psk::findsignal()
|
|||
frequency = ftest;
|
||||
set_freq(frequency);
|
||||
freqerr = 0.0;
|
||||
sigsearch = 0;
|
||||
}
|
||||
// searchBW = progdefaults.SearchRange;
|
||||
// ftest = wf->peakFreq((int)(frequency), searchBW);
|
||||
|
@ -383,9 +384,6 @@ void psk::afc()
|
|||
{
|
||||
if (!afcon)
|
||||
return;
|
||||
// if (sigsearch)
|
||||
// findsignal();
|
||||
else if (dcd == true)
|
||||
phaseafc();
|
||||
}
|
||||
|
||||
|
@ -484,8 +482,8 @@ int psk::rx_process(const double *buf, int len)
|
|||
if (pskviewer && !bHistory) pskviewer->rx_process(buf, len);
|
||||
if (evalpsk) evalpsk->sigdensity();
|
||||
|
||||
if (afcon == 2)
|
||||
sigsearch = 0;
|
||||
// if (afcon == 2)
|
||||
// sigsearch = 0;
|
||||
|
||||
delta = twopi * frequency / samplerate;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#include <string>
|
||||
#include <ctime>
|
||||
|
||||
#ifdef RIGCATTEST
|
||||
#include "rigCAT.h"
|
||||
|
@ -59,6 +60,15 @@ void printhex(unsigned char *s, int len)
|
|||
std::cout << hex << (unsigned int)(s[i] & 0xFF) << " ";
|
||||
std::cout << std::endl;
|
||||
}
|
||||
char * printtime()
|
||||
{
|
||||
time_t t;
|
||||
time(&t);
|
||||
tm *now = gmtime(&t);
|
||||
static char sztime[80];
|
||||
strftime(sztime, 79, "[%H:%M:%S]", now);
|
||||
return sztime;
|
||||
}
|
||||
|
||||
bool readpending = false;
|
||||
int readtimeout;
|
||||
|
@ -68,8 +78,11 @@ bool hexout( string s, int retnbr)
|
|||
// thread might call this function while a read from the rig is in process
|
||||
// wait here until that processing is finished or a timeout occurs
|
||||
// reset the readpending & return false if a timeout occurs
|
||||
//printhex(s);
|
||||
readtimeout = 500; // 500 msec timeout
|
||||
|
||||
// debug code
|
||||
//std::cout << printtime() << "Cmd: "; printhex(s);
|
||||
|
||||
readtimeout = (rig.wait +rig.timeout) * rig.retries + 2000; // 2 second min timeout
|
||||
while (readpending && readtimeout--)
|
||||
MilliSleep(1);
|
||||
if (readtimeout == 0) {
|
||||
|
@ -78,12 +91,14 @@ bool hexout( string s, int retnbr)
|
|||
return false;
|
||||
}
|
||||
|
||||
readpending = true;
|
||||
|
||||
for (int n = 0; n < rig.retries; n++) {
|
||||
int num = 0;
|
||||
memset(sendbuff,0, 200);
|
||||
for (unsigned int i = 0; i < s.length(); i++)
|
||||
sendbuff[i] = s[i];
|
||||
|
||||
readpending = true;
|
||||
rigio.FlushBuffer();
|
||||
rigio.WriteBuffer(sendbuff, s.size());
|
||||
if (rig.echo == true)
|
||||
|
@ -99,17 +114,28 @@ bool hexout( string s, int retnbr)
|
|||
if (retnbr > 0) {
|
||||
num = rigio.ReadBuffer (replybuff, retnbr > 200 ? 200 : retnbr);
|
||||
// debug code
|
||||
// if (num)
|
||||
// printhex(replybuff, num);
|
||||
// else
|
||||
// std::cout << "no reply" << std::endl; fflush(stdout);
|
||||
/*
|
||||
if (num) {
|
||||
std::cout << printtime() << "Rsp (" << n << "): ";
|
||||
printhex(replybuff, num);
|
||||
} else
|
||||
std::cout << printtime() << "Rsp (" << n << "): no reply" << std::endl;
|
||||
std::cout.flush();
|
||||
*/
|
||||
}
|
||||
|
||||
if (retnbr == 0 || num == retnbr) {
|
||||
readpending = false;
|
||||
return true;
|
||||
//
|
||||
if ((readtimeout = rig.timeout) > 0)
|
||||
while (readtimeout--)
|
||||
MilliSleep(1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
readpending = false;
|
||||
|
||||
if (retnbr == 0 || num == retnbr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue