File: SELECT_f.sci

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (47 lines) | stat: -rw-r--r-- 1,171 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
44
45
46
47
function [x,y,typ]=SELECT_f(job,arg1,arg2)
// Copyright INRIA
x=[];y=[];typ=[]
select job
case 'plot' then
  standard_draw(arg1)
case 'getinputs' then
  [x,y,typ]=standard_inputs(arg1)
case 'getoutputs' then
  [x,y,typ]=standard_outputs(arg1)
case 'getorigin' then
  [x,y]=standard_origin(arg1)
case 'set' then
  x=arg1;
  graphics=arg1(2);label=graphics(4)
  model=arg1(3);
  while %t do
    [ok,nin,z0,label]=getvalue('Set parameters',..
	['number of inputs';'initial connected input'],..
	list('vec',1,'vec',1),label)
    if ~ok then break,end
    if z0>nin|z0<=0 then
      message('initial connected input is not a valid input port number')
    else
      [model,graphics,ok]=check_io(model,graphics,-ones(nin,1),1,ones(nin,1),[])
      if ok then
	graphics(4)=label;
	model(7)=z0-1,
	model(11)=[] //compatibility
	x(2)=graphics;x(3)=model
	break
      end
    end
  end
case 'define' then
  z0=0
  in=[-1;-1]
  nin=2
  model=list(list('selector',2),in,-1,ones(in),[],[],z0,[],[],'c',[],[%t %f],' ',list())
  label=[string(nin);string(z0+1)]
  gr_i=['xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');']
  x=standard_define([2 2],model,label,gr_i)
end