Bug 241400 - clarify when scaleExpression is evaluated
Summary: clarify when scaleExpression is evaluated
Status: RESOLVED NOT A BUG
Alias: None
Product: kst
Classification: Applications
Component: documentation (show other bugs)
Version: 1.7.0
Platform: Debian unstable Linux
: NOR wishlist
Target Milestone: ---
Assignee: Philip Rodrigues
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 11:25 UTC by Timo Lindfors
Modified: 2010-06-15 00:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
document many built-in variables (2.67 KB, patch)
2010-06-14 22:40 UTC, Timo Lindfors
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Lindfors 2010-06-11 11:25:00 UTC
Version:           1.7.0 (using KDE 4.4.3) 
OS:                Linux

If I set the "maxExp" part of scaleExpression to "[P1/XMax]" the axis is scaled so that the last samples of P1 are visible. However, if P1 gets more data then scaling is not reapplied. Is this intentional or a bug? If it is intentional then I suggest it should be documented. How about something like

"The expression is not reevaluated if new data is added."


Reproducible: Didn't try
Comment 1 Andrew Walker 2010-06-11 21:29:25 UTC
This is because [P1/XMax] gives the maximum x-value (XMax) visible in Plot 1 (P1). So if you specify the To as [P1/XMax] then essentially what you're doing is XMax = XMax, and so XMax will never change.

What you probably want to do is use [1/Max] where 1 is a vector.

Then everything should work as expected.
Comment 2 Timo Lindfors 2010-06-12 12:50:03 UTC
I started

perl -e 'use Time::HiRes; my $i = 0; for (;;) { printf("%f\n", sin($i/10000)); $i++; Time::HiRes::usleep(100); }' | sid kst -y 1 stdin

and set the range expressions as follows:

from: [1/Max] - 10000
to: [1/Max]

This shows me data from -10000 to 0. So apparently [1/Max] is the maximum value of the vector? Next I tried [1/MaxIndex]. It shows me data from 6000 to 16000 but does not update the scale as new data comes in.

Can you confirm the same behavior?
Comment 3 Timo Lindfors 2010-06-12 12:54:57 UTC
It seems that using "[INDEX/Max] - 10000" and "[INDEX/Max] + 10000" shows the new data and is updated when new data comes in. Maybe there's some bug that prevents MaxIndex from being re-evaluated?
Comment 4 Andrew Walker 2010-06-14 21:54:04 UTC
[1/MinIndex] and [1/MaxIndex] give, respectively, the index of the minimum 
and maximum value of a vector.

In the example you give [1/MinIndex] and [1/MaxIndex] become 47109 and 
15693, respectively - once sufficient data has been read in.

The value that you want to be using is probably [1/NS], where NS stands for 
number of samples.

Hope that helps,

Andrew

----- Original Message ----- 
From: "Timo Lindfors" <timo.lindfors@iki.fi>
To: <arwalker@sumusltd.com>
Sent: Saturday, June 12, 2010 3:50 AM
Subject: [Bug 241400] clarify when scaleExpression is evaluated


> https://bugs.kde.org/show_bug.cgi?id=241400
>
>
>
>
>
> --- Comment #2 from Timo Lindfors <timo lindfors iki fi>  2010-06-12 
> 12:50:03 ---
> I started
>
> perl -e 'use Time::HiRes; my $i = 0; for (;;) { printf("%f\n", 
> sin($i/10000));
> $i++; Time::HiRes::usleep(100); }' | sid kst -y 1 stdin
>
> and set the range expressions as follows:
>
> from: [1/Max] - 10000
> to: [1/Max]
>
> This shows me data from -10000 to 0. So apparently [1/Max] is the maximum 
> value
> of the vector? Next I tried [1/MaxIndex]. It shows me data from 6000 to 
> 16000
> but does not update the scale as new data comes in.
>
> Can you confirm the same behavior?
>
> -- 
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
Comment 5 Timo Lindfors 2010-06-14 22:40:14 UTC
Created attachment 48010 [details]
document many built-in variables
Comment 6 Andrew Walker 2010-06-15 00:12:37 UTC
SVN commit 1138006 by arwalker:

CCBUG:241400 add description of scalar values generated from datasource, plots, and vectors

 M  +133 -0    equation-appendix.docbook  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1138006
Comment 7 Timo Lindfors 2010-06-15 00:35:19 UTC
Thanks for adding MinPos too, I'd never been able to guess it correctly :-)