FTDI Community

General Category => Discussion - Software => Topic started by: techtoys on August 15, 2019, 08:05:27 AM

Title: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: techtoys on August 15, 2019, 08:05:27 AM
Hi

By inspecting source code generated from ESD I can see that explicit casting is available for some cases but not the other. Example with .c source code generated by ESD:

(1)
//Explicit casting is available for context
Code: [Select]
Ft_Esd_Layout_Stretch__Generated.c:: Ft_Esd_Layout_Stretch__Initializer(Ft_Esd_Layout_Stretch *context){
Ft_Esd_Widget__Initializer((Ft_Esd_Widget *)context);
}

(2)
//No explicit casting for context_1
Code: [Select]
Ft_Esd_SpinBox__Generated.c:: Ft_Esd_SpinBox_Update(Ft_Esd_SpinBox *context){
//...
if (if_1)
{
 Ft_Esd_PushButton * context_1 = &context->Push_Up;
 Ft_Esd_Layout_Linear * parent_1 = &context->Horizontal_Layout;
 Ft_Esd_Widget_InsertTop(context_1, parent_1);
}else{
//...
}
}

All __Generated.c source files are generated by ESD with some .widget files as blueprints. So I am thinking if there is any "switch" or some sort to control explicit casting v.s. implicit casting.

Asking this question because I am working on a project to port Eclipse project output for ESP32 and Arduino. ESP32-IDF in pure C has no problem. A python program developed to convert Eclipse output to ESP32-based project is working, because ESD and ESP32 are both using pure C.

However I am hitting a wall with Arduino in C++, which requires strict syntaxes with explicit casting. Modification by putting explicit casting like snippet below will get the project compiled successfully. But it would not be a friendly package if we need to do it manually for every project.

Code: [Select]
Ft_Esd_Widget_InsertTop((Ft_Esd_Widget*)context_1, (Ft_Esd_Widget*)parent_1);
ESD is a nice software that opens up node-based visual programming for embedded GUI development. I am fascinated by its features and the possibility of extending this software to MCUs next to FT9xx. I also believe its influence can be much more profound than just using it for FT9xx (FT9xx MCU series is good but ESD can be much more). The success of porting ESP32 has proven my thinking.

So I wish to see if the same task to Arduino can be done. I am almost there. With manual modification manually and patches applying an Eclipse output from ESD can work with Arduino (Teensy in particular).

The next phase is to get project conversion done in an elegant and automatic manner.

Wish to see if there is somebody sharing my thinking and like to provide any insight.
Title: Re: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: FTDI Community on August 15, 2019, 11:57:44 AM
Hello,

Thank you for pointing this out, I will pass this on to the development team and hopefully they can take account of your suggestions for the next release.

Best Regards,
FTDI Community
Title: Re: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: techtoys on August 15, 2019, 01:01:21 PM
Dear FTDI community

Do you mean it is not possible for me to change from the current ESD UI?

Explicit casting is not the only change. I have summarized a list with changes required so that other compilers (ESP32's IDF and C++ for Teensy) can pass. Could share with you if you need it.

John
Title: Re: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: FTDI Community on August 15, 2019, 01:59:18 PM
Hello,

I cannot see anything in the user guide for ESD regarding a context switch for variable casting.

Yes, please share, I have notified the software team of this post and they should be able to look into this shortly.

Best Regards,
FTDI Community
Title: Re: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: techtoys on August 15, 2019, 05:00:10 PM
Hi

See attached files as patches for /FT_Esd_Framework and /FT_Esd_Widgets. Comment are available at the top of each file to describe what have been changed with reasons. They are easy because all of them are fixed, not __Generated files from .widgets.

Problems came when there are __Generated.c files exported by ESD. Attached a MS WORD file to describe the changes required to make Arduino C++ compiler for Teensy.

In case there is any question please pm : johnleung00@gmail.com

John
Title: Re: Where is the switch to control explicit casting in EVE Screen Designer (ESD)?
Post by: FTDI Community on August 16, 2019, 10:53:24 AM
Hello,

Thanks, I have passed these on to the development team.

Best Regards,
FTDI Community