diff --git a/lib/jt9sim.f90 b/lib/jt9sim.f90 index 99aabc815..ee78cadbe 100644 --- a/lib/jt9sim.f90 +++ b/lib/jt9sim.f90 @@ -50,7 +50,6 @@ program jt9sim rmsdb=25. rms=10.0**(0.05*rmsdb) - f0=1500.d0 !Center frequency (MHz) fsample=12000.d0 !Sample rate (Hz) dt=1.d0/fsample !Sample interval (s) twopi=8.d0*atan(1.d0) @@ -62,6 +61,11 @@ program jt9sim if(minutes.eq.10) nsps=82944 if(minutes.eq.30) nsps=252000 if(nsps.eq.0) stop 'Bad value for minutes.' + f0=1500.d0 !Center frequency (MHz) + if(minutes.eq.5) f0=1100. + if(minutes.eq.10) f0=1050. + if(minutes.eq.30) f0=1025. + ihdr=0 !Temporary ### if(msg0(1:3).eq.'sin') read(msg0(4:),*) sinfreq diff --git a/mainwindow.cpp b/mainwindow.cpp index df534c282..4724e2ff0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -235,6 +235,7 @@ void MainWindow::writeSettings() settings.setValue("KB8RQ",m_kb8rq); settings.setValue("NB",m_NB); settings.setValue("NBslider",m_NBslider); + settings.setValue("TxFreq",m_txFreq); settings.endGroup(); } @@ -280,6 +281,8 @@ void MainWindow::readSettings() ui->NBcheckBox->setChecked(m_NB); m_NBslider=settings.value("NBslider",40).toInt(); ui->NBslider->setValue(m_NBslider); + m_txFreq=settings.value("TxFreq",1500).toInt(); + ui->TxFreqSpinBox->setValue(m_txFreq); m_saveAll=ui->actionSave_all->isChecked(); m_ndepth=settings.value("NDepth",0).toInt(); ui->actionF4_sets_Tx6->setChecked(m_kb8rq); @@ -1384,3 +1387,10 @@ void MainWindow::on_NBslider_valueChanged(int n) { m_NBslider=n; } + +void MainWindow::on_TxFreqSpinBox_valueChanged(int n) +{ + m_txFreq=n; + soundOutThread.setTxFreq(n); +} + diff --git a/mainwindow.h b/mainwindow.h index 52c359f60..a02c787d7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -100,20 +100,14 @@ private slots: void on_actionErase_wsjtx_tx_log_triggered(); void on_actionAFMHot_triggered(); void on_actionBlue_triggered(); - void on_actionJT9_2_triggered(); - void on_actionJT9_1_triggered(); - void on_actionJT9_5_triggered(); - void on_actionJT9_30_triggered(); - void on_actionJT9_10_triggered(); - void on_NBcheckBox_toggled(bool checked); - void on_NBslider_valueChanged(int value); + void on_TxFreqSpinBox_valueChanged(int arg1); private: Ui::MainWindow *ui; diff --git a/mainwindow.ui b/mainwindow.ui index d7e9db54e..27ff17380 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 602 - 515 + 551 @@ -41,7 +41,7 @@ 10 10 565 - 444 + 467 @@ -543,6 +543,37 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + + 100 + 0 + + + + Hz + + + Tx + + + + 1000 + + + 2000 + + + 1500 + + + diff --git a/plotter.cpp b/plotter.cpp index 68fffcbc1..693997b57 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -84,7 +84,7 @@ void CPlotter::paintEvent(QPaintEvent *) // paintEvent() m_paintEventBusy=false; } -void CPlotter::draw(float swide[], int i0, float splot[]) //draw() +void CPlotter::draw(float swide[], int i0) //draw() { int j; float y; @@ -108,7 +108,9 @@ void CPlotter::draw(float swide[], int i0, float splot[]) //draw() bool strong0=false; bool strong=false; + int iz=XfromFreq(2000.0); for(int i=0; iiz) swide[i]=0; strong=false; if(swide[i]<0) { strong=true; @@ -142,7 +144,7 @@ void CPlotter::draw(float swide[], int i0, float splot[]) //draw() m_line++; if(m_line == 13) { UTCstr(); - painter1.setPen(Qt::red); + painter1.setPen(Qt::white); painter1.drawText(5,10,m_sutc); } update(); //trigger a new paintEvent diff --git a/plotter.h b/plotter.h index b8ef71b23..68d1fc5fc 100644 --- a/plotter.h +++ b/plotter.h @@ -36,7 +36,7 @@ public: qint32 m_tol; qint32 m_fCal; - void draw(float sw[], int i0, float splot[]); //Update the waterfalls + void draw(float sw[], int i0); //Update the waterfalls void SetRunningState(bool running); void setPlotZero(int plotZero); int getPlotZero(); diff --git a/soundout.cpp b/soundout.cpp index 1fdf70a3f..7d995c9ff 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -14,6 +14,7 @@ typedef struct //Parameters sent to or received from callback function { int nsps; int ntrperiod; + int ntxfreq; bool txOK; bool txMute; bool bRestart; @@ -43,12 +44,12 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, int mstr = ms % (1000*udata->ntrperiod ); if(mstr<1000) return 0; ic=(mstr-1000)*12; - qDebug() << "Start at:" << 0.001*mstr; +// qDebug() << "Start at:" << 0.001*mstr << udata->ntxfreq; udata->bRestart=false; } int isym=ic/udata->nsps; if(isym>=85) return 0; - freq=1500.0 + itone[isym]*baud; + freq=udata->ntxfreq + itone[isym]*baud; dphi=twopi*freq/12000.0; /* if(ic<10000) qDebug() << "a" << ic << udata->nsps << itone[0] @@ -98,6 +99,7 @@ void SoundOutThread::run() udata.nsps=m_nsps; udata.ntrperiod=m_TRperiod; + udata.ntxfreq=m_txFreq; udata.txOK=false; udata.txMute=m_txMute; udata.bRestart=true; @@ -127,6 +129,7 @@ void SoundOutThread::run() udata.nsps=m_nsps; udata.ntrperiod=m_TRperiod; + udata.ntxfreq=m_txFreq; udata.txOK=m_txOK; udata.txMute=m_txMute; msleep(100); @@ -146,3 +149,8 @@ void SoundOutThread::setPeriod(int ntrperiod, int nsps) m_TRperiod=ntrperiod; m_nsps=nsps; } + +void SoundOutThread::setTxFreq(int n) +{ + m_txFreq=n; +} diff --git a/soundout.h b/soundout.h index 546c23ad4..60f275f9c 100644 --- a/soundout.h +++ b/soundout.h @@ -26,6 +26,7 @@ public: public: void setOutputDevice(qint32 n); void setPeriod(int ntrperiod, int nsps); + void setTxFreq(int n); bool quitExecution; //If true, thread exits gracefully // Private members @@ -35,6 +36,7 @@ private: bool m_txMute; //Mute temporarily qint32 m_TRperiod; //T/R period (s) qint32 m_nsps; //Samples per symbol (at 12000 Hz) + qint32 m_txFreq; }; #endif diff --git a/widegraph.cpp b/widegraph.cpp index b8224961b..74c71529f 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -130,7 +130,7 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata, } } ntr0=ntr; - ui->widePlot->draw(swide,i0,splot); + ui->widePlot->draw(swide,i0); } }