bug/feature in dbFindProp?

S

Sefano Zanella

Guest
Hi,

I am using dbFindProp to figure out whether a certain property exists
in an instance of a cell. If the property exists, and it contains the
default value, dpFindProp will not find it. Example: Capacitor C3,
property c. In my case, 1p (the default in the CDF form) will make
dbFindProp return nil, but 1.000p will not. I can not find any reference
of this in the documentation.

Is there something I am missing? I am sorry that I can not provide a
test case.

Any comments?
Thanks,
Stefano
 
Hi Stephane,

Thanks a lot for your answer. I thought it could be something like
this. However, this is inconsistent with the following case (which shows
the same behaviour):
1) change the default value of a property to something else ->
dbFindProp returns the property
2) change the property value to the default -> dbFindProp returns nil

Please note that you have to use the default "string" value. For
instance, for a resistor from the analog lib, the default is "1K Ohms".
The value "1.000K Ohms" will not show the problem. Turning it back to
"1K Ohms" will show the problem again.

Regards,
Stefano

S. Badel wrote:
There is a 'storeDefault' attribute in the CDF that
defines wether a properties with default values are stored on an
instance's CDF initially. If not, then these properties do not exist
initially - only after they get a value will they exist.

to find out, use

value = cdfFindParamByName(cdfGetInstCDF( inst ) "MYPROP" )~>value

if you know the parameter is a cdf parameter.

stéphane


Sefano Zanella wrote:

Hi,

I am using dbFindProp to figure out whether a certain property exists
in an instance of a cell. If the property exists, and it contains the
default value, dpFindProp will not find it. Example: Capacitor C3,
property c. In my case, 1p (the default in the CDF form) will make
dbFindProp return nil, but 1.000p will not. I can not find any
reference of this in the documentation.

Is there something I am missing? I am sorry that I can not provide a
test case.

Any comments?
Thanks,
Stefano
 
Let me check: I am unfamiliar with digital :) lowercase or uppercase?
Thanks,
Stefano
S. Badel wrote:
Hum... Apparently Analog and Compatibility modes are equal with respect to
CDF. Does it work when set to Digital?

stéphane


Sefano Zanella wrote:

Hi Stephane,

Do you think that dbGet would work in this case? I see solution
1844658 on sourcelink that says that it shouldn't work (using 5033)
but it seems to work for me regardless of the settings of the
environment variable. Am I missing something or does it really work?

Thanks a lot!
Stefano

PS: I am using both 5033 and 5141

S. Badel wrote:

Then I have a follow up question: how do I figure out the list of
properties that exist in the CDF form but contain the default
"value" (i.e. a value that is really identical to the default)?




here's a suggestion

defProps = setof(
cdfParam
cdfGetInstCDF( inst )~>parameters
!dbFindPropByName( inst cdfParam~>name
)

cheers,

stéphane
 
I have tried with digital and Digital. They both work. Or I screwed up
my test cases :)
Stefano

Sefano Zanella wrote:
Let me check: I am unfamiliar with digital :) lowercase or uppercase?
Thanks,
Stefano
S. Badel wrote:

Hum... Apparently Analog and Compatibility modes are equal with
respect to
CDF. Does it work when set to Digital?

stéphane


Sefano Zanella wrote:

Hi Stephane,

Do you think that dbGet would work in this case? I see solution
1844658 on sourcelink that says that it shouldn't work (using 5033)
but it seems to work for me regardless of the settings of the
environment variable. Am I missing something or does it really work?

Thanks a lot!
Stefano

PS: I am using both 5033 and 5141

S. Badel wrote:

Then I have a follow up question: how do I figure out the list of
properties that exist in the CDF form but contain the default
"value" (i.e. a value that is really identical to the default)?





here's a suggestion

defProps = setof(
cdfParam
cdfGetInstCDF( inst )~>parameters
!dbFindPropByName( inst cdfParam~>name
)

cheers,

stéphane
 

Welcome to EDABoard.com

Sponsor

Back
Top