File: do_eval.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 (53 lines) | stat: -rw-r--r-- 1,332 bytes parent folder | download
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
48
49
50
51
52
53
function [scs_m,cpr,needcompile,ok]=do_eval(scs_m,cpr)
// This function (re)-evaluates blocks in the scicos data structure scs_m 
// Copyright INRIA
ok=%t
//Evaluate context
if size(scs_m(1))<5 then scs_m(1)(5)=[] ,end //compatibility
ierr=execstr(scs_m(1)(5),'errcatch')
if ierr<>0 then 
  message(['Incorrect context definition,';
      see message in Scilab window'])
  ok=%f
  return
end
needcompile1=max(2,needcompile)
mprt=funcprot()
funcprot(0) 
getvalue=setvalue;
deff('[x,y,ok,gc]=edit_curv(x,y,job,tit,gc)','ok=%t')
deff('[ok,tt,dep_ut]=genfunc1(tt,ni,no,nci,nco,nx,nz,nrp,type_)',..
    'dep_ut=model(12);ok=%t')
funcprot(mprt)
nx=size(scs_m)



for k=2:nx
  o=scs_m(k)
  if o(1)=='Block' then
    model=o(3)
    if model(1)=='super'|model(1)=='csuper' then
      sblock=model(8)
      [sblock,w,needcompile2,ok]=do_eval(sblock,list())
      needcompile1=max(needcompile1,needcompile2)
      if ok then
	scs_m(k)(3)(8)=sblock
      end
    else
      model=o(3)
      execstr('o='+o(5)+'(''set'',o)')
      needcompile1=max(needcompile1,needcompile) // for scifunc_block
      model_n=o(3)
      if or(model(10)<>model_n(10))|.. // type 'c','d','z','l'
	        or(model(12)<>model_n(12)) then 
	needcompile1=4
      end
      scs_m(k)=o
    end
  end
end
needcompile=needcompile1
if needcompile==4 then cpr=list(),end