403 views
in Embedded Wizard Studio by
Hello.

I'd like to share my thoughts on two improvements that are important for GUI development and integration with device.

1. Current version (8.20) of Embedded Wizard exports Enums and Sets during code generation as unnamed enums. This is very inconvenient, especially for Device Driver implementation.
Is it possible to add generation of named enumerations so that it is possible to refer to these types in my source code?

2. Another useful option would be the ability to define Enums and Sets within a class, not only within a Unit. Currently I have to declare all Enums and Sets, used within some class, outside of it!
Is it feasible to implement in next version?

 

Best regards,
Maxim.

1 Answer

0 votes
by

Hello Maxim,

regarding your first question, with the next release we will adapt the code generators to enhance every generated ANSI C enumeration by a name corresponding to the original Chora enum/set definition. For example, the Chora definition Core::ViewState would be generated in ANSI C enumeration typedef enum { ... } CoreViewState. This should allow you to refer the definitions as individual data types from your code. Ayway, this will not prevent the developer from mixing different enumeration types. C treates them not restrictive enough.

Regarding your second question, such adaptation is very complex and not possible. Being focused on the visually aided programming, we designed Chora with a simple, flat type system. Local, nested type definitions as available e.g. in C++ are not supported. The unique possibility to group and separate type definitions provide units. You could, for example, store the affected class and the corresponding enum/set definitions within an individual unit. Anyway, the enum/set definitions are still global entities. Units provide only namespaces for the enclosed definitions preventing so eventual name conflicts.

Hope it helps you further.

Best regards

Paul Banach

by
Hello Paul.

This is great news regarding named enums.

But I'd kindly ask you to add to the generated code comments that are created in EW for every particular member of enum or set. Currently only comments contained in the Description field of enum/set itself are transferred to the source file. Thus it is impossible to fully describe device interface using EW comments only.

Best regards,
Maxim.
by
Hello Maxim,

I think, this should not be the big problem to generate the description. I put this request on our to-do list for the next release.

Best regards

Paul Banach

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

...