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.

Julie Weller avatar image Julie Weller commented ·

Hi @立洲 , was one of Joerg Vogel's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

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

立洲 avatar image 立洲 commented ·

Is there any other way to directly replace the original yellow frame?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel 立洲 commented ·
@立洲, I would try it in the SDK and develop my own processor.
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann 立洲 commented ·

Do you mean visually (display a frame and not a plane) or functionally (only display the frame when the processor is stopped)?

For the first case, you can draw multiple rectangle that together form a frame.

In the second case, you can what Jörg suggests and overwrite the default drawStopped code for the processor.

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