Bug 83943 - Enhance Data Wizard options
Summary: Enhance Data Wizard options
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: HI wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-24 21:22 UTC by Marc-Antoine Miville-Deschenes
Modified: 2004-09-23 01:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-Antoine Miville-Deschenes 2004-06-24 21:22:01 UTC
Version:           0.98-devel (using KDE 3.2.3, compiled sources)
Compiler:          gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
OS:                Linux (i686) release 2.4.20-8smp

1) When PSD and XY are selected in the data wizard, it would be
useful if a XY curve and its corresponding PSD had the same color.

2) Possibility to have all the PSD in log-log, log-linear, linear-log or linear-linear
Comment 1 George Staikos 2004-07-24 18:04:25 UTC
#1 is a problem if the curves end up in the same plot - they will be indistinguishable and basically look like a mess.

#2 would only apply for PSD-only mode, right?  If "XY and PSD" is enabled, how do we plot XY in linear-linear and the PSD in linear-log, for instance, and choose the scale properly?  They might end up in the same plot and the XY will end up in linear-log, or vice versa.  This is also a problem if the user wants to use existing plots for the curves.
Comment 2 Netterfield 2004-09-08 00:04:57 UTC
I can't think of a situation where a vector and its psd would be sensibly displayed in the same plot.  So:

Since it is very common to want log plots of PSD's 
and
since it is completely safe to have curves and their psd's be of the same colour.

... I think both are good suggestions and should be implemented.
Comment 3 Netterfield 2004-09-22 17:27:01 UTC
CVS commit by netterfield: 

Check boxes for log-log, log-linear, etc psds from data wizard
partial fix for 83943

Also fix X-axis assignment in psd curves plotted from data wizard.

Log X mode does not work well now, because f goes to 0... log(0) is -inf...
This needs a workaround.

CCMAIL: 83943@bugs.kde.org


  M +104 -54   datawizard.ui   1.54
  M +21 -8     datawizard.ui.h   1.85
  M +6 -6      kstfilterdialog_i.cpp   1.16



Comment 4 Andrew Walker 2004-09-23 01:32:56 UTC
CVS commit by arwalker: 

This should make the PSD curve the same color as the data curve.
It also make the PSD point style the same as the data point style (if applicable).
I think this now closes 83943, with Bath's earlier fix.

CCMAIL: 83943-done@bugs.kde.org


  M +15 -5     datawizard.ui.h   1.87


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.86:1.87
@@ -385,4 +385,6 @@ void DataWizard::finished()
     KstVectorList l;
     QString name = QString("V%1-%2").arg(KST::vectorList.count()).arg(_xVector->currentText());
+    QValueList<QColor> colors;
+    QColor color;
     uint n_curves = 0;
     uint n_steps = 0;
@@ -533,6 +535,7 @@ void DataWizard::finished()
         if (_radioButtonPlotData->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
             name = KST::suggestCurveName((*it)->tagName());
-            KstBaseCurvePtr c = new KstVCurve(name, xv, *it, 0L, 0L,
-                    KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      color = KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor());
+      colors.append(color);
+      KstBaseCurvePtr c = new KstVCurve(name, xv, *it, 0L, 0L, color);
             if (_drawBoth->isChecked()) {
                 c->setHasPoints(true);
@@ -577,6 +580,8 @@ void DataWizard::finished()
     // create the PSDs...
     //
-    if (_radioButtonPlotPSD->isChecked() ||
-                                _radioButtonPlotDataPSD->isChecked()) {
+    if (_radioButtonPlotPSD->isChecked() || _radioButtonPlotDataPSD->isChecked()) {
+      KstVCurvePtr c;
+      int indexColor = 0;
+      ptype = 0;
         app->slotUpdateProgress(n_steps, prg, i18n("Creating PSDs..."));
         
@@ -593,5 +598,10 @@ void DataWizard::finished()
                         _kstFFTOptions->VectorUnits->text(),
                         _kstFFTOptions->RateUnits->text());
-                KstVCurvePtr c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      if (_radioButtonPlotPSD->isChecked() || colors.count() <= indexColor) {
+                    c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, KstColorSequence::next(static_cast<Kst2DPlot*>((*pit).data())->Curves,static_cast<Kst2DPlot*>((*pit).data())->backgroundColor()));
+      } else {
+                    c = new KstVCurve(name + "-curve", p->vX(), p->vY(), 0L, 0L, colors[indexColor]);
+        indexColor++;
+      }
                 if (_drawBoth->isChecked()) {
                     c->setHasPoints(true);