File: standard_outputs.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (43 lines) | stat: -rw-r--r-- 928 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function [x,y,typ]=standard_outputs(o)
//get position of inputs ports and clock inputs port for a standard block
//  the output ports are located on the right (or left if tilded) vertical
//    side of the block, regularly located from bottom to top
//  the clock output ports are located on the bottom horizontal side
//     of the block, regularly located from left to right
//!
// Copyright INRIA
xf=60
yf=40
graphics=o(2)
model=o(3)
orig=graphics(1);sz=graphics(2);orient=graphics(3);
out=size(model(3),1);clkout=size(model(5),1);


if orient then
  xo=orig(1)+sz(1)
  dx=xf/7
else
  xo=orig(1)
  dx=-xf/7
end


// output port location
if out==0 then
  x=[];y=[],typ=[]
else
  y=orig(2)+sz(2)-(sz(2)/(out+1))*(1:out)
  x=(xo+dx)*ones(y)
  typ=ones(x)
end


// clock output  port location
if clkout<>0 then
  x=[x,orig(1)+(sz(1)/(clkout+1))*(1:clkout)]
  y=[y,(orig(2)-yf/7)*ones(1,clkout)]
  typ=[typ,-ones(1,clkout)]
end