return_block_desc - return a description of scicos blocks in a scs_m list
txt = return_block_desc(scs_m,dbl)
- scs_m : a main scicos data structure
- dbl : set 1 to remove double file name
- txt : matrix of string of size(n,4)
- txt(,1) : name of gui
- txt(,2) : id of block in scs_m
- txt(,3) : library of block
- txt(,4) : name of computational function
//Fonction qui retourne une description des blocks
//d'une liste scs_m
//si dbl==1 alors élimine les doublons
function txt=return_block_desc(scs_m,dbl)
txt=[]
[%lhs,%rhs]=argn(0)
n=lstsize(scs_m.objs) //nbr d'objet dans scs_m
for i=1:n
if execstr('scs_m.objs(i).gui','errcatch')==0 then
ww=whereis(scs_m.objs(i).gui)
if ww==[]|ww=='' then ww='', end
txt=[txt;string(scs_m.objs(i).gui) string(i) string(ww) string(scs_m.objs(i).model.sim(1))]
end
end
if exists('dbl') then
if dbl==1 then //Trouve les doublons
if txt<>[] then
tt=txt(1,:)
for i=1:size(txt,1)
ok=%t
for j=1:size(tt,1)
if tt(j,1)==txt(i,1) then
ok=%f
end
end
if ok then tt=[tt;txt(i,:)], end
end
txt=tt
end
end
end
endfunction
IRCOM Group
Alan Layec