* This is a fix to commit 64406547b
  * Added Tx attenuator control to Audio configuration tab
  * Added main dialog short cut keys for tx attenuator control
    alt - ==> decrease by 0.1 dB (Command key "-" on OS X)
    alt = ==> increase by 0.1 dB (Command key "=" on OS X)
  * Modify two-tone generator in Olivia / Contestia to avoid
    remultiplication by txlevel
pull/1/head
David Freese 2011-07-10 14:08:19 -05:00
rodzic 12714ebe04
commit 07c12e07a5
6 zmienionych plików z 73 dodań i 68 usunięć

Wyświetl plik

@ -88,25 +88,26 @@ void contestia::tx_init(SoundBase *sc)
void contestia::send_tones()
{
if (tone_midfreq != txbasefreq || tone_bw != bandwidth) {
double freqa, freqb;
tone_bw = bandwidth;
tone_midfreq = txbasefreq;
if (reverse) {
freqa = tone_midfreq + (tone_bw / 2.0);
freqb = tone_midfreq - (tone_bw / 2.0);
} else {
freqa = tone_midfreq - (tone_bw / 2.0);
freqb = tone_midfreq + (tone_bw / 2.0);
}
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[2*SR4 + i] = tonebuff[i] = nco(freqa) * ampshape[i];
double freqa, freqb;
tone_bw = bandwidth;
tone_midfreq = txbasefreq;
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[3*SR4 + i] = tonebuff[SR4 + i] = nco(freqb) * ampshape[i];
if (reverse) {
freqa = tone_midfreq + (tone_bw / 2.0);
freqb = tone_midfreq - (tone_bw / 2.0);
} else {
freqa = tone_midfreq - (tone_bw / 2.0);
freqb = tone_midfreq + (tone_bw / 2.0);
}
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[2*SR4 + i] = tonebuff[i] = nco(freqa) * ampshape[i];
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[3*SR4 + i] = tonebuff[SR4 + i] = nco(freqb) * ampshape[i];
for (int j = 0; j < TONE_DURATION; j += SCBLOCKSIZE)
ModulateXmtr(&tonebuff[j], SCBLOCKSIZE);

Wyświetl plik

@ -2542,7 +2542,7 @@ Fl_Group *tabTxLevel=(Fl_Group *)0;
Fl_Counter *valTxLevel=(Fl_Counter *)0;
static void cb_valTxLevel(Fl_Counter* o, void*) {
progdefaults.txlevel = o->value();
progdefaults.txlevel=o->value();
}
Fl_Group *tabID=(Fl_Group *)0;
@ -3063,7 +3063,6 @@ static const char szProsigns[] = "~|%|&|+|=|{|}|<|>|[|]| ";
tabOperator->tooltip(_("Operator information"));
tabOperator->callback((Fl_Callback*)cb_tabOperator);
tabOperator->when(FL_WHEN_CHANGED);
tabOperator->hide();
{ Fl_Group* o = new Fl_Group(5, 35, 490, 165, _("Station"));
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
@ -4069,7 +4068,7 @@ an merging"));
} // Fl_Tabs* tabsWaterfall
tabWaterfall->end();
} // Fl_Group* tabWaterfall
{ tabModems = new Fl_Group(-4, 25, 544, 347, _("Modems"));
{ tabModems = new Fl_Group(-4, 25, 521, 347, _("Modems"));
tabModems->hide();
{ tabsModems = new Fl_Tabs(-4, 25, 544, 347);
tabsModems->selection_color((Fl_Color)FL_LIGHT1);
@ -5360,7 +5359,6 @@ an merging"));
{ tabsRig = new Fl_Tabs(0, 25, 500, 345);
tabsRig->selection_color((Fl_Color)FL_LIGHT1);
{ Fl_Group* o = new Fl_Group(0, 50, 500, 320, _("Hardware PTT"));
o->hide();
{ grpHWPTT = new Fl_Group(5, 100, 490, 265, _("h/w ptt device-pin"));
grpHWPTT->box(FL_ENGRAVED_FRAME);
grpHWPTT->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
@ -5423,6 +5421,7 @@ an merging"));
} // 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);
@ -6066,17 +6065,16 @@ ll with your audio device."));
} // Fl_Group* o
tabMixer->end();
} // Fl_Group* tabMixer
{ tabTxLevel = new Fl_Group(0, 50, 500, 320, _("Tx Level"));
{ tabTxLevel = new Fl_Group(0, 50, 500, 320, _("TxLevel"));
tabTxLevel->hide();
{ Fl_Group* o = new Fl_Group(5, 64, 490, 82, _("TX Level Control"));
{ Fl_Group* o = new Fl_Group(5, 60, 490, 86, _("Tx Attenuator"));
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
{ Fl_Counter* o = valTxLevel = new Fl_Counter(188, 88, 132, 21, _("Tx Attenuator (dB)"));
{ Fl_Counter* o = valTxLevel = new Fl_Counter(196, 85, 120, 21, _("Tx Atten (dB)"));
valTxLevel->minimum(-30);
valTxLevel->maximum(0);
valTxLevel->value(-6);
valTxLevel->callback((Fl_Callback*)cb_valTxLevel);
o->labelsize(FL_NORMAL_SIZE); o->textsize(FL_NORMAL_SIZE);
o->value(progdefaults.txlevel);
o->lstep(1.0);
} // Fl_Counter* valTxLevel
@ -6274,10 +6272,10 @@ d frequency"));
tabID->end();
} // Fl_Group* tabID
{ tabMisc = new Fl_Group(0, 25, 500, 345, _("Misc"));
tabMisc->hide();
{ tabsMisc = new Fl_Tabs(0, 25, 500, 345);
tabsMisc->selection_color((Fl_Color)FL_LIGHT1);
{ tabCPUspeed = new Fl_Group(0, 50, 500, 320, _("CPU"));
tabCPUspeed->hide();
{ Fl_Group* o = new Fl_Group(5, 60, 490, 51);
o->box(FL_ENGRAVED_FRAME);
o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE);
@ -6520,6 +6518,7 @@ d frequency"));
tabSpot->end();
} // Fl_Group* tabSpot
{ 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);

Wyświetl plik

@ -106,8 +106,8 @@ static const char szProsigns[] = "~|%|&|+|=|{|}|<|>|[|]| ";} {}
} {
Fl_Group tabOperator {
label Operator
callback {progdefaults.changed = true;}
tooltip {Operator information} xywh {0 25 500 345} when 1 hide
callback {progdefaults.changed = true;} selected
tooltip {Operator information} xywh {0 25 500 345} when 1
} {
Fl_Group {} {
label Station open
@ -189,7 +189,7 @@ progdefaults.changed = true;}
label UI open
xywh {0 25 502 346} hide
} {
Fl_Tabs tabsUI {open
Fl_Tabs tabsUI {
xywh {0 25 502 346} selection_color 50
} {
Fl_Group tabUserInterface {
@ -1218,7 +1218,7 @@ behaves inside the waterfall} xywh {15 196 150 22} down_box BORDER_BOX align 8
}
Fl_Group tabModems {
label Modems
xywh {-4 25 544 347} hide
xywh {-4 25 521 347} hide
} {
Fl_Tabs tabsModems {open
xywh {-4 25 544 347} selection_color 50 align 9
@ -2357,7 +2357,7 @@ progdefaults.changed = true;}
} {
Fl_Group {} {
label {Hardware PTT} open
xywh {0 50 500 320} hide
xywh {0 50 500 320}
} {
Fl_Group grpHWPTT {
label {h/w ptt device-pin} open
@ -2463,7 +2463,7 @@ progdefaults.changed = true;}
}
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}
@ -2936,7 +2936,7 @@ progdefaults.changed = true;}
}
}
Fl_Group tabSoundCard {
label Audio
label Audio open
tooltip {Audio devices} xywh {0 25 500 345} hide
} {
Fl_Tabs tabsSoundCard {open
@ -3184,20 +3184,19 @@ progdefaults.changed = true;}
}
}
Fl_Group tabTxLevel {
label {Tx Level} open
label TxLevel open
xywh {0 50 500 320} hide
} {
Fl_Group {} {
label {TX Level Control} open
xywh {5 64 490 82} box ENGRAVED_FRAME align 21
label {Tx Attenuator} open
xywh {5 60 490 86} box ENGRAVED_FRAME align 21
} {
Fl_Counter valTxLevel {
label {Tx Attenuator (dB)}
callback {progdefaults.txlevel = o->value();}
xywh {188 88 132 21} minimum -30 maximum 0 value -6
code0 {o->labelsize(FL_NORMAL_SIZE); o->textsize(FL_NORMAL_SIZE);}
code1 {o->value(progdefaults.txlevel);}
code2 {o->lstep(1.0);}
label {Tx Atten (dB)}
callback {progdefaults.txlevel=o->value();}
xywh {196 85 120 21} minimum -30 maximum 0 value -6
code0 {o->value(progdefaults.txlevel);}
code1 {o->lstep(1.0);}
}
}
}
@ -3392,15 +3391,15 @@ progdefaults.changed = true;}
}
}
Fl_Group tabMisc {
label Misc open
xywh {0 25 500 345}
label Misc
xywh {0 25 500 345} hide
} {
Fl_Tabs tabsMisc {open
xywh {0 25 500 345} selection_color 50
} {
Fl_Group tabCPUspeed {
label CPU open
xywh {0 50 500 320} hide
xywh {0 50 500 320}
} {
Fl_Group {} {open
xywh {5 60 490 51} box ENGRAVED_FRAME align 21
@ -3615,7 +3614,7 @@ progdefaults.changed = true;}
}
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
@ -3657,7 +3656,7 @@ OFF - keep current wf cursor position} xywh {15 101 348 20} down_box DOWN_BOX va
}
}
Fl_Group {} {
label {A1A offset configuration} open selected
label {A1A offset configuration} open
xywh {5 140 490 60} box ENGRAVED_FRAME align 21
} {
Fl_Check_Button btnCWIsLSB {

Wyświetl plik

@ -2339,6 +2339,7 @@ int default_handler(int event)
progdefaults.txlevel += 0.1;
if (progdefaults.txlevel > 0) progdefaults.txlevel = 0;
valTxLevel->value(progdefaults.txlevel);
return 1;
}
#ifdef __APPLE__
if ((key == '-') && (Fl::event_state() == FL_COMMAND)) {
@ -2348,6 +2349,7 @@ int default_handler(int event)
progdefaults.txlevel -= 0.1;
if (progdefaults.txlevel < -30) progdefaults.txlevel = -30;
valTxLevel->value(progdefaults.txlevel);
return 1;
}
}
else if (w == dlgLogbook || w->window() == dlgLogbook)

Wyświetl plik

@ -89,25 +89,26 @@ void olivia::tx_init(SoundBase *sc)
void olivia::send_tones()
{
if (tone_midfreq != txbasefreq || tone_bw != bandwidth) {
double freqa, freqb;
tone_bw = bandwidth;
tone_midfreq = txbasefreq;
if (reverse) {
freqa = tone_midfreq + (tone_bw / 2.0);
freqb = tone_midfreq - (tone_bw / 2.0);
} else {
freqa = tone_midfreq - (tone_bw / 2.0);
freqb = tone_midfreq + (tone_bw / 2.0);
}
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[2*SR4 + i] = tonebuff[i] = nco(freqa) * ampshape[i];
double freqa, freqb;
tone_bw = bandwidth;
tone_midfreq = txbasefreq;
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[3*SR4 + i] = tonebuff[SR4 + i] = nco(freqb) * ampshape[i];
if (reverse) {
freqa = tone_midfreq + (tone_bw / 2.0);
freqb = tone_midfreq - (tone_bw / 2.0);
} else {
freqa = tone_midfreq - (tone_bw / 2.0);
freqb = tone_midfreq + (tone_bw / 2.0);
}
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[2*SR4 + i] = tonebuff[i] = nco(freqa) * ampshape[i];
preamblephase = 0;
for (int i = 0; i < SR4; i++)
tonebuff[3*SR4 + i] = tonebuff[SR4 + i] = nco(freqb) * ampshape[i];
for (int j = 0; j < TONE_DURATION; j += SCBLOCKSIZE)
ModulateXmtr(&tonebuff[j], SCBLOCKSIZE);

Wyświetl plik

@ -380,6 +380,10 @@ void modem::ModulateXmtr(double *buffer, int len)
ModulateStereo( buffer, PTTchannel, len);
return;
}
if (progdefaults.viewXmtSignal)
trx_xmit_wfall_queue(samplerate, buffer, (size_t)len);
if (withnoise && progdefaults.noise) add_noise(buffer, len);
double mult = pow(10, progdefaults.txlevel / 20.0);
@ -396,14 +400,15 @@ void modem::ModulateXmtr(double *buffer, int len)
return;
}
if (progdefaults.viewXmtSignal)
trx_xmit_wfall_queue(samplerate, buffer, (size_t)len);
}
#include <iostream>
using namespace std;
void modem::ModulateStereo(double *left, double *right, int len)
{
if (progdefaults.viewXmtSignal)
trx_xmit_wfall_queue(samplerate, left, (size_t)len);
if (withnoise && progdefaults.noise) add_noise(left, len);
double mult = pow(10, progdefaults.txlevel / 20.0);
@ -420,8 +425,6 @@ void modem::ModulateStereo(double *left, double *right, int len)
return;
}
if (progdefaults.viewXmtSignal)
trx_xmit_wfall_queue(samplerate, left, (size_t)len);
}