File: getparpath.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 (34 lines) | stat: -rw-r--r-- 979 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
function ppath=getparpath(scs_m,bpath,ppath)
// getparpath - computes path to block parameter data structure in scicos structure
//%Syntax
//  ppath=getparpath(scs_m)  standard call
//  ppath=getparpath(scs_m,bpath,ppath) recursive call
//%Parameters
//   scs_m : scicos data structure
//   bpath : current path to scs_m
//   ppath : list, each element is a vector giving the path to a block
//           with non empty rpar or ipar or states
//!
// Copyright INRIA
excluded=['IN_f','OUT_f','CLKIN_f','CLKOUT_f','CLKINV_f','CLKOUTV_f']
[lhs,rhs]=argn(0)
if rhs<2 then bpath=[],end
if rhs<3 then ppath=list(),end
for k=2:size(scs_m)
  o=scs_m(k)
  if o(1)=='Block' then
    if and(o(5)<>excluded) then
      model=o(3)
      if model(1)=='super'|model(1)=='csuper' then
	o=get_tree_elt(scs_m,[k,3,8])
	ppath=getparpath(o,[bpath k],ppath)
      else
	if model(6)<>[]|model(7)<>[]|model(8)<>[]|model(9)<>[] then
	  ppath(size(ppath)+1)=[bpath k],
	end
      end
    end
  end
end