| 1 |
verbatimtex |
| 2 |
%& latex |
| 3 |
\documentclass[a4]{article} |
| 4 |
\begin{document} |
| 5 |
etex |
| 6 |
|
| 7 |
input blockdraw; |
| 8 |
input ./docblockprefs; |
| 9 |
|
| 10 |
|
| 11 |
beginfig( -1 ) |
| 12 |
|
| 13 |
% The controller box has corners (x1,y1), (x2,y2) |
| 14 |
% The inner system box has corners (x3,y3), (x4,y4) |
| 15 |
y1 := -2u; |
| 16 |
y2 := 1.3u; |
| 17 |
y3 := -1.4u; |
| 18 |
y4 := 1u; |
| 19 |
|
| 20 |
picture reg[]; |
| 21 |
reg1 := longblock( btex Reg.~1 etex, (-1u,0) ); |
| 22 |
reg2 := longblock( btex Reg.~2 etex, (-4u,0) ); |
| 23 |
|
| 24 |
picture G[]; |
| 25 |
G1 := longblock( btex $G_{1}$ etex, (1.5u,0) ); |
| 26 |
G2 := longblock( btex $G_{2}$ etex, (4u,0) ); |
| 27 |
|
| 28 |
picture terminator[]; |
| 29 |
terminator1 := pointpicture( leftpoint( reg2, 2, 2 ) - (1u,0) ); |
| 30 |
terminator2 := pointpicture( (5.5u,0) ); |
| 31 |
|
| 32 |
path con; |
| 33 |
picture lab; |
| 34 |
|
| 35 |
con := hhconnect( center( terminator1 ), leftpoint( reg2, 2, 2 ), 0.5, 0 ); |
| 36 |
lab := conlabel( to_ulft, btex $y_{\mathrm{ref}}$ etex, point infinity of con ); |
| 37 |
x1 := xpart( mspoint( con, 0.2, 0 ) ); |
| 38 |
|
| 39 |
con := hhconnect( rightpoint( reg2, 2, 2 ), leftpoint( reg1, 2, 2 ), 0.5, 0 ); |
| 40 |
lab := conlabel( to_urt, btex $z_{\mathrm{ref}}$ etex, point 0 of con ); |
| 41 |
x3 := xpart( mspoint( con, 0.6, 0 ) ); |
| 42 |
|
| 43 |
con := rlconnect( reg1, G1 ); |
| 44 |
lab := conlabel( to_top, btex $u$ etex, mspoint( con, 0.8, 0 ) ); |
| 45 |
x2 := xpart( mspoint( con, 0.3, 0 ) ); |
| 46 |
|
| 47 |
picture split[]; |
| 48 |
|
| 49 |
con := rlconnect( G1, G2 ); |
| 50 |
lab := conlabel( to_top, btex $z$ etex, mspoint( con, 0.8, 0 ) ); |
| 51 |
split1 := splitdot( mspoint( con, 0.3, 0 ) ); |
| 52 |
x4 := xpart( mspoint( con, 0.5, 0 ) ); |
| 53 |
|
| 54 |
con := rlconnect( G2, terminator2 ); |
| 55 |
lab := conlabel( to_top, btex $y$ etex, mspoint( con, 0.8, 0 ) ); |
| 56 |
split2 := splitdot( mspoint( con, 0.4, 0 ) ); |
| 57 |
|
| 58 |
% Draw boxes |
| 59 |
draw (x1,y1)--(x1,y2)--(x2,y2)--(x2,y1)--cycle withpen pencircle scaled dashlw dashed gldash1; |
| 60 |
draw (x3,y3)--(x3,y4)--(x4,y4)--(x4,y3)--cycle withpen pencircle scaled dashlw dashed gldash2; |
| 61 |
|
| 62 |
% Draw broken connections |
| 63 |
pair p; |
| 64 |
p := ( x2, 0.5[y1,y3] ); |
| 65 |
con := vhconnect( center split2, p ); |
| 66 |
con := hhconnect( p, leftpoint( reg2, 2, 1 ), 1, 0.4u ); |
| 67 |
|
| 68 |
p := ( x2, 1.5[y1,y3] ); |
| 69 |
con := vhconnect( center split1, p ); |
| 70 |
con := hhconnect( p, leftpoint( reg1, 2, 1 ), 1, 0.4u ); |
| 71 |
|
| 72 |
endfig; |
| 73 |
end; |