dessin_block - export block figure in eps file
dessin_block(name,flag)
- name : string. name of an interfacing function of a scicos block
- flag : string. option to set the up/down and letf/right margin
- 'html' : to produce a figure for html man page
- 'guide' : to produce a figure for man page with paper format
//dessin_block
//fonction qui charge une structure graphique
//d'un block scicos dans une liste scs_m et qui
//exporte les données graphiques en fichier eps
//grâce à la fonction mdo_export
//Entrée : nom de la fonction d'interface du block
// flag 'html' ou 'guide'
// lblock [] ou autre chose (renseigne sur le type de block)
function dessin_block(name,flag,lblock)
//vérifie présence lblock
if rsh<3 then
lblock=[];
end
//load scicos variable and library
bak=get('figure_style');
set("figure_style","old");
olds=get('old_style');
set('old_style','on');
//load scicos variable and library
load SCI/macros/scicos/lib
exec(loadpallibs,-1)
%scicos_prob=%f;
alreadyran=%f
needcompile=4
%zoom=1.8;
colmap=xget('colormap');
scs_m=scicos_diagram()
ierror=execstr('blk='+name+'(''define'')','errcatch')
if ierror <>0 then
x_message(['Error in GUI function';lasterror()] )
disp('define'+name)
fct=[]
return
end
blk.graphics.sz=20*blk.graphics.sz;
scs_m.objs(1)=blk
if flag=='html' then
if lblock<>[] then
newflag='html_lblock'
else
newflag='html_block'
end
else
if lblock<>[] then
newflag='guide_lblock'
else
newflag=flag
end
end
mdo_export(scs_m,name,newflag)
//restore figure_style
gg=xget('window') // for bug in figure_style and winsid
xset('window',0) // for bug in figure_style and winsid
set('figure_style',bak)
set('old_style',stripblanks(olds));
xset('window',gg) // for bug in figure_style and winsid
endfunction
IRCOM Group
Alan Layec