[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Wed Jun 2 00:00:08 CEST 2004


CVS commit by netterfield: 

Implement PSD properties...
'Each in own plot' produces enough plots in XY+PSD mode.


  M +17 -7     datawizard.ui.h   1.35
  M +2 -0      kstquickpsddialog_i.cpp   1.37


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.34:1.35
@@ -383,5 +383,11 @@ void DataWizard::finished()
   } else if (_multiplePlots->isChecked()) {
     Kst2DPlotPtr p;
-    for (uint i = 0; i < l.count(); ++i) {
+    int n_plots;
+    if (_radioButtonPlotDataPSD->isChecked()) {
+      n_plots = l.count()*2;
+    } else {
+      n_plots = l.count();
+    }
+    for (uint i = 0; i < n_plots; ++i) {
       p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName());
       if (_legends->isChecked()) {
@@ -442,14 +448,18 @@ void DataWizard::finished()
 
     if (_radioButtonPlotPSD->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
-      if (xv->length() > 0) {
+      if ((*it)->length() > 0) {
         name = QString("PSD%1-%2").arg(KST::dataObjectList.count()).arg((*it)->tagName());
         while (KST::dataObjectList.findTag(name) != KST::dataObjectList.end()) {
           name += "'";
         }
+        iLength = _FFTLen->text().toInt();
+        if (iLength<2) iLength = 2;
+        if (iLength>log(double((*it)->length()))/log(2.0))
         iLength = int(ceil(log(double(xv->length())) / log(2.0)));
-        if (iLength > 16) {
-          iLength = 16;
-        }
-        KstBaseCurvePtr c = new KstPSDCurve(name, xv, 1.0, iLength, "", "", KstColorSequence::next());
+
+        double freq = _sampRate->text().toDouble();
+        if (freq<=0) freq = 1.0;
+
+        KstBaseCurvePtr c = new KstPSDCurve(name, *it, freq, iLength, _vectorUnits->text(), _rateUnits->text(), KstColorSequence::next());
         if (_drawBoth->isChecked()) {
           c->setHasPoints(true);

--- kdeextragear-2/kst/kst/kstquickpsddialog_i.cpp  #1.36:1.37
@@ -236,4 +236,6 @@ void KstQuickPSDDialogI::apply(bool auto
       return;
   }
+  if (new_len>log(double(vx->length()))/log(2.0))
+          new_len = int(ceil(log(double(vx->length())) / log(2.0)));
 
   // create the psd curve name





More information about the Kst mailing list