Scicos_blocks: clean Events blocks interfaces 30/13230/4
Paul Bignier [Tue, 26 Nov 2013 10:29:14 +0000 (11:29 +0100)]
Removed unused 'job' and 'gr_i' values.

Change-Id: Ia46abdddbb95d06d38a3ae0ec80e146576d1a28f

17 files changed:
scilab/modules/scicos_blocks/macros/Events/ANDBLK.sci
scilab/modules/scicos_blocks/macros/Events/ANDLOG_f.sci
scilab/modules/scicos_blocks/macros/Events/CLKSOMV_f.sci
scilab/modules/scicos_blocks/macros/Events/CLKSOM_f.sci
scilab/modules/scicos_blocks/macros/Events/CLKSPLIT_f.sci
scilab/modules/scicos_blocks/macros/Events/END_c.sci
scilab/modules/scicos_blocks/macros/Events/EVTDLY_c.sci
scilab/modules/scicos_blocks/macros/Events/EVTDLY_f.sci
scilab/modules/scicos_blocks/macros/Events/EVTGEN_f.sci
scilab/modules/scicos_blocks/macros/Events/EVTVARDLY.sci
scilab/modules/scicos_blocks/macros/Events/HALT_f.sci
scilab/modules/scicos_blocks/macros/Events/IFTHEL_f.sci
scilab/modules/scicos_blocks/macros/Events/MCLOCK_f.sci
scilab/modules/scicos_blocks/macros/Events/MFCLCK_f.sci
scilab/modules/scicos_blocks/macros/Events/M_freq.sci
scilab/modules/scicos_blocks/macros/Events/VirtualCLK0.sci
scilab/modules/scicos_blocks/macros/Events/freq_div.sci

index 53331fb..70bfcff 100644 (file)
 //
 
 function [x,y,typ]=ANDBLK(job,arg1,arg2)
-    x=[];y=[],typ=[]
+    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
     case "define" then
@@ -100,8 +94,7 @@ function [x,y,typ]=ANDBLK(job,arg1,arg2)
         x=scicos_block()
         x.gui="ANDBLK"
         x.graphics.sz=[2,2]
-        x.graphics.gr_i=list("xstringb(orig(1),orig(2),''ANDBLK'',sz(1),s"+...
-        "z(2),''fill'')",8);
+        x.graphics.gr_i=[];
         x.graphics.pein=[0;0]
         x.graphics.peout=0
         x.model.sim="csuper"
index 4409d2f..01c9adb 100644 (file)
 //
 
 function [x,y,typ]=ANDLOG_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    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;
     case "define" then
@@ -41,8 +35,7 @@ function [x,y,typ]=ANDLOG_f(job,arg1,arg2)
         model.firing=[]
         model.dep_ut=[%f %f]
 
-        gr_i=["txt=[''LOGICAL'';'' '';'' AND ''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 3],model,[],gr_i)
     end
 endfunction
index 2f7c15e..aece006 100644 (file)
 //
 
 function [x,y,typ]=CLKSOMV_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     p=1 //pixel sizes ratio
     select job
-        //**--------------------------------------------------------------------
-    case "plot" then
-        orig = arg1.graphics.orig ;
-        sz = arg1.graphics.sz ;
-        orient = arg1.graphics.flip;
-
-        thick = xget("thickness"); xset("thickness",2)
-        //** dash=xget('dashes'); xset('dashes',default_color(-1))
-        rx = sz(1)*p/2
-        ry = sz(2)/2
-        gr_i = arg1.graphics.gr_i ;
-
-        if type(gr_i)==15 then
-            xfarcs([orig(1);orig(2)+sz(2);sz(1)*p;sz(2);0;360*64],gr_i(2))
-            gh_temp = gce();
-            if gh_temp.type=="Compound" then
-                gh_temp.children(1).foreground = default_color(-1);
-            else
-                gh_temp.foreground = default_color(-1);
-            end
-        end
-
-        xarc(orig(1),orig(2)+sz(2),sz(1)*p,sz(2),0,360*64)
-        gh_temp = gce();
-        gh_temp.foreground = default_color(-1);
-
-        xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)
-        gh_temp = gce();
-        gh_temp.segs_color = [default_color(-1), default_color(-1)] ;
-
-        xset("thickness",thick);
-        //** port
-        out= [-1/14  0
-        0      -1/7
-        1/14   0]*3
-        xfpoly(sz(1)*out(:,1)+orig(1)+sz(1)/2,sz(2)*out(:,2)+orig(2),1);
-        gh_temp = gce();
-        gh_temp.foreground = default_color(-1);
-        gh_temp.background = default_color(-1);
-        //** xset('dashes',dash)
-        //**-------------------------------------------------------------------
-    case "getinputs" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        t=[3*%pi/2 0 %pi/2]
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))
-        y=r*cos(t)+(orig(2)+r)*ones(t)
-        typ=-ones(x)
-    case "getoutputs" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        t=%pi
-        dy=sz(2)/7
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))
-        y=r*cos(t)+(orig(2)+r)*ones(t)+dy
-        typ=-ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
@@ -97,8 +37,7 @@ function [x,y,typ]=CLKSOMV_f(job,arg1,arg2)
         model.firing=-1
         model.dep_ut=[%f %f]
 
-        gr_i=["rx=sz(1)*p/2;ry=sz(2)/2"
-        "xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)"]
+        gr_i=[]
         x=standard_define([2 2],model,[],gr_i)
     end
 endfunction
index 3e5dabb..ff4470f 100644 (file)
 //
 
 function [x,y,typ]=CLKSOM_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     p=1 //pixel sizes ratio
     select job
-    case "plot" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-
-        thick=xget("thickness");xset("thickness",2)
-        //** dash=xget('dashes');xset('dashes',default_color(-1))
-        rx=sz(1)*p/2
-        ry=sz(2)/2
-        gr_i=arg1.graphics.gr_i;
-        if type(gr_i)==15 then
-            xfarcs([orig(1);orig(2)+sz(2);sz(1)*p;sz(2);0;360*64],gr_i(2))
-            gh_temp = gce();
-            if gh_temp.type=="Compound" then
-                gh_temp.children(1).foreground = default_color(-1);
-            else
-                gh_temp.foreground = default_color(-1);
-            end
-        end
-        xarc(orig(1),orig(2)+sz(2),sz(1)*p,sz(2),0,360*64)
-        gh_temp = gce();
-        gh_temp.foreground = default_color(-1);
-        xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)
-        gh_temp = gce();
-        gh_temp.segs_color = [default_color(-1), default_color(-1)];
-
-        xset("thickness",thick);
-        if orient then  //standard orientation
-            out= [0  -1/14
-            1/7    0
-            0   1/14]*3
-            xfpoly(sz(1)*out(:,1)+orig(1)+sz(1)*p,sz(2)*out(:,2)+orig(2)+sz(2)/2,1)
-        else //tilded orientation
-            out= [0   -1/14
-            -1/7    0
-            0   1/14]*3
-            xfpoly(sz(1)*out(:,1)+orig(1),sz(2)*out(:,2)+orig(2)+sz(2)/2,1)
-        end
-        gh_temp = gce();
-        gh_temp.foreground = default_color(-1);
-        gh_temp.background = default_color(-1);
-        //** xset('dashes',dash)
-    case "getinputs" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-        if orient then
-            t=[%pi -%pi/2 0]
-        else
-            t=[%pi %pi/2 0]
-        end
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))
-        y=r*cos(t)+(orig(2)+r)*ones(t)
-        typ=-ones(x)
-    case "getoutputs" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-        if orient then
-            t=%pi/2
-            dx=sz(1)/7
-        else
-            t=-%pi/2
-            dx=-sz(1)/7
-        end
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))+dx
-        y=r*cos(t)+(orig(2)+r)*ones(t)
-        typ=-ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
@@ -108,8 +36,7 @@ function [x,y,typ]=CLKSOM_f(job,arg1,arg2)
         model.firing=-1
         model.dep_ut=[%f %f]
 
-        gr_i=["rx=sz(1)*p/2;ry=sz(2)/2"
-        "xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)"]
+        gr_i=[]
         x=standard_define([1 1]/1.2,model,[],gr_i)
     end
 endfunction
index f18b4e1..518b7b3 100644 (file)
@@ -24,31 +24,12 @@ function [x,y,typ] = CLKSPLIT_f(job,arg1,arg2)
     //** 23           ... but it was not here :(
     //** 26 June 2006: eliniating the /scicos_blocks/Events/<duplicate> !
 
-    x=[];y=[],typ=[];
+    x=[];
+    y=[];
+    typ=[];
 
     select job
 
-    case "plot" then
-        //**--- This is the function that DRAW the object
-        //pause ; //** debug
-        orig = arg1.graphics.orig ;
-        xarc(orig(1), orig(2)+1.0 , 1.0 , 1.0 , 0, 360*64)
-
-    case "getinputs" then
-        orig = arg1.graphics.orig;
-        x = orig(1)
-        y = orig(2)
-        typ = -ones(x)
-
-    case "getoutputs" then
-        orig=arg1.graphics.orig;
-        x=[1,1]*orig(1)
-        y=[1,1]*orig(2)
-        typ=-ones(x)
-
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
-
     case "set" then
         x=arg1;
 
index c406f83..f014d70 100644 (file)
 //
 
 function [x,y,typ]=END_c(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,tf,exprs]=scicos_getvalue("Set final simulation time",..
             ["Final simulation time"],list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
                 graphics.exprs=exprs
                 model.firing=tf
@@ -57,7 +54,7 @@ function [x,y,typ]=END_c(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(tf)
-        gr_i=["xstringb(orig(1),orig(2),'' END '',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 6c4e2d1..e4a0e02 100644 (file)
 //
 
 function [x,y,typ]=EVTDLY_c(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,dt,ff,exprs]=scicos_getvalue(["Set Event Delay block parameters";
@@ -44,7 +39,9 @@ function [x,y,typ]=EVTDLY_c(job,arg1,arg2)
             "       to disable any output event."],..
             ["Delay";"Date of initial output event"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if dt<=0 then
                 message("Delay must be positive")
                 ok=%f
@@ -71,9 +68,7 @@ function [x,y,typ]=EVTDLY_c(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(dt);sci2exp(ff)]
-        gr_i=["dt=o.model.rpar(1);";
-        "txt=[''Delay'';string(dt)];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 9232865..4a2f243 100644 (file)
 //
 
 function [x,y,typ]=EVTDLY_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,dt,ff,exprs]=scicos_getvalue(["Set Event Delay  block parameters";
@@ -44,7 +39,9 @@ function [x,y,typ]=EVTDLY_f(job,arg1,arg2)
             "       if no initial event required"],..
             ["Delay";"Date of initial output event"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if dt<=0 then
                 message("Delay must be positive")
                 ok=%f
@@ -53,7 +50,8 @@ function [x,y,typ]=EVTDLY_f(job,arg1,arg2)
                 graphics.exprs=exprs
                 model.rpar=dt
                 model.firing=ff
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -70,9 +68,7 @@ function [x,y,typ]=EVTDLY_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(dt);sci2exp(ff)]
-        gr_i=["dt=o.model.rpar;";
-        "txt=[''Delay'';string(dt)];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 2933f18..b76ccc6 100644 (file)
 //
 
 function [x,y,typ]=EVTGEN_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,tt,exprs]=scicos_getvalue("Set Event time",..
             ["Event Time"],list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             if model.firing<>tt then
                 model.firing=tt
             end
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
             break
         end
     case "define" then
@@ -55,9 +53,7 @@ function [x,y,typ]=EVTGEN_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(tt)
-        gr_i=["tt=model.firing;";
-        "txt=[''Event at'';''time ''+string(tt)];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 12d6448..ff438de 100644 (file)
 //
 
 function [x,y,typ]=EVTVARDLY(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,fir,exprs]=scicos_getvalue("Set parameter of variable event delay",..
             "Initial event firing time (<0 if absent)",..
             list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             model.firing=fir
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
             break
         end
     case "define" then
@@ -55,7 +53,7 @@ function [x,y,typ]=EVTVARDLY(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
         exprs=string(model.firing)
-        gr_i=["xstringb(orig(1),orig(2),[''Event'';''Delay''],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 359affb..f6f5881 100644 (file)
 //
 
 function [x,y,typ]=HALT_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,n,exprs]=scicos_getvalue("Set Halt block parameters",..
             ["State on halt"],list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
                 graphics.exprs=exprs
                 model.ipar=n
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -56,7 +54,7 @@ function [x,y,typ]=HALT_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(n)
-        gr_i=["xstringb(orig(1),orig(2),''STOP'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index ff673a5..2261a5f 100644 (file)
 //
 
 function [x,y,typ]=IFTHEL_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if exprs==[] then exprs=string(1);end
-        if size(exprs,"*")==1 then exprs(2)=string(1);end
+        if exprs==[] then
+            exprs=string(1);
+        end
+        if size(exprs,"*")==1 then
+            exprs(2)=string(1);
+        end
         while %t do
             [ok,inh,nmod,exprs]=scicos_getvalue("Set parameters",..
             ["Inherit (1: no, 0: yes)";"zero-crossing (0: no, 1: yes)"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             model.dep_ut=[%t %f];  //compatibility
-            if nmod<>0 then nmod=1,end
-            if inh<>1 then inh=[]; end
+            if nmod<>0 then
+                nmod=1,
+            end
+            if inh<>1 then
+                inh=[];
+            end
             [model,graphics,ok]=check_io(model,graphics,1,[],inh,[1;1])
             if ok then
                 graphics.exprs=exprs;
@@ -51,7 +56,8 @@ function [x,y,typ]=IFTHEL_f(job,arg1,arg2)
                 model.sim(2)=-1
                 model.nmode=nmod
                 model.nzcross=nmod
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -69,8 +75,7 @@ function [x,y,typ]=IFTHEL_f(job,arg1,arg2)
         model.nmode=1
         model.nzcross=1
 
-        gr_i=["txt=[''If in>0'';'' '';'' then    else''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         exprs=[string(model.in);string(model.nmode)];
         x=standard_define([3 3],model,exprs,gr_i)
     end
index 4ec25bb..2dd62f6 100644 (file)
 //
 
 function [x,y,typ]=MCLOCK_f(job,arg1,arg2)
-    x=[];y=[],typ=[]
+    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
         // look for the clock block
         for i=1:length(arg1.model.rpar.objs) do
@@ -103,8 +97,7 @@ function [x,y,typ]=MCLOCK_f(job,arg1,arg2)
         split2.graphics.pein=5
         split2.graphics.peout=[12;13]
 
-        gr_i=["txt=[''2freq clock'';''  f/n     f''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
 
         diagram=scicos_diagram();
         diagram.objs(1)=mfclck
index 2f1c8ba..db49bc2 100644 (file)
 //
 
 function [x,y,typ]=MFCLCK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    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;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         [ok,dt,nn,exprs]=scicos_getvalue("Set Multifrequency clock parameters",..
         ["basic period (1/f)";"multiply by (n)"],list("vec",1,"vec",1),exprs)
         if ok then
             model.ipar=nn
             model.rpar=dt;
-            hh=model.firing;hh(2)=0;model.firing=hh //compatibility
+            hh=model.firing;
+            hh(2)=0;
+            model.firing=hh //compatibility
             graphics.exprs=exprs
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
         end
     case "define" then
         nn=2
@@ -58,8 +56,7 @@ function [x,y,typ]=MFCLCK_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(dt);string(nn)]
-        gr_i=["txt=[''M. freq'';''clock''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 4cd272e..59c4699 100644 (file)
 //
 
 function [x,y,typ]=M_freq(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    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;
@@ -39,12 +33,20 @@ function [x,y,typ]=M_freq(job,arg1,arg2)
             [ok,frequ,offset,exprs]=scicos_getvalue("Set block parameters",..
             ["Sample time";"Offset"],..
             list("vec",-1,"vec",-1),exprs)
-            if ~ok then break,end
-            offset=offset(:);frequ=frequ(:);
-            if (size(frequ,"*"))<>(size(offset,"*")) then message("offset and frequency must have the same size");ok=%f;
-            elseif or(frequ<0) then message("Frequency must be a positif number");ok=%f;
+            if ~ok then
+                break,
+            end
+            offset=offset(:);
+            frequ=frequ(:);
+            if (size(frequ,"*"))<>(size(offset,"*")) then
+                message("offset and frequency must have the same size");
+                ok=%f;
+            elseif or(frequ<0) then
+                message("Frequency must be a positif number");
+                ok=%f;
             elseif or(abs(offset) > frequ) then
-                message("The |Offset| must be less than the Frequency");ok=%f
+                message("The |Offset| must be less than the Frequency");
+                ok=%f
             end
             if ok then
                 [m,den,off,count,m1,fir,frequ,offset,ok]=mfrequ_clk(frequ,offset);
@@ -53,8 +55,10 @@ function [x,y,typ]=M_freq(job,arg1,arg2)
                 model.opar=list(m,double(den),off,count)
                 mn=(2**size(m1,"*"))-1;
                 [model,graphics,ok]=set_io(model,graphics,list(),list(),1,ones(mn,1))
-                if mn>3 then graphics.sz=[40+(mn-3)*10 40]
-                else graphics.sz=[50 40]
+                if mn>3 then
+                    graphics.sz=[40+(mn-3)*10 40]
+                else
+                    graphics.sz=[50 40]
                 end
                 model.firing=fir;
                 graphics.exprs=exprs
@@ -74,7 +78,7 @@ function [x,y,typ]=M_freq(job,arg1,arg2)
         model.firing=[0 -1 -1]
         model.dep_ut=[%f %f]
         exprs=[sci2exp([1;2]);sci2exp([0;0])]
-        gr_i=["xstringb(orig(1),orig(2),[''      Multiple    '';''    Frequency    ''],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 3b04ac0..b17f1e9 100644 (file)
 //
 function [x,y,typ]=VirtualCLK0(job,arg1,arg2)
     // Copyright INRIA
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        orig=arg1.graphics.orig;sz=arg1.graphics.sz;orient=arg1.graphics.flip;
-        pat=xget("pattern");xset("pattern",default_color(-1))
-        thick=xget("thickness");xset("thickness",2)
-        xx=[0:.01:1];
-        yy=(1/4-(xx-1/2)^2)^(1/2)+1/2;
-        x=(orig(1))*ones(1,101)+sz(1)*xx;
-        y=(orig(2))*ones(1,101)+sz(2)*yy;
-        xset("thickness",2);
-        xpolys(x',y',5*ones(101,1));
-        xx=[1:-.01:.01 0];
-        yy=-(1/4-(xx-1/2)^2)^(1/2)+1/2;
-        x=(orig(1))*ones(1,101)+sz(1)*xx;
-        y=(orig(2))*ones(1,101)+sz(2)*yy;
-        xpolys(x',y',5*ones(101,1));
-        xset("thickness",1);
-        xstringb(orig(1),orig(2),"CLK0",sz(1),sz(2),"fill")
-        x=orig(1)*ones(1,2)+sz(1)*[1/2 1/2];
-        y=(orig(2))*ones(1,2)+sz(2)*[1/2 15/16];
-        xpolys(x',y',2*ones(2,1));
-        x=(orig(1))*ones(1,2)+sz(1)*[1/2 1/2+(3*2^(1/2))/16];
-        y=(orig(2))*ones(1,2)+sz(2)*[1/2 1/2+(3*2^(1/2))/16];
-        xpolys(x',y',2*ones(2,1));
-        xset("thickness",thick)
-        xset("pattern",pat)
-        xf=40
-        yf=60
-        nin=1;
-        if ~orient then
-            in=[-1/14   0
-            0       1/7
-            1/14    0
-            -1/14   0]*diag([xf,yf])
-            dy=sz(1)/(nin+1)
-            xset("pattern",5)
-            for k=1:nin
-                xfpoly(in(:,1)+ones(4,1)*(orig(1)+sz(1)-dy*k),..
-                in(:,2)+ones(4,1)*(orig(2)-yf/7),5)
-            end
-        else
-            in=[-1/14   0
-            0       -1/7
-            1/14    0
-            -1/14   0]*diag([xf,yf])
-            dy=sz(1)/(nin+1)
-            xset("pattern",5)
-            for k=1:nin
-                xfpoly(in(:,1)+ones(4,1)*(orig(1)+sz(1)-dy*k),..
-                in(:,2)+ones(4,1)*(orig(2)+sz(2)+yf/7),5)
-            end
-        end
-
-        x=[];y=[]
-    case "getinputs" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        if arg1.graphics.flip then
-            x=orig(1)+sz(1)/2
-            y=orig(2)+sz(2)
-        else
-            x=orig(1)+sz(1)/2
-            y=orig(2)
-        end
-        typ=-ones(x) //undefined type
-    case "getoutputs" then
-        x=[];y=[];typ=[]
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
index c344cb3..4fae5ea 100644 (file)
 //
 
 function [x,y,typ]=freq_div(job,arg1,arg2)
-    x=[];y=[],typ=[]
+    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
         // look for the modulo block
         for i=1:length(arg1.model.rpar.objs) do
@@ -52,22 +46,30 @@ function [x,y,typ]=freq_div(job,arg1,arg2)
         xx=arg1(spath)// get the block
         //execstr('xxn='+xx.gui+'(''set'',xx)')
         xxn=xx;
-        graphics=xx.graphics;exprs=graphics.exprs
+        graphics=xx.graphics;
+        exprs=graphics.exprs
         model=xx.model;
         while %t do
             [ok,%ph,%df,exprs]=scicos_getvalue..
             ("Set frequency division block parameters",..
             ["Phase (0 to division factor -1)";"Division factor"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if %df<1 then %df=1,end
+                if %df<1 then
+                    %df=1,
+                end
                 %ph=abs(%ph)
-                if %ph>%df-1 then %ph=%df-1,end
+                if %ph>%df-1 then
+                    %ph=%df-1,
+                end
                 graphics.exprs=exprs
                 model.ipar=%df;
                 model.dstate=%ph;
-                xxn.graphics=graphics;xxn.model=model
+                xxn.graphics=graphics;
+                xxn.model=model
                 break
             end
         end
@@ -278,7 +280,7 @@ function [x,y,typ]=freq_div(job,arg1,arg2)
         model.evtout = 1;
         model.rpar = scs_m_1;
 
-        gr_i="xstringb(orig(1),orig(2),''freq_div'',sz(1),sz(2),''fill'')";
+        gr_i=[];
         x=standard_define([3 2],model,[],gr_i)
     end
 endfunction