GUI Class not updating Dashboard when linked GUI changes

GUI Class not updating Dashboard when linked GUI changes

borja_lorenzo
Advocate Advocate
628 Views
4 Replies
Message 1 of 5

GUI Class not updating Dashboard when linked GUI changes

borja_lorenzo
Advocate
Advocate

Hello everyone,

I built a simple model with a GUI1 that has a checkbox2.
I also created a Dashboard with a GUI Class linked to GUI1.

The checkbox is visible in the Dashboard, but when I toggle it in GUI1, the change is not reflected in the Dashboard.

I tried calling repaintview(Dashboard) in the OnPress of checkbox2, but it has no effect.

How can I synchronize the checkbox state between the GUI Class and the Dashboard?

Thank you in advance.

 

Version: 24.1

0 Likes
Accepted solutions (1)
629 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor

Maybe you cannot do this, because object oriented programming metrics with full inheritance is not implemented in FlexSim. A GUI in a dashboard is an instance created by a copy of an object. Maybe you expects that it is a Derivate of a class. I assume that you have to apply by exchanging relevant nodes from library class object to published object yourself. 

0 Likes
Message 3 of 5

borja_lorenzo
Advocate
Advocate

Thanks a lot for your reply and clarification!
It actually helped me understand the behavior better, but at the same time it raised a few more questions that I hope you can help me with.

From what I understand, the GUI Class in a dashboard behaves as a copied instance of a GUI, not as a derived or synchronized class.
Still, I’d like to understand its intended purpose a bit deeper:

• Is the GUI Class meant just to display a static copy of the GUI design, or can it be used as an active interface for model interaction?
• If synchronized behavior is needed, is linking both (the GUI and the GUI Class) to a shared node or variable the correct approach?
• Are there any official examples or documentation where a GUI Class is used inside a dashboard, showing its typical use cases and possible refresh methods?
• In practice, when would you recommend using GUI Class instead of native model inputs like checkboxes or comboboxes?

Thanks again for your time and explanations — I really appreciate any extra insight or examples you can share.

0 Likes
Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

@borja_lorenzo, as I understand this. GUI is a fundamental interface to customize the look of FlexSim completely or partly as free floating or docked windows. A dashboard is a window in Flexsim and it is a newer feature. And therefore it is controlled as a GUI. First a dashboard has been only a chart space to display model output, later other templates have been added. As far as I know this is the third interface for this purpose. 
You can integrate a GUI sub window into a dashboard design. Dashboard and GUI can control both a model.

  • viewwindowtype of a dashboard is 102
  • viewwindowtype of a GUI Class inside of a dashboard is 100

I write this here to demonstrate the dependencies of both features. The view output system of FlexSim is decribed in the View tree. 

Now if you design a custom GUI and you want to integrate it in a dashboard you use the GUI Class Template and link your custom GUI in Properties. 

A template "Model Documentation" is an internet browser window. Therein you link Flexscript and you can even run javascript. This here just a hint.

But be aware of the fact that a dashboard is not synchronized with model run time. If there is a huge mass of statistical data to display in a window which controls also the model, there happens an increasing gap of a lag. If you want to reduce such a lag, you can open a dashboard output window by a smaller faster updated dashboard window. You can have multiple dashboards in FlexSim program window.

0 Likes
Message 5 of 5

borja_lorenzo
Advocate
Advocate

Thanks a lot for your explanations. After spending some time reviewing the documentation and testing different cases in my model, I think I now understand the behaviour better — but I would really appreciate confirmation from more experienced users in case I’m still missing something.

As far as I can tell, the GUI definition (the structure created with the GUI Builder) is stored in the model tree, while the visible GUI window corresponds to a runtime view instance living in the view tree.
This runtime instance includes temporary state such as itemcurrent in comboboxes, checkbox states, etc.

Based on what I observed:

  • When I embed this GUI into a Dashboard using a GUI Class, FlexSim seems to create a new view instance from the model-tree definition,

  • …and not from the currently opened GUI window.

  • Therefore, the GUI Class does not inherit any runtime state (like the selected itemcurrent), and all controls appear with their default values.

This behaviour is not explicitly stated in the documentation (as far as I’ve found), but it appears consistent with how the model tree and view tree are conceptually separated.
Could someone confirm if this interpretation is correct?

Additionally, if one needs persistence or synchronization between the GUI and the GUI Class, it seems necessary to externalize that temporary UI state into model nodes, by using attributes like coldlink and/or pickitem, and then restoring those values when new GUI instances (such as GUI Class controls) are created inside the Dashboard.

Finally, the second issue I experienced — where one combobox wasn’t behaving correctly when used inside the Dashboard — was caused by a missing parameter in one of my User Commands. After fixing the parameter list, the behaviour is now correct.

Thanks again for the support, and I’d appreciate any confirmation or corrections from users who know the internals better than I do.

0 Likes