mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-09-04 14:17:52 -04:00
Progress toward full implementation of real-time decoding of MSK144.
I believe file saving and auto-sequencing nor work. Not sure about posting to PSK reporter: please check. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7112 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
766c978709
commit
6579b93690
@ -807,6 +807,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
|
|
||||||
m_UTCdisk=-1;
|
m_UTCdisk=-1;
|
||||||
m_ntx = 1;
|
m_ntx = 1;
|
||||||
|
m_bFastDone=false;
|
||||||
ui->txrb1->setChecked(true);
|
ui->txrb1->setChecked(true);
|
||||||
|
|
||||||
if(m_mode.startsWith ("WSPR") and m_pctx>0) {
|
if(m_mode.startsWith ("WSPR") and m_pctx>0) {
|
||||||
@ -1273,7 +1274,8 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
bool bmsk144=((m_mode=="MSK144") and (m_monitoring or m_diskData));
|
bool bmsk144=((m_mode=="MSK144") and (m_monitoring or m_diskData));
|
||||||
bmsk144=bmsk144 && m_config.realTimeDecode();
|
bmsk144=bmsk144 && m_config.realTimeDecode();
|
||||||
line[0]=0;
|
line[0]=0;
|
||||||
//### Is this OK?
|
|
||||||
|
//###
|
||||||
m_RxFreq=ui->RxFreqSpinBox->value ();
|
m_RxFreq=ui->RxFreqSpinBox->value ();
|
||||||
hspec_(dec_data.d2,&k,&nutc0,&m_TRperiod,&m_RxFreq,&m_Ftol,&bmsk144,&m_inGain,fast_green,
|
hspec_(dec_data.d2,&k,&nutc0,&m_TRperiod,&m_RxFreq,&m_Ftol,&bmsk144,&m_inGain,fast_green,
|
||||||
fast_s,&fast_jh, &line[0],80);
|
fast_s,&fast_jh, &line[0],80);
|
||||||
@ -1283,9 +1285,9 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
ui->signal_meter_widget->setValue(px); // Update thermometer
|
ui->signal_meter_widget->setValue(px); // Update thermometer
|
||||||
m_fastGraph->plotSpec(m_diskData,m_UTCdisk);
|
m_fastGraph->plotSpec(m_diskData,m_UTCdisk);
|
||||||
|
|
||||||
//###
|
QString message;
|
||||||
if(bmsk144 and (line[0]!=0)) {
|
if(bmsk144 and (line[0]!=0)) {
|
||||||
QString message=QString::fromLatin1(line);
|
message=QString::fromLatin1(line);
|
||||||
DecodedText decodedtext;
|
DecodedText decodedtext;
|
||||||
decodedtext=message.replace("\n","");
|
decodedtext=message.replace("\n","");
|
||||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
@ -1293,9 +1295,24 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
m_config.color_NewCall());
|
m_config.color_NewCall());
|
||||||
m_bDecoded=true;
|
m_bDecoded=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int i1=message.indexOf(m_baseCall);
|
||||||
|
int i2=message.indexOf(m_hisCall);
|
||||||
|
if(i1>10 and i2>i1+3) {
|
||||||
|
if((message.indexOf(" 73") < 0) or (m_ntx!=6)) {
|
||||||
|
processMessage(message,43,false);
|
||||||
|
}
|
||||||
|
writeAllTxt(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
float fracTR=float(k)/(12000.0*m_TRperiod);
|
||||||
|
decodeNow=false;
|
||||||
|
if(fracTR>0.98) {
|
||||||
|
m_bFastDone=true;
|
||||||
|
fast_decode_done();
|
||||||
|
}
|
||||||
//###
|
//###
|
||||||
|
|
||||||
decodeNow=false;
|
|
||||||
m_k0=k;
|
m_k0=k;
|
||||||
if(m_diskData and m_k0 >= dec_data.params.kin - 7 * 512) decodeNow=true;
|
if(m_diskData and m_k0 >= dec_data.params.kin - 7 * 512) decodeNow=true;
|
||||||
if(!m_diskData and m_tRemaining<0.35 and !m_bFastDecodeCalled) decodeNow=true;
|
if(!m_diskData and m_tRemaining<0.35 and !m_bFastDecodeCalled) decodeNow=true;
|
||||||
@ -1311,6 +1328,8 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
m_bFastDecodeCalled=true;
|
m_bFastDecodeCalled=true;
|
||||||
decode();
|
decode();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(decodeNow or m_bFastDone) {
|
||||||
if(!m_diskData) { // Always save; may delete later
|
if(!m_diskData) { // Always save; may delete later
|
||||||
QDateTime now {QDateTime::currentDateTimeUtc()};
|
QDateTime now {QDateTime::currentDateTimeUtc()};
|
||||||
int n=now.time().second() % m_TRperiod;
|
int n=now.time().second() % m_TRperiod;
|
||||||
@ -2282,7 +2301,9 @@ void::MainWindow::fast_decode_done()
|
|||||||
int i2=msg0.indexOf(m_hisCall);
|
int i2=msg0.indexOf(m_hisCall);
|
||||||
if((m_mode=="MSK144" or m_bFast9) and m_bAutoSeq and tmax>=0.0 and
|
if((m_mode=="MSK144" or m_bFast9) and m_bAutoSeq and tmax>=0.0 and
|
||||||
i1>10 and i2>i1+3) {
|
i1>10 and i2>i1+3) {
|
||||||
if((msg0.indexOf(" 73") < 0) or (m_ntx!=6)) processMessage(msg0,43,false);
|
if((msg0.indexOf(" 73") < 0) or (m_ntx!=6)) {
|
||||||
|
processMessage(msg0,43,false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(m_msg[i][0]==0) break;
|
if(m_msg[i][0]==0) break;
|
||||||
QString message=QString::fromLatin1(m_msg[i]);
|
QString message=QString::fromLatin1(m_msg[i]);
|
||||||
@ -2292,9 +2313,11 @@ void::MainWindow::fast_decode_done()
|
|||||||
//Left (Band activity) window
|
//Left (Band activity) window
|
||||||
DecodedText decodedtext;
|
DecodedText decodedtext;
|
||||||
decodedtext=message.replace("\n","");
|
decodedtext=message.replace("\n","");
|
||||||
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
if(!m_bFastDone) {
|
||||||
|
ui->decodedTextBrowser->displayDecodedText (decodedtext,m_baseCall,m_config.DXCC(),
|
||||||
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
m_logBook,m_config.color_CQ(),m_config.color_MyCall(),m_config.color_DXCC(),
|
||||||
m_config.color_NewCall());
|
m_config.color_NewCall());
|
||||||
|
}
|
||||||
|
|
||||||
t=message.mid(10,5).toFloat();
|
t=message.mid(10,5).toFloat();
|
||||||
if(t>tmax) {
|
if(t>tmax) {
|
||||||
@ -2302,25 +2325,7 @@ void::MainWindow::fast_decode_done()
|
|||||||
tmax=t;
|
tmax=t;
|
||||||
m_bDecoded=true;
|
m_bDecoded=true;
|
||||||
}
|
}
|
||||||
|
writeAllTxt(message);
|
||||||
// Write decoded text to file "ALL.TXT".
|
|
||||||
QFile f {m_dataDir.absoluteFilePath ("ALL.TXT")};
|
|
||||||
if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
|
|
||||||
QTextStream out(&f);
|
|
||||||
if(m_RxLog==1) {
|
|
||||||
out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm")
|
|
||||||
<< " " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) << " MHz "
|
|
||||||
<< m_mode << endl;
|
|
||||||
m_RxLog=0;
|
|
||||||
}
|
|
||||||
int n=message.length();
|
|
||||||
out << message.mid(0,n-2) << endl;
|
|
||||||
f.close();
|
|
||||||
} else {
|
|
||||||
MessageBox::warning_message (this, tr ("File Open Error")
|
|
||||||
, tr ("Cannot open \"%1\" for append: %2")
|
|
||||||
.arg (f.fileName ()).arg (f.errorString ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(m_mode=="JT9" or m_mode=="MSK144") {
|
if(m_mode=="JT9" or m_mode=="MSK144") {
|
||||||
// find and extract any report for myCall
|
// find and extract any report for myCall
|
||||||
@ -2331,7 +2336,7 @@ void::MainWindow::fast_decode_done()
|
|||||||
|
|
||||||
// extract details and send to PSKreporter
|
// extract details and send to PSKreporter
|
||||||
if(m_config.spot_to_psk_reporter() and stdMsg and !m_diskData) {
|
if(m_config.spot_to_psk_reporter() and stdMsg and !m_diskData) {
|
||||||
QString msgmode="JT9";
|
QString msgmode=m_mode;
|
||||||
QString deCall;
|
QString deCall;
|
||||||
QString grid;
|
QString grid;
|
||||||
decodedtext.deCallAndGrid(/*out*/deCall,grid);
|
decodedtext.deCallAndGrid(/*out*/deCall,grid);
|
||||||
@ -2353,6 +2358,29 @@ void::MainWindow::fast_decode_done()
|
|||||||
m_startAnother=m_loopall;
|
m_startAnother=m_loopall;
|
||||||
m_nPick=0;
|
m_nPick=0;
|
||||||
ui->DecodeButton->setChecked (false);
|
ui->DecodeButton->setChecked (false);
|
||||||
|
m_bFastDone=false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::writeAllTxt(QString message)
|
||||||
|
{
|
||||||
|
// Write decoded text to file "ALL.TXT".
|
||||||
|
QFile f {m_dataDir.absoluteFilePath ("ALL.TXT")};
|
||||||
|
if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
|
||||||
|
QTextStream out(&f);
|
||||||
|
if(m_RxLog==1) {
|
||||||
|
out << QDateTime::currentDateTimeUtc().toString("yyyy-MMM-dd hh:mm")
|
||||||
|
<< " " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) << " MHz "
|
||||||
|
<< m_mode << endl;
|
||||||
|
m_RxLog=0;
|
||||||
|
}
|
||||||
|
int n=message.length();
|
||||||
|
out << message.mid(0,n-2) << endl;
|
||||||
|
f.close();
|
||||||
|
} else {
|
||||||
|
MessageBox::warning_message (this, tr ("File Open Error")
|
||||||
|
, tr ("Cannot open \"%1\" for append: %2")
|
||||||
|
.arg (f.fileName ()).arg (f.errorString ()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::decodeDone ()
|
void MainWindow::decodeDone ()
|
||||||
@ -2966,7 +2994,6 @@ void MainWindow::guiUpdate()
|
|||||||
|
|
||||||
//Once per second:
|
//Once per second:
|
||||||
if(nsec != m_sec0) {
|
if(nsec != m_sec0) {
|
||||||
// qDebug() << m_config.contestMode() << m_config.realTimeDecode();
|
|
||||||
g_single_decode=m_config.single_decode();
|
g_single_decode=m_config.single_decode();
|
||||||
if(m_auto and m_mode=="Echo" and m_bEchoTxOK) {
|
if(m_auto and m_mode=="Echo" and m_bEchoTxOK) {
|
||||||
progressBar.setMaximum(6);
|
progressBar.setMaximum(6);
|
||||||
|
@ -278,6 +278,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void astroUpdate ();
|
void astroUpdate ();
|
||||||
|
void writeAllTxt(QString message);
|
||||||
|
|
||||||
bool m_valid;
|
bool m_valid;
|
||||||
QSplashScreen * m_splash;
|
QSplashScreen * m_splash;
|
||||||
@ -416,6 +417,7 @@ private:
|
|||||||
bool m_bDoubleClickAfterCQnnn;
|
bool m_bDoubleClickAfterCQnnn;
|
||||||
bool m_bRefSpec;
|
bool m_bRefSpec;
|
||||||
bool m_bUseRef;
|
bool m_bUseRef;
|
||||||
|
bool m_bFastDone;
|
||||||
float m_pctZap;
|
float m_pctZap;
|
||||||
int m_ihsym;
|
int m_ihsym;
|
||||||
int m_nzap;
|
int m_nzap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user