Component creation - registered properties field

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

I am working on multiple custom components, which have same property field (e.g. Display_Name). So in the "Types..." section of each component I have to declare same custom type "Display_Name_Type", which is quite tedious and strange, since it is same type, shared by many components.

On the other hand, the drop-in menu in Parameters Definition shows many pre-registered parameter types (e.g. AMux_AMuxType, etc.), which registered somewhere once and can be used for all components.

Q: How to declare a custom property type (e.g. "myTestType" ) and register it with Creator, so it would show up in the drop-down menu, and could be shared among multiple components?

/odissey1

Componet_properties_01a.png

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please let me correct the information.

It is true that an empty component, MyTypeComponent, having User-defined type is required.  But MyTypeComponent does not require to have a schematic item.

It is not required to put an instance of MyTypeComponent on the MyComponent schematic.  It is enough that MyTypeComponent is in the same project to MyComponent or a library project listed in the dependency list.

GS004197.png

Regards,

Noriaki

View solution in original post

0 Likes
5 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please refer the document "PSoC® Creator™ Component Author Guide, Document # 001-42697" which can be opened from the menu Help>Documentation>Component Author Guide on the PSoC Creator.

The section "3.3 Add User-Defined Types" will explain how to add user-defined types.

Regards,

Noriaki

0 Likes

NoriakiT_91,

Thank you for response and the reference. I am familiar with the process of creation of the user-defined Type, described in Par.3.3 of the Component Author Guide (for example, "Name_Type"). My problem is that such Type definition is active for one component only (for example, "myComponent1"). If I make another component (e.g. "myComponent2"), I have to repeat the process of defining same user type "Name_Type" within myComponent2 again. And so on... (total about 40 components), which I would like to avoid.

From the drop-down menu (see picture above) I can see that many parameter types appear in Creator by default (for example AMux_AMuxType), like they are "registered" with Creator somehow. Similarly, I want to "register" my type "Name_Type", and re-use it multiple times instead of re-defining it for each component. Unfortunately, Par. 3.3 of the Component Author Guide does not cover that.

/odissey1

0 Likes
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

I don't know this is a solution for you.

Create a component having ENUM in its symbol.

GS004191.png

Create an empty schematic for MyTypeComponent.  This is required to be instanced from other components.

Put the MyTypeComponent instance to your own component.  The component is named as MyComponent for example.

GS004192.png

In the MyComponent's symbol editor,  You can find the MyTypeComponent_MyBaseType in the drop-down list of the Parameters Definition dialogue.

GS004193.png

The ENUM definitions can be contained in the API file as follows.

GS004195.png

GS004196.png

The name is too long.

Regards,

Noriaki

0 Likes
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please let me correct the information.

It is true that an empty component, MyTypeComponent, having User-defined type is required.  But MyTypeComponent does not require to have a schematic item.

It is not required to put an instance of MyTypeComponent on the MyComponent schematic.  It is enough that MyTypeComponent is in the same project to MyComponent or a library project listed in the dependency list.

GS004197.png

Regards,

Noriaki

0 Likes

NoriakiT_91,

Thank you for clear explanation. Silly me! I looked carefully into drop-down menu and sure enough all properties are there for re-use. I should have missed them due to large number of entries. I definitely must cut down on coffee consumption.

Thanks again.

/odissey1

0 Likes