question

Borja Lorenzo avatar image
0 Likes"
Borja Lorenzo asked Borja Lorenzo edited

GUI Panel Synchronization

Hello

I have a GUI programmed using the GUI Builder, and it works perfectly with the flow and behavior of all the buttons.

When I insert this GUI into a Dashboard through a “model input” --> GUI Class, it displays correctly, but this panel does not behave the same. It seems that the codes I have in the onSelect of the comboboxes are being triggered, but the changes are not reflected in the GUI inserted into this dashboard.

Attached is an example model to see if you can help me.

Thanks in advance.


Ejemplo GUI.fsm

FlexSim 24.1.1
dashboardsguicomboboxgui buildergui class
ejemplo-gui.fsm (5.5 MiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered Borja Lorenzo edited

Hi @Borja Lorenzo, there needs to be a small change in the User Commands when setting the params. They aren't getting set correctly, so the changes are not getting set on the active view tree, which means the GUI in the Dashboard isn't getting updated.

The lines that are setting the params are using one equal sign, but you would need to use two for the comparison that is needed for the ternary/comparison operator. You can also do something with an exclamation point instead of using equals signs, like this:

treenode cb_month = (!param (2) ? Model.find("Tools/GUIs/GUI 1/cb_month") : param (2));
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Borja Lorenzo avatar image Borja Lorenzo commented ·


Hello Logan
Thank you for your proposal and correction. It has improved some of the errors, but it still doesn't work correctly. I am attaching the simplified model with the correction you mentioned. Now I can see the comboboxes with the values in the dashboard GUI. However, there are still problems. I will try to describe them all:
The behavior I have programmed for the comboboxes is as follows. If we imagine that all the comboboxes already have some data selected and the user changes the selected data in any combobox, the downstream comboboxes should reevaluate/review their values. If in this new selection the list of items in the downstream comboboxes contains the previously selected value in their respective comboboxes, the displayed value should remain (updating the rest of the items that change).

This behavior is not visible in the dashboard GUI. Therefore, it is not replicating the behavior of the GUI Builder. Additionally, what I would like is for changes made in one to be updated in the other. Let me explain, what is seen in one panel should be seen in the other in real-time. There is a trace of this behavior in the line when in the "Select State" combobox, since having both GUIs with the same values (forcing manually), if I make a change in the dashboard panel (changing the hours), the value of the "Select State" combobox in the GUI changes to show nothing (this is correct), but the value of the hour combobox and the "Select State" combobox in the dashboard should also change to show nothing.

I have been testing this script from the script console and it updates the GUIs. But I am not sure if it is 100% correct. Where should I implement it?

Object dash = getdashboardcontrol("Panel1"); 
function_s(ownerobject(dash), "refresh");
refreshview(dash);
dash=getdashboardcontrol("Panel1");


function_s(ownerobject(dash).up.up, "hideSizers");


ejemplo-gui_1.fsm

0 Likes 0 ·