Write current messages to ALL.TXT

This commit is contained in:
Jordan Sherer 2018-07-26 16:30:19 -04:00
parent 571aa6446d
commit bf28918096
3 changed files with 38 additions and 16 deletions

View File

@ -60,19 +60,34 @@ DecodedText::DecodedText (QString const& the_string, bool contest_mode, QString
} }
} }
if(!is_standard_){ tryUnpack();
bool unpacked = false; }
if(!unpacked){ DecodedText::DecodedText (QString const& ft8callmessage){
unpacked = tryUnpackCompound(); message_ = ft8callmessage;
} is_standard_ = false;
if(!unpacked){ tryUnpack();
unpacked = tryUnpackDirected(); }
}
if(!unpacked){ bool DecodedText::tryUnpack(){
unpacked = tryUnpackData(); if(is_standard_){
} return false;
} }
bool unpacked = false;
if(!unpacked){
unpacked = tryUnpackCompound();
}
if(!unpacked){
unpacked = tryUnpackDirected();
}
if(!unpacked){
unpacked = tryUnpackData();
}
return unpacked;
} }
bool DecodedText::tryUnpackCompound(){ bool DecodedText::tryUnpackCompound(){

View File

@ -31,7 +31,9 @@ class DecodedText
{ {
public: public:
explicit DecodedText (QString const& message, bool, QString const& my_grid); explicit DecodedText (QString const& message, bool, QString const& my_grid);
explicit DecodedText (QString const& ft8callmessage);
bool tryUnpack();
bool tryUnpackCompound(); bool tryUnpackCompound();
bool tryUnpackDirected(); bool tryUnpackDirected();
bool tryUnpackData(); bool tryUnpackData();

View File

@ -3095,7 +3095,8 @@ void MainWindow::writeAllTxt(QString message)
<< m_mode << endl; << m_mode << endl;
m_RxLog=0; m_RxLog=0;
} }
out << message << endl; auto dt = DecodedText(message);
out << dt.message() << endl;
f.close(); f.close();
} else { } else {
MessageBox::warning_message (this, tr ("File Open Error") MessageBox::warning_message (this, tr ("File Open Error")
@ -3171,7 +3172,8 @@ void MainWindow::readFromStdout() //readFromStdout
m_RxLog=0; m_RxLog=0;
} }
int n=t.length(); int n=t.length();
out << t.mid(0,n-2) << endl; auto dt = DecodedText(t.mid(0, n-2));
out << dt.message() << endl;
f.close(); f.close();
} else { } else {
MessageBox::warning_message (this, tr ("File Open Error") MessageBox::warning_message (this, tr ("File Open Error")
@ -4139,7 +4141,8 @@ void MainWindow::guiUpdate()
if(m_config.bFox() and ui->tabWidget->currentIndex()==2) { if(m_config.bFox() and ui->tabWidget->currentIndex()==2) {
sprintf(s,"Tx: %d Slots",foxcom_.nslots); sprintf(s,"Tx: %d Slots",foxcom_.nslots);
} else { } else {
sprintf(s,"Tx: %s",msgsent); auto dt = DecodedText(msgsent);
sprintf(s,"Tx: %s", dt.message().toLocal8Bit().mid(0, 41).data());
} }
m_nsendingsh=0; m_nsendingsh=0;
if(s[4]==64) m_nsendingsh=1; if(s[4]==64) m_nsendingsh=1;
@ -4326,7 +4329,8 @@ void MainWindow::stopTx2()
WSPR_scheduling (); WSPR_scheduling ();
m_ntr=0; m_ntr=0;
} }
last_tx_label.setText("Last Tx: " + m_currentMessage.trimmed()); auto dt = DecodedText(m_currentMessage.trimmed());
last_tx_label.setText("Last Tx: " + dt.message()); //m_currentMessage.trimmed());
//### if(m_mode=="FT8" and m_config.bHound()) auto_tx_mode(false); ### //### if(m_mode=="FT8" and m_config.bHound()) auto_tx_mode(false); ###
} }
@ -9376,10 +9380,11 @@ void MainWindow::write_transmit_entry (QString const& file_name)
QTextStream out(&f); QTextStream out(&f);
auto time = QDateTime::currentDateTimeUtc (); auto time = QDateTime::currentDateTimeUtc ();
time = time.addSecs (-(time.time ().second () % m_TRperiod)); time = time.addSecs (-(time.time ().second () % m_TRperiod));
auto dt = DecodedText(m_currentMessage);
out << time.toString("yyMMdd_hhmmss") out << time.toString("yyMMdd_hhmmss")
<< " Transmitting " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) << " Transmitting " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6)
<< " MHz " << m_modeTx << " MHz " << m_modeTx
<< ": " << m_currentMessage << endl; << ": " << dt.message() << endl;
f.close(); f.close();
} }
else else