~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/scicos/fortran_block.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
case 'getorigin' then
13
13
  [x,y]=standard_origin(arg1)
14
14
case 'set' then
15
 
  x=arg1
16
 
  model=arg1(3);graphics=arg1(2);
17
 
  label=graphics(4);
 
15
 x=arg1;
 
16
  model=arg1.model;graphics=arg1.graphics;
 
17
  label=graphics.exprs;
18
18
  while %t do
19
19
    [ok,i,o,rpar,funam,lab]=..
20
 
        getvalue('Set fortran_block parameters',..
21
 
          ['input ports sizes';
22
 
          'output port sizes';
23
 
          'System parameters vector';
24
 
          'function name'],..
25
 
          list('vec',-1,'vec',-1,'vec',-1,'str',-1),label(1))
 
20
        getvalue('Set fortran_block parameters',..
 
21
          ['input ports sizes';
 
22
          'output port sizes';
 
23
          'System parameters vector';
 
24
          'function name'],..
 
25
          list('vec',-1,'vec',-1,'vec',-1,'str',-1),label(1))
26
26
    if ~ok then break,end
27
27
    if funam==' ' then break,end
28
 
    label(1)=lab
 
28
    label(1)=lab    
29
29
    rpar=rpar(:)
30
30
    i=int(i(:));ni=size(i,1);
31
31
    o=int(o(:));no=size(o,1);
32
32
    tt=label(2);
33
 
    if model(1)(1)<>funam|size(model(2),'*')<>size(i,'*')..
34
 
        |size(model(3),'*')<>size(o,'*') then
 
33
    if model.sim(1)<>funam|size(model.in,'*')<>size(i,'*')..
 
34
        |size(model.out,'*')<>size(o,'*') then
35
35
      tt=[]
36
36
    end
37
37
    [ok,tt]=FORTR(funam,tt,i,o)
38
38
    if ~ok then break,end
39
39
    [model,graphics,ok]=check_io(model,graphics,i,o,[],[])
40
40
    if ok then
41
 
      model(1)(1)=funam
42
 
      model(8)=rpar
 
41
      model.sim(1)=funam
 
42
      model.rpar=rpar
43
43
      label(2)=tt
44
 
      x(3)=model
45
 
      graphics(4)=label
46
 
      x(2)=graphics
 
44
      x.model=model
 
45
      graphics.exprs=label
 
46
      x.graphics=graphics
47
47
      break
48
48
    end
49
49
  end
50
50
case 'define' then
51
 
  in=1
52
 
  out=1
53
 
  clkin=[]
54
 
  clkout=[]
55
 
  x0=[]
56
 
  z0=[]
57
 
  typ='c'
58
 
  auto=[]
59
 
  rpar=[]
 
51
  model=scicos_model()
 
52
  model.sim=list(' ',1001)
 
53
  model.in=1
 
54
  model.out=1
 
55
  model.evtin=[]
 
56
  model.evtout=[]
 
57
  model.state=[]
 
58
  model.dstate=[]
 
59
  model.rpar=[]
 
60
  model.ipar=0
 
61
  model.blocktype='c'
 
62
  model.firing=[]
 
63
  model.dep_ut=[%t %f]
60
64
  funam='forty'
61
 
  model=list(list(' ',1001),in,out,clkin,clkout,x0,z0,rpar,0,typ,auto,[%t %f],..
62
 
      ' ',list());
63
 
  label=list([sci2exp(in);sci2exp(out); strcat(sci2exp(rpar));funam],..
64
 
            list([]))
 
65
  label=list([sci2exp(model.in);sci2exp(model.out);..
 
66
  strcat(sci2exp(model.rpar));funam],list([]))
65
67
  gr_i=['xstringb(orig(1),orig(2),''Fortran'',sz(1),sz(2),''fill'');']
66
68
  x=standard_define([2 2],model,label,gr_i)
67
69
end
68
 
 
 
70
endfunction