Bug 250014 - KST Equations are KO when using vector/mean if the vector name contains special characters, it generates constant value of 0
Summary: KST Equations are KO when using vector/mean if the vector name contains speci...
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: equations (show other bugs)
Version: 2.0.1
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: 2.0.1
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-03 14:33 UTC by Grégoire Verlut
Modified: 2010-11-12 10:37 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 Grégoire Verlut 2010-09-03 14:33:30 UTC
Version:           2.0.1
OS:                MS Windows

I try to create an equation object from the data manager. I entered the expression, in my case a constant expression: [WGS84 Altitude [m]:Mean (X149)]
and the generated y vector contains only 0 value.

However when viewing the scalars : Data > View Scalars... I can see the value of
[WGS84 Altitude [m]:Mean (X149)]

I guess it comes from the "[m]" which is not escaped

Reproducible: Always

Steps to Reproduce:
just use a vector which name contains '[' or ']'

Actual Results:  
the equation expression is not stored and the generated y vector contains 0

Expected Results:  
the equation should have been stored in kst and the generated y vector should contain the computed value

OS: Windows 32-Bit
Comment 1 Grégoire Verlut 2010-09-06 14:24:16 UTC
The legend and labels are also not escaping the specials characters.

Ie my vector "WGS84 Altitude [m]" becomes "WGS84 Altitude " when its name is used in legend/labels.

As well the "insert scalar in label" is stuck with my vector because of the [] characters.


Regards

Grégoire
Comment 2 Nicolas Brisset 2010-09-08 16:44:45 UTC
Haven't we had that before?
Comment 3 Netterfield 2010-09-09 18:56:09 UTC
I partially 'fixed' this problem with _ in names by escaping the character '_' when used in automatic names.

IE, "WGS84 Altitude [m]" would appear as "WGS84 Altitude \[m\]" in the kst UI, but as "WGS84 Altitude [m]" when shown in labels.

We might be able to do better than this for '[]' though.  I'll look into it.
Comment 4 Netterfield 2010-11-01 21:20:13 UTC
SVN commit 1192057 by netterfield:

BUG: 250014
Handle special characters in field and vector names.
i) the characters _^[] in field names are escaped with \ so they
appear properly in automatically generated labels.  So, a data vector of the 
field GY_AZ will appear in the UI as "GY\_AZ (V2)" and as GY_AZ in automatic
labels.  The same applies to scalars, strings, and matrixes.

ii) the characters [] are removed from the descriptive names of vectors when they
are used in equations.  So a Vector called "WGS84 Altitude [m] (V4)" will appear in
in the equation as "[WGS84 Altitude m (V4)]" but will otherwise work as expected.
The same applies to matrixes and scalars.




 M  +6 -1      src/libkst/datamatrix.cpp  
 M  +7 -1      src/libkst/datascalar.cpp  
 M  +7 -1      src/libkst/datastring.cpp  
 M  +9 -2      src/libkst/datavector.cpp  
 M  +2 -0      src/libkst/namedobject.cpp  
 M  +3 -1      src/libkstapp/equationdialog.cpp  
 M  +7 -2      src/libkstmath/enodes.cpp  
 M  +4 -4      tests/dirfile_maker/dirfile_maker.c  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1192057
Comment 5 Peter Kümmel 2010-11-12 10:37:09 UTC
There is no version list for "Version Fixed in".
Use Target Milestone as indicator when the bug was fixed.