Get the db object tied to a cdf

C

camelot

Guest
Hello,
in your opinion it is possible to obtain from a CDF callback function
the name of the instance (if an instances exists) that launch that
callbak? That is, if I modify a CDF parameter, that parameter will
unleash a callback. That callback is a function. Inside the code of
that particular function, could I get the name of the db object (or
simply the instance name) tied to the cdf containing the parameter?

Thank you,

Camelot
 
On 28 Mar 2007 07:33:32 -0700, "camelot" <scosmo@tiscalinet.it> wrote:

Hello,
in your opinion it is possible to obtain from a CDF callback function
the name of the instance (if an instances exists) that launch that
callbak? That is, if I modify a CDF parameter, that parameter will
unleash a callback. That callback is a function. Inside the code of
that particular function, could I get the name of the db object (or
simply the instance name) tied to the cdf containing the parameter?

Thank you,

Camelot
No, there is not a clean/safe way of doing this.

It's a bad thing to do - for a start, what would happen on the Create Instance
form? At the time the callback is called, no instance exists yet, so there would
be no instance id available. Note, you can find the instance Id in the doneProc,
since at that stage the instance has been created...

Let me ask things a different way - why do you want to know the instance Id?
We've been discussing this internally recently, and depending on your reason to
know the instance Id, there may be a better way of achieving what you want?

Regards,

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.
 
On 11 Apr, 23:39, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:
On 28 Mar 2007 07:33:32 -0700, "camelot" <sco...@tiscalinet.it> wrote:

Hello,
in your opinion it is possible to obtain from a CDF callback function
the name of the instance (if an instances exists) that launch that
callbak? That is, if I modify a CDF parameter, that parameter will
unleash a callback. That callback is a function. Inside the code of
that particular function, could I get the name of the db object (or
simply the instance name) tied to the cdf containing the parameter?

Thank you,

Camelot

No, there is not a clean/safe way of doing this.

It's a bad thing to do - for a start, what would happen on the Create Instance
form? At the time the callback is called, no instance exists yet, so there would
be no instance id available. Note, you can find the instance Id in the doneProc,
since at that stage the instance has been created...

Let me ask things a different way - why do you want to know the instance Id?
We've been discussing this internally recently, and depending on your reason to
know the instance Id, there may be a better way of achieving what you want?

Regards,

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.
The problem is the following. I'm developing a library of devices that
together built a more complex device. Each instance (a single piece of
the whole) contains two parameters: "tot_area" information referred to
the total device area and "area" refered only to the contribute of the
current cell. If I have already placed other pieces (instances of that
kind), in my CDF I should be able to update the total area present in
the layout. If I have an instance with area 100 and open its property
I see the cell area and the total area already placed, we suppose it
could be 1000. If I modify the area value 100 to 150 the total area
should become 1050 in real time. In order to do that, I take the list
of instances present in the current cellview and through their cdf I
get each "area" property. The problem is that from that list I should
be able to remove the cell I'm editing because it contains the old
area information I had before the property editing (100) and then I
have to sum the current (150) edited value. The question is, how do I
know what is the db to exclude I'm editing? Note that if the operation
is executed on a new instance creation that clearly does not have any
db in the cellview, the problem do not happen because it does not
appear in the list.
I hope have been clear.

Camelot
 
On 12 Apr 2007 23:41:10 -0700, "camelot" <scosmo@tiscalinet.it> wrote:

On 11 Apr, 23:39, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm
wrote:
On 28 Mar 2007 07:33:32 -0700, "camelot" <sco...@tiscalinet.it> wrote:

Hello,
in your opinion it is possible to obtain from a CDF callback function
the name of the instance (if an instances exists) that launch that
callbak? That is, if I modify a CDF parameter, that parameter will
unleash a callback. That callback is a function. Inside the code of
that particular function, could I get the name of the db object (or
simply the instance name) tied to the cdf containing the parameter?

Thank you,

Camelot

No, there is not a clean/safe way of doing this.

It's a bad thing to do - for a start, what would happen on the Create Instance
form? At the time the callback is called, no instance exists yet, so there would
be no instance id available. Note, you can find the instance Id in the doneProc,
since at that stage the instance has been created...

Let me ask things a different way - why do you want to know the instance Id?
We've been discussing this internally recently, and depending on your reason to
know the instance Id, there may be a better way of achieving what you want?

Regards,

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.

The problem is the following. I'm developing a library of devices that
together built a more complex device. Each instance (a single piece of
the whole) contains two parameters: "tot_area" information referred to
the total device area and "area" refered only to the contribute of the
current cell. If I have already placed other pieces (instances of that
kind), in my CDF I should be able to update the total area present in
the layout. If I have an instance with area 100 and open its property
I see the cell area and the total area already placed, we suppose it
could be 1000. If I modify the area value 100 to 150 the total area
should become 1050 in real time. In order to do that, I take the list
of instances present in the current cellview and through their cdf I
get each "area" property. The problem is that from that list I should
be able to remove the cell I'm editing because it contains the old
area information I had before the property editing (100) and then I
have to sum the current (150) edited value. The question is, how do I
know what is the db to exclude I'm editing? Note that if the operation
is executed on a new instance creation that clearly does not have any
db in the cellview, the problem do not happen because it does not
appear in the list.
I hope have been clear.

Camelot
Camelot,

A CDF callback is not the right way to do this. You should have some SKILL which
you call to maintain the total.

Assuming you did somehow get this working, what would happen if one of the
placed instances was deleted? The total would not get updated.

I think it's far safer to avoid overloading an inappropriate callback mechanism
with this, and update the CDF parameters for total_area with some code which
looks at the placed instances, and then call this whenever you need to update
the total.

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.
 

Welcome to EDABoard.com

Sponsor

Back
Top