[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Wed Sep 1 23:39:47 CEST 2004


CVS commit by arwalker: 

If we have changed data files then make sure we recalculate any PSDs. If the number of samples if equal to the number of new samples then its safe to assume that the data file was changed, and so we recalculate the PSD. Previously this was not happening and so the PSD would remain the PSD of the old vector data.


  M +9 -8      kstpsdcurve.cpp   1.38


--- kdeextragear-2/kst/kst/kstpsdcurve.cpp  #1.37:1.38
@@ -236,5 +234,8 @@ KstObject::UpdateType KstPSDCurve::updat
   _last_n_new += iv->numNew();
 
-  if ((_last_n_new < _PSDLen/16) && (n_subsets - _last_n_subsets < 1) && !force) {
+  if (_last_n_new < _PSDLen/16          &&
+      n_subsets - _last_n_subsets < 1   &&
+      iv->sampleCount() != iv->numNew() &&
+      !force                            ) {
     return NO_CHANGE;
   }
@@ -262,6 +263,6 @@ KstObject::UpdateType KstPSDCurve::updat
         );
     }
-    if (copyLen>1) {
-      mean/=(double)copyLen;
+    if (copyLen > 1) {
+      mean /= (double)copyLen;
     }
     
@@ -321,5 +322,5 @@ KstObject::UpdateType KstPSDCurve::updat
       MinPosY = y;
     }
-    mean +=y;
+    mean += y;
   }
 
@@ -327,10 +328,10 @@ KstObject::UpdateType KstPSDCurve::updat
     MeanY = mean/_PSDLen;
   } else {
-    MeanY = 0; // should never ever happen...
+    MeanY = 0.0; // should never ever happen...
   }
 
   NS = _PSDLen;
 
-  if (_Freq <= 0) {
+  if (_Freq <= 0.0) {
     _Freq = 1.0;
   }





More information about the Kst mailing list