projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r613: Added DICOM Export
[ctsim.git]
/
src
/
threadrecon.cpp
diff --git
a/src/threadrecon.cpp
b/src/threadrecon.cpp
index 7f4e9518ba30566c16d0b577b2c08aafadc86b89..a3134a337d393f9abc1f707d19a78dced8039f55 100644
(file)
--- a/
src/threadrecon.cpp
+++ b/
src/threadrecon.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: threadrecon.cpp,v 1.
18 2001/03/04 04:16:20
kevin Exp $
+** $Id: threadrecon.cpp,v 1.
21 2001/03/05 17:26:46
kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
@@
-70,9
+70,8
@@
ReconstructorSupervisorThread::Entry()
m_strInterpName.c_str(), m_iInterpParam, m_strBackprojectName.c_str(), m_strLabel.c_str());
reconSupervisor.start();
m_strInterpName.c_str(), m_iInterpParam, m_strBackprojectName.c_str(), m_strLabel.c_str());
reconSupervisor.start();
- while (! reconSupervisor.
isDone() && ! reconSupervisor.fail
()) {
+ while (! reconSupervisor.
workersDone() && ! reconSupervisor.fail() && ! reconSupervisor.cancelled
()) {
Sleep(100);
Sleep(100);
- Yield();
}
if (reconSupervisor.fail())
{
}
if (reconSupervisor.fail())
{
@@
-83,11
+82,9
@@
ReconstructorSupervisorThread::Entry()
eventLog.SetString( msg );
wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
}
eventLog.SetString( msg );
wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event
}
-
- while (! reconSupervisor.workersDeleted()) {
- Sleep(50);
- reconSupervisor.ProcessPendingEvents();
- }
+ if (! reconSupervisor.cancelled())
+ reconSupervisor.onDone();
+ reconSupervisor.deleteWorkers();
return reinterpret_cast<wxThread::ExitCode>(0);
}
return reinterpret_cast<wxThread::ExitCode>(0);
}
@@
-116,7
+113,7
@@
ReconstructorSupervisor::ReconstructorSupervisor (SupervisorThread* pThread, Pro
BackgroundSupervisor (pThread, pProjView->GetFrame(), pProjView->GetDocument(), "Reconstructing", pProjView->GetDocument()->getProjections().nView())
{
m_vecpChildImageFile.reserve (getNumWorkers());
BackgroundSupervisor (pThread, pProjView->GetFrame(), pProjView->GetDocument(), "Reconstructing", pProjView->GetDocument()->getProjections().nView())
{
m_vecpChildImageFile.reserve (getNumWorkers());
- for (
unsigned
int iThread = 0; iThread < getNumWorkers(); iThread++) {
+ for (int iThread = 0; iThread < getNumWorkers(); iThread++) {
m_vecpChildImageFile[iThread] = new ImageFile (m_iImageNX, m_iImageNY);
}
m_vecpChildImageFile[iThread] = new ImageFile (m_iImageNX, m_iImageNY);
}
@@
-216,12
+213,12
@@
ReconstructorWorker::Entry ()
m_pszFilterGenerationName, m_pszInterpName, m_iInterpParam, m_pszBackprojectName, Trace::TRACE_NONE);
bool bFail = pReconstructor->fail();
m_pszFilterGenerationName, m_pszInterpName, m_iInterpParam, m_pszBackprojectName, Trace::TRACE_NONE);
bool bFail = pReconstructor->fail();
-
wxS
tring failMsg;
+
std::s
tring failMsg;
if (bFail) {
failMsg = "Unable to make reconstructor: ";
failMsg += pReconstructor->failMessage().c_str();
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
if (bFail) {
failMsg = "Unable to make reconstructor: ";
failMsg += pReconstructor->failMessage().c_str();
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT );
- event.SetString( failMsg );
+ event.SetString( failMsg
.c_str()
);
wxPostEvent( theApp->getMainFrame(), event );
}
else
wxPostEvent( theApp->getMainFrame(), event );
}
else
@@
-241,21
+238,16
@@
ReconstructorWorker::Entry ()
break;
}
pReconstructor->reconstructView (iUnit + m_iStartUnit, 1);
break;
}
pReconstructor->reconstructView (iUnit + m_iStartUnit, 1);
- m_pSupervisor->
AddPendingEvent (eventProgress
);
+ m_pSupervisor->
onWorkerUnitTick(
);
}
pReconstructor->postProcessing();
}
delete pReconstructor;
if (bFail) {
}
pReconstructor->postProcessing();
}
delete pReconstructor;
if (bFail) {
- wxCommandEvent eventFail (wxEVT_COMMAND_MENU_SELECTED, BackgroundSupervisor::MSG_WORKER_THREAD_FAIL);
- eventFail.SetInt (m_iThread); // Send back thread# that has finished
- eventFail.SetString (failMsg);
- wxPostEvent (m_pSupervisor, eventFail);
+ m_pSupervisor->onWorkerFail (m_iThread, failMsg);
} else {
} else {
- wxCommandEvent eventDone (wxEVT_COMMAND_MENU_SELECTED, BackgroundSupervisor::MSG_WORKER_THREAD_DONE);
- eventDone.SetInt (m_iThread); // Send back thread# that has finished
- wxPostEvent (m_pSupervisor, eventDone);
+ m_pSupervisor->onWorkerDone (m_iThread);
}
while (! TestDestroy())
}
while (! TestDestroy())