Fixed issue with false decodes causing app crash
This commit is contained in:
parent
cd683f9bf7
commit
c9016d7378
@ -61,6 +61,11 @@ DecodedText::DecodedText (QString const& the_string, bool contest_mode, QString
|
||||
|
||||
bits_ = bits();
|
||||
|
||||
// don't even try to unpack -24dB frames...they are *very* likely to be false decodes...
|
||||
if(snr() <= -24){
|
||||
return;
|
||||
}
|
||||
|
||||
tryUnpack();
|
||||
}
|
||||
|
||||
|
18
jsc.cpp
18
jsc.cpp
@ -107,17 +107,23 @@ QString JSC::decompress(Codeword const& bitvec){
|
||||
|
||||
QList<quint64> bytes;
|
||||
QList<int> separators;
|
||||
auto iter = bitvec.begin();
|
||||
while(iter != bitvec.end()){
|
||||
quint64 byte = Varicode::bitsToInt(iter, 4);
|
||||
iter += 4;
|
||||
|
||||
int i = 0;
|
||||
int count = bitvec.count();
|
||||
while(i < count){
|
||||
auto b = bitvec.mid(i, 4);
|
||||
if(b.length() != 4){
|
||||
break;
|
||||
}
|
||||
quint64 byte = Varicode::bitsToInt(b);
|
||||
bytes.append(byte);
|
||||
i += 4;
|
||||
|
||||
if(byte < s){
|
||||
if(*iter){
|
||||
if(count - i > 0 && bitvec.at(i)){
|
||||
separators.append(bytes.length()-1);
|
||||
}
|
||||
iter += 1;
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1445,6 +1445,9 @@ void MainWindow::initializeDummyData(){
|
||||
return;
|
||||
}
|
||||
|
||||
// auto d = DecodedText("h+vWp6mRPprH", 6);
|
||||
// qDebug() << d.message() << buildMessageFrames(d.message());
|
||||
|
||||
// qDebug() << Varicode::isValidCallsign("@GROUP1", nullptr);
|
||||
// qDebug() << Varicode::packAlphaNumeric50("VE7/KN4CRD");
|
||||
// qDebug() << Varicode::unpackAlphaNumeric50(Varicode::packAlphaNumeric50("VE7/KN4CRD"));
|
||||
@ -3550,14 +3553,6 @@ void MainWindow::readFromStdout() //readFromStdout
|
||||
, tr ("Cannot open \"%1\" for append: %2")
|
||||
.arg (f.fileName ()).arg (f.errorString ()));
|
||||
}
|
||||
if (m_config.insert_blank () && m_blankLine && !m_config.bFox()) {
|
||||
QString band;
|
||||
if((DriftingDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*m_TRperiod/4) {
|
||||
band = ' ' + m_config.bands ()->find (m_freqNominal);
|
||||
}
|
||||
ui->decodedTextBrowser->insertLineSpacer (band.rightJustified (40, '-'));
|
||||
m_blankLine = false;
|
||||
}
|
||||
|
||||
DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"}), "FT8" == m_mode &&
|
||||
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
|
||||
|
Loading…
Reference in New Issue
Block a user