- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know this is a solution for you.
Create a component having ENUM in its symbol.
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.
In the MyComponent's symbol editor, You can find the MyTypeComponent_MyBaseType in the drop-down list of the Parameters Definition dialogue.
The ENUM definitions can be contained in the API file as follows.
The name is too long.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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