[Kst] Sort of serious bug...

D. V. Wiebe dvw at ketiltrout.net
Tue Mar 10 00:23:02 UTC 2015


On Sat, Mar 07, 2015 at 01:49:22PM -0500, Barth Netterfield wrote:
[...]
> The problem is not the syntax.  That hasn't changed.  It is the naming of 
> objects in the session itself which is the issue.
> 
> in kst, the short names for scalars starts at X1 and goes up as each scalar is 
> added.  So, if you start kst with a 2.0 session and then create some vectors, 
> then the 'slave' scalars will be named X1 to X12.  The scalars from the 2nd 
> vector will be called X13 to X24, etc.  These names are set by the inherited 
> NamedObject constructor at construction time, based on some internal 
> variables.  
> 
> In a 2.0.9 session, vectors have two new slave scalars, so the numbers go from 
> X1 - X14, then X15 - X26, etc.
> 
> When you use a scalar (say in a label or in an equation) then it is referred 
> to by its short name (the full name is included, but ignored).  So if the 
> index of the slave scalar name is changed, then all references to it will be 
> broken.

Okay, I took a closer look at a .kst file.  I think the real problem is
you're simply too unnecessarily brief when writing out the session.  All
you store is the initialXNum per vector, which simply isn't enough
information, given that the list of autoscalars is mutable.  Just drop
initialXnum from the vector definition and replace it with an explicit
list of the automatically generated vector scalars in the .kst file
along the lines of:

  <datavector descriptiveName="FOO" initialVNum="1" ... />
  <autoscalar initialVNum="1" datum="Max"  initialXNum="1" />
  <autoscalar initialVNum="1" datum="Min"  initialXNum="2" />
  <autoscalar initialVNum="1" datum="Last" initialXNum="3" />

and the problem should be solved from now on because it enables the .kst
file parser to detect missing automatic scalars in old .kst files and
regenerate them when needed.

Regenerating missing scalars will either require renumbering all scalars,
in order to insert missing data in the right place, or else, and this
is the one I'd reccommend: stop assuming the automatic scalars are
consecutive in scalar-shotname-space and just remember the shortname of
each of the automatic scalars per vector (this ties in nicely with
explicitly listing them in the .kst file).

Cheers,
-dvw
PS.  Is this why I could never get any traction on requests to add the
ability to access Dirfile-supplied vector scalars, ie.:

  vector/datum CONST FLOAT64 -3.81

with kst?
-- 
Don Wiebe                                   dvw at phas.ubc.ca
Department of Physics and Astronomy
University of British Columbia              Hennings 204
6224 Agricultural Road                      Tele: +1-604-822-2585
University Endowment Lands, BC
Canada   V6T 1Z1                            http://ketiltrout.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kst/attachments/20150309/1206688b/attachment.sig>


More information about the Kst mailing list