Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/dpv/FlowDPV.m4

raw
1 .PS
2 # FlowDPV.m4
3 gen_init(svg_font(sans-serif,11bp__,2.5bp__))
4 ifdef(`FlowchartDefs_',,`include(../FlowchartDefs.m4def)')
5
6 # Pic macros for the colors (although m4 macros would work for these examples)
7 define Thistle {rgbstring(0.85,0.75,0.85)}
8 define RubineRed {rgbstring(0.81,0,0.35)}
9 define YellowGreen {rgbstring(0.68,1,0.18)}
10 define SeaGreen {rgbstring(0.13,0.70,0.67)}
11 define Goldenrod {rgbstring(0.85,0.65,0.13)}
12 define Beaublue {rgbstring(0.74,0.83,0.9)}
13 define Celadon {rgbstring(0.67,0.88,0.69)}
14 define Tan {rgbstring(0.9,0.8,0.7)}
15
16 # Accented characters
17 define(`svg_ccedilla',`svg_symbol(&`#'231;)')dnl
18 define(`svg_atilde',`svg_symbol(&`#'227;)')dnl
19
20 linethick_(1.0)
21 arrowwid = 0.05
22 arrowht = 0.1
23 fillval = 0.9
24 maxpsht = 20
25
26 define(`Below',`with .nw at last [].sw+(0,-0.25)')
27 TL: Here
28 Simple: [
29 Fbox("svg_tt(`Fbox')",,shaded Tan)
30 Ftest("svg_tt(``Ftest'')",,shaded Tan) Below
31 Fdata("svg_tt(``Fdata'')",,,shaded Tan) Below
32 Fprep("svg_tt(``Fprep'')",) Below
33 Fkeying("svg_tt(``Fkeying'')") Below
34 Fkeyboard("svg_tt(``Fkeyboard'')") Below
35 Fdocument("svg_tt(``Fdocument'')",,shaded Tan) Below
36 Fdelay("svg_tt(``Fdelay'')",,shaded Beaublue) Below
37 Fdisplay("svg_tt(``Fdisplay'')",,shaded Celadon) Below
38 Fstored("svg_tt(``Fstored'')",,shaded Thistle) Below
39 Fconnect(,,shaded Thistle) Below
40 Fconnect("45",wid boxwid ht boxht:45,shaded Thistle) \
41 with .w at last [].e+(boxht/8,0)
42 "svg_tt(`Fconnect')" at last [].nw + (0,boxht/6)
43 ] with .nw at TL+(0.1,0); move from Simple.nw to TL
44
45 #showbox_
46 Complex: [
47 Case: Fcase(,
48 "Test 1",[Fbox("Task 1",, shaded Thistle); W:last [].W; N:last [].N
49 arrow down linewid/3 from last [].S
50 Fbox("Task 1.5",, shaded Thistle) with .N at Here
51 E:last [].E; S:last [].S],
52 "Test 2",Fbox("Task 2" "is bigger", wid flowboxwid*1.2 ht flowboxht*3/2, \
53 shaded SeaGreen),
54 "Test 3",Fbox("Task 3",, shaded RubineRed)dnl
55 )
56
57 "svg_it(.N)" at Case.N rjust above
58 "svg_it(.S)" at Case.S rjust below
59 "svg_it(.E)" at Case.E ljust
60 "svg_it(.W)" at Case.W rjust
61 "svg_tt(`Fcase')" below at Case.s #+(0,-0.1)
62
63 Whiledo: Fwhiledo("svg_it(i svg_lt n)",,,Fbox("Task"),"T" above ljust at Test.E) \
64 with .nw at Case.ne+(0.25,0)
65
66 "svg_it(.N)" at Whiledo.N rjust
67 "svg_it(.S)" at Whiledo.S rjust below
68 "svg_it(.E)" at Whiledo.E ljust
69 "svg_it(.W)" at Whiledo.W rjust
70 "svg_tt(`Fwhiledo')" below at Whiledo.s
71
72 Repeatuntil: Frepeatuntil("svg_it(n svg_gt 5)",,,Fbox("Task"),
73 "T" at Test.E above ljust) with .nw at Whiledo.sw + (0.25,-0.5)
74
75 "svg_it(.N)" at Repeatuntil.N rjust above
76 "svg_it(.S)" at Repeatuntil.S rjust below
77 "svg_it(.E)" at Repeatuntil.E ljust
78 "svg_it(.W)" at Repeatuntil.W rjust
79 "svg_tt(`Frepeatuntil')" below at Repeatuntil.se +(-0.0,0.1)
80
81 Ifthenelse: Fifthenelse("svg_it(A svg_lt B)",,,
82 Fbox("False"),
83 Fbox("True",ht flowboxht*1.2 wid flowboxwid)dnl
84 ) with .nw at Repeatuntil.sw +(-0.5,-0.3)
85
86 "svg_it(.N)" at Ifthenelse.N rjust above
87 "svg_it(.S)" at Ifthenelse.S below rjust
88 "svg_it(.E)" wid 12bp__ at Ifthenelse.E ljust
89 "svg_it(.W)" at Ifthenelse.W rjust
90 "svg_tt(`Fifthenelse')" below at Ifthenelse.s+(0,-0.15)
91
92 Compound: [ right
93 ellipse shaded YellowGreen "Start"
94 arrow right linewid/2
95
96 Fbox("First task") with .W at Here
97 arrow down linewid/2 from last [].S
98
99 Fifthenelse("Test 1",,,
100 Frepeatuntil("svg_it(i svg_geq 5)",,shaded Goldenrod,Fbox("Task")),
101 Fifthenelse("svg_it(A svg_lt B)",,shaded Goldenrod,
102 Fbox("Left"),
103 Fbox("Right"),
104 "T" at Test.E above ljust),
105 "T" at Test.E above ljust) with .N at Here
106
107 A: arrow down 0.25 from last [].S ] with .nw at Case.sw + (-12bp__,-0.3)
108
109 "svg_it(Compound statements)" at last [].A.end+(0.1,0) ljust above
110
111 ] with .nw at Simple.ne+(0.1,0)
112
113 Example: [ fillvalue = 0.8; awid = linewid/2; right_
114 Start: ellipse wid boxwid/2 ht boxwid/3 shaded "green"
115 arrow right_ awid
116 B1: Fbox("Planejamento")
117 B2: Fbox("Execu`'svg_ccedilla`'svg_atilde`'o") with .W at B1.E+(awid*3,0)
118 B3: Fbox("Sele`'svg_ccedilla`'svg_atilde`'o") with .W at B2.E+(awid*3,0)
119 LT: Ftest("Avalia`'svg_ccedilla`'svg_atilde`'o do" "Planejamento",
120 wid flowboxwid*1.5 ht flowboxht*2.0,
121 shaded YellowGreen,
122 "Correto" at Box.e above ljust;
123 "Incompleto" at Box.w above rjust) with .S at 0.5 between B1.ne and B2.nw
124 arrow from B1.E to (LT.S,B1.E) then to LT.S
125 arrow from LT.W to (B1.N,LT.W) then to B1.N
126 arrow from LT.E to (B2.N,LT.E) then to B2.N
127 RT: Ftest("Avalia`'svg_ccedilla`'svg_atilde`'o da" \
128 "Execu`'svg_ccedilla`'svg_atilde`'o",
129 wid flowboxwid*1.5 ht flowboxht*2.0,
130 shaded YellowGreen,
131 "Correto" at Box.e below ljust;
132 "Incompleto" at Box.w below rjust) with .N at 0.5 between B2.se and B3.sw
133 arrow from B2.E to (RT.N,B2.E) then to RT.N
134 arrow from RT.W to (B2.S,RT.W) then to B2.S
135 arrow from RT.E to (B3.S,RT.E) then to B3.S
136 B4: Fbox("Extra`'svg_ccedilla`'svg_atilde`'o") with .S at B3.N+(0,awid)
137 arrow from B3.N to B4.S
138 arrow up_ awid from B4.N
139 B5: Fbox("Conclus`'svg_atilde`'o")
140 arrow up_ awid from B5.N
141 ellipse wid boxwid/2 ht boxwid/3 shaded "red"
142 ] with .nw at last [].Compound.sw+(0,2.5*flowboxht)
143
144 command "</g>" # end font
145 .PE