220 views
in GUI Development by
Hi,

We have some parameters such as Text string value which is receiving the data from device side.

I have tested the data coming from device side and it is updating the string value on UI screen.

However, there can be a case when data will not be received every time from device, i.e. when the string value is null, i want to retain the previous value.

Currently I have used global variable to store the value.

But I want to avoid the global variable approach as there are many parameter .

Can it be achieved without using global variable?

Is there a function/component which can retain its value in UI?

 

Thanks,

SanujaP

1 Answer

0 votes
by

Hello SanujaP,

for such application case you use the autoobject. It is a kind of global object able to persist as long as it remains referenced within the application. The data inside he object will persist too the whole time.

If you follow the Device Class approach (explained in the section Device Integration), the Device Class contains already such autoobject. Accordingly, the value received via Device Class from the target system remains stored in the autoobject. To manage the value in such case, I would recommend the Device Property. With the corresponding Property Observer you can implement functionality in your GUI application to react to changes of the property and e.g. update the GUI to the new value.

I hope, it helps you further.

Best regards

Paul Banach

by
Hi Paul,

Thanks.

It worked.

 

Thanks,
SanujaP

Embedded Wizard Website | Privacy Policy | Imprint

...