801 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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...