Interfacing function
eng


LOGISTIQUE_f

File content


//LOGISTIQUE_f Scicos logistique function block
//Classical interface function ver1.0 - scilab-2.7
//18 novembre 2003 - IRCOM GROUP - Author : A.Layec
function [x,y,typ]=LOGISTIQUE_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;

case 'define' then

  model=scicos_model()
  model.sim=list('logistique',2)
  model.in=[-1;-1]
  model.out=-1
  model.evtin=[]
  model.evtout=[]
  model.dstate=[]
  model.rpar=[]
  model.ipar=[]
  model.blocktype='d'
  model.firing=[]
  model.dep_ut=[%t %f]

  gr_i=['thick=xget(''thickness'')'
        'pat=xget(''pattern'')'
        'fnt=xget(''font'')'
        'xset(''thickness'',2)'
        'aa=[0.067;0.076;0.084;0.093;0.102;0.111;0.12;0.129;0.138;0.146;'
        '    0.155;0.164;0.173;0.182;0.191;0.2;0.209;0.217;0.226;0.235;0.244;'
        '    0.253;0.262;0.271;0.279;0.288;0.297;0.306;0.315;0.324;0.333;0.342;'
        '    0.35;0.359;0.368;0.377;0.386;0.395;0.404;0.412;0.421;0.43;0.439;0.448;'
        '    0.457;0.466;0.475;0.483;0.492;0.501;0.51;0.519;0.528;0.537;0.545;0.554;'
        '    0.563;0.572;0.581;0.59;0.599;0.608;0.616;0.625;0.634;0.643;0.652;0.661;'
        '    0.67;0.678;0.687;0.696;0.705;0.714;0.723;0.732;0.741;0.749;0.758;0.767;'
        '    0.776;0.785;0.794;0.803;0.811;0.82;0.829;0.838;0.847;0.856;0.865;0.874;'
        '    0.882;0.891;0.9;0.909;0.918;0.927;0.936;0.944;0.953;0.953]'
        'bb=[0.072;0.105;0.138;0.17;0.201;0.231;0.261;0.29;0.319;0.346;0.373;'
        '    0.4;0.426;0.451;0.475;0.499;0.522;0.544;0.566;0.587;0.608;0.627;'
        '    0.646;0.665;0.683;0.7;0.716;0.732;0.747;0.761;0.775;0.788;0.8;'
        '    0.812;0.823;0.834;0.843;0.852;0.861;0.868;0.876;0.882;0.888;0.893;'
        '    0.897;0.901;0.904;0.906;0.908;0.909;0.909;0.909;0.908;0.906;0.904;'
        '    0.901;0.897;0.893;0.888;0.882;0.876;0.869;0.862;0.853;0.844;0.835;0.824;'
        '    0.813;0.802;0.789;0.776;0.763;0.748;0.733;0.718;0.701;0.684;0.667;'
        '    0.648;0.629;0.609;0.589;0.568;0.546;0.524;0.501;0.477;0.453;0.428;'
        '    0.402;0.376;0.349;0.321;0.293;0.264;0.234;0.204;0.173;0.141;0.109;'
        '    0.075;0.075]'
        'xpoly(orig(1)+aa*sz(1),orig(2)+bb*sz(2),"'lines"')'
        'txt=''LOGISTIC'';'
        '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)'
        'xset(''font'',fnt(1),fnt(2))'
       ]
  exprs=[];
  x=standard_define([2 2],model,exprs,gr_i)
end
endfunction