Bug 142622

Summary: scalar's tag names in equations don't follow tag name changes in parent vectors
Product: [Applications] kst Reporter: Netterfield <netterfield>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: patch to fix equations
patch to update labels with current object names

Description Netterfield 2007-03-06 22:34:08 UTC
Version:           1.4.0_devel (using KDE 3.5.6, Kubuntu (edgy) 4:3.5.6-0ubuntu1~edgy1)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-11-generic

When the tag name of a vector is changed, then everywhere it is used gets the new name (because data objects store vector pointers, not tag strings).

However, this does not follow to derived scalars: if a derived scalar is used in an equation, and the parent vector's tag name is changed, then the equation quits working, rather than following the vector's new name.
Comment 1 Eli Fidler 2007-03-13 00:26:36 UTC
Did we decide what the desired behaviour is in this case? Do we really want the derived scalar to automatically change?

I'm not sure exactly how you're reproducing this bug, but if you (for instance) create a vector V and make an equation [V/Mean], then you change the vector name to V2, the equation will no longer work. If you re-parse the equation it will come out as the empty string, since it can't find it's vectors.

In the case of a label, it will come out as whatever you typed originally, but will not show a value.

I think it's probably tricky to make the equations/labels auto-adjust. I suppose we could check the provider of the scalar when re-parsing and use the new name if found, but that would require restructuring the KstEquation. We'd have to add methods to the label and equation parsers to update the object names without re-parsing from the original text.

Is this something we really want for 1.4?
Comment 2 Eli Fidler 2007-03-13 19:25:18 UTC
Created attachment 19962 [details]
patch to fix equations
Comment 3 George Staikos 2007-03-13 19:34:49 UTC
Looks good to me.

On 13-Mar-07, at 2:25 PM, Eli Fidler wrote:

> ------- Additional Comments From eli staikos net  2007-03-13 19:25  
> -------
> Created an attachment (id=19962)
>  --> (http://bugs.kde.org/attachment.cgi?id=19962&action=view)
> patch to fix equations
> _______________________________________________


--
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/
Comment 4 Eli Fidler 2007-03-14 16:25:15 UTC
Created attachment 19974 [details]
patch to update labels with current object names

This patch doesn't handle dependent objects, only direct references to the
changed objects.
Comment 5 Nicolas Brisset 2007-03-14 16:33:45 UTC
Could you just elaborate a bit more (aka give a concrete example) on the limitation wrt indirect dependents ?
Comment 6 Eli Fidler 2007-03-14 17:00:56 UTC
If you have a vector V and you use [V/Mean] in a label, then you change V to V2, the label will not get updated. We haven't figured out the proper way to handle this case yet.
Comment 7 Nicolas Brisset 2007-03-14 17:04:55 UTC
OK, that's clear... and unfortunately annoying : as vector names are unique, when a vector V is renamed to V2 there should probably not be any objects referencing the old name left behind. Is the problem conceptual (like in some cases we don't know what to do) or for the implementation ?
Comment 8 George Staikos 2007-03-14 23:53:45 UTC
It adds a bit of performance impact to label rendering and I'm not  
excited that the render function takes some extra parameters, but it  
looks generally okay and you can commit it.  We can clean it up for 2.

--
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/
Comment 9 Netterfield 2007-03-28 18:05:49 UTC
This has been fixed for equations by Eli... seems to work well.
(note - it doesn't change the tagName of the equation... and until we come up with realtime auto tagnames, it shouldn't)
Comment 10 Eli Fidler 2007-03-29 20:26:17 UTC
I've committed a patch (647867) which fixes dependent objects as well. Equations (and labels) should be working now.