[changeset] property value not paired with name in __add_datasource__.m
David Bateman
David.Bateman at motorola.com
Mon Sep 1 08:32:20 CDT 2008
Ben Abbott wrote:
>
> On Sep 1, 2008, at 6:30 AM, David Bateman wrote:
>
>> This is not the correct fix as __add_datasource__ is looking for a
>> prop/val pair with the name ?DataSource. It doesn't however make the
>> assumption that the other arguments that are passed are all
>> property/value pairs, and in some cases they are.
>>
>> Trying to generate or error with
>>
>> plot(1:10,1:10,"LineWidth", 3)
>>
>> the code works correctly. I then tried a rebuild of voroni.eps with
>> the changeset I just sent and the build when find. I'd therefore
>> suggest not making the change to __add_datasource__ you suggest..
>>
>> Regards
>> David
>>
>
> octave:1> plot(1:10,1:10,"LineWidth", 3)
> error: set: invalid number of arguments
> error: called from:
> error:
> /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt2vv__.m
> at line 83, column 7
> error:
> /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt2__.m
> at line 68, column 14
> error:
> /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/__plt__.m
> at line 79, column 10
> error:
> /Users/bpabbott/Development/mercurial/octave-3-0-0/scripts/plot/plot.m
> at line 189, column 5
>
> The problem appears to remains.
Is this in the 3.1.51+ sources or the 3.0.2+ sources as implied by
octave-3-0-0 above? I'm assuming its 3.1.51+
Ok, this is odd. This works find here.
>
>> I identified the problem is in __plt2vv__.m
>>
>> [...]
>> 69 hg = hggroup ();
>> 70 retval = hg;
>> 71 properties = __add_datasource__ ("__plt2vv__", hg, {"x", "y",
>> "z"},
>> 72 properties{:});
>> 73
>> 74 h = line (x, y, "keylabel", key, "color", color,
>> 75 "linestyle", options.linestyle,
>> 76 "marker", options.marker, "parent", hg);
>> 77
>> 78 __add_line_series__ (h, hg);
>> 79 if (! isempty (properties))
>> 80 set (hg, properties{:});
>> 81 endif
>>
>> Prior to line 71"properties" is set as
>>
>> {
>> [1,1] = LineWidth
>> [1,2] = 3
>> }
>>
>> Subsequently, "properties is set as
>>
>> {
>> [1,1] = LineWidth
>> }
>
> The scripts __add_datasource__ does not preserve the property values.
>
> I'm confused as to how __add_datasource__ is intended to work. Is this
> behavior correct?
>
> If yours works properly (different, I assume), perhaps our sources
> are out of sync?
The function __add_datasource__ is suppose to find prop/value pairs in
an arbitrary list of arguments that have the property name "?DataSource"
in a case insensitive manner. Thus something like
hg = hggroup();
args{1} = "g+";
args{2} = "YDataSource";
args{3} = "sin(x)";
args = __add_datasource__ ("myfunc", hg, {"x","y"}, args{:});
is supposed to add the properties xdatasource and ydatasource to the
hggroup passed, set ydatasource to the string "sin(x)" and return the
argument list args{1} = "g+";
args
get(hg)
will confirm this. Note that the above is a realistic case that is
supposed to be handled by __add_datasource__ in that the LineStyle is a
single argument and not a property/value pair. Now the issue you are
seeing is characterized by
clear all
hg = hggroup ();
args {1} = "LineWidth";
args{2} = 3;
args = __add_datasource__ ("myfunc", hg, {"x", "y","z"}, args{:})
This returns
args =
{
[1,1] = LineWidth
[1,2] = 3
}
for me as it should. Whereas from what you are saying it returns
"LineWdith". Can you confirm
D.
>
> Beb
> Ben
>
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
More information about the Octave-maintainers
mailing list