264 views
in GUI Development by
Hi,

I want to create one .h file having the enum which I've listed inside of one unit named A_ and the enum  named B_ inside of unit A_
I've added one Enum item named C inside of enum B_
So after generating code by build this profile, the A_.h file for unit A_ got generated, with that typedef enum of A_B_ is generating, with enum member as A_B_C I'm able to get
But I need one requirement, say I want to get the typedef enum in lower case a_b_
Is there any way to customize the build and code generation to achieve this requirement, and also I want to generate this A_.h file alone in one particular directory path

Kindly please suggest one solution

Dinesh

1 Answer

0 votes
by

Hello Dinesh,

Is there any way to customize the build and code generation to achieve this requirement, and also I want to generate this A_.h file alone in one particular directory path

Using the attribute OutputIncDirectory you could configure a directory common for all header files. Different directories for individual files can't be configured.

I would recommend to:

1. name the unit and the enums already lowercase. For example unit a, enum b and enum item c.

2. use PostProcess attribute to start a command after the code generation is finished. With this command (e.g. .bat or .cmd file) you can 'post process' the generated code and, for example, move one file into another directory.

I hope it helps you further

Best regards

Paul Banach

by
Hi Paul,

I have a requirement to generate all the enum in upper case only, and the typedef enum name should be in lower case. Is there any way you can help me to achieve this requirement

Thanks & Regards

Dinesh
by

Hello Dinesh,

there is no configuration possibility for this special application case. You could use PostProcess to run a script which renames the identifiers. Other approach would be to manage two sets of enums. The EW generated enums and a second set of enums following your name convention.

Best regards

Paul Banach

by
Hi Paul,

So for if I want to add flags for some enum inside of the generated .h files, how can we keep the flags as macro from embedded wizard enum unit itself.
by
Hi Dinesh,

you can't add any flags, etc. to the generated code. Can you explain more in detail your application case? It is not clear for me what you try to achieve.

Best regards

Paul Banach
by
For example if I want to generate a .h file with enum as follows

typedef enum
{
     A_B_C,
$if $flag
     A_B_D,
$endif
     A_B_E,
}A_B_
So for to get the enum as like this, with flag how can we do. So as to get the generated .h file having this flag
by
I think, there is some misunderstanding of the underlying concepts. The generated code corresponds to the project content and it is coherent in itself by taking in account all cross references between members. Interfering with the code, like the if condition may probably lead to compiler errors because of unknown (missing) members.

The best is you consider the generated code as an intermediate code (like object code) you don't need to think about, nor evaluate nor modify.

Nevertheless, it is still unclear for me why do you want a member generated from the project to depend on some (external?) condition?

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...