question

Haneen A avatar image
0 Likes"
Haneen A asked Jason Lightfoot commented

Labels of flowitems appear while running

Hello,

I am working on a baggage handling system, The passengers are Flowitems that work as a task executer, the bags are linked to the passengers by the label "Person" that is attached to each bag.

While the model is running, I want each bag to show the label "Person" that has the name of the passenger "PassengerTrack_1".

for example:

the bag that is linked to passenger "PassengerTrack_1" will appear visually while running a bag with the label "PassengerTrack_1" under it.

Thank you,

@Raja Sekaran

@Cliff King

@jason.lightfoot

@Jeff Nordgren

@Mischa Spelt

@Ben Wilson

@Ralf Gruber

@Jeanette F

Traditional.fsm

FlexSim 20.2.0
labelsflexsim 20.2.0flowitemtaskexecutormatch label
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

·
Jason Lightfoot avatar image
3 Likes"
Jason Lightfoot answered Jason Lightfoot commented

I added draw code to the bag to create a line from the bag to the passenger which is I think more useful.

traditional_jl.fsm



1612113478186.png (257.1 KiB)
traditional-jl.fsm (4.5 MiB)
· 6
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 Jason Lightfoot ♦ commented ·

You can toggle them on/off by running this line in a script window.

drawPassengerBagConnections=!drawPassengerBagConnections;
1 Like 1 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

@Haneen A You can make the name of the item appear by using the switch_hidelabel() function on the bag So you rename the bag "Passenger1" and that will appear under the bag.

switch_hidelabel(bag,0);

In the updated model attached I added the custom code activity "Label bag" as shown here:

To give this effect:

traditional_jl2.fsm

0 Likes 0 ·
1612242595668.png (17.1 KiB)
1612242723700.png (217.2 KiB)
Haneen A avatar image Haneen A Jason Lightfoot ♦ commented ·
This code is exactly what I was looking for, your help is really appreciated!.

thank you Mr.Jason.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Haneen A commented ·

You're welcome - there is now a fully working version with corrected photo-eye positioning in this post.

0 Likes 0 ·
Show more comments

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.