299 views
in Embedded Wizard Studio by

Hello, I have a simple project where I want to modify the screen background depending on a property's value, managed with an ESP32-WROVER. 

First, I made the mistake to use the Property from Chora folder in Templates. With that, using the OnSet method, I could see the changes every time I started the prototyper, but then I realized that if I want to flash the application to the ESP I need the Property from Device folder in Templates. 

Trying to migrate to the Device's Property, I now use an UpdateProperty method, because I don't want the GUI to change the Property's value. I also use a PropertyObserver with it's slot event. The slot's code is just the following switch:

switch (ButtonValue)
{
  case 1: MenuBackground.Bitmap = Application::SelectedBitmap1;
  case 2: MenuBackground.Bitmap = Application::SelectedBitmap2;
  default: MenuBackground.Bitmap = Application::MenuBitmap;
}

I'll explain these names...I have my Application class, with an object called MenuScreen in which I put an image called MenuBackground. The bitmap resources are situated in the unit Application.

Now the application isn't working. I change the property's value in the Inspector window and doesn't work properly in the prototyper. But the main problem I have is that I can't find anything as my property to change in the generated code. I was willing to use that in order to program the ESP and change the property's value. Is it possible to find my property's translated code in one of the generated files in order to change the value? 

I'll really appreciate any comment you have about anything I said. And if you need screenshots or something else please don't hesitate to ask.

Best regards,

Maria.

1 Answer

0 votes
by

Hello Maria,

have you seen the example "DeviceIntegration" within the folder /Examples of the Build Environment for ESP-WROVER-KIT? This example shows the interaction between the GUI application and the underlying system, e.g. when you press a hardware button, a counter within the GUI is increased. Let me recommend to analyze this example.

Furthermore,  let me refer to the articles Integrating with the device and Implementing a Device Interface, both are part of our online documentation. They explain all basics about natvie code and the integration of external software APIs or hardware drivers.

I think this will help a lot to realize your application.

Nevertheless, let me answer your questions:

Now the application isn't working. I change the property's value in the Inspector window and doesn't work properly in the prototyper. 

When you set the value of a property within the Inspector, you change the initialization value of the property. The onset method of the property is not executed at this time - this means, your code is not executed. As soon as you change the value of the property during runtime, the onset method will be executed.

But the main problem I have is that I can't find anything as my property to change in the generated code.

Please have a look to the mentioned example and documentation - it shows how to change the value of the property from your C code.

Best regards,

Manfred.

by
Hello Manfred, thanks for your quick reply!

Yes, I've seen those articles and the example before, and I was trying to implement what I understood about them, and to simplfy the complexity as my project is quite simple in comparison, I don't use hardware buttons yet nor the touch screen. I'll analyze a little bit more what I have done and the documentation, and if I come up with another way of asking I'll write again.

Thanks for your help!

Kind regards,

Maria.

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

...