FlexSim Community Forum

FlexSim Community Forum (https://archive.flexsim.com/index.php)
-   Q&A (https://archive.flexsim.com/forumdisplay.php?f=66)
-   -   How to set table values by using GUI (https://archive.flexsim.com/showthread.php?t=1353)

Congshi Wang 05-19-2010 11:41 AM

How to set table values by using GUI
 
I want to create a custom GUI which sets the values of global table variables by typing the desired value into a edit-box. I've tried to realize this by setting a coldlink from an edit-box to the global table, but it don't work (yet). Does anyone know a solution?

Congshi Wang 05-19-2010 11:54 AM

Controls Attributes GUI builder tool Documentation
 
Is there a documentation of all the Controls Attributes in the GUI builder tool?

Tom David 05-19-2010 12:11 PM

It is important, that you point to the right node.
If you want to point to Row 1 Col 1 that’s the path you put into your coldlink:
MAIN:/project/model/Tools/GlobalTables/GlobalTable01>variables/data/1/1

To point to Row 2 Col 1 it will be
MAIN:/project/model/Tools/GlobalTables/GlobalTable01>variables/data/2/1

Be aware that the coldlink only updates, if you press Apply or Ok in your GUI. A hotlink will update immediately.

There is an overview about the Attributes in the manual under Miscellaneous Concepts / View Attributes Reference.

Congshi Wang 05-19-2010 12:51 PM

It works, thanks a lot!

Tom David 05-19-2010 10:17 PM

Congshi,

You asked how to point with an edit field to a Global Table cell and it seems to work.

Do you know that you can also put a whole Global Table into your GUI?
There is a table object in the GUI Builder which you can use.
In the viewfocus you point to the data node of your Global Table:
MAIN:/project/model/Tools/GlobalTables/GlobalTable01>variables/data

LINWEIXU 05-19-2010 10:21 PM

in 4.52 ,you should refreshglobalvariables() in apply. if donot do that ,the value will not change.

i am sorry ,i am wrong ,if you want change globalvariable,you should refreshglobalvariables() ,if you want to change values of global table variables ,do not need refreshglobalvariables()

Tom David 05-20-2010 12:52 AM

I am not sure about refreshglobalvariables(), because it was working on my side without it.

refreshglobalvariables()
Description:
For developer use. Refreshes all global variables to their initial values.
Example:
refreshglobalvariables()


In my eyes refreshglobalvariables() is if you use Global Variables, but here we use data from a Global Table.
I know that you need applylinks() which is under the Apply button.

applylinks(node view [, num refresh])
Description:
For developer use. This command applies all of the hotlinks and coldlinks in the view window specified as view. If refresh is 1, then the links will be refreshed, meaning the values from the model will be retrieved and set on the window controls themselves. If refresh is 0, then the values in the model will be set according to what the user specified in the view. This command is used in Flexscript GUI programming.
Example:
applylinks(ownerview(c));
This applies all of the links in the window that is currently designated as the selected view.


Anyway, maybe Linwei had an issue here and if it is not working it is worth to try refreshglobalvariables().

Ooooh, I just realized, that Linwei correct himself. So in this sense my post is obsolete. Sorry.


All times are GMT -6. The time now is 04:20 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.