88 views
in GUI Development by
Hi,

We have created multiple screens as components. According to the meter conditions, we need to display the respective screens in a class, which includes single screens or multiple screens. Is it possible in the embedded wizard to keep a matrix to manage with the multiple screens?   Or is there any way to managing the screens in a class?

Thank you.

1 Answer

0 votes
by

Hello Tharanya,

I'm sorry but I don't understand your question or what you mean with matrix. Concerning screens, see the chapter Managing Dialogs (multiple screens). From technical point of view you can present multiple dialogs, switch between them, nest them, etc..

Best regards

Paul Banach

by

In our project, we have designed multiple screens as separate individual components. According to the meter model provided by the device, we need to display these components within the same class. Is there a way to manage the display of the screens without resorting to switch cases? Please refer the image below.

by

Hello Tharanya,

in the simplest case you show/hide the components depending on the 'meter' condition. For example:

if ( meter == 1 )
{
  Component1.Visible = true;
  Component2.Visible = true;
  Component3.Visible = true;
  Component4.Visible = false;
  Component5.Visible = false;
  ...
  Component9.Visible = false;
}

if ( meter == 2 )
{
  Component1.Visible = false;
  Component2.Visible = false;
  Component3.Visible = false;
  Component4.Visible = true;
  Component5.Visible = true;
  Component6.Visible = true;
  ...
}

If you prefer the matrix, you can use a two dimensional array configured to store bool data. Fill the array appropriately with values. Then the above implementation could looks as shown below:

Component1.Visible = MatrixArray[ meter, 0 ];
Component2.Visible = MatrixArray[ meter, 1 ];
Component3.Visible = MatrixArray[ meter, 2 ];
...
Component9.Visible = MatrixArray[ meter, 8 ];

If you don't want all the component to exist the whole time, you can create them dynamically and remove them again if not needed anymore:

var YourUnit::Component1 comp1 = new YourUnit::Component1;
Add( comp1, 0 );

....


Remove( comp1 );

For more details see the section Compose the component programmatically

I hope it helps you further.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...