question

Martin K5 avatar image
1 Like"
Martin K5 asked VikSin commented

How to update/refresh dashboard view?

Hi,

I am working with dashboard as a toolbox for controlling the model. I used the GUI Class reference to display additional parametres. The problem is when I change something (or the user) in the GUI, the change is not overwritten in the Dashboard view and I need to simply close and reopen the dashboard to view the requisted changes.


Is there any other way to make the Dashboard reload or refresh instead of closing it?


1684410603675.png

The same situation is when using combobox and trying to modify the node's values via code, but the changes do not appear until you close and reopen the dashboard.


Thank you,


Martin

FlexSim 22.2.0
dashboardscomboboxcloserefreshreopen
1684410603675.png (20.4 KiB)
5 |100000

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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered VikSin commented

You should instead be using getdashboardcontrol() to find the combobox:


Object dashctrl=getdashboardcontrol("myComboBox");  //myComboBox is the dashboard control ID, not the name - set it in properties
treenode newOption=items(dashctrl).subnodes.assert("test3",6);
comborefresh(dashctrl);
· 3
5 |100000

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

VikSin avatar image VikSin commented ·

Hi Jason,

I'm replying as my colleague is offline already. We use getdahsboardcontrol but problems is still the same:

I will provide a test model below. You can see in model that when you click on AddComboOption button, you are adding options but they are not visible in dashboard. You must close it a open it again.
Also the treenode is still the same and changes only after dashboard is closed.

flexsim_combobox.fsm

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ VikSin commented ·

I added the comborefresh command to the script above which removes the need to cycle the dashboard's edit mode.

flexsim-combobox_jl.fsm

0 Likes 0 ·
VikSin avatar image VikSin Jason Lightfoot ♦ commented ·

thank you, this works :)

0 Likes 0 ·
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Martin K5 commented

Does a command of repaint do the same?

· 3
5 |100000

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

Martin K5 avatar image Martin K5 commented ·

I am not sure what you mean rigth now. I tried the following command:

treenode view = Model.find("MODEL:/Tools/Dashboards/Dashboard2");
repaintview(view);

but no change appeared.

I thinks it does not refresh the dashboard.

Thank you

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·
0 Likes 0 ·
Martin K5 avatar image Martin K5 Joerg Vogel commented ·

It still does not help. I have a combobox and I want the add new node and set its name. Then I tried the mentioned command to see the changes but not successfully.


treenode node = Model.find("MODEL:/Tools/Dashboards/Dashboard2/DashboardCombobox334>variables/options");
nodeinsertinto(node);
setname(node.last, "test");
updatestates();

Shoud this work?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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