iTools System object bug ?? [message #47821] |
Mon, 06 March 2006 02:41  |
Antonio Santiago
Messages: 201 Registered: February 2004
|
Senior Member |
|
|
Hi group,
this is a happy iTools question. I know major part of you are fans of
iTools and I hope you can help me. (Sorry, this is a little joke, I dont
want to cause the wrath of gods against me).
Well, the question is in iTools is supossed that IDLitSystem object is a
singleton (implemented as common code). Only exist one object System and
can exists manu "tools" objects.
Take a look at the following code (I think it is right :) ).
****
Before execute, put a line in your "IDLitSystem::Init" object (something
like "PRINT, 'Initialized System'".
****
The code creates an "Image Tool" (IDLitToolImage), then creates a
IDitData object and stores it in the component hieriarchy.
The problem is that if you use the "AddByIdentifier" with a fully
qualified identifier then two System object will be created !!!
PRO test2
idTool = IDLitSys_CreateTool('Image Tool')
idt = ITGetCurrent(TOOL=oTool)
da = OBJ_NEW('IDLitData', NAME='data_a')
a = bindgen(10,10)
r = da->SetData(a)
oTool->AddByIdentifier, 'Layers', da
;; Uncomment this and two IDLitSystem object will be created. Is
;; this right???
; oTool->AddByIdentifier, '/Layers', da
END
Any sugestions or ideas??
Is correct that exists two different System object? I think not, but
also the above code can be wrong.
Thanks.
--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
|
|
|
Re: iTools System object bug ?? [message #47870 is a reply to message #47821] |
Wed, 08 March 2006 09:47  |
codepod
Messages: 19 Registered: March 2006
|
Junior Member |
|
|
Antonio,
You are correct, this is a bug. There should only ever be 1 system
object.
This issue is in _IDLitComponent::AddByIdentifier and it's ability to
dynamically create new folders in the iTools hierarchy.
To get around this you could manually walk the iTools hierarchy, find
your target location for your data object and add it.
I passed this on to someone I know at RSI and it will be filed as a
defect.
Cheers
Antonio Santiago wrote:
> Hi group,
> this is a happy iTools question. I know major part of you are fans of
> iTools and I hope you can help me. (Sorry, this is a little joke, I dont
> want to cause the wrath of gods against me).
>
> Well, the question is in iTools is supossed that IDLitSystem object is a
> singleton (implemented as common code). Only exist one object System and
> can exists manu "tools" objects.
>
> Take a look at the following code (I think it is right :) ).
>
>
> ****
> Before execute, put a line in your "IDLitSystem::Init" object (something
> like "PRINT, 'Initialized System'".
> ****
>
>
> The code creates an "Image Tool" (IDLitToolImage), then creates a
> IDitData object and stores it in the component hieriarchy.
> The problem is that if you use the "AddByIdentifier" with a fully
> qualified identifier then two System object will be created !!!
>
> PRO test2
>
> idTool = IDLitSys_CreateTool('Image Tool')
> idt = ITGetCurrent(TOOL=oTool)
>
> da = OBJ_NEW('IDLitData', NAME='data_a')
> a = bindgen(10,10)
> r = da->SetData(a)
>
> oTool->AddByIdentifier, 'Layers', da
>
> ;; Uncomment this and two IDLitSystem object will be created. Is
> ;; this right???
> ; oTool->AddByIdentifier, '/Layers', da
>
> END
>
> Any sugestions or ideas??
> Is correct that exists two different System object? I think not, but
> also the above code can be wrong.
>
> Thanks.
>
>
> --
> -----------------------------------------------------
> Antonio Santiago Pérez
> ( email: santiago<<at>>grahi.upc.edu )
> ( www: http://www.grahi.upc.edu/santiago )
> ( www: http://asantiago.blogsite.org )
> -----------------------------------------------------
> GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
> Universitat Politècnica de Catalunya
> -----------------------------------------------------
|
|
|