question

Clair A avatar image
0 Likes"
Clair A asked Matthew Gillespie commented

Missing green icon on list shared asset

Hi,

Open the attached model Green icon on list.fsm.

There is a global list GlobalList1 with 3 entries:

1677233534021.png

In Process Flow, there are 2 list shared assets (List1 and List2), who are both referencing the same global list GlobalList1, in 2 different ways:

1677233645953.png

1677233656700.png

The green circle on List1 correctly displays the number of entries in the list, whereas this information is missing on List2.

Would it be possible to also display the number of entries in the list in the green circle when we use the syntax List("ListName") ?

FlexSim 23.0.3
global list
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
@Clair A, one is a pointer, the other a constructor.
0 Likes 0 ·
Clair A avatar image Clair A Joerg Vogel commented ·

@Joerg Vogel I know. My question is not what's the difference between Tools/GlobalLists/GlobalList1 and List("GlobalList1").

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Clair A commented ·
Yes, I know, but maybe there is a small difference when a pointer or a constructer gets evaluated. They both reference a list. But the mechanism may differ.
0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented

The code that draws that circle only counts the number of entries if the list references is a pointer. This is because draw code fires very frequently and anything that takes time to evaluate will significantly slow down the framerate of the draw.

When you set the list reference to be List("List1") that makes the reference a FlexScript code reference and that draw code would have to execute the code on that node and evaluate which list it returns. This is an expensive operation and will slow down the drawing of the view, so the draw code skips over that evaluation.

If you want to see the entries icons, make the reference a direct pointer.

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

Clair A avatar image Clair A commented ·
Thanks for your feedback Matthew. The user who reported this issue to us is building user libraries.

For example:

  • an Object Process Flow uses a reference to a global list with a direct pointer
  • you add the global list to the library
  • you add the object to the library (which also adds its Object Process Flow)
  • if you drag & drop the global list and the object in a new model, in the Object Process Flow the direct pointer to the global list is broken, it uses an internal list instead.

That's why when working with global lists in user libraries I think it's better to use the syntax List("ListName"), but then you loose the entries icon. I understand that for performance reasons the icon is not displayed. At first sight this user reported this issue to us because he thought it was a bug.

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Clair A commented ·
If you're building a user library, you could add a line of code to the OnDrop of the process flow object to set the list reference with a pointer to the global list.
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.