Scicos_blocks: clean NonLinear blocks interfaces 43/13243/3
Paul Bignier [Wed, 27 Nov 2013 08:23:35 +0000 (09:23 +0100)]
Removed unused 'job' and 'gr_i' values.

Change-Id: I83198044afb531136b40f6bf85414a4a2ac80796

28 files changed:
scilab/modules/scicos_blocks/macros/NonLinear/ABSBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/ABS_VALUE.sci
scilab/modules/scicos_blocks/macros/NonLinear/COSBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/DLRADAPT_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/EXPBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/EXPBLK_m.sci
scilab/modules/scicos_blocks/macros/NonLinear/FSV_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/INTRP2BLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/INTRPLBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/INVBLK.sci
scilab/modules/scicos_blocks/macros/NonLinear/INVBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/LOGBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/LOOKUP2D.sci
scilab/modules/scicos_blocks/macros/NonLinear/LOOKUP_c.sci
scilab/modules/scicos_blocks/macros/NonLinear/LOOKUP_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/MAXMIN.sci
scilab/modules/scicos_blocks/macros/NonLinear/MAX_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/MIN_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/POWBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/PRODUCT.sci
scilab/modules/scicos_blocks/macros/NonLinear/PROD_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/QUANT_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/SATURATION.sci
scilab/modules/scicos_blocks/macros/NonLinear/SAT_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/SIGNUM.sci
scilab/modules/scicos_blocks/macros/NonLinear/SINBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/TANBLK_f.sci
scilab/modules/scicos_blocks/macros/NonLinear/TrigFun.sci

index 2416adc..d59ab10 100644 (file)
 
 function [x,y,typ]=ABSBLK_f(job,arg1,arg2)
     //Absolute value block GUI.
-    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,7 +34,7 @@ function [x,y,typ]=ABSBLK_f(job,arg1,arg2)
         model.out=-1
         model.blocktype="c"
         model.dep_ut=[%t %f]
-        gr_i="xstringb(orig(1),orig(2),''Abs'',sz(1),sz(2),''fill'')"
+        gr_i=[]
         x=standard_define([2 2],model,[],gr_i)
     end
 endfunction
index a2a2100..bd6a565 100644 (file)
 //
 
 function [x,y,typ]=ABS_VALUE(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,zcr,exprs]=..
             scicos_getvalue("Set block parameters",..
             ["use zero_crossing (1: yes) (0:no)"],..
             list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             if ok then
                 if zcr<>0 then
-                    model.nmode=-1;model.nzcross=-1;
+                    model.nmode=-1;
+                    model.nzcross=-1;
                 else
-                    model.nmode=0;model.nzcross=0;
+                    model.nmode=0;
+                    model.nzcross=0;
                 end
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -63,8 +63,7 @@ function [x,y,typ]=ABS_VALUE(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string([1])]
-        gr_i=["txt=[''ABS''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
 
         x=standard_define([2 2],model,exprs,gr_i)
     end
index 5d642af..fcdcec2 100644 (file)
 //
 
 function [x,y,typ]=COSBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
@@ -41,7 +35,7 @@ function [x,y,typ]=COSBLK_f(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
 
-        gr_i=["xstringb(orig(1),orig(2),[''cos''],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,[],gr_i)
     end
 endfunction
index 5e8c0e1..b26c662 100644 (file)
 //
 
 function [x,y,typ]=DLRADAPT_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,p,rn,rd,g,last_u,last_y,exprs]=scicos_getvalue("Set block parameters",..
@@ -47,7 +42,9 @@ function [x,y,typ]=DLRADAPT_f(job,arg1,arg2)
             "vec","size(%2,2)","vec","size(%3,2)"),exprs)
 
 
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             m=size(rn,2)
             [npt,n]=size(rd)
             if m>=n then
@@ -61,7 +58,8 @@ function [x,y,typ]=DLRADAPT_f(job,arg1,arg2)
                 model.rpar=rpar
                 model.ipar=ipar
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break;
             end
         end
@@ -92,8 +90,7 @@ function [x,y,typ]=DLRADAPT_f(job,arg1,arg2)
         sci2exp(g);
         sci2exp(last_u);
         sci2exp(last_y)]
-        gr_i=["txt=[''N(z,p)'';''-----'';''D(z,p)''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 3b03547..0c4dd55 100644 (file)
 //
 
 function [x,y,typ]=EXPBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if size(exprs,"*")==2 then exprs=exprs(2),end
+        if size(exprs,"*")==2 then
+            exprs=exprs(2),
+        end
         while %t do
             [ok,a,exprs]=scicos_getvalue("Set a^u  block parameters",..
             "a (>0)",list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if or(a<=0) then
                 message("a^u : a must be positive")
             else
                 graphics.exprs=exprs
                 model.rpar=a;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -60,7 +60,7 @@ function [x,y,typ]=EXPBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=["%e"]
-        gr_i=["xstringb(orig(1),orig(2),''a^u'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 8220559..f0059b2 100644 (file)
 //
 
 function [x,y,typ]=EXPBLK_m(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if size(exprs,"*")==2 then exprs=exprs(2),end
+        if size(exprs,"*")==2 then
+            exprs=exprs(2),
+        end
         while %t do
             [ok,a,exprs]=scicos_getvalue("Set a^u  block parameters",..
             "a (>0)",list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if or(a<=0) then
                 message("a^u : a must be positive")
             else
                 graphics.exprs=exprs
                 model.rpar=a;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -64,7 +64,7 @@ function [x,y,typ]=EXPBLK_m(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=["%e"]
-        gr_i=["xstringb(orig(1),orig(2),''a^u'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index fb90059..00db92d 100644 (file)
 
 function [x,y,typ]=FSV_f(job,arg1,arg2)
     //Absolute value block GUI.
-    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
@@ -43,7 +37,7 @@ function [x,y,typ]=FSV_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=" "
-        gr_i="xstringb(orig(1),orig(2),''f_sv'',sz(1),sz(2),''fill'')"
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 672bc08..c64c7c0 100644 (file)
 //
 
 function [x,y,typ]=INTRP2BLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,a,b,c,exprs]=scicos_getvalue("Set Interpolation block parameters",..
             ["X coord.";"Y coord.";"Z values"],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(a,"*") <> size(c,"c") | size(b,"*") <> size(c,"r") then
                 message("incompatible dimension")
             elseif min(a(2:$)-a(1:$-1)) <=0 | min(b(2:$)-b(1:$-1)) <=0 then
@@ -47,13 +44,16 @@ function [x,y,typ]=INTRP2BLK_f(job,arg1,arg2)
                     graphics.exprs=exprs
                     model.rpar=[a(:);b(:);c(:)]
                     model.ipar=[size(a,"*");size(b,"*")]
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
         end
     case "define" then
-        a=[0;1];b=[0;1];c=[0 1;1 2]
+        a=[0;1];
+        b=[0;1];
+        c=[0 1;1 2]
         model=scicos_model()
         model.sim=list("intrp2",1)
         model.in=[1;1]
@@ -63,7 +63,7 @@ function [x,y,typ]=INTRP2BLK_f(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
         exprs=[strcat(sci2exp(a));strcat(sci2exp(b));strcat(sci2exp(c,0))]
-        gr_i=["xstringb(orig(1),orig(2),''interp2'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 4c27f97..0ab7f5b 100644 (file)
 //
 
 function [x,y,typ]=INTRPLBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,a,b,exprs]=scicos_getvalue("Set Interpolation block parameters",..
             ["X coord.";"Y coord."],list("vec",-1,"vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(a,"*") <> size(b,"*") then
                 message("X and Y must have the same size")
             elseif min(a(2:$)-a(1:$-1)) <=0 then
@@ -46,13 +43,15 @@ function [x,y,typ]=INTRPLBLK_f(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs
                     model.rpar=[a(:);b(:)]
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
         end
     case "define" then
-        a=[0;1];b=[0;1]
+        a=[0;1];
+        b=[0;1]
         model=scicos_model()
         model.sim="intrpl"
         model.in=1
@@ -62,7 +61,7 @@ function [x,y,typ]=INTRPLBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[strcat(sci2exp(a));strcat(sci2exp(b))]
-        gr_i=["xstringb(orig(1),orig(2),''interp'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index f0a237a..4960187 100644 (file)
 //
 
 function [x,y,typ]=INVBLK(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
@@ -42,7 +36,7 @@ function [x,y,typ]=INVBLK(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=" "
-        gr_i=["xstringb(orig(1),orig(2),''1/u'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 3ec1ffd..65391d7 100644 (file)
 //
 
 function [x,y,typ]=INVBLK_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
@@ -42,7 +36,7 @@ function [x,y,typ]=INVBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=" "
-        gr_i=["xstringb(orig(1),orig(2),''1/u'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index ff51193..eb85717 100644 (file)
 //
 
 function [x,y,typ]=LOGBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if size(exprs,"*")==2 then exprs=exprs(2),end //compatibility
+        if size(exprs,"*")==2 then
+            exprs=exprs(2),
+        end //compatibility
         while %t do
             [ok,a,exprs]=scicos_getvalue("Set log block parameters",..
             "Basis (>1)",list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if a<=1 then
                 message("Basis must be larger than 1")
             else
                 if ok then
                     graphics.exprs=exprs
                     model.rpar=a
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -62,7 +62,7 @@ function [x,y,typ]=LOGBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs="%e"
-        gr_i=["xstringb(orig(1),orig(2),''Log'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 1ecefee..62df228 100644 (file)
 function [x,y,typ]=LOOKUP2D(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]=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
@@ -50,20 +44,47 @@ function [x,y,typ]=LOOKUP2D(job,arg1,arg2)
             // 5 : use input above
             // 6 : Interpolation-extrapolation (linear)
 
-            if  ~ok then break;end
-            mtd=int(Method); if mtd<1 then mtd=1;end; if mtd>6 then mtd=6;end;
-            if graf<>"y" & graf<>"Y" then  graf="n"; end
+            if  ~ok then
+                break;
+            end
+            mtd=int(Method);
+            if mtd<1 then
+                mtd=1;
+            end;
+            if mtd>6 then
+                mtd=6;
+            end;
+            if graf<>"y" & graf<>"Y" then
+                graf="n";
+            end
             exprs(5)="n";// exprs.graf='n'
             exprs(4)=sci2exp(mtd);// pour le cas methode>7 | method<0
 
             METHOD=getmethod(mtd);
             if ~Ask_again then
-                xx=xx(:);yy=yy(:);
-                [nx,mx]=size(xx); [ny,my]=size(yy);[nz,mz]=size(zz);
-                if ((nx<=1)|(ny<=1)) then, x_message("input row/column data size should be greater than one");  Ask_again=%t;end
-                if ~((nx==nz)&(ny==mz)) then, x_message("incompatible size of x and y");  Ask_again=%t;end
-                [ok]=test_increasing(xx);if (~ok) then  x_message("Row input values must be monotonically increasing");Ask_again=%t;end
-                [ok]=test_increasing(yy);if (~ok) then  x_message("Column input values must be monotonically increasing");Ask_again=%t;end
+                xx=xx(:);
+                yy=yy(:);
+                [nx,mx]=size(xx);
+                [ny,my]=size(yy);
+                [nz,mz]=size(zz);
+                if ((nx<=1)|(ny<=1)) then,
+                    x_message("input row/column data size should be greater than one");
+                    Ask_again=%t;
+                end
+                if ~((nx==nz)&(ny==mz)) then,
+                    x_message("incompatible size of x and y");
+                    Ask_again=%t;
+                end
+                [ok]=test_increasing(xx);
+                if (~ok) then
+                    x_message("Row input values must be monotonically increasing");
+                    Ask_again=%t;
+                end
+                [ok]=test_increasing(yy);
+                if (~ok) then
+                    x_message("Column input values must be monotonically increasing");
+                    Ask_again=%t;
+                end
             end
             if ~Ask_again then
                 if (graf=="Y" | graf=="y") then
@@ -105,12 +126,7 @@ function [x,y,typ]=LOOKUP2D(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
         exprs=list(strcat(sci2exp(xx)),strcat(sci2exp(yy)),strcat(sci2exp(zz)),sci2exp(Method),Graf)
-        gr_i=["txt=[''   Lookup'';''   table''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');";
-        "txt=''r'';";"xstringb(orig(1)+.01*sz(1), orig(2)+.5*sz(1), txt, sz(1)/6,sz(2)/6,''fill'');"
-        "txt=''c'';";"xstringb(orig(1)+.01*sz(1), orig(2)+.1*sz(1), txt, sz(1)/6,sz(2)/6,''fill'');"
-
-        ]
+        gr_i=[]
 
         x=standard_define([2.5 2],model,exprs,gr_i)
     end
index cb0ab47..8b18f31 100644 (file)
@@ -24,16 +24,10 @@ function [x,y,typ]=LOOKUP_c(job,arg1,arg2)
     // origine: serge Steer, Habib Jreij INRIA 1993
     // Copyright INRIA
 
-    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,19 +48,42 @@ function [x,y,typ]=LOOKUP_c(job,arg1,arg2)
             // extra: 0:hold; 1: use end values
             //
 
-            if  ~ok then break;end
+            if ~ok then
+                break;
+            end
             PeriodicOption="n";
 
-            if PeriodicOption=="y" | PeriodicOption=="Y" then,PO=1;else,PO=0;end
-            mtd=int(Method); if mtd<0 then mtd=0;end; if mtd>9 then mtd=9;end;
+            if PeriodicOption=="y" | PeriodicOption=="Y" then,
+                PO=1;
+            else,
+                PO=0;
+            end
+            mtd=int(Method);
+            if mtd<0 then
+                mtd=0;
+            end;
+            if mtd>9 then
+                mtd=9;
+            end;
             METHOD=getmethod(mtd);
-            extrapo=int(extrapo); if extrapo<0 then extrapo=0;end; if extrapo>1 then extrapo=1;end;
+            extrapo=int(extrapo);
+            if extrapo<0 then
+                extrapo=0;
+            end;
+            if extrapo>1 then
+                extrapo=1;
+            end;
 
 
             if ~Ask_again then
-                xx=xx(:);yy=yy(:);
-                [nx,mx]=size(xx); [ny,my]=size(yy);
-                if ~((nx==ny)&(mx==my)) then, x_message("incompatible size of x and y");  Ask_again=%t;end
+                xx=xx(:);
+                yy=yy(:);
+                [nx,mx]=size(xx);
+                [ny,my]=size(yy);
+                if ~((nx==ny)&(mx==my)) then,
+                    x_message("incompatible size of x and y");
+                    Ask_again=%t;
+                end
             end
 
             if ~Ask_again then//+++++++++++++++++++++++++++++++++++++++
@@ -85,23 +102,36 @@ function [x,y,typ]=LOOKUP_c(job,arg1,arg2)
                     curwin=max(winsid())+1;
                     [orpar,oipar,ok]=poke_point(xy,ipar,rpar);
                     curwin=save_curwin;
-                    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);
                     exprs(4)=sci2exp(oipar(4));
-                    if oipar(3)==1 then,perop="y";else,perop="n";end
+                    if oipar(3)==1 then,
+                        perop="y";
+                    else,
+                        perop="n";
+                    end
                     SaveExit=%t
                 else//_____________________No graphics__________________________
                     [Xdummy,Ydummy,orpar]=Do_Spline(N,mtd,xy(:,1),xy(:,2),xy($,1),xy(1,1),0);
@@ -141,7 +171,9 @@ function [x,y,typ]=LOOKUP_c(job,arg1,arg2)
 
         xx=[-1;0.5;1;1.5;2.5]
         yy=[-6;-1;-3;3;-4]
-        N=length(xx);  Method=1;   Graf="n"
+        N=length(xx);
+        Method=1;
+        Graf="n"
         model.sim=list("lookup_c",4)
         model.in=-1
         model.in2=-2
@@ -160,19 +192,7 @@ function [x,y,typ]=LOOKUP_c(job,arg1,arg2)
         model.firing=0
         exprs=[sci2exp(Method);sci2exp(xx);sci2exp(yy);sci2exp(0);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,xx(n),xx(1),model.ipar(4))";
-        "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
@@ -210,7 +230,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 provided");
         return
@@ -225,46 +247,71 @@ function [rpar,ipar,ok]=poke_point(ixy,iparin,rparin)
         extrapo=0
         ipar=[N;NOrder;PeridicOption;extrapo]
         rpar=[]
-    else if rhs==2 then
-            NOrder=iparin(2);
-            PeridicOption=iparin(3);
-            extrapo=iparin(4);
-            ipar=iparin;
-            rpar=[]
-        else if rhs==3 then
-                NOrder=iparin(2);
-                PeridicOption=iparin(3);
-                extrapo=iparin(4);
-                ipar=iparin;
-                rpar=rparin
-            end
-        end
+    elseif rhs==2 then
+        NOrder=iparin(2);
+        PeridicOption=iparin(3);
+        extrapo=iparin(4);
+        ipar=iparin;
+        rpar=[]
+    elseif rhs==3 then
+        NOrder=iparin(2);
+        PeridicOption=iparin(3);
+        extrapo=iparin(4);
+        ipar=iparin;
+        rpar=rparin
     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)),
-    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)),
+    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];
     //===================================================================
@@ -300,10 +347,14 @@ 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")
@@ -347,7 +398,11 @@ function [rpar,ipar,ok]=poke_point(ixy,iparin,rparin)
             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=="Exit") |(Cmenu=="Quit" ) then,
+            ipar=[];
+            rpar=[];
+            ok=%f;return;
+        end
         //-------------------------------------------------------------------
         if ((Cmenu=="zero order-below") | (Cmenu=="linear") | (Cmenu=="order 2")| ...
             (Cmenu=="not_a_knot")| (Cmenu=="periodic")| (Cmenu=="monotone")| ...
@@ -402,10 +457,20 @@ function [rpar,ipar,ok]=poke_point(ixy,iparin,rparin)
             //-------------------------------------------------------------------
         case "Extrapolation" then
             //extrapo
-            if extrapo==1 then, ans0="1",else, ans0="0",end;
+            if extrapo==1 then,
+                ans0="1",
+            else,
+                ans0="0",
+            end;
             [mok,myans]=scicos_getvalue("Extrapolation method (just for Method 1)",["0: hold end values, 1: extrapolation"],list("vec",1),list(ans0));
             if (mok==%t) then
-                extrapo=int(myans); if extrapo<0 then extrapo=0;end; if extrapo>1 then extrapo=1;end;
+                extrapo=int(myans);
+                if extrapo<0 then
+                    extrapo=0;
+                end;
+                if extrapo>1 then
+                    extrapo=1;
+                end;
                 ipar(4)=extrapo;
                 [rpar,ipar]=AutoScale(a,xy,ipar,rpar)
             end
@@ -415,7 +480,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;
@@ -467,17 +534,25 @@ 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
                         xt=[xt;Pd3; Pw3*Tp3/100+Pd3;Tp3];
                         yt=[yt;Amp3+Bias3;Bias3;Bias3];
                     else
-                        xt=[0;Tp3];yt=[Bias3;Bias3];
+                        xt=[0;Tp3];
+                        yt=[Bias3;Bias3];
                     end
                 else
-                    xt=[0;Tp3];yt=[Bias3;Bias3];
+                    xt=[0;Tp3];
+                    yt=[Bias3;Bias3];
                 end
 
                 xy=[xt,yt];
@@ -493,8 +568,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);
@@ -509,8 +586,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);
@@ -601,7 +680,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;
@@ -660,7 +740,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);
@@ -670,17 +751,27 @@ 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
 
-    xmx=max(points.data(:,1));    xmn=min(points.data(:,1));
-    xmx1=max(a.x_ticks.locations); xmn1=min(a.x_ticks.locations)
-    xmx=max(xmx,xmx1);    xmn=min(xmn,xmn1);
+    xmx=max(points.data(:,1));
+    xmn=min(points.data(:,1));
+    xmx1=max(a.x_ticks.locations);
+    xmn1=min(a.x_ticks.locations)
+    xmx=max(xmx,xmx1);
+    xmn=min(xmn,xmn1);
     [X,Y,orpar]=Do_Spline(N,order,x,y,xmx,xmn,extrapo);
 
     if (periodicoption==1) then
@@ -702,7 +793,8 @@ 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);
 
     x(k)=[];
     y(k)=[];
@@ -710,7 +802,10 @@ function [xyt,orpar,oipar]=movept(a,xy,iipar,irpar,k)
     btn=-1
 
     while ~(btn==3 | btn==0| btn==10| btn==-5)
-        rep=xgetmouse([%t %t]); xc=rep(1);yc=rep(2);btn=rep(3);
+        rep=xgetmouse([%t %t]);
+        xc=rep(1);
+        yc=rep(2);
+        btn=rep(3);
 
         xt=[x;xc];
         yt=[y;yc];
@@ -736,20 +831,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(xmx);            XMN=max(xmn);
-    YMX=max(ymx,ymx1);  YMN=min(ymn,ymn1);
+    XMX=max(xmx);
+    XMN=max(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
 
@@ -760,13 +866,16 @@ 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);
@@ -780,35 +889,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=part(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);
@@ -818,10 +961,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));
@@ -835,7 +980,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 ");
             break
@@ -888,28 +1034,45 @@ endfunction
 //============================
 function METHOD=getmethod(order)
     select order
-    case 0 then, METHOD="zero order-below"
-    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 8 then, METHOD="zero order-above"
-    case 9 then, METHOD="zero order-nearest"
+    case 0 then,
+        METHOD="zero order-below"
+    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 8 then,
+        METHOD="zero order-above"
+    case 9 then,
+        METHOD="zero order-nearest"
     end
 endfunction
 //=======================================
 function [sok,xye]=ReadFromFile()
-    xye=[];sok=%f;
+    xye=[];
+    sok=%f;
     while %t
         [sok,filen,Cformat,Cx,Cy]=scicos_getvalue("Text data file ",["Filename";"Reading [C] format";"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");
@@ -921,13 +1084,22 @@ 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);
         xye=[xe,ye];
         [xye]=cleandata(xye)
-        sok=%t;break,
+        sok=%t;
+        break,
     end
 endfunction
 //=======================================
@@ -938,10 +1110,16 @@ function [sok]=SaveToFile(xye)
     while %t
         [sok,filen,Cformat]=scicos_getvalue("Text data file ",["Filename";"Writing [C] format"],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";
 
@@ -954,12 +1132,15 @@ function [sok]=SaveToFile(xye)
             break;
         end
 
-        sok=%t;break,
+        sok=%t;
+        break,
     end
 endfunction
 //=========================================================
 function [X,Y,orpar]=Do_Spline(N,order,x,y,xmx,xmn,extrapo)
-    X=[];Y=[];orpar=[];
+    X=[];
+    Y=[];
+    orpar=[];
 
     METHOD=getmethod(order);
 
@@ -999,7 +1180,9 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y,xmx,xmn,extrapo)
     //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     if (METHOD=="linear") then
 
-        if N<=1 then return; end
+        if N<=1 then
+            return;
+        end
         if extrapo==0 then
             X=[xmn];
             Y=[y(1)];
@@ -1023,11 +1206,16 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y,xmx,xmn,extrapo)
         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;
+    elseif (N<50) then
+        NP=5;
+    elseif (N<100) then
+        NP=2;
+    elseif (N<200) then
+        NP=1;
+    else
+        NP=0;
     end
     for i=1:N-1
         X=[X;linspace(x(i),x(i+1),NP+2)']; // pour tous sauf "linear" et "zero order"
@@ -1043,7 +1231,9 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y,xmx,xmn,extrapo)
         C=Z(2*N-1:3*N-3);
         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 043d132..51f1fc8 100644 (file)
 //
 
 function [x,y,typ]=LOOKUP_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
-        model=arg1.model;rpar=model.rpar;
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
+        model=arg1.model;
+        rpar=model.rpar;
         n=size(rpar,"*")/2
-        xx=rpar(1:n);yy=rpar(n+1:2*n)
+        xx=rpar(1:n);
+        yy=rpar(n+1:2*n)
         while %t do
             [ln,fun]=where();
 
@@ -45,7 +42,9 @@ function [x,y,typ]=LOOKUP_f(job,arg1,arg2)
                 ok=%t
             end  // no need anymore to overload edit_curv in do_eval
 
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             n=size(xx,"*")
             if or(xx(2:n)-xx(1:n-1)<=0) then
                 message("You have not defined a function")
@@ -53,7 +52,8 @@ function [x,y,typ]=LOOKUP_f(job,arg1,arg2)
             end
             if ok then
                 model.rpar=[xx(:);yy(:)]
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -66,15 +66,7 @@ function [x,y,typ]=LOOKUP_f(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
 
-        gr_i=["rpar=model.rpar;n=size(rpar,''*'')/2;";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=rpar(1:n);yy=rpar(n+1:2*n);";
-        "mnx=min(xx);xx=xx-mnx*ones(xx);mxx=max(xx);";
-        "xx=orig(1)+sz(1)*(1/10+(4/5)*xx/mxx);";
-        "mnx=min(yy);yy=yy-mnx*ones(yy);mxx=max(yy);";
-        "yy=orig(2)+sz(2)*(1/10+(4/5)*yy/mxx);";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        gr_i=[]
         x=standard_define([2 2],model,[],gr_i)
     end
 endfunction
index a9b1068..fb6db89 100644 (file)
 //
 
 function [x,y,typ]=MAXMIN(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        if arg1.model.ipar==1 then
-            CCC="MIN"
-        elseif arg1.model.ipar==2
-            CCC="MAX"
-        else
-            CCC="Min/Max"
-        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,mm,nin,zcr,exprs]=..
             scicos_getvalue("Set Max/Min block parameters",..
             ["Min (1) or Max (2) ";"Number of input vectors (1 or 2)";"zero-crossing (1: yes, 0;no)"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
-            if zcr<>0 then zcr=-1, end
-            if mm<>1 then mm=2,end
+            if ~ok then
+                break,
+            end
+            if zcr<>0 then
+                zcr=-1,
+            end
+            if mm<>1 then
+                mm=2,
+            end
             if nin<>1 & nin<>2 then
                 message("Wrong number of inputs, only 1 and 2 allowed")
                 ok=%f
@@ -78,7 +72,8 @@ function [x,y,typ]=MAXMIN(job,arg1,arg2)
                 graphics.style="MAXMIN;displayedLabel=" + label;
 
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model;
+                x.graphics=graphics;
+                x.model=model;
                 break
             end
         end
@@ -91,8 +86,7 @@ function [x,y,typ]=MAXMIN(job,arg1,arg2)
         model.dep_ut=[%t %f]
         model.ipar=0;
         exprs=[string([2,1,1]')]
-        gr_i=["txt=[CCC];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
 
         x=standard_define([2 2],model,exprs,gr_i)
         x.graphics.style="MAXMIN;displayedLabel=MAX"
index 61609a2..809ac54 100644 (file)
 //
 
 function [x,y,typ]=MAX_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
@@ -43,7 +37,7 @@ function [x,y,typ]=MAX_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=" "
-        gr_i=["xstringb(orig(1),orig(2),''Max'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 60c85f0..580b5a7 100644 (file)
 //
 
 function [x,y,typ]=MIN_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
@@ -43,7 +37,7 @@ function [x,y,typ]=MIN_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=sci2exp(in)
-        gr_i=["xstringb(orig(1),orig(2),''MIN'',sz(1),sz(2),''fill'')"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 23fcc1e..02d8e0d 100644 (file)
 //
 
 function [x,y,typ]=POWBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
-        if size(exprs,"*")==2 then exprs=exprs(2),end //compatibility
+        if size(exprs,"*")==2 then
+            exprs=exprs(2),
+        end //compatibility
         while %t do
             [ok,a,exprs]=scicos_getvalue("Set u^a block parameters",..
             "to the power of",list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             if a==int(a) then
                 model.ipar=a;
@@ -48,7 +47,8 @@ function [x,y,typ]=POWBLK_f(job,arg1,arg2)
                 model.ipar=[]
             end
             model.firing=[] //compatibility
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
             break
         end
     case "define" then
@@ -63,7 +63,7 @@ function [x,y,typ]=POWBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=string(a)
-        gr_i=["xstringb(orig(1),orig(2),''u^a'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 7ceadd9..ed4ff19 100644 (file)
 //
 
 function [x,y,typ] = PRODUCT(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        sgn=arg1.model.ipar
-        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
@@ -41,7 +34,9 @@ function [x,y,typ] = PRODUCT(job,arg1,arg2)
             "(multiplication is set with + 1, division with -1)";""],...
             "Number of inputs or sign vector",...
             list("vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             sgn=sgn(:);
             if size(sgn,1)==1 then
                 if sgn<1 then
@@ -71,7 +66,8 @@ function [x,y,typ] = PRODUCT(job,arg1,arg2)
             if ok then
                 model.ipar=sgn
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -87,30 +83,7 @@ function [x,y,typ] = PRODUCT(job,arg1,arg2)
 
 
         exprs=sci2exp(sgn)
-        gr_i=["[x,y,typ]=standard_inputs(o) ";
-        "dd=sz(1)/8,de=0,"
-        "if ~arg1.graphics.flip then dd=6*sz(1)/8,de=-sz(1)/8,end"
-        "for k=1:size(x,''*'')";
-        "if size(sgn,1)>1 then"
-        "  if sgn(k)>0 then";
-        "    xstring(orig(1)+dd,y(k)-4,''*'')";
-        "  else";
-        "    xstring(orig(1)+dd,y(k)-4,''/'')";
-        "  end";
-        "end";
-        "end";
-        "xx=sz(1)*[.8 .8 .4  .4]+orig(1)+de";
-        "yy=sz(2)*[.2 .8 .8  .2]+orig(2)";
-        "xpoly(xx,yy,''lines'')"
-        "txt=''Product'';"
-        "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([2 3],model, exprs,gr_i)
     end
 endfunction
index cfbf077..4c392e4 100644 (file)
 //
 
 function [x,y,typ]=PROD_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     p=1 //pixel sizes ratio
     select job
-        //**-----------------------------------------------------------------------
-    case "plot" then
-        wd = xget("wdim")
-        graphics = arg1.graphics;
-        orig = graphics.orig,
-        sz = graphics.sz
-        orient = graphics.flip
-        thick = xget("thickness");xset("thickness",2)
-        //** patt=xget('dashes');xset('dashes',default_color(1))
-        rx = sz(1)*p/2
-        ry = sz(2)/2
-        xarc(orig(1),orig(2)+sz(2),sz(1)*p,sz(2),0,23040) // (23040=360*64)
-        gh_temp = gce();
-        gh_temp.foreground = default_color(1);
-
-        t=%pi/4
-        xx=(orig(1)+rx)+..
-        [sin(5*t) , sin(-t);
-        sin(t) ,   sin(3*t)]*diag([rx;rx]/1.7)
-        yy=(orig(2)+ry)+..
-        [cos(5*t) , cos(-t);
-        cos(t) ,   cos(3*t)]*diag([ry;ry]/1.7)
-        xsegs(xx,yy,0)
-        gh_temp = gce();
-        gh_temp.segs_color = [default_color(1), default_color(1)] ;
-
-        xset("thickness",1)
-        if orient then  //standard orientation (port)
-            out= [0  -1/14
-            1/7    0
-            0   1/14]*3
-            xfpoly(sz(1)*out(:,1)+ones(3,1)*(orig(1)+sz(1)*p),sz(2)*out(:,2)+ones(3,1)*(orig(2)+sz(2)/2),1);
-            gh_temp = gce();
-            gh_temp.foreground = default_color(1);
-            gh_temp.background = default_color(1);
-        else //tilded orientation
-            out= [0   -1/14
-            -1/7    0
-            0   1/14]*3
-            xfpoly(sz(1)*out(:,1)+ones(3,1)*orig(1),sz(2)*out(:,2)+ones(3,1)*(orig(2)+sz(2)/2),1);
-            gh_temp = gce();
-            gh_temp.foreground = default_color(1);
-            gh_temp.background = default_color(1);
-        end
-        //** xset('dashes',patt)
-        //**-------------------------------------------------------------------------------------------
-    case "getinputs" then
-        graphics=arg1.graphics
-        orig=graphics.orig
-        sz=graphics.sz
-        orient=graphics.flip
-
-        wd=xget("wdim");
-        if orient then
-            t=[%pi -%pi/2]
-        else
-            t=[%pi %pi/2]
-        end
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))
-        y=r*cos(t)+(orig(2)+r)*ones(t)
-        typ=ones(x)
-    case "getoutputs" then
-        graphics=arg1.graphics;
-        orig=graphics.orig,
-        sz=graphics.sz
-        orient=graphics.flip
-        wd=xget("wdim");
-        if orient then
-            t=%pi/2
-            dx=sz(1)/7
-        else
-            t=-%pi/2
-            dx=-sz(1)/7
-        end
-        r=sz(2)/2
-        rx=r*p
-        x=(rx*sin(t)+(orig(1)+rx)*ones(t))+dx
-        y=r*cos(t)+(orig(2)+r)*ones(t)
-        typ=ones(x)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
index de8d57f..3ec21a9 100644 (file)
 //
 
 function [x,y,typ]=QUANT_f(job,arg1,arg2)
-    x=[];y=[],typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t then
             [ok,pas,meth,exprs]=scicos_getvalue("Set parameters",..
             ["Step";"Quantization Type (1-4)"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if meth<1|meth>4 then
                 message("Quantization Type must be from 1 to 4")
             else
@@ -56,7 +53,8 @@ function [x,y,typ]=QUANT_f(job,arg1,arg2)
                     model.sim="qzcel"
                 end
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -73,11 +71,7 @@ function [x,y,typ]=QUANT_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(pas);string(meth)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=orig(1)+[1;2;2;3;3;4;4]/5*sz(1);";
-        "yy= orig(2)+[1;1;2;2;3;3;4]/5*sz(2);";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick);"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index e437d80..cb2098b 100644 (file)
 //
 
 function [x,y,typ]=SATURATION(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,maxp,minp,zeroc,exprs]=scicos_getvalue("Set Saturation parameters",..
             ["Upper limit";"Lower limit";"zero crossing (0:no, 1:yes)"],list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if maxp<=minp  then
                 message("Upper limit must be > Lower limit")
             else
@@ -51,12 +48,15 @@ function [x,y,typ]=SATURATION(job,arg1,arg2)
                     model.nmode=0
                 end
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
     case "define" then
-        minp=-1;maxp=1;rpar=[maxp;minp]
+        minp=-1;
+        maxp=1;
+        rpar=[maxp;minp]
         model=scicos_model()
         model.sim=list("satur",4)
         model.in=1
@@ -68,11 +68,7 @@ function [x,y,typ]=SATURATION(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(maxp);string(minp);string(model.nmode)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=orig(1)+[4/5;1/2+1/5;1/2-1/5;1/5]*sz(1);";
-        "yy=orig(2)+[1-1/5;1-1/5;1/5;1/5]*sz(2);";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 98439ab..53f572e 100644 (file)
 //
 
 function [x,y,typ]=SAT_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
         model=arg1.model;
         while %t do
             [ok,minp,maxp,pente,exprs]=scicos_getvalue("Set Saturation parameters",..
             ["Min";"Max";"Slope"],list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if maxp<=0  then
                 message("Max must be strictly positive")
             elseif pente<=0 then
@@ -47,12 +44,16 @@ function [x,y,typ]=SAT_f(job,arg1,arg2)
                 model.rpar=rpar
                 model.firing=[] //compatibility
                 graphics.exprs=exprs
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
     case "define" then
-        minp=-1;maxp=1;slope=1;rpar=[minp;maxp;slope]
+        minp=-1;
+        maxp=1;
+        slope=1;
+        rpar=[minp;maxp;slope]
 
         model=scicos_model()
         model.sim=list("lusat",1)
@@ -64,11 +65,7 @@ function [x,y,typ]=SAT_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(minp);string(maxp);string(slope)]
-        gr_i=["thick=xget(''thickness'');xset(''thickness'',2);";
-        "xx=orig(1)+[4/5;1/2+1/5;1/2-1/5;1/5]*sz(1);";
-        "yy=orig(2)+[1-1/5;1-1/5;1/5;1/5]*sz(2);";
-        "xpoly(xx,yy,''lines'');";
-        "xset(''thickness'',thick)"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 3d95364..0b2c376 100644 (file)
 //
 
 function [x,y,typ]=SIGNUM(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,zcr,exprs]=..
             scicos_getvalue("Set block parameters",..
             ["use zero_crossing (1: yes) (0:no)"],..
             list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             graphics.exprs=exprs
             if ok then
                 if zcr<>0 then
-                    model.nmode=-1;model.nzcross=-1;
+                    model.nmode=-1;
+                    model.nzcross=-1;
                 else
-                    model.nmode=0;model.nzcross=0;
+                    model.nmode=0;
+                    model.nzcross=0;
                 end
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -63,8 +63,7 @@ function [x,y,typ]=SIGNUM(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string([1])]
-        gr_i=["txt=[''Sign''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
 
         x=standard_define([2 2],model,exprs,gr_i)
     end
index 7828466..e6f86d4 100644 (file)
 //
 
 function [x,y,typ]=SINBLK_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        standard_draw(arg1)
-    case "getinputs" then
-        [x,y,typ]=standard_inputs(arg1)
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
     case "define" then
@@ -41,7 +35,7 @@ function [x,y,typ]=SINBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=" "
-        gr_i=["xstringb(orig(1),orig(2),''sin'',sz(1),sz(2),''fill'')"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index bd0c106..ffea89e 100644 (file)
 //
 
 function [x,y,typ]=TANBLK_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;
         x.model.firing=[]
@@ -43,7 +37,7 @@ function [x,y,typ]=TANBLK_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=sci2exp(in)
-        gr_i=["xstringb(orig(1),orig(2),''tan'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index ff5d495..a9c1600 100644 (file)
 //
 
 function [x,y,typ]=TrigFun(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        Txt="  "+arg1.graphics.exprs+" "
-        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;
         %FF=["sin";"cos";"tan";
         "asin";"acos";"atan";
@@ -42,13 +36,16 @@ function [x,y,typ]=TrigFun(job,arg1,arg2)
         %GG=["Choose among "+strcat(%FF(1:4),", ");strcat(%FF(5:$),", ")]
         while %t do
             [ok,fun,exprs]=scicos_getvalue(%GG,"Function",list("str",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if find(%FF==fun)==[] then
                 message("Sorry but "+fun +" is not in the list!")
             else
                 graphics.exprs=exprs
                 execstr("model.sim=list(''"+fun+"_blk'',4)")
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -60,7 +57,7 @@ function [x,y,typ]=TrigFun(job,arg1,arg2)
         model.blocktype="c"
         model.dep_ut=[%t %f]
         exprs="sin"
-        gr_i=["xstringb(orig(1),orig(2),[''Trig. Function'';Txt],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([4 2],model,exprs,gr_i)
     end
 endfunction