From b4f2d26b8657e786cecf339a13fe8e53c2a0e6b5 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 5 Mar 2001 20:29:23 +0000 Subject: [PATCH] r609: *** empty log message *** --- src/backgroundmgr.cpp | 8 ++++---- src/backgroundmgr.h | 7 +++---- src/backgroundsupr.cpp | 4 ++-- src/ctsim.cpp | 7 +++++-- src/dialogs.cpp | 8 ++++++-- src/threadraster.cpp | 4 ++-- src/threadraster.h | 3 +-- src/tips.cpp | 4 ++-- src/tips.h | 4 ++-- src/views.cpp | 8 ++++---- 10 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/backgroundmgr.cpp b/src/backgroundmgr.cpp index 3a93370..2d77145 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.11 2001/03/05 19:14:40 kevin Exp $ +** $Id: backgroundmgr.cpp,v 1.12 2001/03/05 20:29:23 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 @@ -39,9 +39,7 @@ #include "backgroundmgr.h" -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS IMPLEMENT_DYNAMIC_CLASS(BackgroundManager, wxMiniFrame) @@ -249,3 +247,5 @@ BackgroundManagerCanvas::OnPaint (wxPaintEvent& event) // dc.DrawLine (30,0, 0, 30); } #endif + +#endif // HAVE_WXTHREADS diff --git a/src/backgroundmgr.h b/src/backgroundmgr.h index b6e668a..a900f72 100644 --- a/src/backgroundmgr.h +++ b/src/backgroundmgr.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: backgroundmgr.h,v 1.7 2001/02/25 10:52:55 kevin Exp $ +** $Id: backgroundmgr.h,v 1.8 2001/03/05 20:29:23 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 @@ -44,9 +44,7 @@ #include -#if defined(HAVE_CONFIG_H) -#include "config.h" -#endif +#ifdef HAVE_WXTHREADS class BackgroundManagerCanvas; @@ -117,6 +115,7 @@ public: DECLARE_EVENT_TABLE() }; +#endif // HAVE_WXTHREADS #endif // _BACKGROUNDMGR_H diff --git a/src/backgroundsupr.cpp b/src/backgroundsupr.cpp index 7ec3408..74b417a 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.14 2001/03/05 19:14:40 kevin Exp $ +** $Id: backgroundsupr.cpp,v 1.15 2001/03/05 20:29:23 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,7 +40,7 @@ #ifdef HAVE_WXTHREADS -#define USE_BKGMGR 1 +// #define USE_BKGMGR 1 //////////////////////////////////////////////////////////////////////////// // diff --git a/src/ctsim.cpp b/src/ctsim.cpp index 7beb6e3..120be5b 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.95 2001/03/05 15:16:25 kevin Exp $ +** $Id: ctsim.cpp,v 1.96 2001/03/05 20:29:23 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 @@ -69,7 +69,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.95 2001/03/05 15:16:25 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.96 2001/03/05 20:29:23 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -229,7 +229,10 @@ CTSimApp::OnInit() if (getStartupTips()) ShowTips(); +#ifdef HAVE_WXTHREADS m_pBackgroundMgr = new BackgroundManager; +#endif + return true; } diff --git a/src/dialogs.cpp b/src/dialogs.cpp index 8ecf945..860841a 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.46 2001/03/02 21:11:50 kevin Exp $ +** $Id: dialogs.cpp,v 1.47 2001/03/05 20:29:23 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 @@ -242,9 +242,9 @@ DialogPreferences::DialogPreferences (wxWindow* pParent, const char* const pszTi m_pCBStartupTips->SetValue (bStartupTips); pTopSizer->Add (m_pCBStartupTips, 0, wxALIGN_CENTER_VERTICAL); +#ifdef HAVE_WXTHREADS m_pCBUseBackgroundTasks = new wxCheckBox (this, -1, "Put Tasks in Background", wxDefaultPosition, wxSize(250, 25), 0); m_pCBUseBackgroundTasks->SetValue (bUseBackgroundTasks); -#ifdef HAVE_WXTHREADS pTopSizer->Add (m_pCBUseBackgroundTasks, 0, wxALIGN_CENTER_VERTICAL); #endif @@ -298,7 +298,11 @@ DialogPreferences::getStartupTips () bool DialogPreferences::getUseBackgroundTasks () { +#ifdef HAVE_WXTHREADS return static_cast(m_pCBUseBackgroundTasks->GetValue()); +#else + return false; +#endif } diff --git a/src/threadraster.cpp b/src/threadraster.cpp index 736bf90..8a93fac 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.10 2001/03/05 19:14:40 kevin Exp $ +** $Id: threadraster.cpp,v 1.11 2001/03/05 20:29:23 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 @@ RasterizerSupervisorThread::Entry() if (! rasterSupervisor.cancelled()) rasterSupervisor.onDone(); rasterSupervisor.deleteWorkers(); - + return reinterpret_cast(0); } diff --git a/src/threadraster.h b/src/threadraster.h index 222091c..6ed173b 100644 --- a/src/threadraster.h +++ b/src/threadraster.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: threadraster.h,v 1.3 2001/03/04 03:14:47 kevin Exp $ +** $Id: threadraster.h,v 1.4 2001/03/05 20:29:23 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 @@ -56,7 +56,6 @@ public: RasterizerSupervisorThread(PhantomFileView* pProjView, int iNX, int iNY, int iNSample, double dViewRatio, const char* const pszLabel); virtual wxThread::ExitCode Entry(); - virtual void OnExit(); }; diff --git a/src/tips.cpp b/src/tips.cpp index dc425d6..05c2a9e 100644 --- a/src/tips.cpp +++ b/src/tips.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: tips.cpp,v 1.2 2001/02/22 11:05:38 kevin Exp $ +** $Id: tips.cpp,v 1.3 2001/03/05 20:29:23 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 @@ -62,7 +62,7 @@ const char* const CTSimTipProvider::s_aszTips[] = { {"You can control CTSim's operation using the \"File - Preferences\" menu command."}, }; -const int CTSimTipProvider::s_iNumTips = sizeof(s_aszTips) / sizeof(const char *); +const size_t CTSimTipProvider::s_iNumTips = sizeof(s_aszTips) / sizeof(const char *); CTSimTipProvider::CTSimTipProvider (size_t iCurrentTip) diff --git a/src/tips.h b/src/tips.h index 39d264d..de50ee6 100644 --- a/src/tips.h +++ b/src/tips.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2001 Kevin Rosenberg ** -** $Id: tips.h,v 1.1 2001/02/22 00:56:50 kevin Exp $ +** $Id: tips.h,v 1.2 2001/03/05 20:29:23 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 @@ -33,7 +33,7 @@ class CTSimTipProvider : public wxTipProvider { private: static const char* const s_aszTips[]; - static const int s_iNumTips; + static const size_t s_iNumTips; size_t m_iCurrentTip; diff --git a/src/views.cpp b/src/views.cpp index 1377479..7bbf71a 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: views.cpp,v 1.126 2001/03/04 22:30:20 kevin Exp $ +** $Id: views.cpp,v 1.127 2001/03/05 20:29:23 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 @@ -1949,7 +1949,7 @@ PhantomFileView::OnProjections (wxCommandEvent& event) } } else { #if HAVE_WXTHREADS - if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { + if (theApp->getUseBackgroundTasks()) { ProjectorSupervisorThread* pProjector = new ProjectorSupervisorThread (this, m_iDefaultNDet, m_iDefaultNView, sGeometry.c_str(), m_iDefaultNSample, dRotationRadians, m_dDefaultFocalLength, m_dDefaultCenterDetectorLength, m_dDefaultViewRatio, m_dDefaultScanRatio, os.str().c_str()); @@ -2032,7 +2032,7 @@ PhantomFileView::OnRasterize (wxCommandEvent& event) << m_iDefaultRasterNSamples;; #if HAVE_WXTHREADS - if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { + if (theApp->getUseBackgroundTasks()) { RasterizerSupervisorThread* pThread = new RasterizerSupervisorThread (this, m_iDefaultRasterNX, m_iDefaultRasterNY, m_iDefaultRasterNSamples, m_dDefaultRasterViewRatio, os.str().c_str()); if (pThread->Create() != wxTHREAD_NO_ERROR) { @@ -2472,7 +2472,7 @@ ProjectionFileView::OnReconstructFBP (wxCommandEvent& event) delete pReconstructor; } else { #if HAVE_WXTHREADS - if (theApp->getUseBackgroundTasks() || theApp->getNumberCPU() > 1) { + if (theApp->getUseBackgroundTasks()) { ReconstructorSupervisorThread* pReconstructor = new ReconstructorSupervisorThread (this, m_iDefaultNX, m_iDefaultNY, optFilterName.c_str(), m_dDefaultFilterParam, optFilterMethodName.c_str(), m_iDefaultZeropad, optFilterGenerationName.c_str(), -- 2.34.1