Added right audio channel PTT signal

pull/2/head
David Freese 2009-02-25 04:39:17 -06:00
rodzic 5417cf2b97
commit afc4e0b890
6 zmienionych plików z 69 dodań i 28 usunięć

Wyświetl plik

@ -1137,6 +1137,13 @@ btnInitHWPTT->redraw();
progdefaults.changed = true;
}
Fl_Check_Button *btnPTTrightchannel=(Fl_Check_Button *)0;
static void cb_btnPTTrightchannel(Fl_Check_Button* o, void*) {
progdefaults.PTTrightchannel = o->value();
progdefaults.changed = true;
}
Fl_Check_Button *chkUSERIGCAT=(Fl_Check_Button *)0;
static void cb_chkUSERIGCAT(Fl_Check_Button* o, void*) {
@ -2179,6 +2186,7 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
{ tabsUI = new Fl_Tabs(0, 25, 505, 345);
tabsUI->selection_color(FL_LIGHT1);
{ tabUserInterface = new Fl_Group(0, 50, 500, 320, _("General"));
tabUserInterface->hide();
{ Fl_Group* o = new Fl_Group(5, 60, 490, 301);
o->box(FL_ENGRAVED_FRAME);
{ Fl_Check_Button* o = btnShowTooltips = new Fl_Check_Button(15, 70, 120, 20, _("Show tooltips"));
@ -2315,7 +2323,6 @@ static const char szBaudRates[] = "300|600|1200|2400|4800|9600|19200|38400|57600
tabWfallRestart->end();
} // Fl_Group* tabWfallRestart
{ tabContest = new Fl_Group(0, 50, 500, 320, _("Contest"));
tabContest->hide();
{ Fl_Group* o = new Fl_Group(5, 60, 490, 80, _("Exchanges"));
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
@ -3434,44 +3441,43 @@ an merging"));
tabsRig->selection_color(FL_LIGHT1);
{ Fl_Group* o = new Fl_Group(0, 50, 500, 320, _("Hardware PTT"));
o->tooltip(_("Tottle DTR for ptt"));
o->hide();
{ btnPTT[0] = new Fl_Round_Button(181, 68, 138, 17, _("No PTT available"));
{ btnPTT[0] = new Fl_Round_Button(45, 68, 138, 17, _("No h/w PTT available"));
btnPTT[0]->down_box(FL_DIAMOND_DOWN_BOX);
btnPTT[0]->value(1);
btnPTT[0]->selection_color((Fl_Color)1);
btnPTT[0]->callback((Fl_Callback*)cb_btnPTT);
} // Fl_Round_Button* btnPTT[0]
{ grpHWPTT = new Fl_Group(5, 105, 490, 190);
{ grpHWPTT = new Fl_Group(5, 140, 490, 190);
grpHWPTT->box(FL_ENGRAVED_FRAME);
{ inpTTYdev = new Fl_Input_Choice(200, 152, 150, 22, _("Device:"));
{ inpTTYdev = new Fl_Input_Choice(200, 183, 150, 22, _("Device:"));
inpTTYdev->tooltip(_("Select serial port"));
inpTTYdev->callback((Fl_Callback*)cb_inpTTYdev);
} // Fl_Input_Choice* inpTTYdev
{ btnRTSptt = new Fl_Round_Button(147, 192, 85, 20, _("Use RTS"));
{ btnRTSptt = new Fl_Round_Button(147, 223, 85, 20, _("Use RTS"));
btnRTSptt->tooltip(_("RTS is ptt signal line"));
btnRTSptt->down_box(FL_DOWN_BOX);
btnRTSptt->callback((Fl_Callback*)cb_btnRTSptt);
} // Fl_Round_Button* btnRTSptt
{ btnRTSplusV = new Fl_Round_Button(262, 192, 100, 20, _("RTS = +V"));
{ btnRTSplusV = new Fl_Round_Button(262, 223, 100, 20, _("RTS = +V"));
btnRTSplusV->tooltip(_("Initial voltage on RTS"));
btnRTSplusV->down_box(FL_DOWN_BOX);
btnRTSplusV->callback((Fl_Callback*)cb_btnRTSplusV);
} // Fl_Round_Button* btnRTSplusV
{ btnDTRptt = new Fl_Round_Button(147, 222, 85, 20, _("Use DTR"));
{ btnDTRptt = new Fl_Round_Button(147, 253, 85, 20, _("Use DTR"));
btnDTRptt->tooltip(_("DTR is ptt signal line"));
btnDTRptt->down_box(FL_DOWN_BOX);
btnDTRptt->callback((Fl_Callback*)cb_btnDTRptt);
} // Fl_Round_Button* btnDTRptt
{ btnDTRplusV = new Fl_Round_Button(262, 222, 100, 20, _("DTR = +V"));
{ btnDTRplusV = new Fl_Round_Button(262, 253, 100, 20, _("DTR = +V"));
btnDTRplusV->tooltip(_("Initial voltage on DTR"));
btnDTRplusV->down_box(FL_DOWN_BOX);
btnDTRplusV->callback((Fl_Callback*)cb_btnDTRplusV);
} // Fl_Round_Button* btnDTRplusV
{ btnInitHWPTT = new Fl_Button(188, 260, 113, 24, _("Initialize"));
{ btnInitHWPTT = new Fl_Button(188, 291, 113, 24, _("Initialize"));
btnInitHWPTT->tooltip(_("Initialize the ptt h/w interface"));
btnInitHWPTT->callback((Fl_Callback*)cb_btnInitHWPTT);
} // Fl_Button* btnInitHWPTT
{ btnPTT[4] = new Fl_Round_Button(145, 120, 210, 20, _("Use separate serial port PTT"));
{ btnPTT[4] = new Fl_Round_Button(145, 151, 210, 20, _("Use separate serial port PTT"));
btnPTT[4]->tooltip(_("Serial port h/w used for PTT"));
btnPTT[4]->down_box(FL_DIAMOND_DOWN_BOX);
btnPTT[4]->selection_color(FL_SELECTION_COLOR);
@ -3479,10 +3485,17 @@ an merging"));
} // Fl_Round_Button* btnPTT[4]
grpHWPTT->end();
} // Fl_Group* grpHWPTT
{ Fl_Check_Button* o = btnPTTrightchannel = new Fl_Check_Button(45, 105, 70, 15, _("Enable right audio channel PTT tone"));
btnPTTrightchannel->tooltip(_("Can be used in lieu of or in addition to other PTT types"));
btnPTTrightchannel->down_box(FL_DOWN_BOX);
btnPTTrightchannel->callback((Fl_Callback*)cb_btnPTTrightchannel);
o->value(progdefaults.PTTrightchannel);
} // Fl_Check_Button* btnPTTrightchannel
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(0, 50, 500, 320, _("RigCAT"));
o->tooltip(_("Rig Control using xml spec file"));
o->hide();
{ chkUSERIGCAT = new Fl_Check_Button(195, 60, 110, 20, _("Use RigCAT"));
chkUSERIGCAT->tooltip(_("RigCAT used for rig control"));
chkUSERIGCAT->down_box(FL_DOWN_BOX);
@ -4074,6 +4087,7 @@ l with your sound hardware."));
{ tabsMisc = new Fl_Tabs(0, 25, 500, 345);
tabsMisc->selection_color(FL_LIGHT1);
{ tabSweetSpot = new Fl_Group(0, 50, 500, 320, _("Sweet Spot"));
tabSweetSpot->hide();
{ Fl_Group* o = new Fl_Group(5, 60, 490, 75);
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
@ -4214,7 +4228,6 @@ l with your sound hardware."));
tabCPUspeed->end();
} // Fl_Group* tabCPUspeed
{ tabFileExtraction = new Fl_Group(0, 50, 500, 320, _("Text Capture"));
tabFileExtraction->hide();
{ Fl_Group* o = new Fl_Group(5, 60, 490, 155, _("Auto Extract files from rx stream"));
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);

Wyświetl plik

@ -140,7 +140,7 @@ progdefaults.changed = true;}
} {
Fl_Group tabUserInterface {
label General open
xywh {0 50 500 320}
xywh {0 50 500 320} hide
} {
Fl_Group {} {open
xywh {5 60 490 301} box ENGRAVED_FRAME
@ -277,7 +277,7 @@ progdefaults.changed = true;}
}
Fl_Group tabContest {
label Contest open
xywh {0 50 500 320} hide
xywh {0 50 500 320}
} {
Fl_Group {} {
label Exchanges open
@ -1377,10 +1377,10 @@ progdefaults.changed = true;}
} {
Fl_Group {} {
label {Hardware PTT} open
tooltip {Tottle DTR for ptt} xywh {0 50 500 320} hide
tooltip {Tottle DTR for ptt} xywh {0 50 500 320}
} {
Fl_Round_Button {btnPTT[0]} {
label {No PTT available}
label {No h/w PTT available}
callback {btnPTT[1]->value(0);
btnPTT[2]->value(0);
btnPTT[3]->value(0);
@ -1390,52 +1390,52 @@ o->value(1);
btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
xywh {181 68 138 17} down_box DIAMOND_DOWN_BOX value 1 selection_color 1
xywh {45 68 138 17} down_box DIAMOND_DOWN_BOX value 1 selection_color 1
}
Fl_Group grpHWPTT {open
xywh {5 105 490 190} box ENGRAVED_FRAME
xywh {5 140 490 190} box ENGRAVED_FRAME
} {
Fl_Input_Choice inpTTYdev {
label {Device:}
callback {btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;} open
tooltip {Select serial port} xywh {200 152 150 22}
tooltip {Select serial port} xywh {200 183 150 22}
} {}
Fl_Round_Button btnRTSptt {
label {Use RTS}
callback {btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
tooltip {RTS is ptt signal line} xywh {147 192 85 20} down_box DOWN_BOX
tooltip {RTS is ptt signal line} xywh {147 223 85 20} down_box DOWN_BOX
}
Fl_Round_Button btnRTSplusV {
label {RTS = +V}
callback {btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
tooltip {Initial voltage on RTS} xywh {262 192 100 20} down_box DOWN_BOX
tooltip {Initial voltage on RTS} xywh {262 223 100 20} down_box DOWN_BOX
}
Fl_Round_Button btnDTRptt {
label {Use DTR}
callback {btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
tooltip {DTR is ptt signal line} xywh {147 222 85 20} down_box DOWN_BOX
tooltip {DTR is ptt signal line} xywh {147 253 85 20} down_box DOWN_BOX
}
Fl_Round_Button btnDTRplusV {
label {DTR = +V}
callback {btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
tooltip {Initial voltage on DTR} xywh {262 222 100 20} down_box DOWN_BOX
tooltip {Initial voltage on DTR} xywh {262 253 100 20} down_box DOWN_BOX
}
Fl_Button btnInitHWPTT {
label Initialize
callback {progdefaults.initInterface();
o->labelcolor(FL_FOREGROUND_COLOR);
progdefaults.changed = true;}
tooltip {Initialize the ptt h/w interface} xywh {188 260 113 24}
tooltip {Initialize the ptt h/w interface} xywh {188 291 113 24}
}
Fl_Round_Button {btnPTT[4]} {
label {Use separate serial port PTT}
@ -1451,13 +1451,20 @@ btnRigCatDTRptt->value(0);
btnInitHWPTT->labelcolor(FL_RED);
btnInitHWPTT->redraw();
progdefaults.changed = true;}
tooltip {Serial port h/w used for PTT} xywh {145 120 210 20} down_box DIAMOND_DOWN_BOX selection_color 15
tooltip {Serial port h/w used for PTT} xywh {145 151 210 20} down_box DIAMOND_DOWN_BOX selection_color 15
}
}
Fl_Check_Button btnPTTrightchannel {
label {Enable right audio channel PTT tone}
callback {progdefaults.PTTrightchannel = o->value();
progdefaults.changed = true;}
tooltip {Can be used in lieu of or in addition to other PTT types} xywh {45 105 70 15} down_box DOWN_BOX
code0 {o->value(progdefaults.PTTrightchannel);}
}
}
Fl_Group {} {
label RigCAT open
tooltip {Rig Control using xml spec file} xywh {0 50 500 320}
tooltip {Rig Control using xml spec file} xywh {0 50 500 320} hide
} {
Fl_Check_Button chkUSERIGCAT {
label {Use RigCAT}
@ -2290,7 +2297,7 @@ OFF - limit search to +/- 200 Hz} xywh {215 246 270 20} down_box DOWN_BOX
} {
Fl_Group tabSweetSpot {
label {Sweet Spot} open
xywh {0 50 500 320}
xywh {0 50 500 320} hide
} {
Fl_Group {} {open
xywh {5 60 490 75} box ENGRAVED_FRAME align 21
@ -2443,7 +2450,7 @@ progdefaults.changed = true;}
}
Fl_Group tabFileExtraction {
label {Text Capture} open
xywh {0 50 500 320} hide
xywh {0 50 500 320}
} {
Fl_Group {} {
label {Auto Extract files from rx stream} open

Wyświetl plik

@ -182,6 +182,7 @@ extern Fl_Round_Button *btnRTSplusV;
extern Fl_Round_Button *btnDTRptt;
extern Fl_Round_Button *btnDTRplusV;
extern Fl_Button *btnInitHWPTT;
extern Fl_Check_Button *btnPTTrightchannel;
extern Fl_Check_Button *chkUSERIGCAT;
extern Fl_Group *grpRigCAT;
#include <FL/Fl_Output.H>

Wyświetl plik

@ -186,6 +186,7 @@
ELEM_(bool, DTRptt, "DTRPTT", false) \
ELEM_(bool, RTSplus, "RTSPLUS", false) \
ELEM_(bool, DTRplus, "DTRPLUS", false) \
ELEM_(bool, PTTrightchannel, "PTTRIGHTCHANNEL", false) \
ELEM_(int, choiceHAMLIBis, "CHOICEHAMLIBIS", 0) \
ELEM_(int, chkUSEMEMMAPis, "CHKUSEMEMMAPIS", 0) \
ELEM_(int, chkUSEHAMLIBis, "CHKUSEHAMLIBIS", 0) \

Wyświetl plik

@ -41,6 +41,8 @@ protected:
double rx_corr;
double tx_corr;
double tx_frequency;
double PTTphaseacc;
double PTTchannel[OUTBUFSIZE];
// for CW modem use only
bool cwTrack;
@ -152,6 +154,8 @@ private:
void wfid_sendchar(char c);
void wfid_sendchars(std::string s);
double PTTnco();
public:
void wfid_text(const std::string& s);

Wyświetl plik

@ -93,6 +93,7 @@ modem::modem()
reverse = wfrev ^ !wfsb;
historyON = false;
cap = 0;
PTTphaseacc = 0.0;
}
void modem::init()
@ -232,10 +233,24 @@ void modem::set_samplerate(int smprate)
samplerate = smprate;
}
double modem::PTTnco()
{
PTTphaseacc += TWOPI * 1000 / samplerate;
if (PTTphaseacc > M_PI)
PTTphaseacc -= TWOPI;
return sin(PTTphaseacc);
}
mbuffer<double, 512 * 2, 2> _mdm_scdbl;
void modem::ModulateXmtr(double *buffer, int len)
{
if (progdefaults.PTTrightchannel) {
for (int i = 0; i < len; i++)
PTTchannel[i] = PTTnco();
ModulateStereo( buffer, PTTchannel, len);
return;
}
try {
unsigned n = 4;
while (scard->Write(buffer, len) == 0 && --n);