~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to macros/scicos_blocks/ISELECT_f.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function [x,y,typ]=ISELECT_f(job,arg1,arg2)
 
2
// Copyright INRIA
 
3
x=[];y=[];typ=[]
 
4
select job
 
5
case 'plot' then
 
6
  standard_draw(arg1)
 
7
case 'getinputs' then
 
8
  [x,y,typ]=standard_inputs(arg1)
 
9
case 'getoutputs' then
 
10
  [x,y,typ]=standard_outputs(arg1)
 
11
case 'getorigin' then
 
12
  [x,y]=standard_origin(arg1)
 
13
case 'set' then
 
14
  x=arg1;
 
15
  graphics=arg1(2);label=graphics(4)
 
16
  model=arg1(3);
 
17
  while %t do
 
18
    [ok,nout,z0,label]=getvalue('Set parameters',..
 
19
        ['number of outputs';'initial connected output'],..
 
20
        list('vec',1,'vec',1),label)
 
21
    if ~ok then break,end
 
22
    if z0>nout|z0<=0 then
 
23
      message('initial connected input is not a valid input port number')
 
24
    else
 
25
      [model,graphics,ok]=check_io(model,graphics,-1,-ones(nout,1),ones(nout,1),[])
 
26
      if ok then
 
27
        graphics(4)=label;
 
28
        model(7)=z0-1,
 
29
        model(11)=[] //compatibility
 
30
        x(2)=graphics;x(3)=model
 
31
        break
 
32
      end
 
33
    end
 
34
  end
 
35
case 'define' then
 
36
  z0=0
 
37
  out=[-1;-1]
 
38
  nout=2
 
39
  model=list(list('selector',2),-1,out,ones(out),[],[],z0,[],[],'c',[],[%t %f],' ',list())
 
40
  label=[string(nout);string(z0+1)]
 
41
  gr_i=['xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');']
 
42
  x=standard_define([2 2],model,label,gr_i)
 
43
end
 
44
 
 
45
 
 
46
 
 
47