From fbe99ce7041eb409981b1fd8e269827daf4ed168 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 5 Mar 2001 19:14:40 +0000 Subject: [PATCH] r608: *** empty log message *** --- src/backgroundmgr.cpp | 4 ++-- src/backgroundsupr.cpp | 11 ++++++++++- src/threadraster.cpp | 20 ++++++++++---------- src/threadrecon.h | 4 ++-- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/backgroundmgr.cpp b/src/backgroundmgr.cpp index ff22e58..3a93370 100644 --- a/src/backgroundmgr.cpp +++ b/src/backgroundmgr.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundmgr.cpp,v 1.10 2001/03/05 15:16:25 kevin Exp $ +** $Id: backgroundmgr.cpp,v 1.11 2001/03/05 19:14:40 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 @@ -236,7 +236,7 @@ BEGIN_EVENT_TABLE(BackgroundManagerCanvas, wxPanel) END_EVENT_TABLE() BackgroundManagerCanvas::BackgroundManagerCanvas (BackgroundManager* pMgr) -: m_pBackgroundManager(pMgr), wxPanel (pMgr) +: wxPanel (pMgr), m_pBackgroundManager(pMgr) { } diff --git a/src/backgroundsupr.cpp b/src/backgroundsupr.cpp index 561009c..7ec3408 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.13 2001/03/05 17:26:46 kevin Exp $ +** $Id: backgroundsupr.cpp,v 1.14 2001/03/05 19:14:40 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 @@ -40,6 +40,8 @@ #ifdef HAVE_WXTHREADS +#define USE_BKGMGR 1 + //////////////////////////////////////////////////////////////////////////// // // Class BackgroundSupervisor -- An event handler run by a SupervisorThread @@ -68,9 +70,11 @@ BackgroundSupervisor::BackgroundSupervisor (SupervisorThread* pMyThread, wxFrame BackgroundSupervisor::~BackgroundSupervisor() { +#ifdef USE_BKGMGR wxCommandEvent doneEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_REMOVE); doneEvent.SetClientData (this); wxPostEvent (theApp->getBackgroundManager(), doneEvent); +#endif m_pDocument->removeBackgroundSupervisor (this); @@ -128,11 +132,14 @@ BackgroundSupervisor::start() std::string strLabel (m_strProcessTitle); strLabel += " "; strLabel += m_pParentFrame->GetTitle(); + +#ifdef USE_BKGMGR wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_ADD); addTaskEvent.SetString (strLabel.c_str()); addTaskEvent.SetInt (m_iTotalUnits); addTaskEvent.SetClientData (this); wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); +#endif m_pDocument->addBackgroundSupervisor (this); @@ -163,10 +170,12 @@ BackgroundSupervisor::onWorkerUnitTick () *theApp->getLog() << "Units done: " << static_cast(m_iUnitsDone) <<"\n"; #endif +#ifdef USE_BKGMGR wxCommandEvent addTaskEvent (wxEVT_COMMAND_MENU_SELECTED, MSG_BACKGROUND_SUPERVISOR_UNIT_TICK); addTaskEvent.SetInt (m_iUnitsDone - 1); addTaskEvent.SetClientData (this); wxPostEvent (theApp->getBackgroundManager(), addTaskEvent); +#endif } void diff --git a/src/threadraster.cpp b/src/threadraster.cpp index f1678ce..736bf90 100644 --- a/src/threadraster.cpp +++ b/src/threadraster.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadraster.cpp,v 1.9 2001/03/05 17:26:46 kevin Exp $ +** $Id: threadraster.cpp,v 1.10 2001/03/05 19:14:40 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,28 +65,28 @@ RasterizerSupervisorThread::RasterizerSupervisorThread (PhantomFileView* pProjVi wxThread::ExitCode RasterizerSupervisorThread::Entry() { - RasterizerSupervisor* pRasterSupervisor = new RasterizerSupervisor (this, m_pPhantomView, m_iNX, m_iNY, m_iNSample, m_dViewRatio, m_strLabel.c_str()); + RasterizerSupervisor rasterSupervisor (this, m_pPhantomView, m_iNX, m_iNY, m_iNSample, m_dViewRatio, m_strLabel.c_str()); - pRasterSupervisor->start(); + rasterSupervisor.start(); - while (! pRasterSupervisor->workersDone() && ! pRasterSupervisor->fail() && ! pRasterSupervisor->cancelled()) { + while (! rasterSupervisor.workersDone() && ! rasterSupervisor.fail() && ! rasterSupervisor.cancelled()) { Sleep(100); } - if (pRasterSupervisor->fail()) + if (rasterSupervisor.fail()) { wxString msg ("Error starting Rasterizer supervisor: "); - msg += pRasterSupervisor->getFailMessage().c_str(); + msg += rasterSupervisor.getFailMessage().c_str(); msg += "\n"; wxCommandEvent eventLog (wxEVT_COMMAND_MENU_SELECTED, MAINMENU_LOG_EVENT ); eventLog.SetString( msg ); wxPostEvent( theApp->getMainFrame(), eventLog ); // send log event } - if (! pRasterSupervisor->cancelled()) - pRasterSupervisor->onDone(); - pRasterSupervisor->deleteWorkers(); - + if (! rasterSupervisor.cancelled()) + rasterSupervisor.onDone(); + rasterSupervisor.deleteWorkers(); + return reinterpret_cast(0); } diff --git a/src/threadrecon.h b/src/threadrecon.h index f8d2940..89c58fe 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.11 2001/03/02 21:11:50 kevin Exp $ +** $Id: threadrecon.h,v 1.12 2001/03/05 19:14:40 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 @@ -76,8 +76,8 @@ class ReconstructorSupervisor : public BackgroundSupervisor { private: std::vector m_vecpChildImageFile; - ProjectionFileDocument* m_pProjDoc; ProjectionFileView* m_pProjView; + ProjectionFileDocument* m_pProjDoc; const int m_iImageNX; const int m_iImageNY; -- 2.34.1