Clean up the timer 'init' and 'fini' calls, etc.

This commit is contained in:
Joe Taylor 2022-12-10 09:24:24 -05:00
parent 1a5815f084
commit 61d9d45be1
5 changed files with 28 additions and 17 deletions

View File

@ -20,7 +20,6 @@ subroutine decode0(dd,ss,savg,nstandalone)
call sec0(0,tquick)
ncand=0
call timer('decode0 ',0)
if(newdat.ne.0) then
nz=96000*nhsym/5.3833
hist=0
@ -59,7 +58,6 @@ subroutine decode0(dd,ss,savg,nstandalone)
neme,ndepth,nstandalone,hiscall,hisgrid,nhsym,nfsample, &
ndiskdat,nxpol,nmode,ndop00,ncand)
call timer('map65a ',1)
call timer('decode0 ',1)
if(nhsym.eq.nhsym2) write(*,1012) ndecodes,ncand
1012 format('<DecodeFinished>',2i4)

View File

@ -1,7 +1,7 @@
!subroutine ftninit()
subroutine ftninit
use timer_module, only: timer
use timer_impl, only: init_timer !,fini_timer, limtrace
use, intrinsic :: iso_c_binding, only: C_NULL_CHAR
use FFTW3
! character*(*) appd
@ -10,6 +10,9 @@ subroutine ftninit
character wisfile*256
common/pfxcom/addpfx
lu=8
call init_timer('./timer.out')
appd='.'
addpfx=' '
call pfxdump(appd//'/prefixes.txt')

View File

@ -1,7 +1,7 @@
subroutine m65c
subroutine m65c(itimer)
use timer_module, only: timer
use timer_impl, only: init_timer !, limtrace
use timer_impl, only: fini_timer !, limtrace
use, intrinsic :: iso_c_binding, only: C_NULL_CHAR
use FFTW3
use q65
@ -29,21 +29,27 @@ subroutine m65c
data first/.true./
save first,cwd
if(itimer.ne.0) then
! call timer('q65w ',1)
! call timer('q65w ',101)
call timer('decode0 ',101)
call fini_timer
return
endif
lq65w=.true.
lq65w2=.true.
nparams=nparams0 !Copy parameters into common/npar/
datetime(18:20)=':00'
! if(first) then
! call getcwd(cwd)
! call ftninit(trim(cwd))
! call init_timer (trim(cwd)//'/timer.out')
! first=.false.
! endif
! if(first) call timer('q65w ',0)
! first=.false.
npatience=1
nstandalone=0
if(sum(nparams).ne.0) call decode0(dd,ss,savg,nstandalone)
call timer('decode0 ',0)
call decode0(dd,ss,savg,nstandalone)
call timer('decode0 ',1)
return
end subroutine m65c

View File

@ -233,6 +233,9 @@ MainWindow::MainWindow(QWidget *parent) :
MainWindow::~MainWindow()
{
writeSettings();
int itimer=1;
m65c_(&itimer);
if (soundInThread.isRunning()) {
soundInThread.quit();
soundInThread.wait(3000);
@ -751,7 +754,7 @@ void MainWindow::on_stopButton_clicked() //stopButton
{
m_monitoring=false;
soundInThread.setMonitoring(m_monitoring);
m_loopall=false;
m_loopall=false;
}
void MainWindow::msgBox(QString t) //msgBox
@ -1033,7 +1036,8 @@ void MainWindow::decode() //decode()
// QFile lockFile(m_appDir + "/.lock"); // Allow m65 to start
// lockFile.remove();
watcher3.setFuture(QtConcurrent::run (std::bind (m65c_)));
int itimer=0;
watcher3.setFuture(QtConcurrent::run (std::bind (m65c_, &itimer)));
decodeBusy(true);
}
@ -1067,7 +1071,7 @@ void MainWindow::m65_error (QProcess::ProcessError)
}
void MainWindow::readFromStdout() //readFromStdout
{
{
while(proc_m65.canReadLine())
{
QByteArray t=proc_m65.readLine();
@ -1302,7 +1306,7 @@ void MainWindow::on_addButton_clicked() //Add button
} while(!s.isNull());
if(hc>hc1 && !m_call3Modified) out << newEntry + "\n";
}
if(m_call3Modified) {
auto const& old_path = m_appDir + "/CALL3.OLD";
QFile f0 {old_path};

View File

@ -231,7 +231,7 @@ extern "C" {
void astrosub00_ (int* nyear, int* month, int* nday, double* uth, int* nfreq,
const char* mygrid, int* ndop00, int len1);
void m65c_(void);
void m65c_(int* itimer);
}
#endif // MAINWINDOW_H