mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-26 06:08:42 -05:00
Re-enable "Save decoded". In fast modes, we no longer save all files and
delete some later. Rather, we save only those with real-time decodes (or we save all). git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7188 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
1740b73def
commit
bf068fc6fd
@ -1148,18 +1148,9 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
m_fileToSave.clear ();
|
m_fileToSave.clear ();
|
||||||
// the following is potential a threading hazard - not a good
|
// the following is potential a threading hazard - not a good
|
||||||
// idea to pass pointer to be processed in another thread
|
// idea to pass pointer to be processed in another thread
|
||||||
m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file
|
m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file,
|
||||||
, this
|
this, m_fnameWE, &dec_data.d2[0], m_TRperiod, m_config.my_callsign(),
|
||||||
, m_fnameWE
|
m_config.my_grid(), m_mode, m_nSubMode, m_freqNominal, m_hisCall, m_hisGrid)));
|
||||||
, &dec_data.d2[0]
|
|
||||||
, m_TRperiod
|
|
||||||
, m_config.my_callsign ()
|
|
||||||
, m_config.my_grid ()
|
|
||||||
, m_mode
|
|
||||||
, m_nSubMode
|
|
||||||
, m_freqNominal
|
|
||||||
, m_hisCall
|
|
||||||
, m_hisGrid)));
|
|
||||||
if (m_mode.startsWith ("WSPR")) {
|
if (m_mode.startsWith ("WSPR")) {
|
||||||
QString c2name_string {m_fnameWE + ".c2"};
|
QString c2name_string {m_fnameWE + ".c2"};
|
||||||
int len1=c2name_string.length();
|
int len1=c2name_string.length();
|
||||||
@ -1199,16 +1190,9 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MainWindow::save_wave_file (QString const& name
|
QString MainWindow::save_wave_file (QString const& name, short const * data, int seconds,
|
||||||
, short const * data
|
QString const& my_callsign, QString const& my_grid, QString const& mode, qint32 sub_mode,
|
||||||
, int seconds
|
Frequency frequency, QString const& his_call, QString const& his_grid) const
|
||||||
, QString const& my_callsign
|
|
||||||
, QString const& my_grid
|
|
||||||
, QString const& mode
|
|
||||||
, qint32 sub_mode
|
|
||||||
, Frequency frequency
|
|
||||||
, QString const& his_call
|
|
||||||
, QString const& his_grid) const
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// This member function runs in a thread and should not access
|
// This member function runs in a thread and should not access
|
||||||
@ -1260,6 +1244,7 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
fast_jh2=fast_jh;
|
fast_jh2=fast_jh;
|
||||||
if(!m_diskData) memset(dec_data.d2,0,2*30*12000); //Zero the d2[] array
|
if(!m_diskData) memset(dec_data.d2,0,2*30*12000); //Zero the d2[] array
|
||||||
m_bFastDecodeCalled=false;
|
m_bFastDecodeCalled=false;
|
||||||
|
m_bDecoded=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDateTime tnow=QDateTime::currentDateTimeUtc();
|
QDateTime tnow=QDateTime::currentDateTimeUtc();
|
||||||
@ -1339,28 +1324,23 @@ void MainWindow::fastSink(qint64 frames)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(decodeNow or m_bFastDone) {
|
if(decodeNow or m_bFastDone) {
|
||||||
if(!m_diskData) { // Always save; may delete later
|
if(!m_diskData) {
|
||||||
QDateTime now {QDateTime::currentDateTimeUtc()};
|
QDateTime now {QDateTime::currentDateTimeUtc()};
|
||||||
int n=now.time().second() % m_TRperiod;
|
int n=now.time().second() % m_TRperiod;
|
||||||
if(n<(m_TRperiod/2)) n=n+m_TRperiod;
|
if(n<(m_TRperiod/2)) n=n+m_TRperiod;
|
||||||
auto const& period_start = now.addSecs (-n);
|
auto const& period_start = now.addSecs (-n);
|
||||||
m_fnameWE = m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmmss"));
|
m_fnameWE = m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmmss"));
|
||||||
m_fileToSave.clear ();
|
m_fileToSave.clear ();
|
||||||
// the following is potential a threading hazard - not a good
|
if(m_saveAll or (m_bDecoded and m_saveDecoded) or (m_mode!="MSK144")) {
|
||||||
// idea to pass pointer to be processed in another thread
|
// the following is potential a threading hazard - not a good
|
||||||
m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file
|
// idea to pass pointer to be processed in another thread
|
||||||
, this
|
m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file,
|
||||||
, m_fnameWE
|
this, m_fnameWE, &dec_data.d2[0], m_TRperiod, m_config.my_callsign(),
|
||||||
, &dec_data.d2[0]
|
m_config.my_grid(), m_mode, m_nSubMode, m_freqNominal, m_hisCall, m_hisGrid)));
|
||||||
, m_TRperiod
|
}
|
||||||
, m_config.my_callsign ()
|
if(m_mode!="MSK144") {
|
||||||
, m_config.my_grid ()
|
killFileTimer.start (3*1000*m_TRperiod/4); //Kill 3/4 period from now
|
||||||
, m_mode
|
}
|
||||||
, m_nSubMode
|
|
||||||
, m_freqNominal
|
|
||||||
, m_hisCall
|
|
||||||
, m_hisGrid)));
|
|
||||||
killFileTimer.start (3*1000*m_TRperiod/4); //Kill 3/4 period from now
|
|
||||||
}
|
}
|
||||||
m_bFastDone=false;
|
m_bFastDone=false;
|
||||||
}
|
}
|
||||||
@ -1452,10 +1432,6 @@ void MainWindow::on_actionSettings_triggered() //Setup Dialog
|
|||||||
}
|
}
|
||||||
update_watchdog_label ();
|
update_watchdog_label ();
|
||||||
ui->cbCQRx->setEnabled(m_splitMode);
|
ui->cbCQRx->setEnabled(m_splitMode);
|
||||||
//###
|
|
||||||
bool b=m_config.my_callsign()=="K1JT" or m_config.my_callsign()=="K9AN";
|
|
||||||
ui->actionSave_decoded->setEnabled(b);
|
|
||||||
//###
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_monitorButton_clicked (bool checked)
|
void MainWindow::on_monitorButton_clicked (bool checked)
|
||||||
@ -1599,6 +1575,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
|
|||||||
case Qt::Key_V:
|
case Qt::Key_V:
|
||||||
if(e->modifiers() & Qt::AltModifier) {
|
if(e->modifiers() & Qt::AltModifier) {
|
||||||
m_fileToSave = m_fnameWE;
|
m_fileToSave = m_fnameWE;
|
||||||
|
m_bDecoded=true; //###
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1844,8 +1821,7 @@ void MainWindow::closeEvent(QCloseEvent * e)
|
|||||||
m_prefixes.reset ();
|
m_prefixes.reset ();
|
||||||
m_shortcuts.reset ();
|
m_shortcuts.reset ();
|
||||||
m_mouseCmnds.reset ();
|
m_mouseCmnds.reset ();
|
||||||
|
if(m_mode!="MSK144") killFile();
|
||||||
killFile ();
|
|
||||||
mem_jt9->detach();
|
mem_jt9->detach();
|
||||||
QFile quitFile {m_config.temp_dir ().absoluteFilePath (".quit")};
|
QFile quitFile {m_config.temp_dir ().absoluteFilePath (".quit")};
|
||||||
quitFile.open(QIODevice::ReadWrite);
|
quitFile.open(QIODevice::ReadWrite);
|
||||||
@ -2305,7 +2281,7 @@ void::MainWindow::fast_decode_done()
|
|||||||
QString msg0;
|
QString msg0;
|
||||||
dec_data.params.nagain=false;
|
dec_data.params.nagain=false;
|
||||||
dec_data.params.ndiskdat=false;
|
dec_data.params.ndiskdat=false;
|
||||||
if(m_msg[0][0]==0) m_bDecoded=false;
|
// if(m_msg[0][0]==0) m_bDecoded=false;
|
||||||
for(int i=0; i<100; i++) {
|
for(int i=0; i<100; i++) {
|
||||||
int i1=msg0.indexOf(m_baseCall);
|
int i1=msg0.indexOf(m_baseCall);
|
||||||
int i2=msg0.indexOf(m_hisCall);
|
int i2=msg0.indexOf(m_hisCall);
|
||||||
@ -5496,7 +5472,7 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout
|
|||||||
t=WSPR_hhmm(-60) + ' ' + t.rightJustified (66, '-');
|
t=WSPR_hhmm(-60) + ' ' + t.rightJustified (66, '-');
|
||||||
ui->decodedTextBrowser->appendText(t);
|
ui->decodedTextBrowser->appendText(t);
|
||||||
}
|
}
|
||||||
killFileTimer.start (45*1000); //Kill in 45s
|
killFileTimer.start (45*1000); //Kill in 45s (for slow modes)
|
||||||
}
|
}
|
||||||
m_nWSPRdecodes=0;
|
m_nWSPRdecodes=0;
|
||||||
ui->DecodeButton->setChecked (false);
|
ui->DecodeButton->setChecked (false);
|
||||||
|
Loading…
Reference in New Issue
Block a user