Interfacing function
eng


PEVTDLY_f

File content


//PEVTDLY_f Scicos Phase Modulator Event block
//Classical interface function ver1.0 - scilab-3.0
//7 octobre 2003 - IRCOM GROUP - Author : A.Layec
//14 janvier 2005 : passage type 4
function [x,y,typ]=PEVTDLY_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,period,init_time,exprs]=getvalue('Scicos Phase Modulator Event block',...
      ['Period';'Init time'],...
      list('vec',1,'vec',1),exprs);

      if ~ok then break,end;

      if ok then
           graphics.exprs=exprs;
           model.rpar=period;
           model.firing=[init_time;-1;-1];
           x.graphics=graphics; x.model=model;
           break;
      end
   end

case 'define' then

  period=0.1;
  init_time=0;

  model=scicos_model()
  model.sim=list('pevtdly',4)
  model.in=1
  model.evtin=1
  model.evtout=[1;1;1]
  model.dstate=0
  model.rpar=period
  model.blocktype='d'
  model.firing=[init_time;-1;-1]
  model.dep_ut=[%f %f]

  gr_i=['txt=[''Phase'';''Modulator''];';
    'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');']
  exprs=[sci2exp(period);sci2exp(init_time)];
  x=standard_define([3 2],model,exprs,gr_i)
end
endfunction