kopia lustrzana https://github.com/jamescoxon/dl-fldigi
Upstream version 3.03AG
rodzic
67bec3df87
commit
db64583e91
|
|
@ -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, [0])
|
||||
m4_define(FLDIGI_PATCH, [3AF])
|
||||
m4_define(FLDIGI_PATCH, [3AG])
|
||||
|
||||
AC_INIT([fldigi], FLDIGI_MAJOR.FLDIGI_MINOR[FLDIGI_PATCH], [w1hkj AT w1hkj DOT com])
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static void cbRxFontBrowser(Fl_Widget* w, void* arg) {
|
|||
RxText->textcolor(color);
|
||||
RxText->redraw();
|
||||
|
||||
progdefaults.RxFontnbr = (int)(font);
|
||||
progdefaults.RxFontnbr = font;
|
||||
progdefaults.RxFontsize = size;
|
||||
progdefaults.RxFontcolor = color;
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ static void cbTxFontBrowser(Fl_Widget* w, void* arg) {
|
|||
TxText->textcolor(color);
|
||||
TxText->redraw();
|
||||
|
||||
progdefaults.TxFontnbr = (int)(font);
|
||||
progdefaults.TxFontnbr = font;
|
||||
progdefaults.TxFontsize = size;
|
||||
progdefaults.TxFontcolor = color;
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ void cbWaterfallFontBrowser(Font_Browser*, void* v) {
|
|||
Fl_Font fnt = ft->fontNumber();
|
||||
int size = ft->fontSize();
|
||||
|
||||
progdefaults.WaterfallFontnbr = (int)(fnt);
|
||||
progdefaults.WaterfallFontnbr = fnt;
|
||||
progdefaults.WaterfallFontsize = size;
|
||||
progdefaults.changed = true;
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ static void cb_btnRxFont(Fl_Button*, void*) {
|
|||
static Font_Browser* b = 0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.RxFontnbr);
|
||||
b->fontNumber(progdefaults.RxFontnbr);
|
||||
b->fontSize(progdefaults.RxFontsize);
|
||||
b->fontColor(progdefaults.RxFontcolor);
|
||||
b->callback(cbRxFontBrowser);
|
||||
|
|
@ -292,7 +292,7 @@ static void cb_btnTxFont(Fl_Button*, void*) {
|
|||
static Font_Browser* b = 0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.TxFontnbr);
|
||||
b->fontNumber(progdefaults.TxFontnbr);
|
||||
b->fontSize(progdefaults.TxFontsize);
|
||||
b->fontColor(progdefaults.TxFontcolor);
|
||||
b->callback(cbTxFontBrowser);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ Function {cbRxFontBrowser(Fl_Widget* w, void* arg)} {open private return_type vo
|
|||
RxText->textcolor(color);
|
||||
RxText->redraw();
|
||||
|
||||
progdefaults.RxFontnbr = (int)(font);
|
||||
progdefaults.RxFontnbr = font;
|
||||
progdefaults.RxFontsize = size;
|
||||
progdefaults.RxFontcolor = color;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ Function {cbTxFontBrowser(Fl_Widget* w, void* arg)} {open private return_type vo
|
|||
TxText->textcolor(color);
|
||||
TxText->redraw();
|
||||
|
||||
progdefaults.TxFontnbr = (int)(font);
|
||||
progdefaults.TxFontnbr = font;
|
||||
progdefaults.TxFontsize = size;
|
||||
progdefaults.TxFontcolor = color;
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ Function {cbWaterfallFontBrowser(Font_Browser*, void* v)} {open return_type void
|
|||
Fl_Font fnt = ft->fontNumber();
|
||||
int size = ft->fontSize();
|
||||
|
||||
progdefaults.WaterfallFontnbr = (int)(fnt);
|
||||
progdefaults.WaterfallFontnbr = fnt;
|
||||
progdefaults.WaterfallFontsize = size;
|
||||
progdefaults.changed = true;
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ progdefaults.changed = true;}
|
|||
callback {static Font_Browser* b = 0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.RxFontnbr);
|
||||
b->fontNumber(progdefaults.RxFontnbr);
|
||||
b->fontSize(progdefaults.RxFontsize);
|
||||
b->fontColor(progdefaults.RxFontcolor);
|
||||
b->callback(cbRxFontBrowser);
|
||||
|
|
@ -330,7 +330,7 @@ b->show();}
|
|||
callback {static Font_Browser* b = 0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.TxFontnbr);
|
||||
b->fontNumber(progdefaults.TxFontnbr);
|
||||
b->fontSize(progdefaults.TxFontsize);
|
||||
b->fontColor(progdefaults.TxFontcolor);
|
||||
b->callback(cbTxFontBrowser);
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ static void cb_btnWaterfallFont(Fl_Button*, void*) {
|
|||
static Font_Browser *b = (Font_Browser *)0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.WaterfallFontnbr);
|
||||
b->fontNumber(progdefaults.WaterfallFontnbr);
|
||||
b->fontSize(progdefaults.WaterfallFontsize);
|
||||
}
|
||||
b->callback((Fl_Callback*)cbWaterfallFontBrowser, (void*)(b));
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ progdefaults.changed = true;}
|
|||
callback {static Font_Browser *b = (Font_Browser *)0;
|
||||
if (!b) {
|
||||
b = new Font_Browser;
|
||||
b->fontNumber((Fl_Font)progdefaults.WaterfallFontnbr);
|
||||
b->fontNumber(progdefaults.WaterfallFontnbr);
|
||||
b->fontSize(progdefaults.WaterfallFontsize);
|
||||
}
|
||||
b->callback((Fl_Callback*)cbWaterfallFontBrowser, (void*)(b));
|
||||
|
|
|
|||
|
|
@ -489,20 +489,6 @@ bool clean_exit() {
|
|||
MilliSleep(10);
|
||||
}
|
||||
|
||||
// fl_lock (&trx_mutex);
|
||||
// if (active_modem) {
|
||||
// active_modem->shutdown();
|
||||
// MilliSleep(100);
|
||||
// delete active_modem;
|
||||
// }
|
||||
// active_modem = (modem *) 0;
|
||||
// fl_unlock (&trx_mutex);
|
||||
|
||||
//#if USE_HAMLIB
|
||||
// delete xcvr;
|
||||
//#endif
|
||||
// delete push2talk;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1759,19 +1745,13 @@ void create_fl_digi_main() {
|
|||
|
||||
|
||||
|
||||
ReceiveText->setFont((Fl_Font)progdefaults.RxFontnbr);
|
||||
|
||||
ReceiveText->setFont(progdefaults.RxFontnbr);
|
||||
ReceiveText->setFontSize(progdefaults.RxFontsize);
|
||||
|
||||
ReceiveText->setFontColor((Fl_Color)progdefaults.RxFontcolor, FTextBase::RECV);
|
||||
|
||||
ReceiveText->setFontColor((Fl_Color)progdefaults.XMITcolor, FTextBase::XMIT);
|
||||
|
||||
ReceiveText->setFontColor((Fl_Color)progdefaults.CTRLcolor, FTextBase::CTRL);
|
||||
|
||||
ReceiveText->setFontColor((Fl_Color)progdefaults.SKIPcolor, FTextBase::SKIP);
|
||||
|
||||
ReceiveText->setFontColor((Fl_Color)progdefaults.ALTRcolor, FTextBase::ALTR);
|
||||
ReceiveText->setFontColor(progdefaults.RxFontcolor, FTextBase::RECV);
|
||||
ReceiveText->setFontColor(progdefaults.XMITcolor, FTextBase::XMIT);
|
||||
ReceiveText->setFontColor(progdefaults.CTRLcolor, FTextBase::CTRL);
|
||||
ReceiveText->setFontColor(progdefaults.SKIPcolor, FTextBase::SKIP);
|
||||
ReceiveText->setFontColor(progdefaults.ALTRcolor, FTextBase::ALTR);
|
||||
|
||||
TiledGroup->add_resize_check(FTextView::wheight_mult_tsize, ReceiveText);
|
||||
FHdisp = new Raster(sw, Y, WNOM-sw, minRxHeight);
|
||||
|
|
@ -1784,19 +1764,13 @@ void create_fl_digi_main() {
|
|||
progdefaults.TxColor.G,
|
||||
progdefaults.TxColor.B));
|
||||
|
||||
TransmitText->setFont((Fl_Font)progdefaults.TxFontnbr);
|
||||
|
||||
TransmitText->setFont(progdefaults.TxFontnbr);
|
||||
TransmitText->setFontSize(progdefaults.TxFontsize);
|
||||
|
||||
TransmitText->setFontColor((Fl_Color)progdefaults.TxFontcolor, FTextBase::RECV);
|
||||
|
||||
TransmitText->setFontColor((Fl_Color)progdefaults.XMITcolor, FTextBase::XMIT);
|
||||
|
||||
TransmitText->setFontColor((Fl_Color)progdefaults.CTRLcolor, FTextBase::CTRL);
|
||||
|
||||
TransmitText->setFontColor((Fl_Color)progdefaults.SKIPcolor, FTextBase::SKIP);
|
||||
|
||||
TransmitText->setFontColor((Fl_Color)progdefaults.ALTRcolor, FTextBase::ALTR);
|
||||
TransmitText->setFontColor(progdefaults.TxFontcolor, FTextBase::RECV);
|
||||
TransmitText->setFontColor(progdefaults.XMITcolor, FTextBase::XMIT);
|
||||
TransmitText->setFontColor(progdefaults.CTRLcolor, FTextBase::CTRL);
|
||||
TransmitText->setFontColor(progdefaults.SKIPcolor, FTextBase::SKIP);
|
||||
TransmitText->setFontColor(progdefaults.ALTRcolor, FTextBase::ALTR);
|
||||
|
||||
Fl_Box *minbox = new Fl_Box(sw,Y + 66, WNOM-sw, Htext - 66 - 32);
|
||||
minbox->hide();
|
||||
|
|
|
|||
|
|
@ -196,10 +196,10 @@ struct configuration {
|
|||
RGBint btnFkeyTextColor;
|
||||
|
||||
// Rx / Tx fonts & palettes
|
||||
int RxFontnbr;
|
||||
Fl_Font RxFontnbr;
|
||||
int RxFontsize;
|
||||
Fl_Color RxFontcolor;
|
||||
int TxFontnbr;
|
||||
Fl_Font TxFontnbr;
|
||||
int TxFontsize;
|
||||
Fl_Color TxFontcolor;
|
||||
RGBint RxColor;
|
||||
|
|
@ -209,7 +209,7 @@ struct configuration {
|
|||
Fl_Color SKIPcolor;
|
||||
Fl_Color ALTRcolor;
|
||||
|
||||
int WaterfallFontnbr;
|
||||
Fl_Font WaterfallFontnbr;
|
||||
int WaterfallFontsize;
|
||||
|
||||
string ui_scheme;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ private:
|
|||
struct termios oldtio, newtio;
|
||||
int timeout;
|
||||
int retries;
|
||||
int status;
|
||||
int status, origstatus;
|
||||
bool dtr;
|
||||
bool dtrptt;
|
||||
bool rts;
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ void writeadif () {
|
|||
adiFile = fopen (sfname.c_str(), "a");
|
||||
if (adiFile) {
|
||||
// write the current record to the file
|
||||
adif.append("<EOR>\n");
|
||||
fprintf(adiFile,"%s", adif.c_str());
|
||||
fclose (adiFile);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,10 +213,10 @@ configuration progdefaults = {
|
|||
|
||||
// Rx / Tx / Waterfall Text Widgets
|
||||
|
||||
FL_SCREEN, // int RxFontnbr
|
||||
FL_SCREEN, // Fl_Font RxFontnbr
|
||||
16, // int RxFontsize
|
||||
FL_BLACK, // Fl_Color RxFontcolor
|
||||
FL_SCREEN, // int TxFontnbr
|
||||
FL_SCREEN, // Fl_Font TxFontnbr
|
||||
16, // int TxFontsize
|
||||
FL_BLACK, // Fl_Color TxFontcolor
|
||||
{ 255, 242, 190}, // RGBint RxColor;
|
||||
|
|
@ -227,7 +227,7 @@ configuration progdefaults = {
|
|||
FL_BLUE, // Fl_Color SKIPcolor;
|
||||
FL_DARK_MAGENTA,// Fl_Color ALTRcolor;
|
||||
|
||||
FL_SCREEN, // int WaterfallFontnbr
|
||||
FL_SCREEN, // Fl_Font WaterfallFontnbr
|
||||
12, // int WaterfallFontsize
|
||||
|
||||
"gtk+", // string ui_scheme
|
||||
|
|
@ -537,10 +537,10 @@ void configuration::writeDefaultsXML()
|
|||
writeXMLrgb(f, "FKEYTEXTCOLOR",
|
||||
btnFkeyTextColor.R, btnFkeyTextColor.G, btnFkeyTextColor.B);
|
||||
|
||||
writeXMLint(f, "RXFONTNBR", RxFontnbr);
|
||||
writeXMLint(f, "RXFONTNBR", (int)RxFontnbr);
|
||||
writeXMLint(f, "RXFONTSIZE", RxFontsize);
|
||||
writeXMLint(f, "RXFNTCOLOR", (int)RxFontcolor);
|
||||
writeXMLint(f, "TXFONTNBR", TxFontnbr);
|
||||
writeXMLint(f, "TXFONTNBR", (int)TxFontnbr);
|
||||
writeXMLint(f, "TXFONTSIZE", TxFontsize);
|
||||
writeXMLint(f, "TXFNTCOLOR", (int)TxFontcolor);
|
||||
writeXMLint(f, "XMITCOLOR", (int)XMITcolor);
|
||||
|
|
@ -550,7 +550,7 @@ void configuration::writeDefaultsXML()
|
|||
|
||||
writeXMLrgb(f, "RXFONTCOLOR", RxColor.R, RxColor.G, RxColor.B);
|
||||
writeXMLrgb(f, "TXFONTCOLOR", TxColor.R, TxColor.G, TxColor.B);
|
||||
writeXMLint(f, "WATERFALLFONTNBR", WaterfallFontnbr);
|
||||
writeXMLint(f, "WATERFALLFONTNBR", (int)WaterfallFontnbr);
|
||||
writeXMLint(f, "WATERFALLFONTSIZE", WaterfallFontsize);
|
||||
|
||||
writeXMLstr(f, "UISCHEME", ui_scheme);
|
||||
|
|
@ -1068,7 +1068,7 @@ bool configuration::readDefaultsXML()
|
|||
&btnFkeyTextColor.B);
|
||||
break;
|
||||
case RXFONTNBR :
|
||||
RxFontnbr = atoi(xml->getNodeData());
|
||||
RxFontnbr = (Fl_Font)atoi(xml->getNodeData());
|
||||
break;
|
||||
case RXFONTSIZE :
|
||||
RxFontsize = atoi(xml->getNodeData());
|
||||
|
|
@ -1077,7 +1077,7 @@ bool configuration::readDefaultsXML()
|
|||
RxFontcolor = (Fl_Color)atoi(xml->getNodeData());
|
||||
break;
|
||||
case TXFONTNBR :
|
||||
TxFontnbr = atoi(xml->getNodeData());
|
||||
TxFontnbr = (Fl_Font)atoi(xml->getNodeData());
|
||||
break;
|
||||
case TXFONTSIZE :
|
||||
TxFontsize = atoi(xml->getNodeData());
|
||||
|
|
@ -1102,7 +1102,7 @@ bool configuration::readDefaultsXML()
|
|||
ALTRcolor = (Fl_Color)atoi(xml->getNodeData());
|
||||
break;
|
||||
case WATERFALLFONTNBR :
|
||||
WaterfallFontnbr = atoi(xml->getNodeData());
|
||||
WaterfallFontnbr = (Fl_Font)atoi(xml->getNodeData());
|
||||
break;
|
||||
case WATERFALLFONTSIZE :
|
||||
WaterfallFontsize = atoi(xml->getNodeData());
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ static string sRigMode = "";
|
|||
static long long llFreq = 0;
|
||||
|
||||
static int dummy = 0;
|
||||
static bool nonCATrig = false;
|
||||
long long noCATfreq = 0L;
|
||||
string noCATmode = "USB";
|
||||
string noCATwidth = "";
|
||||
|
||||
static void *rigCAT_loop(void *args);
|
||||
|
||||
|
|
@ -351,6 +355,10 @@ long long rigCAT_getfreq()
|
|||
list<XMLIOS>::iterator itrCmd;
|
||||
string strCmd;
|
||||
|
||||
if (nonCATrig == true) {
|
||||
return noCATfreq;
|
||||
}
|
||||
|
||||
LOG_DEBUG("get frequency");
|
||||
|
||||
itrCmd = commands.begin();
|
||||
|
|
@ -359,8 +367,13 @@ long long rigCAT_getfreq()
|
|||
break;
|
||||
++itrCmd;
|
||||
}
|
||||
if (itrCmd == commands.end())
|
||||
return -1;
|
||||
|
||||
if (itrCmd == commands.end()) {
|
||||
LOG_DEBUG("Cmd not defined");
|
||||
nonCATrig = true;
|
||||
return -1; // get_freq command is not defined!
|
||||
}
|
||||
|
||||
modeCmd = *itrCmd;
|
||||
|
||||
if ( modeCmd.str1.empty() == false)
|
||||
|
|
@ -369,10 +382,6 @@ long long rigCAT_getfreq()
|
|||
if (modeCmd.str2.empty() == false)
|
||||
strCmd.append(modeCmd.str2);
|
||||
|
||||
// if (hexout(strCmd) == false) {
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
if (modeCmd.info.size()) {
|
||||
list<XMLIOS>::iterator preply = reply.begin();
|
||||
while (preply != reply.end()) {
|
||||
|
|
@ -439,8 +448,11 @@ void rigCAT_setfreq(long long f)
|
|||
break;
|
||||
++itrCmd;
|
||||
}
|
||||
if (itrCmd == commands.end())
|
||||
if (itrCmd == commands.end()) {
|
||||
noCATfreq = f;
|
||||
return;
|
||||
}
|
||||
|
||||
modeCmd = *itrCmd;
|
||||
|
||||
if ( modeCmd.str1.empty() == false)
|
||||
|
|
@ -477,6 +489,9 @@ string rigCAT_getmode()
|
|||
list<XMLIOS>::iterator itrCmd;
|
||||
string strCmd;
|
||||
|
||||
if (nonCATrig == true)
|
||||
return noCATmode;
|
||||
|
||||
LOG_DEBUG("get mode");
|
||||
|
||||
itrCmd = commands.begin();
|
||||
|
|
@ -581,8 +596,10 @@ void rigCAT_setmode(const string& md)
|
|||
break;
|
||||
++itrCmd;
|
||||
}
|
||||
if (itrCmd == commands.end())
|
||||
if (itrCmd == commands.end()) {
|
||||
noCATmode = md;
|
||||
return;
|
||||
}
|
||||
modeCmd = *itrCmd;
|
||||
|
||||
if ( modeCmd.str1.empty() == false)
|
||||
|
|
@ -634,6 +651,9 @@ string rigCAT_getwidth()
|
|||
XMLIOS modeCmd;
|
||||
list<XMLIOS>::iterator itrCmd;
|
||||
string strCmd;
|
||||
|
||||
if (nonCATrig == true)
|
||||
return noCATwidth;
|
||||
|
||||
LOG_DEBUG("get width");
|
||||
|
||||
|
|
@ -739,8 +759,10 @@ void rigCAT_setwidth(const string& w)
|
|||
break;
|
||||
++itrCmd;
|
||||
}
|
||||
if (itrCmd == commands.end())
|
||||
if (itrCmd == commands.end()) {
|
||||
noCATwidth = w;
|
||||
return;
|
||||
}
|
||||
modeCmd = *itrCmd;
|
||||
|
||||
if ( modeCmd.str1.empty() == false)
|
||||
|
|
@ -919,6 +941,7 @@ void rigCAT_sendINIT()
|
|||
|
||||
bool rigCAT_init()
|
||||
{
|
||||
|
||||
if (rigCAT_open == true) {
|
||||
LOG_ERROR("RigCAT already open file present");
|
||||
return false;
|
||||
|
|
@ -937,10 +960,12 @@ bool rigCAT_init()
|
|||
sRigMode = "";
|
||||
sRigWidth = "";
|
||||
|
||||
nonCATrig = false;
|
||||
|
||||
if (rigCAT_getfreq() <= 0) {
|
||||
LOG_ERROR("Transceiver not responding");
|
||||
rigio.ClosePort();
|
||||
return false;
|
||||
LOG_ERROR("Xcvr Freq request not answered");
|
||||
// rigio.ClosePort();
|
||||
// return false;
|
||||
}
|
||||
|
||||
rigCAT_sendINIT();
|
||||
|
|
@ -952,7 +977,7 @@ bool rigCAT_init()
|
|||
}
|
||||
|
||||
init_Xml_RigDialog();
|
||||
// rigCAT_sendINIT();
|
||||
|
||||
rigCAT_open = true;
|
||||
rigCAT_exit = false;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -588,15 +588,21 @@ void parsePORT(size_t &p0)
|
|||
rigio.RTSCTS(rig.rtscts);
|
||||
}
|
||||
p0 = pend;
|
||||
#ifdef DEBUGXML
|
||||
LOG_DEBUG("port: %s\n" "baud: %d\n" "retries: %d\n" "timeout: %d\n", "initial rts: %+d\n"
|
||||
"use rts ptt: %c\n" "initial dts: %+d\n" "use dtr ptt: %c\n"
|
||||
"use flowcontrol: %c",
|
||||
|
||||
LOG_DEBUG("\nSerial port parameters:\n\
|
||||
port: %s\n\
|
||||
baud: %d\n\
|
||||
retries: %d\n\
|
||||
timeout: %d\n\
|
||||
initial rts: %+d\n\
|
||||
use rts ptt: %c\n\
|
||||
initial dts: %+d\n\
|
||||
use dtr ptt: %c\n\
|
||||
use flowcontrol: %c",
|
||||
rig.port.c_str(), rig.baud, rig.retries, rig.timeout, (rig.rts ? +12 : -12),
|
||||
(rig.rtsptt ? 'T' : 'F'), (rig.dtr ? +12 : -12), (rig.dtrptt ? 'T' : 'F'),
|
||||
(rig.rtscts ? 'T' : 'F'));
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "serial.h"
|
||||
#include "re.h"
|
||||
#include "debug.h"
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
// convert COMx to /dev/ttySy with y = x - 1
|
||||
|
|
@ -126,6 +127,7 @@ bool Cserial::OpenPort() {
|
|||
tcsetattr (fd, TCSANOW, &newtio);
|
||||
|
||||
ioctl(fd, TIOCMGET, &status);
|
||||
origstatus = status;
|
||||
|
||||
if (dtr)
|
||||
status |= TIOCM_DTR; // set the DTR bit
|
||||
|
|
@ -149,12 +151,17 @@ bool Cserial::OpenPort() {
|
|||
///////////////////////////////////////////////////////
|
||||
void Cserial::SetPTT(bool b)
|
||||
{
|
||||
if (fd < 0)
|
||||
if (fd < 0) {
|
||||
LOG_DEBUG("ptt fd < 0");
|
||||
return;
|
||||
if ( !(dtrptt || rtsptt) )
|
||||
}
|
||||
if ( !(dtrptt || rtsptt) ) {
|
||||
LOG_DEBUG("No h/w PTT");
|
||||
return;
|
||||
}
|
||||
|
||||
ioctl(fd, TIOCMGET, &status);
|
||||
LOG_DEBUG("Status %X", status);
|
||||
if (b == true) { // ptt enabled
|
||||
if (dtrptt && dtr)
|
||||
status &= ~TIOCM_DTR; // toggle low
|
||||
|
|
@ -178,6 +185,7 @@ void Cserial::SetPTT(bool b)
|
|||
status &= ~TIOCM_RTS; // toggle low
|
||||
}
|
||||
}
|
||||
LOG_DEBUG("Status %X", status);
|
||||
ioctl(fd, TIOCMSET, &status);
|
||||
}
|
||||
|
||||
|
|
@ -189,6 +197,8 @@ void Cserial::SetPTT(bool b)
|
|||
void Cserial::ClosePort()
|
||||
{
|
||||
if (fd < 0) return;
|
||||
LOG_DEBUG("Serial port closed");
|
||||
ioctl(fd, TIOCMSET, &origstatus);
|
||||
tcsetattr (fd, TCSANOW, &oldtio);
|
||||
close(fd);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -857,37 +857,6 @@ void x1_cb(Fl_Widget *w, void* v) {
|
|||
restoreFocus();
|
||||
}
|
||||
|
||||
//void bw_rsid_toggle(waterfall *wf)
|
||||
//{
|
||||
// if (trx_state == STATE_TX)
|
||||
// return;
|
||||
// if (progdefaults.rsid == true) {
|
||||
// progdefaults.rsid = false;
|
||||
// wf->bw_rsid->color(FL_BACKGROUND_COLOR);
|
||||
// wf->bw_rsid->redraw();
|
||||
// wf->xmtrcv->activate();
|
||||
// } else {
|
||||
// ReedSolomon->reset();
|
||||
// progdefaults.rsid = true;
|
||||
// wf->bw_rsid->color(FL_YELLOW);
|
||||
// wf->bw_rsid->redraw();
|
||||
// wf->xmtrcv->deactivate();
|
||||
// }
|
||||
// restoreFocus();
|
||||
//}
|
||||
|
||||
//void bw_rsid_cb(Fl_Widget *w, void * v) {
|
||||
// waterfall *wf = (waterfall *)w->parent();
|
||||
// wf->wfdisp->DispColor(!wf->wfdisp->DispColor());
|
||||
// if (wf->wfdisp->DispColor() == 0) {
|
||||
// w->label("gry");
|
||||
// } else {
|
||||
// w->label("clr");
|
||||
// }
|
||||
// restoreFocus();
|
||||
// bw_rsid_toggle(wf);
|
||||
//}
|
||||
|
||||
void slew_left(Fl_Widget *w, void * v) {
|
||||
waterfall *wf = (waterfall *)w->parent();
|
||||
wf->wfdisp->slew(-100);
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue