question

asb.p avatar image
0 Likes"
asb.p asked Matthew Gillespie commented

How does a table view work in Flexsim GUI?

Hello,

I am importing some table data from a txt file. Right now I am using global tables to use that data.

In the next step I want to import data and from node tree so that user of the model cannot have direct access to input data.

I want to create create some views similar to global table views in my custom GUI where users can see & edit the some of data.

I want to understand how table view works.

How to display & edit a simple tree structure in the form a table? I want to dynamicly pass the node value from a combo box. Please let me know if any addtional data required.

Thanks in advance,

Praneeth Akondi.

FlexSim 17.0.13
guicodingcustom guicustom dashboard
tableview.jpg (54.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.

1 Answer

Matthew Gillespie avatar image
4 Likes"
Matthew Gillespie answered Matthew Gillespie commented

A table view just needs to have its viewfocus attribute point at the data you want to display and edit.

From the user manual:

viewfocus: The viewfocus attribute is required for the table control. It specifies what the table will "point at". It is like the objectfocus attribute. It should have text data that is a path to the node that contains the table information. There are two options for the structure of the table node itself. It can be a list, meaning it contains a number of subnodes. If the table node is a list, then the table control will show just one column of data, and the text in each entry is the data, either text or number, of each of the subnodes in the list. The row headers of the table are defined by the names of each subnode. The other option is to have the table node be an actual table. In this case the table node contains a set of subnodes. Each subnode is one row in the table, and it contains subnodes, each being an individual entry in the table. The number of columns that will be shown in the table is defined by the number of subnodes of the first row. Row headers again are defined by the names of each row node. Column headers are defined by the names of the subnodes of the first row node. Please note that with a table, it is a direct view into the table data. This means that any changes made in an entry in the table will be applied as soon as you click off of the entry. This is different than using coldlink in other controls, where changes are only made when the user hits the Apply button. This is why the table control uses the viewfocus attribute, because it is a direct view into the data of a model, just like an ortho or perspective control.

The table will display all the data held by the node you point it at. There isn't an easy way to limit what the table shows or what it lets you edit.

· 2
5 |100000

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

asb.p avatar image asb.p commented ·

Hello Matt,

Thanks for your reply,

I have 3 questions from the above description

1.The Option 2 you are saying "Have the table node be an actual table" - This means you are suggesting to use global tables right?.

2. If I create tree structure similar to trees structure of global table in the model tree, is it possible to display that tree structure in the table view of my GUI & edit names and values of the tree structure from the GUI?

3. Is there a way to hide some of the global tables from the view of users?


Thanks,

Praneeth.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ asb.p commented ·

-- 1 and 2

No, it's not saying to use a global table. The documentation is telling you how to create the node structure you need for a table view to recognize the node as a "table".

First, it tells you how to make a 1-dimensional table, or a list, by making a node with subnodes that hold the row headers and the values, like this:

Second, it tells you how to make a 2-dimensional table. Again make a list of subnodes with the names representing row headers, but now each row subnode needs a number of subnodes equal to the number of columns. These subnodes hold the names of the columns and the values of the cell, like this:

Here's the model I used to make the pictures. I made a custom GUI with a Table View and a Drop Down that lets you toggle what table is being displayed. Note that you can edit these tables and the nodes in the tree update accordingly.

tableview.fsm

-- 3

Only the tables in Tools/GlobalTables will be displayed in the Toolbox or be accessible with the Table("TableName") constructor. If you put a table anywhere else it will be pretty hard for a user to find.

2 Likes 2 ·
tableview.fsm (21.3 KiB)
list.png (21.8 KiB)
table.png (28.0 KiB)