question

Mischa Spelt avatar image
0 Likes"
Mischa Spelt asked Mischa Spelt commented

Specify displayText for bundle

Hi,

When using a table view (viewwindowtype 5), how can I provide a custom display text for a column?

It seems that the displayText node expects a treenode for param(1), which works fine for node-based tables, but of course for a bundle there is no cell node.

Please see the attached model, where I gave both global tables a custom GUI. For the node-based Global Table it works (I see the custom display text "value + [Click Me!]", but for the bundle-based table it doesn't as cellNode is null.

CustomGUI_viewwindowtype5.fsm


1656350778851.png

FlexSim 22.0.4
custom guibundle data
· 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.

anthony.johnson avatar image
2 Likes"
anthony.johnson answered Mischa Spelt commented

The engine code for resolving custom display text is:

  1. if (format->displayText) {
  2. Variant temp = format->displayText->evaluate(cellNode, row, col, precision);
  3. if (temp.type == VariantType::String) {
  4. customStr = temp;
  5. str = (char*)customStr.c_str();
  6. }
  7. }

It looks like the row and column numbers are passed in as param(2) and param(3), so you should be able to use those to determine display text for bundle table views.

· 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.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Finally I got it working:

customgui-viewwindowtype5-JV_bruteForce.fsm

It is based on the answer of @anthony.johnson

https://answers.flexsim.com/questions/22094/how-to-access-node-array-values.html

if you parse the name on table into a table declaration you can get access to values of a bundle even if you haven't got a cell node.

It is obviously not what you are looking for, because it will cost a lot of system time to build for each cell a new table of all values.

fill-table-cell-windowtype5-bundledata.jpg


5 |100000

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