1
function vanne_draw_ports(o)
2
[orig,sz,orient]=(o.graphics.orig,o.graphics.sz,o.graphics.flip)
3
xset('pattern',default_color(0))
4
// draw input/output ports
5
//------------------------
7
if orient then //standard orientation
12
0 1]*diag([xf/7,yf/14])
17
-1 1]*diag([xf/7,yf/14])
19
xset('pattern',default_color(1))
20
//xpoly(out2(:,1)+(orig(1)+sz(1)),..
21
// out2(:,2)+(orig(2)+sz(2)-dy),"lines",1)
22
xpoly(out2(:,1)+(orig(1)+sz(1)),..
23
out2(:,2)+(orig(2)+2*sz(2)/10),"lines",1)
26
//xfpoly(in2(:,1)+orig(1),..
27
// in2(:,2)+(orig(2)+sz(2)-dy),1)
29
xfpoly(in2(:,1)+orig(1),..
30
in2(:,2)+(orig(2)+2*sz(2)/10),1)
31
else //tilded orientation
35
0 1]*diag([xf/7,yf/14])
40
1 1]*diag([xf/7,yf/14])
44
xset('pattern',default_color(1))
45
//xpoly(out2(:,1)+ones(4,1)*orig(1)-1,..
46
// out2(:,2)+ones(4,1)*(orig(2)+sz(2)-dy),"lines",1)
48
//xfpoly(in2(:,1)+ones(4,1)*(orig(1)+sz(1))+1,..
49
// in2(:,2)+ones(4,1)*(orig(2)+sz(2)-dy),1)
50
xpoly(out2(:,1)+ones(4,1)*orig(1)-1,..
51
out2(:,2)+ones(4,1)*(orig(2)+2*sz(2)/10),"lines",1)
53
xfpoly(in2(:,1)+ones(4,1)*(orig(1)+sz(1))+1,..
54
in2(:,2)+ones(4,1)*(orig(2)+2*sz(2)/10),1)
56
// valve command port port
57
//------------------------
65
-1 1]*diag([xf/14,yf/7])
71
xfpoly(in(:,1)+ones(4,1)*(orig(1)+dx),..
72
in(:,2)+ones(4,1)*(orig(2)+sz(2)),1)