Scicos_blocks: clean Sources blocks interfaces 47/13247/3
Paul Bignier [Wed, 27 Nov 2013 09:36:44 +0000 (10:36 +0100)]
Removed unused 'job' and 'gr_i' values.

Change-Id: I5b282ae3212ac25ca9146a17af670521872c77c4

33 files changed:
scilab/modules/scicos_blocks/macros/Sources/CLKINV_f.sci
scilab/modules/scicos_blocks/macros/Sources/CLKIN_f.sci
scilab/modules/scicos_blocks/macros/Sources/CLOCK_c.sci
scilab/modules/scicos_blocks/macros/Sources/CLOCK_f.sci
scilab/modules/scicos_blocks/macros/Sources/CONST.sci
scilab/modules/scicos_blocks/macros/Sources/CONST_f.sci
scilab/modules/scicos_blocks/macros/Sources/CONST_m.sci
scilab/modules/scicos_blocks/macros/Sources/CURVE_c.sci
scilab/modules/scicos_blocks/macros/Sources/CURV_f.sci
scilab/modules/scicos_blocks/macros/Sources/Counter.sci
scilab/modules/scicos_blocks/macros/Sources/FROMWSB.sci
scilab/modules/scicos_blocks/macros/Sources/FROMWS_c.sci
scilab/modules/scicos_blocks/macros/Sources/GENSIN_f.sci
scilab/modules/scicos_blocks/macros/Sources/GENSQR_f.sci
scilab/modules/scicos_blocks/macros/Sources/GEN_SQR.sci
scilab/modules/scicos_blocks/macros/Sources/Ground_g.sci
scilab/modules/scicos_blocks/macros/Sources/INIMPL_f.sci
scilab/modules/scicos_blocks/macros/Sources/IN_f.sci
scilab/modules/scicos_blocks/macros/Sources/Modulo_Count.sci
scilab/modules/scicos_blocks/macros/Sources/PULSE_SC.sci
scilab/modules/scicos_blocks/macros/Sources/RAMP.sci
scilab/modules/scicos_blocks/macros/Sources/RAND_f.sci
scilab/modules/scicos_blocks/macros/Sources/RAND_m.sci
scilab/modules/scicos_blocks/macros/Sources/READAU_f.sci
scilab/modules/scicos_blocks/macros/Sources/READC_f.sci
scilab/modules/scicos_blocks/macros/Sources/RFILE_f.sci
scilab/modules/scicos_blocks/macros/Sources/SAWTOOTH_f.sci
scilab/modules/scicos_blocks/macros/Sources/STEP.sci
scilab/modules/scicos_blocks/macros/Sources/STEP_FUNCTION.sci
scilab/modules/scicos_blocks/macros/Sources/SampleCLK.sci
scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci
scilab/modules/scicos_blocks/macros/Sources/TIME_f.sci
scilab/modules/scicos_blocks/macros/Sources/TKSCALE.sci

index e4e1c58..117cc4f 100644 (file)
 //
 
 function [x,y,typ]=CLKINV_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        gr_i=arg1.graphics.gr_i;
-
-        prt=arg1.model.ipar
-        pat=xget("pattern");xset("pattern",default_color(-1))
-        thick=xget("thickness");xset("thickness",2)
-        x=orig(1)+sz(1)*[1/2;1;  1;0;0  ]
-        y=orig(2)+sz(2)*[0;  1/3;1;1;1/3]
-        xo=orig(1);yo=orig(2)+sz(2)/3
-
-        if type(gr_i)==15 then
-            coli=gr_i(2);
-            xfpolys(x,y,coli);
-            pcoli=xget("pattern");xset("pattern",coli)
-            xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5)
-            xset("pattern",pcoli)
-            xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5)
-        else
-            xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5)
-            xpoly(x,y,"lines",1)
-        end
-
-        xset("thickness",thick)
-        xset("pattern",pat)
-        //identification
-        ident = arg1.graphics.id
-        if ident <> [] & ident <> "" then
-            font=xget("font")
-            xset("font", options.ID(1)(1), options.ID(1)(2))
-            rectangle = xstringl(orig(1), orig(2)+3/2*sz(2), ident)
-            w = rectangle(3)
-            h = rectangle(4)
-            xstringb(orig(1) + sz(1)/2 -w/2, orig(2)+sz(2)+h/2 , ident , w, h)
-            xset("font", font(1), font(2))
-        end
-    case "getinputs" then
-        x=[];y=[];typ=[]
-    case "getoutputs" then
-        orig=arg1.graphics.orig
-        sz=arg1.graphics.sz
-        x=orig(1)+sz(1)/2
-        y=orig(2)
-        typ=-ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
         graphics=arg1.graphics
@@ -82,7 +37,9 @@ function [x,y,typ]=CLKINV_f(job,arg1,arg2)
             gettext("Event input port");" ";], "Port Number", ..
             list("vec", 1),exprs);
             prt=int(prt)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if prt <= 0 then
                 block_parameter_error(msprintf(gettext("Wrong values for ''Port Number'' parameter: %d."), prt), ..
                 gettext("Strictly positive integer expected."));
@@ -107,8 +64,7 @@ function [x,y,typ]=CLKINV_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=string(prt)
-        gr_i=["xo=orig(1);yo=orig(2)+sz(2)/3";
-        "xstringb(xo,yo,string(prt),sz(1),sz(2)/1.5)"]
+        gr_i=[]
         x=standard_define([1 1],model,exprs,gr_i)
     end
 endfunction
index d5901a3..6c4c1c6 100644 (file)
 //
 
 function [x,y,typ]=CLKIN_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        orig=arg1.graphics.orig;sz=arg1.graphics.sz;orient=arg1.graphics.flip;
-        prt=arg1.model.ipar
-        pat=xget("pattern");xset("pattern",default_color(-1))
-        thick=xget("thickness");xset("thickness",2)
-        if orient then
-            x=orig(1)+sz(1)*[-1/6;-1/6;1/1.5;1;1/1.5]
-            y=orig(2)+sz(2)*[0;1;1; 1/2;0]
-            xo=orig(1);yo=orig(2)+sz(2)/12
-        else
-            x=orig(1)+sz(1)*[0;1/3;7/6;7/6;1/3]
-            y=orig(2)+sz(2)*[1/2;1;1;0;0]
-            xo=orig(1)+sz(1)/3;yo=orig(2)+sz(2)/12
-        end
-
-        gr_i=arg1.graphics.gr_i;
-        if type(gr_i)==15 then
-            coli=gr_i(2);pcoli=xget("pattern")
-            xfpolys(x,y,coli);
-            xset("pattern",coli)
-            xstringb(xo,yo,string(prt),sz(1)/1.5,sz(2))
-            xset("pattern",pcoli)
-            xstringb(xo,yo,string(prt),sz(1)/1.5,sz(2))
-        else
-            xstringb(xo,yo,string(prt),sz(1)/1.5,sz(2))
-            xpoly(x,y,"lines",1)
-        end
-
-        xset("thickness",thick)
-        xset("pattern",pat)
-        //identification
-        ident = arg1.graphics.id
-        if ident <> [] & ident <> "" then
-            font=xget("font")
-            xset("font", options.ID(1)(1), options.ID(1)(2))
-            rectangle = xstringl(orig(1)+3/2*sz(1), orig(2), ident)
-            w = rectangle(3)
-            h = rectangle(4)
-            xstringb(orig(1) + 3/2 * sz(1), orig(2) + sz(2) * 0.5 , ident , w, h)
-            xset("font", font(1), font(2))
-        end
-        x=[];y=[]
-    case "getinputs" then
-        x=[];y=[];typ=[]
-    case "getoutputs" then
-        orig=arg1.graphics.orig;sz=arg1.graphics.sz;
-        if arg1.graphics.flip then
-            x=orig(1)+sz(1)
-            y=orig(2)+sz(2)/2
-        else
-            x=orig(1)
-            y=orig(2)+sz(2)/2
-        end
-        typ=-ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
         graphics=arg1.graphics;
@@ -89,7 +35,9 @@ function [x,y,typ]=CLKIN_f(job,arg1,arg2)
             [ok,prt,exprs]=scicos_getvalue("Set Event Input block parameters",..
             "Port number",list("vec",1),exprs)
             prt=int(prt)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if prt<=0 then
                 message("Port number must be a positive integer")
             else
index b3f3664..02a150b 100644 (file)
 //
 
 function [x,y,typ]=CLOCK_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
         // look for the evtdly block
         for i=1:length(arg1.model.rpar.objs) do
@@ -51,7 +45,9 @@ function [x,y,typ]=CLOCK_c(job,arg1,arg2)
             [ok, dt, t0, exprs0]=scicos_getvalue([msprintf(gettext("Set %s block parameters"), "CLOCK_c");" "; gettext("Event clock generator");" "; ..
             gettext("&nbsp; Do not start if ''Initialisation Time'' is negative");" "], [gettext("Period");gettext("Initialisation Time")], list("vec",1,"vec",1), exprs);
 
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if dt <= 0 then
                 block_parameter_error(msprintf(gettext("Wrong values for ''%s'' parameter: %5.1e."), gettext("Period"), dt), gettext("Strictly positive number expected."));
                 ok=%f
@@ -70,7 +66,11 @@ function [x,y,typ]=CLOCK_c(job,arg1,arg2)
             // parameter  changed
             newpar(size(newpar)+1)=path// Notify modification
         end
-        if t0_old<>t0 then needcompile=2,else needcompile=0,end
+        if t0_old<>t0 then
+            needcompile=2,
+        else
+            needcompile=0,
+        end
         x=arg1
         y=needcompile
         typ=newpar
@@ -98,23 +98,7 @@ function [x,y,typ]=CLOCK_c(job,arg1,arg2)
         split.graphics.pein=3,
         split.graphics.peout=[5;6]
 
-        gr_i=list(["wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "rx=sz(1)*p/2;ry=sz(2)/2;";
-        "xarcs([orig(1)+0.05*sz(1);";
-        "orig(2)+0.95*sz(2);";
-        "   0.9*sz(1)*p;";
-        "   0.9*sz(2);";
-        "   0;";
-        "   360*64],scs_color(5));";
-        "xset(''thickness'',1);";
-        "xx=[orig(1)+rx    orig(1)+rx;";
-        "    orig(1)+rx    orig(1)+rx+0.6*rx*cos(%pi/6)];";
-        "yy=[orig(2)+ry    orig(2)+ry ;";
-        "  orig(2)+1.8*ry  orig(2)+ry+0.6*ry*sin(%pi/6)];";
-        "xsegs(xx,yy,scs_color(10));";
-        "xset(''thickness'',thick);"],8)
+        gr_i=[]
         diagram=scicos_diagram();
         diagram.objs(1)=output_port
         diagram.objs(2)=evtdly
index d051597..9dd1461 100644 (file)
 //
 
 function [x,y,typ]=CLOCK_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 internal edge trigger block
         for i=1:length(arg1.model.rpar.objs) do
@@ -50,7 +44,9 @@ function [x,y,typ]=CLOCK_f(job,arg1,arg2)
         while %t do
             [ok,dt,t0,exprs0]=scicos_getvalue("Set Clock  block parameters",..
             ["Period";"Init time"],list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if dt<=0 then
                 message("period must be positive")
                 ok=%f
@@ -68,7 +64,11 @@ function [x,y,typ]=CLOCK_f(job,arg1,arg2)
             // parameter  changed
             newpar(size(newpar)+1)=path// Notify modification
         end
-        if t0_old<>t0 then needcompile=2,else needcompile=0,end
+        if t0_old<>t0 then
+            needcompile=2,
+        else
+            needcompile=0,
+        end
         x=arg1
         y=needcompile
         typ=newpar
@@ -96,23 +96,7 @@ function [x,y,typ]=CLOCK_f(job,arg1,arg2)
         split.graphics.pein=3,
         split.graphics.peout=[5;6]
 
-        gr_i=list(["wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "rx=sz(1)*p/2;ry=sz(2)/2;";
-        "xarcs([orig(1)+0.05*sz(1);";
-        "orig(2)+0.95*sz(2);";
-        "   0.9*sz(1)*p;";
-        "   0.9*sz(2);";
-        "   0;";
-        "   360*64],scs_color(5));";
-        "xset(''thickness'',1);";
-        "xx=[orig(1)+rx    orig(1)+rx;";
-        "    orig(1)+rx    orig(1)+rx+0.6*rx*cos(%pi/6)];";
-        "yy=[orig(2)+ry    orig(2)+ry ;";
-        "  orig(2)+1.8*ry  orig(2)+ry+0.6*ry*sin(%pi/6)];";
-        "xsegs(xx,yy,scs_color(10));";
-        "xset(''thickness'',thick);"],8)
+        gr_i=[]
         diagram=scicos_diagram();
         diagram.objs(1)=output_port
         diagram.objs(2)=evtdly
index e702452..e674dc7 100644 (file)
 //
 
 function [x,y,typ]=CONST(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        C=arg1.graphics.exprs;
-        standard_draw(arg1)
-    case "getinputs" then
-        x=[];y=[];typ=[];
-    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,C,exprs]=scicos_getvalue(["Set Contant Block"],..
             "Constant",list("vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             nout=size(C,"*")
             if nout==0 then
                 message("C must have at least one element")
             else
                 model.rpar=C(:);model.out=nout
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break;
             end
         end
@@ -61,10 +58,7 @@ function [x,y,typ]=CONST(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=strcat(sci2exp(C))
-        gr_i=["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;"
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index b06cdd8..4b93119 100644 (file)
@@ -32,7 +32,9 @@ function [x,y,typ]=CONST_f(job,arg1,arg2)
         while %t do
             [ok,C,exprs]=scicos_getvalue(["Set Contant Block"],..
             "Constant",list("vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             nout=size(C,"*")
             if nout==0 then
                 message("C must have at least one element")
index 1107b45..5421903 100644 (file)
 //
 
 function [x,y,typ]=CONST_m(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        C=arg1.graphics.exprs;
-        standard_draw(arg1)
-    case "getinputs" then
-        x=[];y=[];typ=[];
-    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, C, exprs] = scicos_getvalue([msprintf(gettext("Set %s block parameters"), "CONST_m");" "; ..
             gettext("Constant value generator");" "], gettext("Constant Value"), list("vec", -1), exprs)
 
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             nout=size(C)
             if find(nout==0)<>[] then
                 block_parameter_error(msprintf(gettext("Wrong size for ''%s'' parameter"), gettext("Constant Value")), gettext("Constant value must have at least one element."));
@@ -75,7 +71,8 @@ function [x,y,typ]=CONST_m(job,arg1,arg2)
                     model.rpar=[]
                     [model,graphics,ok]=set_io(model,graphics,list(),list(nout,ot),[],[])
                     graphics.exprs=exprs;
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break;
                 end
             end
@@ -94,10 +91,7 @@ function [x,y,typ]=CONST_m(job,arg1,arg2)
         model.blocktype="d"
         model.dep_ut=[%f %f]
         exprs=sci2exp(C)
-        gr_i=["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;"
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index d22ebdd..d5c87f6 100644 (file)
 
 function [x,y,typ]=CURVE_c(job,arg1,arg2)
     //** 07/01/2008 : Adapted fot Scilab 5.0 by Simone Mannori
-    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;
@@ -54,7 +44,9 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2)
             " Method (0..7)";"x";"y";"Periodic signal(y/n)?";"Launch"+...
             " graphic window(y/n)?"],list("vec",1,"vec",-1, ...
             "vec",-1,"str",1,"str",1),exprs)
-            if  ~ok then break;end
+            if  ~ok then
+                break;
+            end
 
             if PeriodicOption=="y" | PeriodicOption=="Y" then
                 PO=1;
@@ -75,8 +67,10 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2)
             METHOD = getmethod(mtd);
 
             if ~Ask_again then
-                xx=xx(:); yy=yy(:);
-                [nx,mx] = size(xx); [ny,my]=size(yy);
+                xx=xx(:);
+                yy=yy(:);
+                [nx,mx] = size(xx);
+                [ny,my]=size(yy);
                 if ~((nx==ny)&(mx==my)) then
                     messagebox("Incompatible size of [x] and [y]","modal","error");
                     Ask_again = %t;
@@ -100,23 +94,36 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2)
                     end
                     //** see below in this file; "poke_point" is very similar to "edit_curv"
                     [orpar,oipar,ok] = poke_point(xy,ipar,rpar); //** HERE WE ARE +++++++++++++++++++++++++++++++++++
-                    if ~ok then break;end;//  exit without save
+                    if ~ok then
+                        break;
+                    end;//  exit without save
 
                     // verifying the data change
-                    N2=oipar(1);xy2=[orpar(1:N2),orpar(N2+1:2*N2)];
+                    N2=oipar(1);
+                    xy2=[orpar(1:N2),orpar(N2+1:2*N2)];
                     New_methhod=oipar(2);
                     DChange=%f;
                     METHOD=getmethod(New_methhod);
-                    if or(xy(:,1)<>xy2(:,1)) then, DChange=%t;end
-                    if or(xy(1:N-1,2)<>xy2(1:N2-1,2)) then, DChange=%t;end
-                    if (xy(N,2)<>xy2(N2,2) & (METHOD<>"periodic")) then, DChange=%t;end
+                    if or(xy(:,1)<>xy2(:,1)) then,
+                        DChange=%t;
+                    end
+                    if or(xy(1:N-1,2)<>xy2(1:N2-1,2)) then,
+                        DChange=%t;
+                    end
+                    if (xy(N,2)<>xy2(N2,2) & (METHOD<>"periodic")) then,
+                        DChange=%t;
+                    end
                     if DChange then
                         exprs(2)=strcat(sci2exp(xy2(:,1)))
                         exprs(3)=strcat(sci2exp(xy2(:,2)))
                     end
 
                     exprs(1)=sci2exp(New_methhod);
-                    if oipar(3)==1 then,perop="y";else,perop="n";end
+                    if oipar(3)==1 then,
+                        perop="y";
+                    else,
+                        perop="n";
+                    end
                     exprs(4)=perop;
                     SaveExit=%t
                 else//_____________________No graphics__________________________
@@ -154,7 +161,12 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2)
         end
     case "define" then
         model=scicos_model()
-        xx=[0, 1, 2];yy=[10, 20, -30];  N=3;  Method=3;  PeriodicOption="y";  Graf="n"
+        xx=[0, 1, 2];
+        yy=[10, 20, -30];
+        N=3;
+        Method=3;
+        PeriodicOption="y";
+        Graf="n"
         model.sim=list("curve_c",4)
         model.in=[]
         model.out=1
@@ -167,19 +179,7 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2)
         model.firing=0
         exprs=[sci2exp(Method);sci2exp(xx);sci2exp(yy);PeriodicOption;Graf]
 
-        gr_i=["rpar=arg1.model.rpar;n=model.ipar(1);order=model.ipar(2);";
-        "xx=rpar(1:n);yy=rpar(n+1:2*n);";
-        "[XX,YY,rpardummy]=Do_Spline(n,order,xx,yy)";
-        "xmx=max(XX);xmn=min(XX);";
-        "ymx=max(YY);ymn=min(YY);";
-        "dx=xmx-xmn;if dx==0 then dx=max(xmx/2,1);end";
-        "xmn=xmn-dx/20;xmx=xmx+dx/20;";
-        "dy=ymx-ymn;if dy==0 then dy=max(ymx/2,1);end;";
-        "ymn=ymn-dy/20;ymx=ymx+dy/20;";
-        "xx2=orig(1)+sz(1)*((XX-xmn)/(xmx-xmn));";
-        "yy2=orig(2)+sz(2)*((YY-ymn)/(ymx-ymn));";
-        "xset(''color'',2)";
-        "xpoly(xx2,yy2,''lines'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
@@ -219,7 +219,9 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
     "Cmenu=[]"])
 
     ok = %f
-    if rhs==0 then ixy=[];end;
+    if rhs==0 then
+        ixy=[];
+    end;
 
     if size(xy,"c")<2 then
         xinfo(" No [y] is provided");
@@ -235,12 +237,14 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
         PeridicOption = 0;
         ipar = [N;NOrder;PeridicOption]
         rpar = []
-    else if rhs==2 then
+    else
+        if rhs==2 then
             NOrder = iparin(2);
             PeridicOption = iparin(3);
             ipar = iparin;
             rpar = [];
-        else if rhs==3 then
+        else
+            if rhs==3 then
                 NOrder = iparin(2);
                 PeridicOption = iparin(3);
                 ipar = iparin;
@@ -249,32 +253,60 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
         end //** ???
     end //** ???
 
-    Amp=[]; wp=[]; phase=[]; offset=[]; np1=[];
+    Amp=[];
+    wp=[];
+    phase=[];
+    offset=[];
+    np1=[];
     Sin_exprs = list(string(Amp),string(wp), string(phase),string(offset),string(np1));
-    sAmp=[]; sTp=[]; sdelay=[];
+    sAmp=[];
+    sTp=[];
+    sdelay=[];
     Sawt1_exprs = list(string(sAmp),string(sTp),string(sdelay));
-    sAmp2=[]; sTp2 = [];
+    sAmp2=[];
+    sTp2 = [];
     Sawt2_exprs = list(string(sAmp2),string(sTp2));
 
-    Amp3=[];Tp3=[];Pw3=[];Pd3=[];Bias3=[];
+    Amp3=[];
+    Tp3=[];
+    Pw3=[];
+    Pd3=[];
+    Bias3=[];
     Pulse_exprs=list(string(Amp3), string(Tp3),string(Pw3),string(Pd3),string(Bias3))
 
-    mean4=[];var4=[];seed4=[];sample4=[];np4=[];
+    mean4=[];
+    var4=[];
+    seed4=[];
+    sample4=[];
+    np4=[];
     random_n_exprs=list(string(mean4),string(var4), string(seed4),string(sample4),string(np4))
 
-    min5=[];max5=[];seed5=[];sample5=[];np5=[];
+    min5=[];
+    max5=[];
+    seed5=[];
+    sample5=[];
+    np5=[];
     random_u_exprs=list(string(min5), string(max5), string(seed5),string(sample5),string(np5))
 
     // bornes initiales du graphique
-    xmx = max(xy(:,1));xmn=min(xy(:,1)),xmn=max(xmn,0);
-    ymx = max(xy(:,2));ymn=min(xy(:,2));
-    dx = xmx-xmn; dy = ymx-ymn
-
-    if dx==0 then dx=max(xmx/2,1),end;
+    xmx = max(xy(:,1));
+    xmn=min(xy(:,1)),
+    xmn=max(xmn,0);
+    ymx = max(xy(:,2));
+    ymn=min(xy(:,2));
+    dx = xmx-xmn;
+    dy = ymx-ymn
+
+    if dx==0 then
+        dx=max(xmx/2,1),
+    end;
     xmx = xmx+dx/50;
 
-    if dy==0 then dy=max(ymx/2,1),end;
-    ymn = ymn-dy/50; ymx = ymx+dy/50;
+    if dy==0 then
+        dy=max(ymx/2,1),
+    end;
+    ymn = ymn-dy/50;
+    ymx = ymx+dy/50;
 
     rect = [xmn,ymn;xmx,ymx];
 
@@ -292,10 +324,18 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
     menus = list(MENU,menu_s,menu_o,menu_d,menu_t,menu_e);
 
     scam="menus(1)(1)"
-    w="menus(3)(";r=")";Orderm=w(ones(menu_o))+string(1:size(menu_o,"*"))+r(ones(menu_o))
-    w="menus(4)(";r=")";Datam=w(ones(menu_d))+string(1:size(menu_d,"*"))+r(ones(menu_d))
-    w="menus(5)(";r=")";Standm=w(ones(menu_t))+string(1:size(menu_t,"*"))+r(ones(menu_t))
-    w="menus(6)(";r=")";Exitm=w(ones(menu_e))+string(1:size(menu_e,"*"))+r(ones(menu_e))
+    w="menus(3)(";
+    r=")";
+    Orderm=w(ones(menu_o))+string(1:size(menu_o,"*"))+r(ones(menu_o))
+    w="menus(4)(";
+    r=")";
+    Datam=w(ones(menu_d))+string(1:size(menu_d,"*"))+r(ones(menu_d))
+    w="menus(5)(";
+    r=")";
+    Standm=w(ones(menu_t))+string(1:size(menu_t,"*"))+r(ones(menu_t))
+    w="menus(6)(";
+    r=")";
+    Exitm=w(ones(menu_e))+string(1:size(menu_e,"*"))+r(ones(menu_e))
 
     execstr("Autoscale_"+string(curwin)+"=scam")
     execstr("Spline_"+string(curwin)+"=Orderm")
@@ -337,8 +377,15 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
         if ((win>0) & (win<>curwin)) then
             Cmenu="Mouse click is Offside!";
         end
-        if Cmenu==[] then Cmenu="edit",end
-        if (Cmenu=="Exit") |(Cmenu=="Quit" ) then, ipar=[];rpar=[];ok=%f;return; end
+        if Cmenu==[] then
+            Cmenu="edit",
+        end
+        if (Cmenu=="Exit") |(Cmenu=="Quit" ) then,
+            ipar=[];
+            rpar=[];
+            ok=%f;
+            return;
+        end
         //-------------------------------------------------------------------
         if ((Cmenu=="zero order") | (Cmenu=="linear") | (Cmenu=="order 2")| ...
             (Cmenu=="not_a_knot")| (Cmenu=="periodic")| (Cmenu=="monotone")| ...
@@ -391,9 +438,17 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
             [rpar,ipar]=AutoScale(a,xy,ipar,rpar)
             //-------------------------------------------------------------------
         case "Periodic signal" then
-            if PeridicOption==1 then, ans0="y",else, ans0="n",end;
+            if PeridicOption==1 then,
+                ans0="y",
+            else,
+                ans0="n",
+            end;
             [mok,myans]=scicos_getvalue("Generating periodic signal",["y/n"],list("str",1),list(ans0));
-            if ((myans=="y")|(myans=="Y")) then,PeridicOption=1,else,PeridicOption=0;end;
+            if ((myans=="y")|(myans=="Y")) then,
+                PeridicOption=1,
+            else,
+                PeridicOption=0;
+            end;
             ipar(3)=PeridicOption;
             [rpar,ipar]=AutoScale(a,xy,ipar,rpar)
             //-------------------------------------------------------------------
@@ -402,7 +457,9 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
             ["Amplitude";"Frequency(rad/sec)"; ...
             "Phase(rad)";"Bias";"number of points"],list("vec",1,"vec",1,"vec",1, ...
             "vec",1,"vec",1),Sin_exprs)
-            if np1< 2 then np1=2;end
+            if np1< 2 then
+                np1=2;
+            end
             if mok & wp>0  then
                 NOrder=3;
                 ipar(2)=NOrder;
@@ -454,7 +511,13 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
             if mok & Tp3>0  then
                 NOrder=0;
                 ipar(2)=NOrder;
-                if (Pd3>0) then xt=0;yt=Bias3;else xt=[];yt=[]; end
+                if (Pd3>0) then
+                    xt=0;
+                    yt=Bias3;
+                else
+                    xt=[];
+                    yt=[];
+                end
                 //otherwise there      would be double points at 0
                 if Pd3<Tp3 then
                     if Pw3>0 then
@@ -480,8 +543,10 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
             if mok & sample4>0 then
                 NOrder=0;
                 ipar(2)=NOrder;
-                rand("normal");  rand("seed",seed4);
-                xt=0:sample4:sample4*(np4-1);xt=xt(:);
+                rand("normal");
+                rand("seed",seed4);
+                xt=0:sample4:sample4*(np4-1);
+                xt=xt(:);
                 yt=mean4+sqrt(var4)*rand(np4,1);
                 xy=[xt,yt];
                 [rpar,ipar]=AutoScale(a,xy,ipar,rpar);
@@ -496,8 +561,10 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
             if mok & sample5>0 then
                 NOrder=0;
                 ipar(2)=NOrder;
-                rand("uniform"); rand("seed",seed5);
-                xt=0:sample5:sample5*(np5-1);xt=xt(:);
+                rand("uniform");
+                rand("seed",seed5);
+                xt=0:sample5:sample5*(np5-1);
+                xt=xt(:);
                 yt=min5+(max5-min5)*rand(np5,1);
                 xy=[xt,yt];
                 [rpar,ipar]=AutoScale(a,xy,ipar,rpar);
@@ -588,7 +655,8 @@ function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
         case "edit" then
             HIT=%f
             if N<>0 then
-                xt=xy(:,1);yt=xy(:,2);
+                xt=xy(:,1);
+                yt=xy(:,2);
                 dist=((xt-ones(N,1)*xc))^2+((yt-ones(N,1)*yc))^2
                 [dca,k]=min(dist);
                 rectx=a.data_bounds;
@@ -653,7 +721,8 @@ endfunction
 //========================================================================
 function [orpar,oipar] = drawSplin(a,xy,iipar,irpar)
     N=size(xy,"r");// new size of xy
-    x=xy(:,1);  y=xy(:,2);
+    x=xy(:,1);
+    y=xy(:,2);
     points=a.children(2).children
     splines=a.children(1).children
     order=iipar(2);
@@ -662,12 +731,19 @@ function [orpar,oipar] = drawSplin(a,xy,iipar,irpar)
 
     METHOD=getmethod(order);
 
-    if periodicoption==1 then PERIODIC="periodic, T="+string(x(N)-x(1));
-    else PERIODIC="aperiodic";end
+    if periodicoption==1 then
+        PERIODIC="periodic, T="+string(x(N)-x(1));
+    else
+        PERIODIC="aperiodic";
+    end
     a.title.text=[string(N)+" points,  "+"Method: "+METHOD+",  "+PERIODIC];
 
-    if (N==0) then, return; end
-    if (N==1) then, order=0; end
+    if (N==0) then,
+        return;
+    end
+    if (N==1) then,
+        order=0;
+    end
     //  NP=50;// number of intermediate points between two data points
     [X,Y,orpar]=Do_Spline(N,order,x,y);
     if (periodicoption==1) then
@@ -675,7 +751,8 @@ function [orpar,oipar] = drawSplin(a,xy,iipar,irpar)
         Y=[Y;Y(1)];
     else
         xmx=max(points.data(:,1));  xmn=min(points.data(:,1));
-        XMX=max(0,xmx); XMN=max(0,xmn);
+        XMX=max(0,xmx);
+        XMN=max(0,xmn);
         xmx1=max(a.x_ticks.locations)
         XMX=max(XMX,xmx1);
         X=[X;XMX];
@@ -693,11 +770,13 @@ function [xyt,orpar,oipar]=movept(a,xy,iipar,irpar,k)
     oipar=iipar
     orpar=irpar
     order=iipar(2);
-    x=xy(:,1);  y=xy(:,2);
+    x=xy(:,1);
+    y=xy(:,2);
 
     if (x(k)==0) then
         zz=find(x==0);
-        x(zz)=[];y(zz)=[];
+        x(zz)=[];
+        y(zz)=[];
         ZERO_POINT=%t
     else
         x(k)=[];
@@ -714,7 +793,8 @@ function [xyt,orpar,oipar]=movept(a,xy,iipar,irpar,k)
         else
             if (xc<=0) then
                 zz=find(x==0);
-                x(zz)=[];y(zz)=[];
+                x(zz)=[];
+                y(zz)=[];
                 ZERO_POINT=%t;
                 xc=0;
             end
@@ -744,20 +824,31 @@ function rectx = findrect(a)
     end
 
 
-    ymx1=max(splines.data(:,2));  ymn1=min(splines.data(:,2))
+    ymx1=max(splines.data(:,2));
+    ymn1=min(splines.data(:,2))
 
-    xmx=max(points.data(:,1));xmn=min(points.data(:,1));
-    ymx=max(points.data(:,2));ymn=min(points.data(:,2));
+    xmx=max(points.data(:,1));
+    xmn=min(points.data(:,1));
+    ymx=max(points.data(:,2));
+    ymn=min(points.data(:,2));
 
 
-    XMX=max(0,xmx);            XMN=max(0,xmn);
-    YMX=max(ymx,ymx1);  YMN=min(ymn,ymn1);
+    XMX=max(0,xmx);
+    XMN=max(0,xmn);
+    YMX=max(ymx,ymx1);
+    YMN=min(ymn,ymn1);
 
-    dx=XMX-XMN;dy=YMX-YMN
-    if dx==0 then dx=max(XMX/2,1),end;
+    dx=XMX-XMN;
+    dy=YMX-YMN
+    if dx==0 then
+        dx=max(XMX/2,1),
+    end;
     XMX=XMX+dx/50
-    if dy==0 then dy=max(YMX/2,1),end;
-    YMN=YMN-dy/50;YMX=YMX+dy/50;
+    if dy==0 then
+        dy=max(YMX/2,1),
+    end;
+    YMN=YMN-dy/50;
+    YMX=YMX+dy/50;
     rectx=[XMN,YMN;XMX,YMX];
 endfunction
 
@@ -768,14 +859,17 @@ function [tok,xyo]=ReadExcel()
     "g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v"; ...
     "w";"x";"y";"z"];
     TN=["0","1","2","3","4","5","6","7","8","9"];
-    xyo=[];tok=%f;
+    xyo=[];
+    tok=%f;
     while %t
         [zok,filen,sheetN,xa,ya]=scicos_getvalue("Excel data file ",["Filename";"Sheet #"+...
         " ";"X[start:Stop]";"Y[start:stop]"],list("str",1, ...
         "vec",1,"str",1, ...
         "str",1), ...
         list(["Classeur1.xls"],["1"],["C5:C25"],["D5:D25"]));
-        if ~zok then break,end
+        if ~zok then
+            break,
+        end
 
         try
             [fd,SST,Sheetnames,Sheetpos] = xls_open(filen);
@@ -789,35 +883,69 @@ function [tok,xyo]=ReadExcel()
                 [Value,TextInd] = xls_read(fd,Sheetpos(sheetN))
                 mclose(fd)
             end
-            xa=strsubst(xa," ",""); px=strindex(xa,":");
-            ya=strsubst(ya," ",""); py=strindex(ya,":");
-            x1=part(xa,1:px-1); x2=part(xa,px+1:length(xa));
-            y1=part(ya,1:py-1); y2=part(ya,py+1:length(ya));
+            xa=strsubst(xa," ","");
+            px=strindex(xa,":");
+            ya=strsubst(ya," ","");
+            py=strindex(ya,":");
+            x1=part(xa,1:px-1);
+            x2=part(xa,px+1:length(xa));
+            y1=part(ya,1:py-1);
+            y2=part(ya,py+1:length(ya));
 
             x1p=min(strindex(x1,TN));
-            if x1p==[] then, xinfo("Bad address in X:"+x1); break, end
-            x11=part(x1,1:x1p-1);x12=part(x1,x1p:length(x1));
+            if x1p==[] then,
+                xinfo("Bad address in X:"+x1);
+                break,
+            end
+            x11=part(x1,1:x1p-1);
+            x12=part(x1,x1p:length(x1));
 
             x2p=min(strindex(x2,TN));
-            if x2p==[] then, xinfo("Bad address in X:"+x2); break, end
-            x21=part(x2,1:x2p-1);x22=part(x2,x2p:length(x2));
+            if x2p==[] then,
+                xinfo("Bad address in X:"+x2);
+            break, end
+            x21=par
+            t(x2,1:x2p-1);
+            x22=part(x2,x2p:length(x2));
 
             y1p=min(strindex(y1,TN));
-            if y1p==[] then, xinfo("Bad address in Y:"+y1); break, end
-            y11=part(y1,1:y1p-1);y12=part(y1,y1p:length(y1));
+            if y1p==[] then,
+                xinfo("Bad address in Y:"+y1);
+                break,
+            end
+            y11=part(y1,1:y1p-1);
+            y12=part(y1,y1p:length(y1));
 
             y2p=min(strindex(y2,TN));
-            if y2p==[] then, xinfo("Bad address in Y:"+y2); break, end
-            y21=part(y2,1:y2p-1);y22=part(y2,y2p:length(y2));
+            if y2p==[] then,
+                xinfo("Bad address in Y:"+y2);
+                break,
+            end
+            y21=part(y2,1:y2p-1);
+            y22=part(y2,y2p:length(y2));
 
             // x11 x12: x21 x22
 
-            lx11=length(x11);lx21=length(x21);
-            ly11=length(y11);ly21=length(y21)
-            xstC=0;for i=1:lx11,xstC=xstC+modulo(find(TA==part(x11,lx11-i+1)),26)*26^(i-1);end
-            xenC=0;for i=1:lx21,xenC=xenC+modulo(find(TA==part(x21,lx21-i+1)),26)*26^(i-1);end
-            ystC=0;for i=1:ly11,ystC=ystC+modulo(find(TA==part(y11,ly11-i+1)),26)*26^(i-1);end
-            yenC=0;for i=1:ly11,yenC=yenC+modulo(find(TA==part(y21,ly21-i+1)),26)*26^(i-1);end
+            lx11=length(x11);
+            lx21=length(x21);
+            ly11=length(y11);
+            ly21=length(y21)
+            xstC=0;
+            for i=1:lx11,
+                xstC=xstC+modulo(find(TA==part(x11,lx11-i+1)),26)*26^(i-1);
+            end
+            xenC=0;
+            for i=1:lx21,
+                xenC=xenC+modulo(find(TA==part(x21,lx21-i+1)),26)*26^(i-1);
+            end
+            ystC=0;
+            for i=1:ly11,
+                ystC=ystC+modulo(find(TA==part(y11,ly11-i+1)),26)*26^(i-1);
+            end
+            yenC=0;
+            for i=1:ly11,
+                yenC=yenC+modulo(find(TA==part(y21,ly21-i+1)),26)*26^(i-1);
+            end
 
             xstR=evstr(x12);
             xenR=evstr(x22);
@@ -827,10 +955,12 @@ function [tok,xyo]=ReadExcel()
             [mv,nv]=size(Value)
 
             if ~(xstR<=mv & xstR>0 & xenR<=mv & xenR>0&ystR<=mv & ystR>0&yenR<=mv&yenR>0 ) then
-                xinfo("error in Row data addresses"); break
+                xinfo("error in Row data addresses");
+                break
             end
             if ~(xstC<=nv & xstC>0 & xenC<=nv & xenC>0&ystC<=nv & ystC>0&yenC<=nv&yenC>0 ) then
-                xinfo("error in Column data addresses"); break
+                xinfo("error in Column data addresses");
+                break
             end
 
             xo=Value(min(xstR,xenR):max(xstR,xenR),min(xstC,xenC):max(xstC,xenC));
@@ -844,7 +974,8 @@ function [tok,xyo]=ReadExcel()
             xyo=[xo,yo];
             [xyo]=cleandata(xyo)
 
-            tok=%t;break,
+            tok=%t;
+            break,
         catch
             xinfo(" Scicos cannot read your Excel file, please verify"+...
             " the parameters ");
@@ -875,7 +1006,9 @@ function [xyo]=cleandata(xye)
             return;
         end
     end
-    zz=find(xe<0);xe(zz)=[];ye(zz)=[]
+    zz=find(xe<0);
+    xe(zz)=[];
+    ye(zz)=[]
     if (find(xe==0)==[]) then // add zero point
         xe($+1)=0;
         ye($+1)=0;
@@ -903,14 +1036,22 @@ endfunction
 //============================
 function METHOD = getmethod(order)
     select order
-    case 0 then, METHOD="zero order"
-    case 1 then, METHOD="linear"
-    case 2 then, METHOD="order 2"
-    case 3 then, METHOD="not_a_knot"
-    case 4 then, METHOD="periodic"
-    case 5 then, METHOD="monotone"
-    case 6 then, METHOD="fast"
-    case 7 then, METHOD="clamped"
+    case 0 then,
+        METHOD="zero order"
+    case 1 then,
+        METHOD="linear"
+    case 2 then,
+        METHOD="order 2"
+    case 3 then,
+        METHOD="not_a_knot"
+    case 4 then,
+        METHOD="periodic"
+    case 5 then,
+        METHOD="monotone"
+    case 6 then,
+        METHOD="fast"
+    case 7 then,
+        METHOD="clamped"
     end
 endfunction
 //=======================================
@@ -921,10 +1062,16 @@ function [sok,xye] = ReadFromFile()
         "ormat";"Abscissa column";"Output"+...
         " column"],list("str",1,"str",1,"vec",1,"vec",1), ...
         list(["mydatafile.dat"],["%g %g"],["1"],["2"]));
-        if ~sok then break,end
+        if ~sok then
+            break,
+        end
         px=strindex(Cformat,"%");
         NC=size(px,"*");
-        if NC==[] then, xinfo("Bad format in reading data file");sok=%f;break;end
+        if NC==[] then,
+            xinfo("Bad format in reading data file");
+            sok=%f;
+            break;
+        end
         Lx=[];
         try
             fd=mopen(filen,"r");
@@ -936,13 +1083,23 @@ function [sok,xye] = ReadFromFile()
         end
 
         [nD,mD] = size(Lx);
-        if ((mD==0) | (nD==0)) then,  xinfo("No data read");sok=%f;break;end
-        if (mD<>NC) then, xinfo("Bad format");sok=%f;break;end
+        if ((mD==0) | (nD==0)) then,
+            xinfo("No data read");
+            sok=%f;
+            break;
+        end
+        if (mD<>NC) then,
+            xinfo("Bad format");
+            sok=%f;
+            break;
+        end
 
-        xe=Lx(:,Cx);ye=Lx(:,Cy);
+        xe=Lx(:,Cx);
+        ye=Lx(:,Cy);
         xye=[xe,ye];
         [xye]=cleandata(xye)
-        sok=%t;break,
+        sok=%t;
+        break,
     end
 endfunction
 //=======================================
@@ -954,10 +1111,16 @@ function [sok]=SaveToFile(xye)
         [sok,filen,Cformat]=scicos_getvalue("Text data file ",["Filename";"Writing [C] f"+...
         "ormat"],list("str",1,"str",1), ...
         list(["mydatafile.dat"],["%g %g"]));
-        if ~sok then break,end
+        if ~sok then
+            break,
+        end
         px=strindex(Cformat,"%");
         NC=size(px,"*");
-        if NC<>2 then, xinfo("Bad format in writing data file");sok=%f;break;end
+        if NC<>2 then,
+            xinfo("Bad format in writing data file");
+            sok=%f;
+            break;
+        end
 
         Cformat=Cformat+"\n";
 
@@ -970,17 +1133,21 @@ function [sok]=SaveToFile(xye)
             break;
         end
 
-        sok=%t;break,
+        sok=%t;
+        break,
     end
 endfunction
 //=========================================================
 function [X,Y,orpar]=Do_Spline(N,order,x,y)
-    X=[];Y=[];orpar=[];
+    X=[];
+    Y=[];
+    orpar=[];
 
     METHOD=getmethod(order);
 
     if (METHOD=="zero order") then
-        X=x(1);Y=y(1);
+        X=x(1);
+        Y=y(1);
         for i=1:N-1
             X=[X;x(i);x(i+1);x(i+1)];
             Y=[Y;y(i);y(i);y(i+1)];
@@ -997,11 +1164,22 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y)
         return
     end
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    if (N<25) then NP=10;else
-        if (N<50) then NP=5;else
-            if (N<100) then NP=2;else
-                if (N<200) then NP=1;else
-        NP=0;end;end;end;
+    if (N<25) then
+        NP=10;
+    else
+        if (N<50) then
+            NP=5;
+        else
+            if (N<100) then
+                NP=2;
+            else
+                if (N<200) then
+                    NP=1;
+                else
+                    NP=0;
+                end;
+            end;
+        end;
     end
     for i=1:N-1
         X=[X;linspace(x(i),x(i+1),NP+2)']; // pour tous sauf "linear" et "zero order"
@@ -1015,7 +1193,9 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y)
 
         for j=1:size(X,"*")
             for i=N-1:-1:1
-                if X(j)>=x(i) then,break;end
+                if X(j)>=x(i) then,
+                    break;
+                end
             end
             Y(j)=A(i)*(X(j)-x(i))^2+B(i)*(X(j)-x(i))+C(i);
         end
index 90c5fb1..38b3d7c 100644 (file)
 
 function [x,y,typ] = CURV_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;
         model    = arg1.model;
@@ -95,16 +85,7 @@ function [x,y,typ] = CURV_f(job,arg1,arg2)
         model.blocktype = "c"
         model.dep_ut    = [%f %t]
 
-        gr_i = ["rpar=arg1.model.rpar;n=model.ipar(1);";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=rpar(1:n);yy=rpar(n+1:2*n);";
-        "rect=rpar(2*n+1:2*n+4);";
-        "mxx=rect(3)-rect(1);";
-        "mxy=rect(4)-rect(2);";
-        "xx=orig(1)+sz(1)*(1/10+(4/5)*((xx-rect(1))/mxx));";
-        "yy=orig(2)+sz(2)*(1/10+(4/5)*((yy-rect(2))/mxy));";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        gr_i = []
         x = standard_define([2 2],model,[],gr_i)
     end
 
index 0fd1829..cc4fead 100644 (file)
 //
 
 function [x,y,typ] = Counter(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        graphics=arg1.graphics;
-        ierr=execstr("(evstr(graphics.exprs(3))==1)","errcatch")
-        if ierr<>0 then graphics.exprs(3)="1";end
-        if (evstr(graphics.exprs(3))==1) then
-            from=graphics.exprs(1)
-            to=graphics.exprs(2)
-        else
-            from=graphics.exprs(2)
-            to=graphics.exprs(1)
-        end
-        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,minim,maxim,rule,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"), "Counter"); " "; ..
@@ -52,8 +37,11 @@ function [x,y,typ] = Counter(job,arg1,arg2)
             gettext("Rule (1:Increment, 2:Decrement)");], ..
             list("vec",1,"vec",1,"vec",1),exprs);
 
-            if ~ok then break,end
-            maxim=int(maxim);minim=int(minim);
+            if ~ok then
+                break,
+            end
+            maxim=int(maxim);
+            minim=int(minim);
 
             if maxim < minim then
                 block_parameter_error(msprintf(gettext("Wrong values for ''Maximum'' and ''Minimum'' parameters: %d &lt; %d"), minim, maxim), ..
@@ -65,7 +53,8 @@ function [x,y,typ] = Counter(job,arg1,arg2)
                 graphics.exprs=exprs
                 model.dstate=0
                 model.ipar=[rule;maxim;minim]
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -84,7 +73,7 @@ function [x,y,typ] = Counter(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(minim);string(maxim);string(rule)]
-        gr_i=["xstringb(orig(1),orig(2),[''Counter'';+from+'' --> ''+to],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 0f11b28..a97c0c9 100644 (file)
 //
 
 function [x,y,typ] = FROMWSB(job,arg1,arg2)
-    x=[];y=[],typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        varnam=string(arg1.model.rpar.objs(1).graphics.exprs(1))
-        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 internal edge trigger block
         for i=1:length(arg1.model.rpar.objs) do
@@ -139,9 +132,7 @@ function [x,y,typ] = FROMWSB(job,arg1,arg2)
         pout=4,..
         pein=2,..
         peout=2,..
-        gr_i=list(..
-        ["txt=[''From workspace''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -189,7 +180,7 @@ function [x,y,typ] = FROMWSB(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=[],..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit="E",..
         out_implicit=[]),..
@@ -249,16 +240,7 @@ function [x,y,typ] = FROMWSB(job,arg1,arg2)
         nmode=0,..
         equations=list())
         //## modif made by hand
-        gr_i=["xstringb(orig(1),orig(2),''From workspace'',sz(1),sz(2),''fill'')"
-        "txt=varnam;"
-        "style=5;"
-        "rectstr=stringbox(txt,orig(1),orig(2),0,style,1);"
-        "if ~exists(''%zoom'') then %zoom=1, end;"
-        "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;"]
+        gr_i=[]
         x=standard_define([5 2],model,[],gr_i)
     end
 endfunction
index cf460bc..6962275 100644 (file)
 //
 
 function [x,y,typ] = FROMWS_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,varnam,Method,ZC,OutEnd,exprs]=scicos_getvalue("Set From_Workspace block parameters",..
@@ -41,7 +36,9 @@ function [x,y,typ] = FROMWS_c(job,arg1,arg2)
             "Enable zero crossing(0:No, 1:Yes)?";
             "Output at end(0:Zero, 1:Hold, 2:Repeat)"],...
             list("str",1,"vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ~(Method==0 | Method==1| Method==2| Method==3) then
                 message("Interpolation method should be chosen in [0,1,2,3]");
                 ok=%f;
@@ -71,7 +68,8 @@ function [x,y,typ] = FROMWS_c(job,arg1,arg2)
                 [model,graphics,ok]=set_io(model,graphics,list(),list([-1,-2],-1),1,1);
                 if ok then
                     graphics.exprs=exprs;
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -94,8 +92,7 @@ function [x,y,typ] = FROMWS_c(job,arg1,arg2)
         model.firing=[0];
         model.blocktype="d";
         model.dep_ut=[%f %t];
-        gr_i=["txt=[''From workspace''];"..
-        ;"xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
         exprs=[string(varnam);string(Method);string(ZC);string(OutEnd)];
         x=standard_define([3.5 2],model,exprs,gr_i)
     end
index b87e4bd..384b9f4 100644 (file)
 //
 
 function [x,y,typ]=GENSIN_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok, M, F, P, exprs] = scicos_getvalue([msprintf(gettext("Set %s block parameters"), "GENSIN_f");" "; ..
             gettext("Sine wave generator");" "], ..
             [gettext("Magnitude"); gettext("Frequency (rad/s)"); gettext("Phase (rad)")], ..
             list("vec",1,"vec",1,"vec",1), exprs);
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if F < 0 then
                 block_parameter_error(msprintf(gettext("Wrong value for ''Frequency'' parameter: %e."), F), ..
                 gettext("Strictly positive integer expected."));
@@ -48,7 +53,8 @@ function [x,y,typ]=GENSIN_f(job,arg1,arg2)
                 model.outtyp=1;
 
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
index bdeb79d..b05a5a3 100644 (file)
 //
 
 function [x,y,typ]=GENSQR_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if size(exprs,"*")==2 then exprs=exprs(2),end //compatibility
+        if size(exprs,"*")==2 then
+            exprs=exprs(2),
+        end //compatibility
         while %t do
             [ok,Amplitude,exprs]=scicos_getvalue([
             "Set Square generator block parameters"],..
             ["Amplitude"],..
             list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             model.dstate=Amplitude
             //next two lines to fix invalid properties in scilab version
@@ -40,7 +47,8 @@ function [x,y,typ]=GENSQR_f(job,arg1,arg2)
             model.out2=1;
             model.outtyp=1;
 
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
             break
         end
     case "define" then
index c847b65..6ff65a0 100644 (file)
 
 function [x,y,typ]=GEN_SQR(job,arg1,arg2)
     //Generated from SuperBlock on 8-Feb-2008
-    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
         y=needcompile
         arg1.model.ipar=1;
@@ -53,7 +47,9 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         ok=%f
         while ~ok do
             [ok,scicos_context.Amin,scicos_context.Amax,scicos_context.rule,scicos_context.F,exprs]=scicos_getvalue(Btitre,Bitems,Ss,exprs)
-            if ~ok then return;end
+            if ~ok then
+                return;
+            end
             %scicos_context=scicos_context;
             sblock=x.model.rpar
             [%scicos_context,ierr]=script2var(sblock.props.context,%scicos_context)
@@ -101,9 +97,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=8,..
         pein=16,..
         peout=[],..
-        gr_i=list(..
-        "xstringb(orig(1),orig(2),[''Counter'';+from+'' --> ''+to],sz(1),sz(2),''fill'');",..
-        8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -143,11 +137,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=5,..
         pein=[],..
         peout=[],..
-        gr_i=list(..
-        ["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;";
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -187,11 +177,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=6,..
         pein=[],..
         peout=[],..
-        gr_i=list(..
-        ["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;";
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -231,7 +217,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=14,..
         pein=[9;10],..
         peout=[],..
-        gr_i=list("xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');",8),..
+        gr_i=[],..
         id="",..
         in_implicit=["E";"E"],..
         out_implicit="E"),..
@@ -287,9 +273,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=[9;10],..
-        gr_i=list(..
-        ["txt=[''event select''];";"xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],..
-        8),..
+        gr_i=[],..
         id="",..
         in_implicit="E",..
         out_implicit=[]),..
@@ -355,7 +339,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=[],..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit="E",..
         out_implicit=[]),..
@@ -403,7 +387,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=16,..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit=[]),..
@@ -472,12 +456,7 @@ function [x,y,typ]=GEN_SQR(job,arg1,arg2)
         sci2exp(rule)
         sci2exp(F)
         ]
-        gr_i=list(..
-        ["xx=[1 2 2 3 3 4 4 5 5 6]/7;";
-        "yy=[1 1 3 3 1 1 3 3 1 1]/4;";
-        "x=orig(1)*ones(1,10)+sz(1)*xx;";
-        "y=orig(2)*ones(1,10)+sz(2)*yy;";
-        "xpolys(x'',y'');"],8)
+        gr_i=[]
         x=standard_define([3,2],model,exprs,gr_i)
     end
 endfunction
index 0656bd8..9746b9d 100644 (file)
 
 function [x,y,typ]=Ground_g(job,arg1,arg2)
     // Copyright INRIA
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        x=[];y=[];typ=[];
-    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
@@ -47,15 +41,7 @@ function [x,y,typ]=Ground_g(job,arg1,arg2)
         model.blocktype="d"
         model.dep_ut=[%f %f]
         exprs=[]
-        gr_i=["x=orig(1)*ones(5,1)+sz(1)*[1/16;15/16;1/2;1/2;1];";
-        "y=orig(2)*ones(5,1)+sz(2)*[1/2;1/2;1/2;3/4;3/4];";
-        "xpolys(x,y);";
-        "x=orig(1)*ones(2,1)+sz(1)*[1/4;3/4];";
-        "y=orig(2)*ones(2,1)+sz(2)*[1/8+3/16;1/8+3/16];";
-        "xpolys(x,y);";
-        "x=orig(1)*ones(2,1)+sz(1)*[7/16;9/16];";
-        "y=orig(2)*ones(2,1)+sz(2)*[1/8;1/8];";
-        "xpolys(x,y);"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index da2eec3..e605677 100644 (file)
 //
 
 function [x,y,typ]=INIMPL_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        x=[];y=[];typ=[]
-    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 size(exprs,"*")==2 then exprs=exprs(1),end //compatibility
+        if size(exprs,"*")==2 then
+            exprs=exprs(1),
+        end //compatibility
         while %t do
             [ok,prt,exprs] = scicos_getvalue([msprintf(gettext("Set %s block parameters"),"INIMPL_f");" "; ..
             gettext("Implicit input port");" ";], "Port Number", ..
             list("vec",1), exprs);
-            if ~ok then 
+            if ~ok then
                 break
             end
             prt=int(prt)
@@ -48,7 +45,10 @@ function [x,y,typ]=INIMPL_f(job,arg1,arg2)
                 block_parameter_error(msprintf(gettext("Wrong value for ''Port Number'' parameter: %d."), prt), ..
                 gettext("Strictly positive integer expected."));
             else
-                if model.ipar<>prt then needcompile=4;y=needcompile,end
+                if model.ipar<>prt then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 model.ipar=prt
                 graphics.exprs=exprs
                 x.graphics=graphics
@@ -70,7 +70,7 @@ function [x,y,typ]=INIMPL_f(job,arg1,arg2)
         model.equations=mo
         prt=1
         exprs="1"
-        gr_i=["prt=string(model.ipar);xstringb(orig(1),orig(2),prt,sz(1),sz(2))"]
+        gr_i=[]
         x=standard_define([1 1],model,exprs,gr_i)
         x.graphics.out_implicit=["I"]
 
index 8eb7dcb..be5bb00 100644 (file)
 //
 
 function [x,y,typ]=IN_f(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
     case "set" then
         x=arg1;
         graphics=arg1.graphics;
         model=arg1.model;
         exprs=graphics.exprs;
-        if size(exprs,"*")==2 then exprs=exprs(1),end //compatibility
-        if size(exprs,"*")==1 then exprs=[exprs(1);"[-1 -2]";"-1"],end //compatibility
+        if size(exprs,"*")==2 then
+            exprs=exprs(1),
+        end //compatibility
+        if size(exprs,"*")==1 then
+            exprs=[exprs(1);"[-1 -2]";"-1"],
+        end //compatibility
         while %t do
             [ok,prt,otsz,ot,exprs]=getvalue(_("Set Input block parameters"),...
             [_("Port number");
             _("Outport size ([-1 -2] for inherit)");
             _("Outport Type (-1 for inherit)")],...
             list("vec",1,"vec",-1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             prt=int(prt)
             if prt<=0 then
                 message(_("Port number must be a positive integer"))
@@ -45,7 +53,10 @@ function [x,y,typ]=IN_f(job,arg1,arg2)
             elseif ((ot<1|ot>9)&(ot<>-1)) then
                 message(_("Outport type must be a number between 1 and 9, or -1 for inheritance."))
             else
-                if model.ipar<>prt then needcompile=4;y=needcompile,end
+                if model.ipar<>prt then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 model.ipar=prt
                 model.firing=[];
                 model.out=otsz(1)
@@ -69,7 +80,7 @@ function [x,y,typ]=IN_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=sci2exp(prt)
-        gr_i=" "
+        gr_i=[]
         x=standard_define([1 1],model,exprs,gr_i)
     end
 endfunction
index 0a458e7..edeb094 100644 (file)
 //
 
 function [x,y,typ]=Modulo_Count(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        graphics=arg1.graphics;base=evstr(graphics.exprs(2))
-        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,ini_c,base,exprs] = scicos_getvalue([msprintf(gettext("Set %s block parameters"), "Modulo_Count");" "; gettext("Modulo counter (0 to N counter)");" "], ..
@@ -43,7 +37,9 @@ function [x,y,typ]=Modulo_Count(job,arg1,arg2)
 
             ini_c = int(ini_c);
             base = int(base);
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ini_c <0 then
                 block_parameter_error(msprintf(gettext("Wrong value for ''Initial State'' parameter: %d."), ini_c), ..
                 gettext("Null or positive integer expected."));
@@ -54,7 +50,8 @@ function [x,y,typ]=Modulo_Count(job,arg1,arg2)
                 graphics.exprs=exprs
                 model.ipar=base;
                 model.dstate=ini_c;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -71,7 +68,7 @@ function [x,y,typ]=Modulo_Count(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(ini_c);string(base)]
-        gr_i=["xstringb(orig(1),orig(2),[''  Counter'';''Modulo ''+string(base)],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 0b073c7..0f2c269 100644 (file)
 //
 function [x,y,typ]=PULSE_SC(job,arg1,arg2)
     //Generated from SuperBlock on 7-Feb-2008
-    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
         y=needcompile
         arg1.model.ipar=1;
@@ -49,7 +43,9 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         ok=%f
         while ~ok do
             [ok,scicos_context.E,scicos_context.W,scicos_context.F,scicos_context.A,exprs]=scicos_getvalue(Btitre,Bitems,Ss,exprs)
-            if ~ok then return;end
+            if ~ok then
+                return;
+            end
             %scicos_context=scicos_context;
             sblock=x.model.rpar
             [%scicos_context,ierr]=script2var(sblock.props.context,%scicos_context)
@@ -97,11 +93,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=5,..
         pein=[],..
         peout=[],..
-        gr_i=list(..
-        ["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;";
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -141,16 +133,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=4,..
         pein=[],..
         peout=[],..
-        gr_i=list(..
-        ["x=orig(1)*ones(5,1)+sz(1)*[1/16;15/16;1/2;1/2;1];";
-        "y=orig(2)*ones(5,1)+sz(2)*[1/2;1/2;1/2;3/4;3/4];";
-        "xpolys(x,y);";
-        "x=orig(1)*ones(2,1)+sz(1)*[1/4;3/4];";
-        "y=orig(2)*ones(2,1)+sz(2)*[1/8+3/16;1/8+3/16];";
-        "xpolys(x,y);";
-        "x=orig(1)*ones(2,1)+sz(1)*[7/16;9/16];";
-        "y=orig(2)*ones(2,1)+sz(2)*[1/8;1/8];";
-        "xpolys(x,y);"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -190,7 +173,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=11,..
         pein=[9;8],..
         peout=[],..
-        gr_i=list("xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');",8),..
+        gr_i=[],..
         id="",..
         in_implicit=["E";"E"],..
         out_implicit="E"),..
@@ -246,7 +229,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=9,..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit=[]),..
@@ -286,7 +269,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=8,..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit=[]),..
@@ -342,7 +325,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=[],..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit="E",..
         out_implicit=[]),..
@@ -411,12 +394,7 @@ function [x,y,typ]=PULSE_SC(job,arg1,arg2)
         sci2exp(F)
         sci2exp(A)
         ]
-        gr_i=list(..
-        ["xx=[1 3 3 3 5 5 5 7]/8;";
-        "yy=[1 1 3 1 1 3 1 1]/4;";
-        "x=orig(1)*ones(1,8)+sz(1)*xx;";
-        "y=orig(2)*ones(1,8)+sz(2)*yy;";
-        "xpolys(x'',y'');"],8)
+        gr_i=[]
         x=standard_define([3,2],model,exprs,gr_i)
     end
 endfunction
index 1c9d701..f0d9a5f 100644 (file)
 //
 
 function [x,y,typ]=RAMP(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,slope,stt,iout,exprs]=scicos_getvalue([msprintf(gettext("Set %s block parameters"), "RAMP"); " "; gettext("Ramp function");" "], ..
             [gettext("Slope"); gettext("Start Time"); gettext("Initial Value")], ..
             list("vec",1,"vec",1,"vec",1), exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if stt<0  then
                 block_parameter_error(msprintf(gettext("Wrong value for ''Start Time'' parameter: %e."), stt), ..
                 gettext("Null or positive integer expected."));
             else
                 model.rpar=[slope;stt;iout];
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
     case "define" then
-        slope=0;iout=0;stt=0;rpar=[slope;stt;iout];
+        slope=0;
+        iout=0;
+        stt=0;
+        rpar=[slope;stt;iout];
         model=scicos_model()
         model.sim=list("ramp",4)
         model.in=[]
@@ -63,11 +64,7 @@ function [x,y,typ]=RAMP(job,arg1,arg2)
         model.dep_ut=[%f %t]
 
         exprs=[string(rpar)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=orig(1)+[4/5;3/5;2/5]*sz(1);";
-        "yy=orig(2)+[4/5;1/2;1/2]*sz(2);";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 6dd0f84..bd4e7c6 100644 (file)
 //
 
 function [x,y,typ]=RAND_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then //normal  position
-        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 size(exprs,"*")==5 then exprs=exprs(1:3),end //compatibility
-        if size(exprs,"*")==3 then exprs=[exprs;string(model.dstate(1))],end //compatibility
+        if size(exprs,"*")==5 then
+            exprs=exprs(1:3),
+        end //compatibility
+        if size(exprs,"*")==3 then
+            exprs=[exprs;string(model.dstate(1))],
+        end //compatibility
         while %t do
             [ok,flag,a,b,seed_c,exprs]=scicos_getvalue([
             "Set Random generator block parameters";
@@ -46,7 +45,9 @@ function [x,y,typ]=RAND_f(job,arg1,arg2)
             "seed is the seed of random number generator (integer<2**31)"],..
             ["flag";"A";"B";"seed"],..
             list("vec",1,"vec",-1,"vec","size(%2,''*'')","vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if flag<>0&flag<>1 then
                 message("flag must be equal to 1 or 0")
             else
@@ -56,7 +57,8 @@ function [x,y,typ]=RAND_f(job,arg1,arg2)
                 model.ipar=flag
                 model.rpar=[a(:);b(:)]
                 model.dstate=[seed_c;0*a(:)]
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -77,8 +79,7 @@ function [x,y,typ]=RAND_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[string(flag);sci2exp(a(:));sci2exp(b(:));string(model.dstate(1))]
-        gr_i=["txt=[''random'';''generator''];";
-        "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 57a9364..28b267b 100644 (file)
 //
 
 function [x,y,typ]=RAND_m(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then //normal  position
-        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 size(exprs,"*")==14 then exprs(9)=[],end //compatiblity
+        if size(exprs,"*")==14 then
+            exprs(9)=[],
+        end //compatiblity
         while %t do
             [ok,typ,flag,a,b,seed_c,exprs]=scicos_getvalue([
             "Set Random generator block parameters";
@@ -44,7 +41,9 @@ function [x,y,typ]=RAND_m(job,arg1,arg2)
             "A and B must be matrix with equal sizes"],..
             ["Datatype(1=real double  2=complex)";"flag";"A";"B";"SEED"],..
             list("vec",1,"vec",1,"mat",[-1 -2],"mat","[-1 -2]","mat",[1 2]),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if flag<>0&flag<>1 then
                 message("flag must be equal to 1 or 0")
             else
@@ -59,14 +58,18 @@ function [x,y,typ]=RAND_m(job,arg1,arg2)
                     ot=2
                     model.rpar=[real(a(:));imag(a(:));real(b(:));imag(b(:))]
                     model.dstate=[seed_c(:);0*[real(a(:));imag(a(:))]]
-                else message("Datatype is not supported");ok=%f;end
+                else
+                    message("Datatype is not supported");
+                    ok=%f;
+                end
                 if ok then
                     [model,graphics,ok]=set_io(model,graphics,list([],[]),list(out,ot),1,[])
                     if ok then
                         model.sim=list(function_name,4)
                         graphics.exprs=exprs
                         model.ipar=flag
-                        x.graphics=graphics;x.model=model
+                        x.graphics=graphics;
+                        x.model=model
                         break
                     end
                 end
@@ -98,8 +101,7 @@ function [x,y,typ]=RAND_m(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=[sci2exp(1);string(flag);sci2exp([a]);sci2exp([b]);sci2exp([model.dstate(1) int(rand()*(10^7-1))])]
-        gr_i=["txt=[''random'';''generator''];";
-        "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 7e40360..0c371c2 100644 (file)
 //
 
 function [x,y,typ]=READAU_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;
         out=model.out
         dstate=model.dstate
@@ -49,8 +44,14 @@ function [x,y,typ]=READAU_f(job,arg1,arg2)
             gettext("(Read Audio File)");" "; gettext("Read is done on a binary ''.au'' file")], ..
             [gettext("Input File Name"); gettext("Buffer size"); gettext("Swap Mode (0:No, 1:Yes)")], ..
             list("str",1,"vec",1,"vec",1), exprs);
-            tmask1=[];outmask=1;frmt1="uc";M=1;offset=1;
-            if ~ok then break,end //user cancel modification
+            tmask1=[];
+            outmask=1;
+            frmt1="uc";
+            M=1;
+            offset=1;
+            if ~ok then
+                break,
+            end //user cancel modification
             fname1=stripblanks(fname1)
             frmt1=stripblanks(frmt1)
             if alreadyran&fname1<>fname then
@@ -84,9 +85,11 @@ function [x,y,typ]=READAU_f(job,arg1,arg2)
                     if prod(size(dstate))<>(N*M)+3 then
                         dstate=[-1;-1;lunit;zeros(N*M,1)]
                     end
-                    model.dstate=dstate;model.ipar=ipar
+                    model.dstate=dstate;
+                    model.ipar=ipar
                     graphics.exprs=exprs;
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -117,8 +120,7 @@ function [x,y,typ]=READAU_f(job,arg1,arg2)
         exprs=[fname;
         string(N);
         string(swap)]
-        gr_i=["txt=[''read from .au'';''sound file''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
         x=standard_define([5 2],model,exprs,gr_i)
     end
 endfunction
index 97dc017..b47d527 100644 (file)
 
 function [x,y,typ] = READC_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;
@@ -62,7 +51,6 @@ function [x,y,typ] = READC_f(job,arg1,arg2)
 
             if ~ok then
                 break
-
             end //user cancel modification
 
             fname1 = pathconvert(stripblanks(fname1), %f, %t)
@@ -125,18 +113,14 @@ function [x,y,typ] = READC_f(job,arg1,arg2)
             elseif offset < 1 then
                 block_parameter_error(msprintf(gettext("Wrong value for ''%s'' parameter: %d."), gettext("Initial Record Index"), offset), ..
                 gettext("Strictly positive integer expected."));
-
             else
-
                 if tmask1 == [] then
                     ievt = 0;
                     tmask1 = 0;
                     outpt = [];
-
                 else
                     ievt = 1;
                     outpt = 1;
-
                 end
 
                 out = size(outmask,"*")
@@ -146,10 +130,8 @@ function [x,y,typ] = READC_f(job,arg1,arg2)
                 if ok then
                     if ievt == 0 then
                         model.firing = -1
-
                     else
                         model.firing = 0
-
                     end
 
                     ipar = [ ...
@@ -167,7 +149,6 @@ function [x,y,typ] = READC_f(job,arg1,arg2)
 
                     if prod(size(dstate)) <> (N*M) + 3 then
                         dstate = [-1; -1; lunit; zeros(N*M, 1)]
-
                     end
 
                     model.dstate = dstate;
@@ -223,10 +204,7 @@ function [x,y,typ] = READC_f(job,arg1,arg2)
         string(N); string(offset);string(swap) ...
         ];
 
-        gr_i = [ ...
-        "txt=[""read from"";""C binary file""];"; ...
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),""fill"")" ...
-        ];
+        gr_i = [];
 
         x = standard_define([4 2],model,exprs,gr_i)
     end
index d7fc80e..2326109 100644 (file)
 
 function [x, y, typ] = RFILE_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;
@@ -68,7 +57,6 @@ function [x, y, typ] = RFILE_f(job,arg1,arg2)
 
             if ~ok then
                 break
-
             end //user cancel modification
 
             fname1 = pathconvert(stripblanks(fname1), %f, %t)
@@ -116,20 +104,16 @@ function [x, y, typ] = RFILE_f(job,arg1,arg2)
                     ievt = 0;
                     cout = [];
                     tmask1 = 0;
-
                 else
                     ievt = 1
                     cout = 1;
-
                 end
                 [model,graphics,ok] = check_io( model, graphics, [], nout, 1, cout)
                 if ok then
                     if ievt == 0 then
                         model.firing = []
-
                     else
                         model.firing = 0
-
                     end
                     ipar = [ ...
                     length(fname1); ...
@@ -144,7 +128,6 @@ function [x, y, typ] = RFILE_f(job,arg1,arg2)
 
                     if prod(size(dstate)) <> (nout+ievt)*N + 3 then
                         dstate = [-1 ; -1; lunit; zeros((nout + ievt) * N, 1)]
-
                     end
                     model.dstate = dstate;
                     model.ipar = ipar
@@ -152,11 +135,8 @@ function [x, y, typ] = RFILE_f(job,arg1,arg2)
                     x.graphics = graphics;
                     x.model = model
                     break
-
                 end
-
             end
-
         end
 
     case "define" then
@@ -196,10 +176,7 @@ function [x, y, typ] = RFILE_f(job,arg1,arg2)
         frmt;
         string(N);
         sci2exp(out)]
-        gr_i = [ ...
-        "txt=[""read from"";""input file""];"; ...
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),""fill"")"...
-        ];
+        gr_i = [];
 
         x = standard_define([3 2],model,exprs,gr_i)
     end
index 53b1619..e66aa26 100644 (file)
 //
 
 function [x,y,typ]=SAWTOOTH_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then //normal  position
-        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
@@ -42,8 +36,7 @@ function [x,y,typ]=SAWTOOTH_f(job,arg1,arg2)
         model.dep_ut=[%f %t]
 
         exprs=" "
-        gr_i=["txt=[''sawtooth'';''generator''];";
-        "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 17d6818..6c23807 100644 (file)
@@ -33,7 +33,9 @@ function [x,y,typ]=STEP(job,arg1,arg2)
             gettext("Step Function");" "], ..
             [gettext("Step Time"); gettext("Initial Value"); gettext("Final Value")], ..
             list("vec",1,"vec",-1,"vec",-1), exprs);
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             in=in(:);fi=fi(:);
             if size(in,"*")<>size(fi,"*")  then
                 if size(in,"*")==1 then
@@ -46,9 +48,9 @@ function [x,y,typ]=STEP(job,arg1,arg2)
                 end
             end
             if ok then
-              model.out2=1;
-              model.outtyp=1;
-              [model,graphics,ok]=check_io(model,graphics,[],size(fi,"*"),1,1)
+                model.out2=1;
+                model.outtyp=1;
+                [model,graphics,ok]=check_io(model,graphics,[],size(fi,"*"),1,1)
             end
             if ok then
                 model.firing=temps
index af72df4..f622ba9 100644 (file)
@@ -20,7 +20,9 @@
 //
 
 function [x,y,typ]=STEP_FUNCTION(job,arg1,arg2)
-    x=[];y=[],typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
     case "set" then
         // look for the internal edge trigger block
index d21c1a7..7ca1231 100644 (file)
 //
 
 function [x,y,typ]=SampleCLK(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        thik=xget("thickness");
-        pat=xget("pattern"); xset("pattern",default_color(0))
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-        x=orig(1)*ones(1,9)+sz(1)*[0 1/16 15/16 1 15/16 14/16 2/16 1/16 0];
-        y=orig(2)*ones(1,9)+sz(2)*[2/3 1 1 2/3 1/3 0 0 1/3 2/3];
-        xpolys(x',y',5*ones(9,1));
-        //    xarcs([orig(1),orig(2)+sz(2),sz(1),sz(2),-360*64,360*64]',5);
-        x=orig(1)*ones(1,2)+sz(1)*[0 1];
-        y=orig(2)*ones(1,2)+sz(2)*[2/3 2/3];
-        xpolys(x',y',5*ones(2,1));
-        x=orig(1)*ones(1,2)+sz(1)*[1/16 15/16];
-        y=orig(2)*ones(1,2)+sz(2)*[1/3 1/3];
-        xpolys(x',y',5*ones(2,1));
-        xstringb(orig(1)+sz(1)/16,orig(2)+2*sz(2)/3+sz(2)/16,arg1.graphics.exprs(1),7*sz(1)/8,sz(2)/3-sz(2)/8,"fill")
-        xstringb(orig(1)+sz(1)/16,orig(2)+sz(2)/3+sz(2)/16,arg1.graphics.exprs(2),7*sz(1)/8,sz(2)/3-sz(2)/8,"fill")
-        font=xget("font")
-        xset("font", options.ID(1)(1), options.ID(1)(2))
-        xstringb(orig(1)+2*sz(1)/16,orig(2)+sz(2)/16,"S-CLK",sz(1)/2,sz(2)/3-sz(2)/8,"fill")
-        xx=[0:.01:1];
-        yy=(1/4-(xx-1/2)^2)^(1/2)+1/2;
-        x=(orig(1)+5*sz(1)/8)*ones(1,101)+sz(1)/4*xx;
-        y=(orig(2))*ones(1,101)+sz(2)/3*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)+5*sz(1)/8)*ones(1,101)+sz(1)/4*xx;
-        y=(orig(2))*ones(1,101)+sz(2)/3*yy;
-        xpolys(x',y',5*ones(101,1));
-        xset("thickness",1);
-        x=(orig(1)+5*sz(1)/8)*ones(1,2)+sz(1)/4*[1/2 1/2];
-        y=(orig(2))*ones(1,2)+sz(2)/3*[1/2 15/16];
-        xpolys(x',y',2*ones(2,1));
-        x=(orig(1)+5*sz(1)/8)*ones(1,2)+sz(1)/4*[1/2 1/2+(3*2^(1/2))/16];
-        y=(orig(2))*ones(1,2)+sz(2)/3*[1/2 1/2+(3*2^(1/2))/16];
-        xpolys(x',y',2*ones(2,1));
-        xset("thickness",thik);
-        xset("font",font(1),font(2));
-        xf=40
-        yf=60
-        nout=1;
-
-        if orient then
-            out=[-1/14   0
-            0       -1/7
-            1/14    0
-            -1/14   0]*diag([xf,yf])
-            dy=sz(1)/(nout+1)
-            xset("pattern",5)
-            for k=1:nout
-                xfpoly(out(:,1)+ones(4,1)*(orig(1)+sz(1)-dy*k),..
-                out(:,2)+ones(4,1)*(orig(2)),5)
-            end
-        else
-            out=[-1/14   0
-            0       1/7
-            1/14    0
-            -1/14   0]*diag([xf,yf])
-            dy=sz(1)/(nout+1)
-            xset("pattern",5)
-            for k=1:nout
-                xfpoly(out(:,1)+ones(4,1)*(orig(1)+sz(1)-dy*k),..
-                out(:,2)+ones(4,1)*(orig(2)+sz(2)),5)
-            end
-        end
-
-        ident = arg1.graphics.id
-        if ident <> [] & ident <> "" then
-            font=xget("font")
-            xset("font", options.ID(1)(1), options.ID(1)(2))
-            if ~orient then
-                rectangle = xstringl(orig(1), orig(2), ident) ;
-                w = max(rectangle(3), sz(1)) ;
-                h = rectangle(4) * 1.3 ;
-                xstringb(orig(1) + sz(1) / 2 - w / 2, orig(2) - h , ident , w, h) ;
-            else
-                rectangle = xstringl(orig(1), orig(2)+sz(2), ident) ;
-                w = max(rectangle(3), sz(1)) ;
-                h = rectangle(4) * 1.3 ;
-                xstringb(orig(1) + sz(1) / 2 - w / 2, orig(2)+ sz(2) , ident , w, h) ;
-            end
-            xset("font", font(1), font(2))
-        end
-        x=[];y=[]
-    case "getinputs" then
-        x=[];y=[];typ=[]
-    case "getoutputs" then
-        orig=arg1.graphics.orig;sz=arg1.graphics.sz;
-        if arg1.graphics.flip then
-            x=orig(1)+sz(1)/2
-            y=orig(2)
-        else
-            x=orig(1)+sz(1)/2
-            y=orig(2)+sz(2)
-        end
-        typ=-ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
         graphics=arg1.graphics;
@@ -132,13 +33,22 @@ function [x,y,typ]=SampleCLK(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
-            if frequ<0 then message("Frequency must be a positif number");ok=%f;end
+            if ~ok then
+                break,
+            end
+            if frequ<0 then
+                message("Frequency must be a positif number");
+                ok=%f;
+            end
             if 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
-                if or(model.rpar(:)<>[frequ;offset]) then needcompile=4;y=needcompile,end
+                if or(model.rpar(:)<>[frequ;offset]) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 model.rpar=[frequ;offset]
                 model.evtout=1
                 model.firing=-1//compatibility
index 7f2f6f2..01c7750 100644 (file)
 
 function [x,y,typ] = Sigbuilder(job,arg1,arg2)
     //** updated for Scilab 5.1 by Simone Mannori
-    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 internal curve block
@@ -146,20 +137,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
         pout=6,..
         pein=4,..
         peout=2,..
-        gr_i=list(..
-        ["rpar=arg1.model.rpar;n=model.ipar(1);order=model.ipar(2);";
-        "xx=rpar(1:n);yy=rpar(n+1:2*n);";
-        "[XX,YY,rpardummy]=Do_Spline(n,order,xx,yy)";
-        "xmx=max(XX);xmn=min(XX);";
-        "ymx=max(YY);ymn=min(YY);";
-        "dx=xmx-xmn;if dx==0 then dx=max(xmx/2,1);end";
-        "xmn=xmn-dx/20;xmx=xmx+dx/20;";
-        "dy=ymx-ymn;if dy==0 then dy=max(ymx/2,1);end;";
-        "ymn=ymn-dy/20;ymx=ymx+dy/20;";
-        "xx2=orig(1)+sz(1)*((XX-xmn)/(xmx-xmn));";
-        "yy2=orig(2)+sz(2)*((YY-ymn)/(ymx-ymn));";
-        "xset(''color'',2)";
-        "xpoly(xx2,yy2,''lines'');"],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit="E"),..
@@ -207,7 +185,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
         pout=[],..
         pein=2,..
         peout=[8;4],..
-        gr_i=list([],8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit=[]),..
@@ -255,7 +233,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
         pout=[],..
         pein=[],..
         peout=[],..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit="E",..
         out_implicit=[]),..
@@ -303,7 +281,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
         pout=[],..
         pein=8,..
         peout=[],..
-        gr_i=list(" ",8),..
+        gr_i=[],..
         id="",..
         in_implicit=[],..
         out_implicit=[]),..
@@ -362,23 +340,7 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2)
         nzcross=0,..
         nmode=0,..
         equations=list())
-        //  gr_i='xstringb(orig(1),orig(2),''Sigbuilder'',sz(1),sz(2),''fill'')';
-        gr_i=["ipar=arg1.model.rpar.objs(1).model.ipar";
-        "rpar=arg1.model.rpar.objs(1).model.rpar";
-        "n=ipar(1);order=ipar(2);";
-        "xx=rpar(1:n);yy=rpar(n+1:2*n);";
-        "[XX,YY,rpardummy]=Do_Spline2(n,order,xx,yy)";
-        "xmx=max(XX);xmn=min(XX);";
-        "ymx=max(YY);ymn=min(YY);";
-        "dx=xmx-xmn;if dx==0 then dx=max(xmx/2,1);end";
-        "xmn=xmn-dx/20;xmx=xmx+dx/20;";
-        "dy=ymx-ymn;if dy==0 then dy=max(ymx/2,1);end;";
-        "ymn=ymn-dy/20;ymx=ymx+dy/20;";
-        "rect=[xmn,ymn;xmx,ymx];";
-        "xx2=orig(1)+sz(1)*((XX-xmn)/(xmx-xmn));";
-        "yy2=orig(2)+sz(2)*((YY-ymn)/(ymx-ymn));";
-        "xset(''color'',2)";
-        "xpoly(xx2,yy2,''lines'');"]
+        gr_i=[]
 
         x=standard_define([3 2],model,[],gr_i)
     end
@@ -409,10 +371,18 @@ function [X,Y,orpar]=Do_Spline2(N,order,x,y)
         return;
     end
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    if (N<20) then NP=4;else
-        if (N<40) then NP=2;else
-            if (N<100) then NP=1;else
-        NP=0;end;end;
+    if (N<20) then
+        NP=4;
+    else
+        if (N<40) then
+            NP=2;
+        else
+            if (N<100) then
+                NP=1;
+            else
+                NP=0;
+            end;
+        end;
     end
     for i=1:N-1
         X=[X;linspace(x(i),x(i+1),NP+2)']; // pour tous sauf "linear" et "zero order"
index 041c5eb..0af91f5 100644 (file)
 //
 
 function [x,y,typ]=TIME_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
@@ -40,18 +34,7 @@ function [x,y,typ]=TIME_f(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%f %t]
 
-        gr_i=["wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "rx=sz(1)*p/2;ry=sz(2)/2;";
-        "xarc(orig(1)+0.05*sz(1),orig(2)+0.95*sz(2),0.9*sz(1)*p,0.9*sz(2),0,360*64);";
-        "xset(''thickness'',1);";
-        "xx=[orig(1)+rx    orig(1)+rx;";
-        "orig(1)+rx    orig(1)+rx+0.6*rx*cos(%pi/6)];";
-        "yy=[orig(2)+ry    orig(2)+ry ;";
-        "        orig(2)+1.8*ry  orig(2)+ry+0.6*ry*sin(%pi/6)];";
-        "xsegs(xx,yy,0);";
-        "xset(''thickness'',thick);"]
+        gr_i=[]
         x=standard_define([2 2],model,[],gr_i)
     end
 endfunction
index a5af3fc..3f2e113 100644 (file)
 
 function [x,y,typ]=TKSCALE(job,arg1,arg2)
     //Source block; output defined by tk widget scale
-    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,a,b,f,exprs]=scicos_getvalue("Set scale block parameters",..
         ["Min value";"Max value";"Normalization"],..
@@ -43,10 +38,13 @@ function [x,y,typ]=TKSCALE(job,arg1,arg2)
         if ok then
             graphics.exprs=exprs
             model.rpar=[a;b;f]
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
         end
     case "define" then
-        a=-10;b=10;f=1;// default parameter values
+        a=-10;
+        b=10;
+        f=1;// default parameter values
         model=scicos_model()
         model.sim=list("tkscaleblk",5)
         model.out=1
@@ -55,7 +53,7 @@ function [x,y,typ]=TKSCALE(job,arg1,arg2)
         model.blocktype="d"
         model.dep_ut=[%f %f]
         exprs=[sci2exp(a);sci2exp(b);sci2exp(f)]
-        gr_i=["xstringb(orig(1),orig(2),''TK Scale'',sz(1),sz(2),''fill'')"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction