Several tweaks toward letting someone else Tx to me...

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2651 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-05 19:14:45 +00:00
parent a4d96a79fa
commit 734e6e7163
9 changed files with 67 additions and 16 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>602</width>
<height>515</height>
<height>551</height>
</rect>
</property>
<property name="sizePolicy">
@ -41,7 +41,7 @@
<x>10</x>
<y>10</y>
<width>565</width>
<height>444</height>
<height>467</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@ -543,6 +543,37 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="TxFreqSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="suffix">
<string> Hz</string>
</property>
<property name="prefix">
<string>Tx +</string>
</property>
<property name="minimum">
<number>1000</number>
</property>
<property name="maximum">
<number>2000</number>
</property>
<property name="value">
<number>1500</number>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

View File

@ -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; i<m_w; i++) {
if(i>iz) 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

View File

@ -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();

View File

@ -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;
}

View File

@ -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

View File

@ -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);
}
}