//DECODVEC_f Scicos Code by Symbole demultipliction block //Classical interface function ver1.0 - scilab-3.s //16 décembre 2004 - IRCOM GROUP - Author : A.Layec function [x,y,typ]=DECODVEC_f(job,arg1,arg2) x=[];y=[];typ=[] select job case 'plot' then standard_draw(arg1) case 'getinputs' then [x,y,typ]=standard_inputs(arg1) case 'getoutputs' then [x,y,typ]=standard_outputs(arg1) case 'getorigin' then [x,y]=standard_origin(arg1) case 'set' then x=arg1; graphics=arg1.graphics;model=arg1.model; exprs=graphics.exprs; while %t do [ok,nc,nus,pc,exprs]=getvalue('Set sequence/symbol demodulation block',... ['Size of sequence';'Size of symbol';'Port of sequence (1 or 2)'],... list('vec',-1,'vec',-1,'vec',-1),exprs); if ~ok then break,end; //nu=size(wo,'*') if (pc==1) then [model,graphics,ok]=check_io(model,graphics,[nc;nus],[nus],[],[]) else [model,graphics,ok]=check_io(model,graphics,[nus;nc],[nus],[],[]) end if ok then graphics.exprs=exprs; model.ipar=pc-1; x.graphics=graphics; x.model=model; break; end end case 'define' then pc=1 nc=31 nus=310 herit=1 model=scicos_model() model.sim=list('decodvec',4) model.in=[nc;nus] model.out=[nus] model.evtin=[] model.evtout=[] model.dstate=[] model.rpar=[] model.ipar=[pc-1] model.blocktype='d' model.firing=[] model.dep_ut=[%t %f] gr_i=['thick=xget(''thickness'')' 'pat=xget(''pattern'')' 'fnt=xget(''font'')' 'xset(''thickness'',3)' 'xpoly(orig(1)+[0.232;0.786]*sz(1),orig(2)+[0.901;0.109]*sz(2),""lines"")' 'xpoly(orig(1)+[0.243;0.762]*sz(1),orig(2)+[0.119;0.925]*sz(2),""lines"")' 'txt=''decoder'';' 'style=5;' 'rectstr=stringbox(txt,orig(1),orig(2),0,style,1);' 'w=(rectstr(1,3)-rectstr(1,2))*%zoom;' 'h=(rectstr(2,2)-rectstr(2,4))*%zoom;' 'xstringb(orig(1)+sz(1)/2-w/2,orig(2)-h-4,txt,w,h,''fill'');' 'e=gce();' 'e.font_style=style;' 'xset(''thickness'',thick)' 'xset(''pattern'',pat)' ] exprs=[sci2exp(nc),sci2exp(nus),sci2exp(pc)]; x=standard_define([2 2],model,exprs,gr_i) end endfunction