Bug 118704 - "Samples" field in data wizard is not updated for unused vectors
Summary: "Samples" field in data wizard is not updated for unused vectors
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Solaris
: HI normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-20 11:57 UTC by Nicolas Brisset
Modified: 2006-03-13 20:20 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 Nicolas Brisset 2005-12-20 11:57:04 UTC
Version:           1.2.0_devel (using KDE 3.4.0, compiled sources)
Compiler:          gcc version 3.4.3
OS:                SunOS (sun4u) release 5.8

I have just spent quite some time figuring out why vectors had only 1 sample when created with the "Change data file" dialog. As it turned out they actually had more, but the curves did not get created (as I've just reported separately) and the sample count of new vectors was not updated. 
This is quite misleading and "not nice", though not blocking. It should probably be fixed at some point (though maybe not required for 1.2.0).

Note: an easy way (independent from the "Change data file" dialog) to reproduce this is to plot one curve from a data file, go to the data manager, create a new vector from the same file with the "New vector" button on the left and look at the sampe number indicated in the data manager.
Comment 1 George Staikos 2005-12-20 16:02:03 UTC
  This is true though.  There are no samples loaded in that vector.  They 
won't be loaded until they're needed.  It would be even more unexpected to 
see 1000 samples listed, but then open the vector to find it empty.
Comment 2 Nicolas Brisset 2005-12-20 16:13:24 UTC
OK, I understand. To solve the UI issue, I'd suggest writing something like "-" or "N/A" in the "Samples" column to make it clear that it does not contain only 1 point, but instead is in a special state.
Comment 3 Andrew Walker 2005-12-20 19:08:52 UTC
SVN commit 490073 by arwalker:

CCBUG:118704 If vector is not in use then display Samples as -. Should this also be done for curves, histograms, equations, etc?

 M  +12 -2     kstdatamanager_i.cpp  


--- trunk/extragear/graphics/kst/kst/kstdatamanager_i.cpp #490072:490073
@@ -161,7 +161,12 @@
           _inUse = inUse;
           setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
         }
-        QString field = QString::number(x->length());
+        QString field;
+        if (inUse) {
+          field = QString::number(x->length());
+        } else {
+          field = "-";
+        }
         if (text(3) != field) {
           setText(3, field);
         }
@@ -189,7 +194,12 @@
           _inUse = inUse;
           setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
         }
-        QString field = QString::number(x->length());
+        QString field;
+        if (inUse) {
+          field = QString::number(x->length());
+        } else {
+          field = "-";
+        }
         if (text(3) != field) {
           setText(3, field);
         }
Comment 4 Nicolas Brisset 2005-12-21 09:48:50 UTC
I think we have to pay special attention to the information presented in the UI. My experience with introducing new users to kst is that it takes some time for them to understand what objects are being manipulated and how they interact and they tend to be overwhelmed at the beginning. In that respect, the data manager is a good help, provided that the information shown is not misleading. 
This is the reason I wrote this report, and I think it is a good idea to review quickly the various states all objects can have, and make sure that the information shown to the user is consistent. So, yes, I believe the same kind of fix should be applied to other objects too.
Just one example: if you create an equation, currently it shows "0" samples, which is a bit strange. The samples field should probably be left empty for equations, plugins, histograms, etc, and only contain the sample number for their slave vectors.
Comment 5 Andrew Walker 2006-01-26 19:49:21 UTC
Should be fixed for 1.2.1 release
Comment 6 Andrew Walker 2006-03-13 20:20:49 UTC
SVN commit 518340 by arwalker:

BUG:118704 Display '-' rather than '0' for objects that do not themselves contain vector entries, but whose slave vectors do.

 M  +9 -3      kstdatamanager_i.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kstdatamanager_i.cpp #518339:518340
@@ -260,9 +260,15 @@
           _inUse = inUse;
           setPixmap(2, inUse ? _dm->yesPixmap() : QPixmap());
         }
-        field = QString::number(x->sampleCount());
-        if (text(3) != field) {
-          setText(3, field);
+        if (x->sampleCount() > 0) {
+          field = QString::number(x->sampleCount());
+          if (text(3) != field) {
+            setText(3, field);
+          }
+        } else {
+          if (text(3) != "-") {
+            setText(3, "-");
+          }          
         }
         field = x->propertyString();
         if (text(4) != field) {