mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
Pass mode name to the Modulator.
This commit is contained in:
parent
42a0e9df32
commit
ae6ca148bd
@ -45,7 +45,7 @@ Modulator::Modulator (unsigned frameRate, double periodLengthInSeconds,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Modulator::start (unsigned symbolsLength, double framesPerSymbol,
|
void Modulator::start (QString mode, unsigned symbolsLength, double framesPerSymbol,
|
||||||
double frequency, double toneSpacing,
|
double frequency, double toneSpacing,
|
||||||
SoundOutput * stream, Channel channel,
|
SoundOutput * stream, Channel channel,
|
||||||
bool synchronize, bool fastMode, double dBSNR, double TRperiod)
|
bool synchronize, bool fastMode, double dBSNR, double TRperiod)
|
||||||
@ -69,8 +69,8 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol,
|
|||||||
m_bFastMode=fastMode;
|
m_bFastMode=fastMode;
|
||||||
m_TRperiod=TRperiod;
|
m_TRperiod=TRperiod;
|
||||||
unsigned delay_ms=1000;
|
unsigned delay_ms=1000;
|
||||||
if(m_nsps==1920) delay_ms=500; //FT8
|
if(mode=="FT8" or (mode=="FST240" and m_nsps==800)) delay_ms=500; //FT8, FST240-15
|
||||||
if(m_nsps==576) delay_ms=300; //FT4
|
if(mode=="FT4") delay_ms=300; //FT4
|
||||||
|
|
||||||
// noise generator parameters
|
// noise generator parameters
|
||||||
if (m_addNoise) {
|
if (m_addNoise) {
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
void set_nsym(int n) {m_symbolsLength=n;}
|
void set_nsym(int n) {m_symbolsLength=n;}
|
||||||
void set_ms0(qint64 ms) {m_ms0=ms;}
|
void set_ms0(qint64 ms) {m_ms0=ms;}
|
||||||
|
|
||||||
Q_SLOT void start (unsigned symbolsLength, double framesPerSymbol, double frequency,
|
Q_SLOT void start (QString mode, unsigned symbolsLength, double framesPerSymbol, double frequency,
|
||||||
double toneSpacing, SoundOutput *, Channel = Mono,
|
double toneSpacing, SoundOutput *, Channel = Mono,
|
||||||
bool synchronize = true, bool fastMode = false,
|
bool synchronize = true, bool fastMode = false,
|
||||||
double dBSNR = 99., double TRperiod=60.0);
|
double dBSNR = 99., double TRperiod=60.0);
|
||||||
|
@ -7133,7 +7133,7 @@ void MainWindow::transmit (double snr)
|
|||||||
if(m_nSubMode==0) toneSpacing=11025.0/4096.0;
|
if(m_nSubMode==0) toneSpacing=11025.0/4096.0;
|
||||||
if(m_nSubMode==1) toneSpacing=2*11025.0/4096.0;
|
if(m_nSubMode==1) toneSpacing=2*11025.0/4096.0;
|
||||||
if(m_nSubMode==2) toneSpacing=4*11025.0/4096.0;
|
if(m_nSubMode==2) toneSpacing=4*11025.0/4096.0;
|
||||||
Q_EMIT sendMessage (NUM_JT65_SYMBOLS,
|
Q_EMIT sendMessage (m_mode, NUM_JT65_SYMBOLS,
|
||||||
4096.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
|
4096.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
@ -7145,7 +7145,7 @@ void MainWindow::transmit (double snr)
|
|||||||
if(m_config.x2ToneSpacing()) toneSpacing=2*12000.0/1920.0;
|
if(m_config.x2ToneSpacing()) toneSpacing=2*12000.0/1920.0;
|
||||||
if(m_config.x4ToneSpacing()) toneSpacing=4*12000.0/1920.0;
|
if(m_config.x4ToneSpacing()) toneSpacing=4*12000.0/1920.0;
|
||||||
if(SpecOp::FOX==m_config.special_op_id() and !m_tune) toneSpacing=-1;
|
if(SpecOp::FOX==m_config.special_op_id() and !m_tune) toneSpacing=-1;
|
||||||
Q_EMIT sendMessage (NUM_FT8_SYMBOLS,
|
Q_EMIT sendMessage (m_mode, NUM_FT8_SYMBOLS,
|
||||||
1920.0, ui->TxFreqSpinBox->value () - m_XIT,
|
1920.0, ui->TxFreqSpinBox->value () - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
@ -7154,7 +7154,7 @@ void MainWindow::transmit (double snr)
|
|||||||
if (m_modeTx == "FT4") {
|
if (m_modeTx == "FT4") {
|
||||||
m_dateTimeSentTx3=QDateTime::currentDateTimeUtc();
|
m_dateTimeSentTx3=QDateTime::currentDateTimeUtc();
|
||||||
toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform.
|
toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform.
|
||||||
Q_EMIT sendMessage (NUM_FT4_SYMBOLS,
|
Q_EMIT sendMessage (m_mode, NUM_FT4_SYMBOLS,
|
||||||
576.0, ui->TxFreqSpinBox->value() - m_XIT,
|
576.0, ui->TxFreqSpinBox->value() - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel(),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel(),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
@ -7171,7 +7171,7 @@ void MainWindow::transmit (double snr)
|
|||||||
int hmod=int(pow(2.0,double(m_nSubMode)));
|
int hmod=int(pow(2.0,double(m_nSubMode)));
|
||||||
double dfreq=hmod*12000.0/nsps;
|
double dfreq=hmod*12000.0/nsps;
|
||||||
double f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;
|
double f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;
|
||||||
Q_EMIT sendMessage (NUM_FST240_SYMBOLS,double(nsps),f0,toneSpacing,
|
Q_EMIT sendMessage (m_mode, NUM_FST240_SYMBOLS,double(nsps),f0,toneSpacing,
|
||||||
m_soundOutput,m_config.audio_output_channel(),
|
m_soundOutput,m_config.audio_output_channel(),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
}
|
}
|
||||||
@ -7182,7 +7182,7 @@ void MainWindow::transmit (double snr)
|
|||||||
if(m_nSubMode==2) toneSpacing=4*12000.0/6912.0;
|
if(m_nSubMode==2) toneSpacing=4*12000.0/6912.0;
|
||||||
if(m_nSubMode==3) toneSpacing=8*12000.0/6912.0;
|
if(m_nSubMode==3) toneSpacing=8*12000.0/6912.0;
|
||||||
if(m_nSubMode==4) toneSpacing=16*12000.0/6912.0;
|
if(m_nSubMode==4) toneSpacing=16*12000.0/6912.0;
|
||||||
Q_EMIT sendMessage (NUM_QRA64_SYMBOLS,
|
Q_EMIT sendMessage (m_mode, NUM_QRA64_SYMBOLS,
|
||||||
6912.0, ui->TxFreqSpinBox->value () - m_XIT,
|
6912.0, ui->TxFreqSpinBox->value () - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
@ -7201,7 +7201,7 @@ void MainWindow::transmit (double snr)
|
|||||||
sps=nsps[m_nSubMode-4];
|
sps=nsps[m_nSubMode-4];
|
||||||
m_toneSpacing=12000.0/sps;
|
m_toneSpacing=12000.0/sps;
|
||||||
}
|
}
|
||||||
Q_EMIT sendMessage (NUM_JT9_SYMBOLS, sps,
|
Q_EMIT sendMessage (m_mode, NUM_JT9_SYMBOLS, sps,
|
||||||
ui->TxFreqSpinBox->value() - m_XIT, m_toneSpacing,
|
ui->TxFreqSpinBox->value() - m_XIT, m_toneSpacing,
|
||||||
m_soundOutput, m_config.audio_output_channel (),
|
m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, fastmode, snr, m_TRperiod);
|
true, fastmode, snr, m_TRperiod);
|
||||||
@ -7220,7 +7220,7 @@ void MainWindow::transmit (double snr)
|
|||||||
int nsym;
|
int nsym;
|
||||||
nsym=NUM_MSK144_SYMBOLS;
|
nsym=NUM_MSK144_SYMBOLS;
|
||||||
if(itone[40] < 0) nsym=40;
|
if(itone[40] < 0) nsym=40;
|
||||||
Q_EMIT sendMessage (nsym, double(m_nsps), f0, m_toneSpacing,
|
Q_EMIT sendMessage (m_mode, nsym, double(m_nsps), f0, m_toneSpacing,
|
||||||
m_soundOutput, m_config.audio_output_channel (),
|
m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, true, snr, m_TRperiod);
|
true, true, snr, m_TRperiod);
|
||||||
}
|
}
|
||||||
@ -7233,7 +7233,7 @@ void MainWindow::transmit (double snr)
|
|||||||
if(m_nSubMode==4) toneSpacing=18*4.375;
|
if(m_nSubMode==4) toneSpacing=18*4.375;
|
||||||
if(m_nSubMode==5) toneSpacing=36*4.375;
|
if(m_nSubMode==5) toneSpacing=36*4.375;
|
||||||
if(m_nSubMode==6) toneSpacing=72*4.375;
|
if(m_nSubMode==6) toneSpacing=72*4.375;
|
||||||
Q_EMIT sendMessage (NUM_JT4_SYMBOLS,
|
Q_EMIT sendMessage (m_mode, NUM_JT4_SYMBOLS,
|
||||||
2520.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
|
2520.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT,
|
||||||
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
toneSpacing, m_soundOutput, m_config.audio_output_channel (),
|
||||||
true, false, snr, m_TRperiod);
|
true, false, snr, m_TRperiod);
|
||||||
@ -7242,22 +7242,16 @@ void MainWindow::transmit (double snr)
|
|||||||
int nToneSpacing=1;
|
int nToneSpacing=1;
|
||||||
if(m_config.x2ToneSpacing()) nToneSpacing=2;
|
if(m_config.x2ToneSpacing()) nToneSpacing=2;
|
||||||
if(m_config.x4ToneSpacing()) nToneSpacing=4;
|
if(m_config.x4ToneSpacing()) nToneSpacing=4;
|
||||||
Q_EMIT sendMessage (NUM_WSPR_SYMBOLS, 8192.0,
|
Q_EMIT sendMessage (m_mode, NUM_WSPR_SYMBOLS, 8192.0,
|
||||||
ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192,
|
ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192,
|
||||||
m_toneSpacing*nToneSpacing, m_soundOutput,
|
m_toneSpacing*nToneSpacing, m_soundOutput,
|
||||||
m_config.audio_output_channel(),true, false, snr,
|
m_config.audio_output_channel(),true, false, snr,
|
||||||
m_TRperiod);
|
m_TRperiod);
|
||||||
}
|
}
|
||||||
if (m_mode=="WSPR-LF") {
|
|
||||||
Q_EMIT sendMessage (NUM_WSPR_LF_SYMBOLS, 24576.0,
|
|
||||||
ui->TxFreqSpinBox->value(),
|
|
||||||
m_toneSpacing, m_soundOutput,
|
|
||||||
m_config.audio_output_channel(),true, false, snr,
|
|
||||||
m_TRperiod);
|
|
||||||
}
|
|
||||||
if(m_mode=="Echo") {
|
if(m_mode=="Echo") {
|
||||||
//??? should use "fastMode = true" here ???
|
//??? should use "fastMode = true" here ???
|
||||||
Q_EMIT sendMessage (27, 1024.0, 1500.0, 0.0, m_soundOutput,
|
Q_EMIT sendMessage (m_mode, 27, 1024.0, 1500.0, 0.0, m_soundOutput,
|
||||||
m_config.audio_output_channel(),
|
m_config.audio_output_channel(),
|
||||||
false, false, snr, m_TRperiod);
|
false, false, snr, m_TRperiod);
|
||||||
}
|
}
|
||||||
@ -7273,7 +7267,7 @@ void MainWindow::transmit (double snr)
|
|||||||
toneSpacing=11025.0/256.0;
|
toneSpacing=11025.0/256.0;
|
||||||
f0=13*toneSpacing;
|
f0=13*toneSpacing;
|
||||||
}
|
}
|
||||||
Q_EMIT sendMessage (NUM_ISCAT_SYMBOLS, sps, f0, toneSpacing, m_soundOutput,
|
Q_EMIT sendMessage (m_mode, NUM_ISCAT_SYMBOLS, sps, f0, toneSpacing, m_soundOutput,
|
||||||
m_config.audio_output_channel(),
|
m_config.audio_output_channel(),
|
||||||
true, true, snr, m_TRperiod);
|
true, true, snr, m_TRperiod);
|
||||||
}
|
}
|
||||||
|
@ -337,8 +337,8 @@ private:
|
|||||||
Q_SIGNAL void transmitFrequency (double) const;
|
Q_SIGNAL void transmitFrequency (double) const;
|
||||||
Q_SIGNAL void endTransmitMessage (bool quick = false) const;
|
Q_SIGNAL void endTransmitMessage (bool quick = false) const;
|
||||||
Q_SIGNAL void tune (bool = true) const;
|
Q_SIGNAL void tune (bool = true) const;
|
||||||
Q_SIGNAL void sendMessage (unsigned symbolsLength, double framesPerSymbol,
|
Q_SIGNAL void sendMessage (QString mode, unsigned symbolsLength,
|
||||||
double frequency, double toneSpacing,
|
double framesPerSymbol, double frequency, double toneSpacing,
|
||||||
SoundOutput *, AudioDevice::Channel = AudioDevice::Mono,
|
SoundOutput *, AudioDevice::Channel = AudioDevice::Mono,
|
||||||
bool synchronize = true, bool fastMode = false, double dBSNR = 99.,
|
bool synchronize = true, bool fastMode = false, double dBSNR = 99.,
|
||||||
int TRperiod=60) const;
|
int TRperiod=60) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user