423 views
in Embedded Wizard Studio by
Dear all,

i have a strange behaviour when I change language on my GUI. The Reinit method is called in an order in the simulator and in a different order in the target device.

For example, in the semulator first is called the LedPage Reinit method and then the ReInit of each items that are in the Led Page. Since I need to load string text from external flash i use a custom functrion to perform it and in the simulator everything move in the right way. Conversely, in the target, first is called the Reinit method of each items and then the LedPage method. in this way I had the old string on the items.

Coud you help me please?

Thanks in advance

Best regards

Gianni

1 Answer

0 votes
by

Hello Gianni,

the order in which the ReInit methods are called is not predetermined. It depends on various factors like the order in which objects are created and shortly accessed. Even during the runtime the order can change. Your implementation should thus not rely on a predetermined activation order. SimIlar is valid to the order in which objects are released during the garbage collection. It is not predetermined.

What you can do is to defer the operation by using postsignal statement. The idea:

- In your Item class --> move the code, you have originally implemented in the ReInit method to a new slot method.

- In the ReInit method you put only postsignal theNewSlotMethod.

With this, the Item components don't perform the update immediately when ReInit is executed. They perform the operation after a short delay in the slot method. In the meantime the LedPage component can perform its own ReInit code.

Hope it helps you.

Best reagrds

Paul Banach

by
Hello Paul,

yes that solves my problem.

Thanks very much,

Best regards

Gianni Perugini

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

...