[Kst] branches/work/kst/portto4/kst/src

Barth Netterfield netterfield at astro.utoronto.ca
Thu Oct 11 01:18:10 UTC 2012


SVN commit 1320093 by netterfield:

BUG:
Some objects were not getting updated after changes via the dialogs when paused.
PSDs were not getting updated when some changes were made.
This fixes these things.


 M  +4 -0      libkstapp/basicplugindialog.cpp  
 M  +4 -0      libkstapp/csddialog.cpp  
 M  +5 -0      libkstapp/curvedialog.cpp  
 M  +5 -0      libkstapp/equationdialog.cpp  
 M  +3 -0      libkstapp/eventmonitordialog.cpp  
 M  +3 -0      libkstapp/filterfitdialog.cpp  
 M  +3 -0      libkstapp/histogramdialog.cpp  
 M  +2 -0      libkstapp/imagedialog.cpp  
 M  +3 -0      libkstapp/powerspectrumdialog.cpp  
 M  +16 -1     libkstmath/psd.cpp  
 M  +3 -0      libkstmath/psd.h  


--- branches/work/kst/portto4/kst/src/libkstapp/basicplugindialog.cpp #1320092:1320093
@@ -18,6 +18,7 @@
 #include "datacollection.h"
 #include "document.h"
 #include "basicplugin.h"
+#include "updatemanager.h"
 
 #include <QMessageBox>
 
@@ -89,6 +90,7 @@
 
     return 0;
   }
+  UpdateManager::self()->doUpdates(true);
 
   return dataObject;
 }
@@ -107,6 +109,8 @@
     plugin->registerChange();
     plugin->unlock();
   }
+  UpdateManager::self()->doUpdates(true);
+
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/csddialog.cpp #1320092:1320093
@@ -30,6 +30,7 @@
 #include "image.h"
 
 #include "datacollection.h"
+#include "updatemanager.h"
 
 #include <QPushButton>
 
@@ -276,6 +277,7 @@
           }
       }
   }
+  UpdateManager::self()->doUpdates(true);
 
   return ObjectPtr(image.data());
 }
@@ -343,6 +345,8 @@
       csd->unlock();
     }
   }
+  UpdateManager::self()->doUpdates(true);
+
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/curvedialog.cpp #1320092:1320093
@@ -27,6 +27,7 @@
 #include "datacollection.h"
 #include "document.h"
 #include "objectstore.h"
+#include "updatemanager.h"
 
 #include <QPushButton>
 
@@ -473,6 +474,8 @@
       }
   }
 
+  UpdateManager::self()->doUpdates(true);
+
   return ObjectPtr(curve.data());
 }
 
@@ -591,6 +594,8 @@
       _curveTab->curveAppearance()->setWidgetDefaults(false);
     }
   }
+
+  UpdateManager::self()->doUpdates(true);
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/equationdialog.cpp #1320092:1320093
@@ -22,6 +22,7 @@
 #include "curve.h"
 #include "document.h"
 #include "objectstore.h"
+#include "updatemanager.h"
 
 #include <QPushButton>
 
@@ -382,6 +383,8 @@
       }
   }
 
+  UpdateManager::self()->doUpdates(true);
+
   return ObjectPtr(equation.data());
 }
 
@@ -418,6 +421,8 @@
       equation->unlock();
     }
   }
+  UpdateManager::self()->doUpdates(true);
+
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/eventmonitordialog.cpp #1320092:1320093
@@ -20,6 +20,7 @@
 #include "objectstore.h"
 
 #include "eventmonitorentry.h"
+#include "updatemanager.h"
 
 namespace Kst {
 
@@ -329,6 +330,7 @@
   eventMonitor->writeLock();
   eventMonitor->registerChange();
   eventMonitor->unlock();
+  UpdateManager::self()->doUpdates(true);
 
   return ObjectPtr(eventMonitor.data());
 }
@@ -382,6 +384,7 @@
       eventMonitor->unlock();
     }
   }
+  UpdateManager::self()->doUpdates(true);
   return dataObject();}
 
 }
--- branches/work/kst/portto4/kst/src/libkstapp/filterfitdialog.cpp #1320092:1320093
@@ -20,6 +20,7 @@
 #include "objectstore.h"
 #include "curve.h"
 #include "labelitem.h"
+#include "updatemanager.h"
 
 #include <QMessageBox>
 
@@ -297,6 +298,7 @@
   }
 
   _filterFitTab->configWidget()->save();
+  UpdateManager::self()->doUpdates(true);
 
   return dataObject;
 }
@@ -314,6 +316,7 @@
     plugin->registerChange();
     plugin->unlock();
   }
+  UpdateManager::self()->doUpdates(true);
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/histogramdialog.cpp #1320092:1320093
@@ -29,6 +29,7 @@
 
 #include "datacollection.h"
 #include "dialogdefaults.h"
+#include "updatemanager.h"
 
 namespace Kst {
 
@@ -444,6 +445,7 @@
           }
       }
   }
+  UpdateManager::self()->doUpdates(true);
   return ObjectPtr(histogram.data());
 }
 
@@ -493,6 +495,7 @@
       setHistogramDefaults(histogram);
     }
   }
+  UpdateManager::self()->doUpdates(true);
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/imagedialog.cpp #1320092:1320093
@@ -26,6 +26,7 @@
 #include "image.h"
 #include "document.h"
 #include "objectstore.h"
+#include "updatemanager.h"
 
 #include "datacollection.h"
 
@@ -608,6 +609,7 @@
       image->unlock();
     }
   }
+  UpdateManager::self()->doUpdates(true);
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/powerspectrumdialog.cpp #1320092:1320093
@@ -26,6 +26,7 @@
 #include "tabwidget.h"
 #include "view.h"
 #include "editmultiplewidget.h"
+#include "updatemanager.h"
 
 #include <QPushButton>
 
@@ -293,6 +294,7 @@
           }
       }
   }
+  UpdateManager::self()->doUpdates(true);
 
   return ObjectPtr(powerspectrum.data());
 }
@@ -364,6 +366,7 @@
       _powerSpectrumTab->FFTOptionsWidget()->setWidgetDefaults();
     }
   }
+  UpdateManager::self()->doUpdates(true);
   return dataObject();
 }
 
--- branches/work/kst/portto4/kst/src/libkstmath/psd.cpp #1320092:1320093
@@ -50,6 +50,7 @@
 
 PSD::PSD(ObjectStore *store)
 : DataObject(store) {
+  _changed = true;
   _typeString = staticTypeString;
   _type = "PowerSpectrum";
   _initializeShortName();
@@ -106,6 +107,7 @@
   _fVector->resize(_PSDLength);
   _sVector->resize(_PSDLength);
 
+  _changed = true;
   updateVectorLabels();
 }
 
@@ -141,7 +143,7 @@
   // if averaging, then we want enough new data for a complete subset.
   // ... unless we are counting from end at fixed length (scrolling data).
   bool scrolling_data = (_last_n == iv->length());
-  if ( ((_last_n_new < _PSDLength/16) ||
+  if ( (!_changed) && ((_last_n_new < _PSDLength/16) ||
         (_Average && scrolling_data && (_last_n_new < _PSDLength/16)) ||
         (_Average && !scrolling_data && (n_subsets - _last_n_subsets < 1))) &&
        iv->length() != iv->numNew()) {
@@ -149,6 +151,8 @@
     return;
   }
 
+  _changed = false;
+
   _adjustLengths();
 
   double *psd = _sVector->value();
@@ -192,6 +196,7 @@
     }
 
     _last_n_subsets = 0;
+    _changed = true;
   }
 }
 
@@ -223,6 +228,7 @@
 
 void PSD::setApodize(bool in_apodize)  {
   _Apodize = in_apodize;
+  _changed = true;
 }
 
 
@@ -233,6 +239,7 @@
 
 void PSD::setRemoveMean(bool in_removeMean) {
   _RemoveMean = in_removeMean;
+  _changed = true;
 }
 
 
@@ -243,6 +250,7 @@
 
 void PSD::setAverage(bool in_average) {
   _Average = in_average;
+  _changed = true;
 }
 
 
@@ -257,6 +265,7 @@
   } else {
     _Frequency = 1.0;
   }
+  _changed = true;
 }
 
 
@@ -269,6 +278,7 @@
   if (in_length != _averageLength) {
     _averageLength = in_length;
   }
+  _changed = true;
 }
 
 
@@ -281,6 +291,7 @@
   if (in_output != _Output) {
     _Output = in_output;
   }
+  _changed = true;
 }
 
 
@@ -303,6 +314,7 @@
   _inputVectors.remove(INVECTOR);
   new_v->writeLock();
   _inputVectors[INVECTOR] = new_v;
+  _changed = true;
 }
 
 
@@ -355,6 +367,7 @@
   if (_apodizeFxn != in_apodizeFxn) {
     _apodizeFxn = in_apodizeFxn;
   }
+  _changed = true;
 }
 
 
@@ -367,6 +380,7 @@
   if (_gaussianSigma != in_gaussianSigma) {
     _gaussianSigma = in_gaussianSigma;
   }
+  _changed = true;
 }
 
 
@@ -407,6 +421,7 @@
   if (interpolate != _interpolateHoles) {
     _interpolateHoles = interpolate;
   }
+  _changed = true;
 }
 
 void PSD::updateVectorLabels() {
--- branches/work/kst/portto4/kst/src/libkstmath/psd.h #1320092:1320093
@@ -97,6 +97,8 @@
         double in_gaussianSigma = 3.0, PSDType in_output = PSDAmplitudeSpectralDensity, bool interpolateHoles = false);
     virtual void internalUpdate();
 
+    void setChanged() { _changed=true;}
+
   protected:
 
     PSD(ObjectStore *store);
@@ -133,6 +135,7 @@
     QString _rateUnits;
 
     VectorPtr _sVector, _fVector;
+    bool _changed;
 };
 
 typedef SharedPtr<PSD> PSDPtr;


More information about the Kst mailing list