From a97f1819c4f24321ba8d54a16f6534ee94404d26 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 25 Feb 2001 19:24:01 +0000 Subject: [PATCH] r586: *** empty log message *** --- src/Makefile.in | 12 ++++++++---- src/backgroundsupr.cpp | 6 +++--- src/backgroundsupr.h | 11 +++++++---- src/threadproj.cpp | 10 +++++----- src/threadproj.h | 4 ++-- src/threadrecon.cpp | 10 +++++----- src/threadrecon.h | 4 ++-- 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 0bb18c1..0a7b4bc 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -92,7 +92,8 @@ wxlibs = @wxlibs@ bin_PROGRAMS = ctsim -ctsim_SOURCES = ctsim.cpp docs.cpp views.cpp dialogs.cpp ctsim.h docs.h views.h dialogs.h dlgprojections.cpp dlgprojections.h dlgreconstruct.cpp dlgreconstruct.h graph3dview.cpp graph3dview.h ctsim-map.h ctsim.xpm splash.xpm +ctsim_SOURCES = ctsim.cpp docs.cpp views.cpp dialogs.cpp ctsim.h docs.h views.h dialogs.h dlgprojections.cpp dlgprojections.h dlgreconstruct.cpp dlgreconstruct.h graph3dview.cpp graph3dview.h ctsim-map.h ctsim.xpm splash.xpm tips.cpp tips.h threadrecon.cpp threadrecon.h backgroundmgr.cpp backgroundmgr.h backgroundsupr.cpp backgroundsupr.h threadproj.cpp threadproj.h + ctsim_DEPENDENCIES = ../libctgraphics/libctgraphics.a ../libctsupport/libctsupport.a ../libctsim/libctsim.a ../include/ct.h ctsim_LDADD = -L../libctgraphics -L../libctsupport -L../libctsim @ctlibs@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -106,7 +107,8 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ ctsim_OBJECTS = ctsim.o docs.o views.o dialogs.o dlgprojections.o \ -dlgreconstruct.o graph3dview.o +dlgreconstruct.o graph3dview.o tips.o threadrecon.o backgroundmgr.o \ +backgroundsupr.o threadproj.o ctsim_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -123,8 +125,10 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best -DEP_FILES = .deps/ctsim.P .deps/dialogs.P .deps/dlgprojections.P \ -.deps/dlgreconstruct.P .deps/docs.P .deps/graph3dview.P .deps/views.P +DEP_FILES = .deps/backgroundmgr.P .deps/backgroundsupr.P .deps/ctsim.P \ +.deps/dialogs.P .deps/dlgprojections.P .deps/dlgreconstruct.P \ +.deps/docs.P .deps/graph3dview.P .deps/threadproj.P .deps/threadrecon.P \ +.deps/tips.P .deps/views.P SOURCES = $(ctsim_SOURCES) OBJECTS = $(ctsim_OBJECTS) diff --git a/src/backgroundsupr.cpp b/src/backgroundsupr.cpp index 4f9e4c6..4083c82 100644 --- a/src/backgroundsupr.cpp +++ b/src/backgroundsupr.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundsupr.cpp,v 1.6 2001/02/25 16:21:36 kevin Exp $ +** $Id: backgroundsupr.cpp,v 1.7 2001/02/25 19:24:01 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 @@ -92,7 +92,7 @@ BackgroundSupervisor::~BackgroundSupervisor() } while (m_bBackgroundTaskAdded) { - Sleep(50); + m_pMyThread->Sleep(50); ProcessPendingEvents(); } @@ -113,7 +113,7 @@ BackgroundSupervisor::deleteWorkers() } while (m_iRunning > 0) { - Sleep(50); + m_pMyThread->Sleep(50); ProcessPendingEvents(); } m_iRunning = 0; diff --git a/src/backgroundsupr.h b/src/backgroundsupr.h index acc5f55..12372d0 100644 --- a/src/backgroundsupr.h +++ b/src/backgroundsupr.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundsupr.h,v 1.3 2001/02/25 08:43:03 kevin Exp $ +** $Id: backgroundsupr.h,v 1.4 2001/02/25 19:24:01 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 @@ -53,7 +53,7 @@ class BackgroundWorkerThread; class BackgroundSupervisor : public wxEvtHandler { private: DECLARE_DYNAMIC_CLASS(BackgroundSupervisor) - + typedef std::vector ThreadContainer; ThreadContainer m_vecpThreads; wxFrame* m_pParentFrame; @@ -74,6 +74,9 @@ private: bool m_bWorkersDeleted; wxCriticalSection m_critsectThreads; +protected: + SupervisorThread* m_MyThread; + public: enum { MSG_BACKGROUND_SUPERVISOR_ADD = 7500, // sends to BackgroundManager and Document @@ -87,7 +90,7 @@ public: MSG_WORKER_THREAD_FAIL = 7507, // sent by workers when they fail }; - BackgroundSupervisor (wxFrame* pParentFrame, wxDocument* pDocument, const char* const pszProcessTitle, + BackgroundSupervisor (SupervisorThread* pMyThread, wxFrame* pParentFrame, wxDocument* pDocument, const char* const pszProcessTitle, int iTotalUnits); BackgroundSupervisor () @@ -138,4 +141,4 @@ public: {} }; -#endif // _BACKGROUNDSUPR_H_ \ No newline at end of file +#endif // _BACKGROUNDSUPR_H_ diff --git a/src/threadproj.cpp b/src/threadproj.cpp index db6070c..dfdf2be 100644 --- a/src/threadproj.cpp +++ b/src/threadproj.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadproj.cpp,v 1.3 2001/02/25 16:21:36 kevin Exp $ +** $Id: threadproj.cpp,v 1.4 2001/02/25 19:24:01 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 @@ -64,12 +64,12 @@ ProjectorSupervisorThread::ProjectorSupervisorThread (PhantomFileView* pProjView wxThread::ExitCode ProjectorSupervisorThread::Entry() { - ProjectorSupervisor projSupervisor (m_pPhantomView, m_iNDet, m_iNView, + ProjectorSupervisor projSupervisor (this, m_pPhantomView, m_iNDet, m_iNView, m_strGeometry.c_str(), m_iNSample, m_dRotation, m_dFocalLength, m_dViewRatio, m_dScanRatio, m_strLabel.c_str()); projSupervisor.start(); while (! projSupervisor.isDone() && ! projSupervisor.fail()) { - Sleep(50); + Sleep(100); Yield(); } if (projSupervisor.fail()) @@ -102,14 +102,14 @@ ProjectorSupervisorThread::OnExit() // ///////////////////////////////////////////////////////////////////// -ProjectorSupervisor::ProjectorSupervisor (PhantomFileView* pPhantomView, int iNDet, int iNView, +ProjectorSupervisor::ProjectorSupervisor (SupervisorThread* pThread, PhantomFileView* pPhantomView, int iNDet, int iNView, const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dViewRatio, double dScanRatio, const char* const pszLabel) : m_pPhantomView(pPhantomView), m_pPhantomDoc(pPhantomView->GetDocument()), m_iNDet(iNDet), m_iNView(iNView), m_pszGeometry(pszGeometry), m_iNSample(iNSample), m_dRotation(dRotation), m_dFocalLength(dFocalLength), m_dViewRatio(dViewRatio), m_dScanRatio(dScanRatio), m_pszLabel(pszLabel), - BackgroundSupervisor (pPhantomView->GetFrame(), pPhantomView->GetDocument(), "Projecting", iNView) + BackgroundSupervisor (pThread, pPhantomView->GetFrame(), pPhantomView->GetDocument(), "Projecting", iNView) { m_pScanner = new Scanner (m_pPhantomDoc->getPhantom(), m_pszGeometry, m_iNDet, m_iNView, m_iNSample, m_dRotation, m_dFocalLength, m_dViewRatio, m_dScanRatio); diff --git a/src/threadproj.h b/src/threadproj.h index 6bb16f5..6e6db11 100644 --- a/src/threadproj.h +++ b/src/threadproj.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadproj.h,v 1.2 2001/02/25 15:27:28 kevin Exp $ +** $Id: threadproj.h,v 1.3 2001/02/25 19:24:01 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 @@ -86,7 +86,7 @@ private: public: - ProjectorSupervisor (PhantomFileView* pProjView, int iNDet, int iNView, + ProjectorSupervisor (SupervisorThread* pThread, PhantomFileView* pProjView, int iNDet, int iNView, const char* pszGeometry, int iNSample, double dRotation, double dFocalLength, double dViewRatio, double dScanRatio, const char* const pszLabel); diff --git a/src/threadrecon.cpp b/src/threadrecon.cpp index 51b930d..dba0827 100644 --- 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 ** -** $Id: threadrecon.cpp,v 1.12 2001/02/25 10:52:55 kevin Exp $ +** $Id: threadrecon.cpp,v 1.13 2001/02/25 19:24:01 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 @@ -65,13 +65,13 @@ ReconstructorSupervisorThread::ReconstructorSupervisorThread (ProjectionFileView wxThread::ExitCode ReconstructorSupervisorThread::Entry() { - ReconstructorSupervisor reconSupervisor (m_pProjView, m_iNX, m_iNY, + ReconstructorSupervisor reconSupervisor (this, m_pProjView, m_iNX, m_iNY, m_strFilterName.c_str(), m_dFilterParam, m_strFilterMethod.c_str(), m_iZeropad, m_strFilterGenerationName.c_str(), m_strInterpName.c_str(), m_iInterpParam, m_strBackprojectName.c_str(), m_strLabel.c_str()); reconSupervisor.start(); while (! reconSupervisor.isDone() && ! reconSupervisor.fail()) { - Sleep(50); + Sleep(100); Yield(); } if (reconSupervisor.fail()) @@ -104,7 +104,7 @@ ReconstructorSupervisorThread::OnExit() // ///////////////////////////////////////////////////////////////////// -ReconstructorSupervisor::ReconstructorSupervisor (ProjectionFileView* pProjView, +ReconstructorSupervisor::ReconstructorSupervisor (SupervisorThread* pThread, ProjectionFileView* pProjView, int iImageNX, int iImageNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel) @@ -113,7 +113,7 @@ ReconstructorSupervisor::ReconstructorSupervisor (ProjectionFileView* pProjView, m_pszFilterName(pszFilterName), m_dFilterParam(dFilterParam), m_pszFilterMethod(pszFilterMethod), m_iZeropad(iZeropad), m_pszFilterGenerationName(pszFilterGenerationName), m_pszInterpName(pszInterpName), m_iInterpParam(iInterpParam), m_pszBackprojectName(pszBackprojectName), m_pszLabel(pszLabel), - BackgroundSupervisor (pProjView->GetFrame(), pProjView->GetDocument(), "Reconstructing", pProjView->GetDocument()->getProjections().nView()) + BackgroundSupervisor (pThread, pProjView->GetFrame(), pProjView->GetDocument(), "Reconstructing", pProjView->GetDocument()->getProjections().nView()) { m_vecpChildImageFile.reserve (getNumWorkers()); for (unsigned int iThread = 0; iThread < getNumWorkers(); iThread++) { diff --git a/src/threadrecon.h b/src/threadrecon.h index cbb2ea9..97b36f4 100644 --- a/src/threadrecon.h +++ b/src/threadrecon.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadrecon.h,v 1.9 2001/02/25 10:52:55 kevin Exp $ +** $Id: threadrecon.h,v 1.10 2001/02/25 19:24:01 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 @@ -90,7 +90,7 @@ private: const char* const m_pszLabel; public: - ReconstructorSupervisor (ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName, + ReconstructorSupervisor (SupervisorThread* pMyThread, ProjectionFileView* pProjView, int iNX, int iNY, const char* pszFilterName, double dFilterParam, const char* pszFilterMethod, int iZeropad, const char* pszFilterGenerationName, const char* pszInterpName, int iInterpParam, const char* pszBackprojectName, const char* const pszLabel); -- 2.34.1