changeset 374:7cc6b7b0d819 sv1-v1.2pre3

* line up overview widget nicely with main pane (at least on first startup) * fix #1878396 renaming layer seems to have no visible effect * comment out some debug output
author Chris Cannam
date Wed, 06 Feb 2008 17:40:53 +0000
parents 0a44caddd9fe
children f1ff248a793e
files base/StorageAdviser.cpp data/fft/FFTDataServer.cpp data/fft/FFTFileCache.cpp data/fft/FFTMemoryCache.cpp
diffstat 4 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/base/StorageAdviser.cpp	Wed Feb 06 16:21:29 2008 +0000
+++ b/base/StorageAdviser.cpp	Wed Feb 06 17:40:53 2008 +0000
@@ -22,6 +22,8 @@
 
 #include <iostream>
 
+//#define DEBUG_STORAGE_ADVISER 1
+
 long StorageAdviser::m_discPlanned = 0;
 long StorageAdviser::m_memoryPlanned = 0;
 
@@ -30,9 +32,11 @@
 			  int minimumSize,
 			  int maximumSize)
 {
+#ifdef DEBUG_STORAGE_ADVISER
     std::cerr << "StorageAdviser::recommend: Criteria " << criteria 
               << ", minimumSize " << minimumSize
               << ", maximumSize " << maximumSize << std::endl;
+#endif
 
     QString path = TempDirectory::getInstance()->getPath();
     int discFree = GetDiscSpaceMBAvailable(path.toLocal8Bit());
@@ -51,7 +55,9 @@
         memoryFree = 0;
     }
 
+#ifdef DEBUG_STORAGE_ADVISER
     std::cerr << "Disc space: " << discFree << ", memory free: " << memoryFree << ", memory total: " << memoryTotal << ", min " << minimumSize << ", max " << maximumSize << std::endl;
+#endif
 
     //!!! We have a potentially serious problem here if multiple
     //recommendations are made in advance of any of the resulting
@@ -86,8 +92,10 @@
     else if (minmb > (discFree / 10)) discStatus = Marginal;
     else discStatus = Sufficient;
 
+#ifdef DEBUG_STORAGE_ADVISER
     std::cerr << "Memory status: " << memoryStatus << ", disc status "
               << discStatus << std::endl;
+#endif
 
     int recommendation = NoRecommendation;
 
--- a/data/fft/FFTDataServer.cpp	Wed Feb 06 16:21:29 2008 +0000
+++ b/data/fft/FFTDataServer.cpp	Wed Feb 06 17:40:53 2008 +0000
@@ -727,9 +727,9 @@
     compactCache = canCompact &&
         (recommendation & StorageAdviser::ConserveSpace);
 
+#ifdef DEBUG_FFT_SERVER
     std::cerr << "FFTDataServer: memory cache = " << memoryCache << ", compact cache = " << compactCache << std::endl;
     
-#ifdef DEBUG_FFT_SERVER
     std::cerr << "Width " << w << " of " << m_width << ", height " << h << ", size " << w * h << std::endl;
 #endif
 }
--- a/data/fft/FFTFileCache.cpp	Wed Feb 06 16:21:29 2008 +0000
+++ b/data/fft/FFTFileCache.cpp	Wed Feb 06 17:40:53 2008 +0000
@@ -23,6 +23,7 @@
 
 #include <QMutexLocker>
 
+
 // The underlying matrix has height (m_height * 2 + 1).  In each
 // column we store magnitude at [0], [2] etc and phase at [1], [3]
 // etc, and then store the normalization factor (maximum magnitude) at
--- a/data/fft/FFTMemoryCache.cpp	Wed Feb 06 16:21:29 2008 +0000
+++ b/data/fft/FFTMemoryCache.cpp	Wed Feb 06 17:40:53 2008 +0000
@@ -18,6 +18,8 @@
 
 #include <iostream>
 
+//#define DEBUG_FFT_MEMORY_CACHE 1
+
 FFTMemoryCache::FFTMemoryCache(StorageType storageType) :
     m_width(0),
     m_height(0),
@@ -30,13 +32,17 @@
     m_factor(0),
     m_storageType(storageType)
 {
+#ifdef DEBUG_FFT_MEMORY_CACHE
     std::cerr << "FFTMemoryCache[" << this << "]::FFTMemoryCache (type "
               << m_storageType << ")" << std::endl;
+#endif
 }
 
 FFTMemoryCache::~FFTMemoryCache()
 {
-//    std::cerr << "FFTMemoryCache[" << this << "]::~FFTMemoryCache" << std::endl;
+#ifdef DEBUG_FFT_MEMORY_CACHE
+    std::cerr << "FFTMemoryCache[" << this << "]::~FFTMemoryCache" << std::endl;
+#endif
 
     for (size_t i = 0; i < m_width; ++i) {
 	if (m_magnitude && m_magnitude[i]) free(m_magnitude[i]);
@@ -59,7 +65,9 @@
 void
 FFTMemoryCache::resize(size_t width, size_t height)
 {
+#ifdef DEBUG_FFT_MEMORY_CACHE
     std::cerr << "FFTMemoryCache[" << this << "]::resize(" << width << "x" << height << " = " << width*height << ")" << std::endl;
+#endif
     
     if (m_width == width && m_height == height) return;
 
@@ -81,7 +89,9 @@
     m_width = width;
     m_height = height;
 
-//    std::cerr << "done, width = " << m_width << " height = " << m_height << std::endl;
+#ifdef DEBUG_FFT_MEMORY_CACHE
+    std::cerr << "done, width = " << m_width << " height = " << m_height << std::endl;
+#endif
 }
 
 void