« Back to Fachhochschule Nordwestschweiz FHNW

Two variables to modify the GRAPHREP of an element

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hi,

I'm trying to implement the specification as indicated in the the attached image.
The actor part works, the style part does not (relies on the attribute Status).
Please see my code below.

 1GRAPHREP
 2SHADOW mode:off
 3
 4AVAL actor:"Actor"
 5SET c:"red"
 6
 7IF (actor = "customer")
 8SET c:$ff7f00
 9ELSIF (actor = "service provider")
10SET c:$00bf5f
11ELSIF (actor = "other actor")
12SET c:$56aaff
13ENDIF
14
15AVAL status:"Status"
16SET st:"dot"
17
18IF (status = "completed")
19SET st:solid
20ELSIF (status = "missing")
21SET st:dot
22ELSIF (status = "failed")
23SET st:solid
24ENDIF
25
26PEN color:(c) style:(st) w:3pt
27ELLIPSE x:0pt y:0pt rx:20pt ry:20pt
28
29#icon
30AVAL iconFile:"Icon"
31BITMAPINFO (iconFile)
32BITMAP (iconFile) x:-20pt y:-20pt w:40pt h:40pt
33
34ATTR "Actor" x:-0cm y:25pt w:c h:t


A further question appears with the “failed” selection of “Status”. How do I need to implement the following code, that it only appears when “failed” is selected and disappears if one of the other is selected?

1PEN style:solid w:0.1cm
2LINE x1:-0.5cm y1:0.5cm x2:0.5cm y2:-0.5cm
3LINE x1:-0.5cm y1:-0.5cm x2:0.5cm y2:0.5cm

Thanks for your feedback in advance and best regards.
Attachment

Attachments: image.png (44.6k)

RE: Two variables to modify the GRAPHREP of an element
Answer
3/24/16 1:46 PM as a reply to Anonymous.
1) As the assignment and the call of the variable for the PEN-style does not work you can declare the properties of the PEN in the IF condition (see code below).
2) As this two lines has to be displayed only if the "failed" value of the attribute "Status" is selected you have only to add this three lines into the condition of "failed" (see code bleow).

 1GRAPHREP
 2SHADOW mode:off 
 3AVAL actor:"Actor"
 4SET c:"red" 
 5IF (actor = "customer")
 6  SET c:$ff7f00
 7ELSIF (actor = "service provider")
 8  SET c:$00bf5f
 9ELSIF (actor = "other actor")
10  SET c:$56aaff
11ENDIF
12
13AVAL status:"Status"
14SET st:"dot"
15IF (status = "completed")
16  PEN color: (c) style:solid w:3pt
17ELSIF (status = "missing")
18  PEN color: (c) style:dot w:3pt
19ELSIF (status = "failed")
20  PEN style:solid w:0.1cm
21  LINE x1:-0.5cm y1:0.5cm x2:0.5cm y2:-0.5cm
22  LINE x1:-0.5cm y1:-0.5cm x2:0.5cm y2:0.5cm
23  PEN color: (c) style:solid w:3pt
24ENDIF
25
26ELLIPSE x:0pt y:0pt rx:20pt ry:20pt
27
28#icon
29AVAL iconFile:"Icon"
30BITMAPINFO (iconFile)
31BITMAP (iconFile) x:-20pt y:-20pt w:40pt h:40pt
32ATTR "Actor" x:-0cm y:25pt w:c h:t