137 views
in GUI Development by

Hi, 
we are using value display and configuration in our application for parameter menu class.

in parameter  menu class created configuration for specific value  and setting that config to appearance property in value display

ex: engine speed - value display wizard type

      engine speed config - value display configuration type - setting to appearance property

when I was debugging inside value display execution flow is like below
1. OnSetappearance called first ,  enter to below case

/ ... and attach to the new one
if ( value != null )
  attachobserver onConfigChanged, value.

2. based on above case called on_format_value{} slot triggered

3. Next UpdateViewState{} slot trigged
but inside slot it is showing appearance as null , based on that setting all below variables as false

// Determine which views are necessary within the widget.
var bool needs_value      = ( appearance != null ) && ( appearance.ValueFont      != null );
var bool needs_unit       = ( appearance != null ) && ( appearance.UnitFont       != null );
var bool needs_data_loss  = ( appearance != null ) && ( appearance.data_loss_font != null );

could you please check it and let me know whether my understanding is correct on it or not ?

Thanks,

Harshini

1 Answer

0 votes
by

Hello Harshini,

but inside slot it is showing appearance as null , based on that setting all below variables as false

within OnSetAppearance the assigned appearance object is stored within the property Appearance. If it is null later there are two possibilities:

1. Shortly after assigning a valid appearance object to the property Appearance, the value null has been assigned to this property explicitly.

2. There are two different Value Display objects and during debugging you observe the invocation of OnSetAppearance in context of object A while UpdateViewState() is executed on object B. Add following line of code to the methods to track the identity of the corresponding objects:

trace this;

I hope it helps you further.

Best regards

Paul Banach

by



Hi, 

In our configuration we are trying to make value display configuration as generic as possible
but am facing one issue

while loading first time - default value is setting after that only current value is updating (with delay)

for example :
engine speed 1000rpm i/p
it is loading like default - then 1000 rpm
Is there any possible to remove default value while loading starting

I attached demo project also please check https://ask.embedded-wizard.de/8972/value-display-appearance-showing-null-after-initialization

by
Hello Harshini,

I can't find any demo project attached to this Ask thread.

Best regards

Paul
by

Hello Harshini,

while loading first time - default value is setting after that only current value is updating (with delay)

so far I could review the project, it seems the delay is caused by the timer update_data_timer in the component Application::value_display:

I hope it helps you further.

Best regards

Paul

by
yes, we are keeping that timer for continuous update of value,  my question is before calling update_data slot can we disable default value (like always value is setting to zero )
by

Hello Harshini,

... before calling update_data slot can we disable default value (like always value is setting to zero )

Hmmm, one possible approach would be to modify UpdateViewState() and make the respective text views invisible until the timer expires for the first time. For this purpose:

Step 1: I have added a new bool variable to the value_display component. The variable is initialized with false. Name the variable e.g. initialized.

Step 2: In UpdateViewState() following code is added. It makes the text views invisible if the variable initialized is false.

Step 3: In the update_data slot method set the variable initialized to the value true:

I hope it helps you further.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...