Interfacing function
eng


VCOEVT_f

File content


//VCOEVT_f Scicos Time transition calculator block
//Classical interface function ver1.0 - scilab-3
//8 avril 2004 - IRCOM GROUP - Author : A.Layec
function [x,y,typ]=VCOEVT_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,step,transition,init_trans,init_date,dyn_input,exprs]=getvalue('Scicos Time transition calculator block',...
      ['Step';'Value of transition';'Initital Value of transition';...
      'Date of initial output event';'Dynamical Value(0:No/1:Yes)'],...
      list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1),exprs);

      if ~ok then break,end;

      if ok then
        if dyn_input==1 then
           [model,graphics,ok]=check_io(model,graphics,[1;1],[],1,1)
           model.in=[1;1]
        else
           [model,graphics,ok]=check_io(model,graphics,1,[],1,1)
           model.in=1
        end
        model.dstate=[0;init_trans]
        model.rpar=[step;transition]
        model.ipar=[dyn_input]
        model.firing=init_date
        graphics.exprs=exprs
        x.graphics=graphics; x.model=model;
        break
      end
   end


case 'define' then
  step=1
  transition=2*%pi
  init_trans=2*%pi
  init_date=0
  dyn_input=0

  model=scicos_model()
  model.sim=list('vcoevt',4)
  model.in=[1]
  model.out=[]
  model.evtin=[1]
  model.evtout=1
  model.dstate=[0;init_trans]
  model.rpar=[step;transition]
  model.ipar=[dyn_input]
  model.blocktype='d'
  model.firing=init_date
  model.dep_ut=[%t %f]

  gr_i=['txt=[''VCOEVT''];';
    'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');']
  exprs=[string(step),string('2*%pi'),string('2*%pi'),string(init_date),string(dyn_input)]
  x=standard_define([2.5 2],model,exprs,gr_i)
end
endfunction