Revert "Implement mock real-time input for MAP65: read data from a .tf2 file, with"

This reverts commit 60b0c5b984.
This commit is contained in:
Joe Taylor 2021-07-16 09:22:35 -04:00
parent 924876e92c
commit 139478b865
3 changed files with 3 additions and 69 deletions

View File

@ -62,7 +62,6 @@ set (libm65_FSRCS
packjt.f90 packjt.f90
pfxdump.f90 pfxdump.f90
polfit.f90 polfit.f90
read_tf2.f90
recvpkt.f90 recvpkt.f90
rfile3a.f90 rfile3a.f90
s3avg.f90 s3avg.f90

View File

@ -164,16 +164,10 @@ void SoundInThread::run() //SoundInThread::run()
{ {
quitExecution = false; quitExecution = false;
QFile f("mockRTfiles.txt");
m_mockRT=f.exists();
if(m_mockRT) {
inputMockRT(); //"Mock realtime" input from a .tf2 file
return;
}
if (m_net) { if (m_net) {
inputUDP(); //Network input from Linrad (or equivalent) // qDebug() << "Start inputUDP()";
inputUDP();
// qDebug() << "Finished inputUDP()";
return; return;
} }
@ -455,59 +449,3 @@ void SoundInThread::inputUDP()
} }
delete udpSocket; delete udpSocket;
} }
//--------------------------------------------------------------- inputMockRT()
void SoundInThread::inputMockRT()
{
bool qe = quitExecution;
int ntr0=99;
int k=0;
int nsec;
int ntr;
int nhsym0=0;
int iz=174;
int nBusy=0;
int mstr=0;
int mswait=0;
// Main loop for mock realtime input of data from .tf2 files
while (!qe) {
qe = quitExecution;
if (qe) break;
qint64 ms = QDateTime::currentMSecsSinceEpoch(); // Time according to this computer
mstr = ms % (1000*m_TRperiod);
nsec = (ms % 86400000l) / 1000;
ntr = nsec % m_TRperiod;
// Reset buffer pointer and symbol number at start of minute
if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) {
k=0;
nhsym0=0;
m_TRperiod0=m_TRperiod;
}
ntr0=ntr;
if(m_monitoring) {
// If buffer will not overflow, move data into datcom_
if ((k+iz) <= 60*96000) {
if(k>mstr*96) {
mswait=(k-mstr*96)/96;
msleep(mswait);
}
read_tf2_(&k);
}
m_hsym=(k-2048)*11025.0/(2048.0*m_rate);
if(m_hsym != nhsym0) {
if(m_dataSinkBusy) {
nBusy++;
} else {
m_dataSinkBusy=true;
emit readyForFFT(k); //Signal to compute new FFTs
}
nhsym0=m_hsym;
}
}
}
}

View File

@ -56,7 +56,6 @@ public slots:
private: private:
void inputUDP(); void inputUDP();
void inputMockRT();
double m_fAdd; double m_fAdd;
bool m_net; bool m_net;
@ -64,7 +63,6 @@ private:
bool m_bForceCenterFreq; bool m_bForceCenterFreq;
bool m_IQswap; bool m_IQswap;
bool m_10db; bool m_10db;
bool m_mockRT;
double m_dForceCenterFreq; double m_dForceCenterFreq;
qint32 m_nrx; qint32 m_nrx;
qint32 m_hsym; qint32 m_hsym;
@ -79,7 +77,6 @@ private:
extern "C" { extern "C" {
void recvpkt_(int* nsam, quint16* iblk, qint8* nrx, int* k, double s1[], void recvpkt_(int* nsam, quint16* iblk, qint8* nrx, int* k, double s1[],
double s2[], double s3[]); double s2[], double s3[]);
void read_tf2_(int* k);
} }
#endif // SOUNDIN_H #endif // SOUNDIN_H