question

立洲 avatar image
0 Likes"
立洲 asked Julie Weller commented

How to change the outline state color?

When using the Stop object, can the displayed box color be changed according to different states?


I want to change the yellow frame to another color and customize the color according to the occurrence of different states


1692321201457.png

FlexSim 22.0.16
color change
1692321201457.png (29.2 KiB)
· 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.

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You might be able to change the frame's color somewhere deep within FlexSim or by developing a custom object.

The easier solution would be to simply draw your own colored shape in the processor's On Draw trigger. If you return a non-null value in that trigger, the default draw code will not executed and thus the "stopped-object-frame" will not be drawn, so you don't have to worry about overlapping/confusing coloring.

In the attached model, a colored rectangle is drawn beneath the processors depending on their state (processing - green, blocked - orange, breakdown - red, scheduled down - grey).

color-indicators-state-fm-22-0.fsm


· 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
0 Likes"
Joerg Vogel answered

The mechanism is controlled in MAIN:/project/library/FlexSimObject>behaviour/cppfunctions

Involved nodes are onDraw(treenode view) and drawStopped(double red, double blue, double green).

An event of stop calls by onDraw the function drawStopped. You make copies of them in objects, which you want to customize to bypass default library inherited setups. Naturally you do it in the objects same attributes tree path of cppfunctions. By calling drawStopped you pass color RGB-values. But you can alter them also in drawStopped.

5 |100000

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