Plotter domainSpecs bug #264

Closed
jleben opened this Issue May 6, 2012 · 3 comments

Comments

Projects
None yet
5 participants
@jleben
Member

jleben commented May 6, 2012

[Issue migrated from SourceForge | ID: 3520169 | Submitted by 'nobody']
[http://sourceforge.net/support/tracker.php?aid=3520169]

Encountered the following problem while editing a Plotview with a mouse:

d = Plotter("domainSpecs_ bug?", Rect(600, 300, 600, 200))
.editMode_(true)
.value = (0, 0.0078125..1);

//edit some values in the plot with the mouse. Works as expected.

d.domainSpecs_([0.0, 10.0, 'linear', 0.1, 1, ""].asSpec); d.refresh;
//note the incorrect behaviour while editing the plot with the mouse.

This happens with the cocoa and qt GUI schemes.
Tested with the latest git 64bit version on OSX 10.7, although I am pretty sure it is an old pre-3.5 bug.

@ghost ghost assigned crucialfelix May 6, 2012

@telephon

This comment has been minimized.

Show comment
Hide comment
@telephon

telephon Sep 29, 2012

Member

For whoever has the time to take a closer look, the problem is most probably in the method Plot:editDataLine.

Member

telephon commented Sep 29, 2012

For whoever has the time to take a closer look, the problem is most probably in the method Plot:editDataLine.

@LucaDanieli

This comment has been minimized.

Show comment
Hide comment
@LucaDanieli

LucaDanieli Mar 21, 2014

Contributor

I do think that the problem is in ControlModel.sc

range { ^maxval - minval }.
When refreshed, maxval = 1 instead of 128, and I guess that this is the reason because the plotter writes only in [0,1].

Contributor

LucaDanieli commented Mar 21, 2014

I do think that the problem is in ControlModel.sc

range { ^maxval - minval }.
When refreshed, maxval = 1 instead of 128, and I guess that this is the reason because the plotter writes only in [0,1].

@LucaDanieli

This comment has been minimized.

Show comment
Hide comment
@LucaDanieli

LucaDanieli Mar 22, 2014

Contributor

Ok.. I have understood where the problem is:

if we want that after the reScaling, the resolution to be the higher, it is a problem of range.
But thinking again about the problem, probably the expected behaviour is that the reScaling (for example from min:0 - max:128 --> min:0 - max:10) has to hold the same resolution.

So, if we write this:
d = Plotter("domainSpecs_ bug?", Rect(600, 300, 600, 200))
.editMode_(true)
.value = (0, 0.0078125..1);

d.domainSpecs_([0.0, 10.0, 'linear', 0.1, 1, ""].asSpec).value = (0, 0.0078125..(1/12.8)); d.refresh

it works fine.
The reason is: when we refresh the plotter, it doesn't set a value.size proportioned to the new grid. So, it still have an array of 128 values.

Unfortunately I don't know how to handle with this problem, as I don't understand where to modify the program (I have tried many things). It should be something very simple I guess. So, if you do it, please give me feedback.

ps: my code sets a new array, and not the reScaling of the previous plot.
Any way, I guess than we could create a new array in the domainSpec_ {} with the size wanted, and later copy (if statement) the old values. This in order to "save" the previous plot with another variable name.

Contributor

LucaDanieli commented Mar 22, 2014

Ok.. I have understood where the problem is:

if we want that after the reScaling, the resolution to be the higher, it is a problem of range.
But thinking again about the problem, probably the expected behaviour is that the reScaling (for example from min:0 - max:128 --> min:0 - max:10) has to hold the same resolution.

So, if we write this:
d = Plotter("domainSpecs_ bug?", Rect(600, 300, 600, 200))
.editMode_(true)
.value = (0, 0.0078125..1);

d.domainSpecs_([0.0, 10.0, 'linear', 0.1, 1, ""].asSpec).value = (0, 0.0078125..(1/12.8)); d.refresh

it works fine.
The reason is: when we refresh the plotter, it doesn't set a value.size proportioned to the new grid. So, it still have an array of 128 values.

Unfortunately I don't know how to handle with this problem, as I don't understand where to modify the program (I have tried many things). It should be something very simple I guess. So, if you do it, please give me feedback.

ps: my code sets a new array, and not the reScaling of the previous plot.
Any way, I guess than we could create a new array in the domainSpec_ {} with the size wanted, and later copy (if statement) the old values. This in order to "save" the previous plot with another variable name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment