Scicos_blocks: clean Branching blocks interfaces 29/13229/4
Paul Bignier [Tue, 26 Nov 2013 09:33:08 +0000 (10:33 +0100)]
Removed unused 'job' and 'gr_i' values.

Change-Id: I422105125cf385dc16a9c56869d8bd3b29eefb8c

27 files changed:
scilab/modules/scicos_blocks/macros/Branching/CLKFROM.sci
scilab/modules/scicos_blocks/macros/Branching/CLKGOTO.sci
scilab/modules/scicos_blocks/macros/Branching/CLKGotoTagVisibility.sci
scilab/modules/scicos_blocks/macros/Branching/DEMUX.sci
scilab/modules/scicos_blocks/macros/Branching/DEMUX_f.sci
scilab/modules/scicos_blocks/macros/Branching/ESELECT_f.sci
scilab/modules/scicos_blocks/macros/Branching/EXTRACTOR.sci
scilab/modules/scicos_blocks/macros/Branching/FROM.sci
scilab/modules/scicos_blocks/macros/Branching/FROMMO.sci
scilab/modules/scicos_blocks/macros/Branching/GOTO.sci
scilab/modules/scicos_blocks/macros/Branching/GOTOMO.sci
scilab/modules/scicos_blocks/macros/Branching/GotoTagVisibility.sci
scilab/modules/scicos_blocks/macros/Branching/GotoTagVisibilityMO.sci
scilab/modules/scicos_blocks/macros/Branching/ISELECT_f.sci
scilab/modules/scicos_blocks/macros/Branching/ISELECT_m.sci
scilab/modules/scicos_blocks/macros/Branching/MUX.sci
scilab/modules/scicos_blocks/macros/Branching/MUX_f.sci
scilab/modules/scicos_blocks/macros/Branching/M_SWITCH.sci
scilab/modules/scicos_blocks/macros/Branching/NRMSOM_f.sci
scilab/modules/scicos_blocks/macros/Branching/RELAY_f.sci
scilab/modules/scicos_blocks/macros/Branching/SCALAR2VECTOR.sci
scilab/modules/scicos_blocks/macros/Branching/SELECT_f.sci
scilab/modules/scicos_blocks/macros/Branching/SELECT_m.sci
scilab/modules/scicos_blocks/macros/Branching/SELF_SWITCH.sci
scilab/modules/scicos_blocks/macros/Branching/SWITCH2.sci
scilab/modules/scicos_blocks/macros/Branching/SWITCH2_m.sci
scilab/modules/scicos_blocks/macros/Branching/SWITCH_f.sci

index 6258305..0bc3e39 100644 (file)
 function [x,y,typ]=CLKFROM(job,arg1,arg2)
     x=[];y=[];typ=[]
     select job
-    case "plot" then
-        orig=arg1.graphics.orig;sz=arg1.graphics.sz;orient=arg1.graphics.flip;
-        prt="["+arg1.graphics.exprs+"]"
-        pat=xget("pattern");xset("pattern",default_color(-1))
-        thick=xget("thickness");xset("thickness",2)
-        if orient then
-            y=orig(2)+sz(2)*[1/4 1/2 1;1 1 1;1 1/2 1/4;1/4 1/8 0;0 1/8 1/4]'
-            x=orig(1)+sz(1)*[0 0 0;0 1/2 1;1 1 1;1 3/4 1/2;1/2 1/4 0]'
-            x1=0
-        else
-            y=orig(2)+sz(2)*[0 1/2 3/4;3/4 7/8 1;1 7/8 3/4;3/4 1/2 0;0 0 0]'
-            x=orig(1)+sz(1)*[0 0 0;0 1/4 1/2;1/2 3/4 1;1 1 1;1 1/2 0]'
-            x1=0
-        end
-        xpolys(x,y,5*ones(1,5))
-        xstringb(orig(1)+x1*sz(1),orig(2),prt,(1-x1)*sz(1),sz(2))
-
-        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))
-            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;
@@ -82,8 +30,13 @@ function [x,y,typ]=CLKFROM(job,arg1,arg2)
         while %t do
             [ok,tag,exprs]=scicos_getvalue("Set block parameters",..
             "Tag",list("str",-1),exprs)
-            if ~ok then break,end
-            if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+            if ~ok then
+                break,
+            end
+            if model.opar<>list(tag) then
+                needcompile=4;
+                y=needcompile,
+            end
             model.opar=list(tag)
             model.evtout=1
             model.firing=-1//compatibility
index 9f70cfc..19957cb 100644 (file)
 //
 
 function [x,y,typ]=CLKGOTO(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;
-        rul=["[","{","","]","}",""]
-        prt=rul(evstr(arg1.graphics.exprs(2)))+arg1.graphics.exprs(1)+rul(evstr(arg1.graphics.exprs(2))+3)
-        pat=xget("pattern");xset("pattern",default_color(-1))
-        thick=xget("thickness");xset("thickness",2)
-        if ~orient then
-            y=orig(2)+sz(2)*[1/4 1/2 1;1 1 1;1 1/2 1/4;1/4 1/8 0;0 1/8 1/4]'
-            x=orig(1)+sz(1)*[0 0 0;0 1/2 1;1 1 1;1 3/4 1/2;1/2 1/4 0]'
-            x1=0
-        else
-            y=orig(2)+sz(2)*[0 1/2 3/4;3/4 7/8 1;1 7/8 3/4;3/4 1/2 0;0 0 0]'
-            x=orig(1)+sz(1)*[0 0 0;0 1/4 1/2;1/2 3/4 1;1 1 1;1 1/2 0]'
-            x1=0
-        end
-        xpolys(x,y,5*ones(1,5))
-        xstringb(orig(1)+x1*sz(1),orig(2),prt,(1-x1)*sz(1),sz(2))
-
-        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))
-            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
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        if arg1.graphics.flip then
-            x=orig(1)+sz(1)/2
-            y=orig(2)+sz(2)
-        else
-            x=orig(1)+sz(1)/2
-            y=orig(2)
-        end
-        typ=-ones(x) //undefined type
-    case "getoutputs" then
-        x=[];y=[];typ=[]
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
         graphics=arg1.graphics;
@@ -84,7 +32,9 @@ function [x,y,typ]=CLKGOTO(job,arg1,arg2)
         while %t do
             [ok,tag,tagvis,exprs]=scicos_getvalue("Set block parameters",..
             ["Tag";"Tag Visibility (1=Local 2=Scoped 3=Global)"], list("str",-1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ((tagvis<1)|(tagvis>3)) then
                 message("Tag Visibility must be between 1 and 3");ok=%f;
             end
index 8b38e82..59dccf0 100644 (file)
 //
 
 function [x,y,typ] = CLKGotoTagVisibility(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,tag,exprs]=scicos_getvalue("Set parameters",..
             ["GotoTag"],..
             list("str",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+                if model.opar<>list(tag) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag);
-                x.graphics=graphics;x.model=model;
+                x.graphics=graphics;
+                x.model=model;
                 break
             end
         end
@@ -63,31 +64,7 @@ function [x,y,typ] = CLKGotoTagVisibility(job,arg1,arg2)
         model.firing=%f
         model.dep_ut=[%f %f]
         exprs="A"
-        gr_i=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-        "wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "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));";
-        "txt=[''Goto Tag'';''Visibility'' ];"
-        "style=5;"
-        "gh_axes = gca();"
-        "axes_font_style = gh_axes.font_style ;"
-        "axes_font_size  = gh_axes.font_size  ;"
-        "gh_axes.font_style = 5;"
-        "gh_axes.font_size  = 1;"
-        "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-5,txt,w,h,''fill'');"
-        "gh_axes.font_style = axes_font_style ;"
-        "gh_axes.font_size  = axes_font_size  ;"
-        "xset(''thickness'',thick)"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index f015bfa..2e1cb8f 100644 (file)
 //
 
 function [x,y,typ]=DEMUX(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,out,exprs]=scicos_getvalue("Set DEMUX block parameters",..
             ["number of output ports or vector of sizes"],list("intvec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(out,"*")==1 then
                 if out<2|out>31 then
                     message("Block must have at least 2 and at most 31 output ports")
@@ -51,14 +48,22 @@ function [x,y,typ]=DEMUX(job,arg1,arg2)
                     "size 0 is not allowed"])
                     ok=%f
                 else
-                    if min(out)<0 then nin=0,else nin=sum(out),end
+                    if min(out)<0 then
+                        nin=0,
+                    else
+                        nin=sum(out),
+                    end
                     [model,graphics,ok]=check_io(model,graphics,nin,out(:),[],[])
-                    if ok then out=size(out,"*"),end
+                    if ok then
+                        out=size(out,"*"),
+                    end
                 end
             end
             if ok then
-                graphics.exprs=exprs;model.ipar=out
-                x.graphics=graphics;x.model=model
+                graphics.exprs=exprs;
+                model.ipar=out
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -74,15 +79,7 @@ function [x,y,typ]=DEMUX(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=string(out)
-        gr_i=["txt=''Demux'';"
-        "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,exprs,gr_i)
     end
 endfunction
index ff964d6..ebccbc0 100644 (file)
 //
 
 function [x,y,typ]=DEMUX_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,out,exprs]=scicos_getvalue("Set DEMUX block parameters",..
             ["number of output ports or vector of sizes"],list("vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(out,"*")==1 then
                 if out<2 | out>8 then
                     message("Block must have at least 2 and at most 8 output ports")
@@ -51,14 +48,22 @@ function [x,y,typ]=DEMUX_f(job,arg1,arg2)
                     "and size 0 is not allowed"]   )
                     ok=%f
                 else
-                    if min(out)<0 then nin=0,else nin=sum(out),end
+                    if min(out)<0 then
+                        nin=0,
+                    else
+                        nin=sum(out),
+                    end
                     [model,graphics,ok]=check_io(model,graphics,nin,out(:),[],[])
-                    if ok then out=size(out,"*"),end
+                    if ok then
+                        out=size(out,"*"),
+                    end
                 end
             end
             if ok then
-                graphics.exprs=exprs;model.ipar=out
-                x.graphics=graphics;x.model=model
+                graphics.exprs=exprs;
+                model.ipar=out
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -74,7 +79,7 @@ function [x,y,typ]=DEMUX_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=string(out)
-        gr_i="xstringb(orig(1),orig(2),''Demux'',sz(1),sz(2),''fill'')"
+        gr_i=[]
         x=standard_define([.5 2],model,exprs,gr_i)
     end
 endfunction
index 1a1561f..1fe2664 100644 (file)
 //
 
 function [x,y,typ]=ESELECT_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
-        if size(exprs,"*")==1 then exprs(2)=string(1);end
-        if size(exprs,"*")==2 then exprs(3)=string(0);end
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
+        if size(exprs,"*")==1 then
+            exprs(2)=string(1);
+        end
+        if size(exprs,"*")==2 then
+            exprs(3)=string(0);
+        end
         model=arg1.model;
         while %t do
             [ok,out,inh,nmod,exprs]=scicos_getvalue("Set ESELECT block parameters",..
             ["number of output event ports";"Inherit (1: no, 0: yes)";
             "zero-crossing (0: no, 1: yes)"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
-            if nmod<>0 then nmod=1,end
-            if inh==0 then inh=[]; else inh=1;end
+            if ~ok then
+                break,
+            end
+            if nmod<>0 then
+                nmod=1,
+            end
+            if inh==0 then
+                inh=[];
+            else
+                inh=1;
+            end
             out=int(out)
             if out<2 then
                 message("Block must have at least two output ports")
             else
                 [model,graphics,ok]=check_io(model,graphics,1,[],inh,[ones(out,1)])
                 if ok then
-                    graphics.exprs=exprs;model.evtout=ones(out,1); model.firing=-ones(out,1)
+                    graphics.exprs=exprs;
+                    model.evtout=ones(out,1);
+                    model.firing=-ones(out,1)
                     x.graphics=graphics;
                     model.nmode=nmod
                     model.nzcross=nmod
@@ -74,8 +83,7 @@ function [x,y,typ]=ESELECT_f(job,arg1,arg2)
         model.nmode=0
         model.nzcross=0
 
-        gr_i=["txt=[''event select''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"]
+        gr_i=[]
         exprs=[string(out);string(1);string(model.nmode)]
         x=standard_define([4 2],model,exprs,gr_i)
     end
index 558247f..dd682b7 100644 (file)
 //
 
 function [x,y,typ]=EXTRACTOR(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,ind,exprs]=..
             scicos_getvalue("Set block parameters",..
             ["indices to extract"],..
             list("vec",-1),exprs)
-            if ~ok then break,end
-            ind=int(ind);ind=ind(:);
+            if ~ok then
+                break,
+            end
+            ind=int(ind);
+            ind=ind(:);
             [model,graphics,ok]=check_io(model,graphics,[-1],size(ind,1),[],[])
             if ok then
                 model.ipar=ind
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -59,8 +58,7 @@ function [x,y,typ]=EXTRACTOR(job,arg1,arg2)
         model.dep_ut=[%t %f]
         model.ipar=ind
         exprs=[sci2exp(ind)]
-        gr_i=["txt=[''Extractor''];";
-        "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 429c4af..61b6e6c 100644 (file)
 //
 
 function [x,y,typ]=FROM(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[]
     select job
-    case "plot" then
-        //++ Save current pattern in 'pat' and set up a new one
-        pat    = xget("pattern"); xset("pattern",default_color(0)); //++ pat = 34 (white); default_color(0) = 1
-        orig   = arg1.graphics.orig       //++ position
-        sz     = arg1.graphics.sz         //++ size
-        orient = arg1.graphics.flip       //++ orientation
-        tg="["+arg1.graphics.exprs(1)+"]";
-
-
-        gr_i   = arg1.graphics.gr_i
-
-        if type(gr_i) == 15 & gr_i(2) <> 36 then
-            [gr_i, coli] = gr_i(1:2)
-        else
-            coli = []
-        end
-
-        //++ Draw contour +  variable name & scope/visibility
-        if orient then //++ standard orientation
-
-            xx = orig(1) + [  0     0     0  ;
-            0    1/2   3/4 ;
-            3/4   7/8    1  ;
-            1    7/8   3/4 ;
-            3/4   1/2    0  ]'*sz(1)
-
-            yy = orig(2) + [  0    1/2    1  ;
-            1     1     1  ;
-            1    3/4   1/2 ;
-            1/2   1/4    0  ;
-            0     0     0  ]'*sz(2)
-
-            x1 = 0 //++ used by xstringb to set up text position
-
-        else //++ flipped orientation
-
-            xx = orig(1) + [  0    1/8   1/4 ;
-            1/4   1/2    1  ;
-            1     1     1  ;
-            1    1/2   1/4 ;
-            1/4   1/8    0  ]'*sz(1)
-
-            yy = orig(2) + [ 1/2   3/4    1  ;
-            1     1     1  ;
-            1    1/2    0  ;
-            0     0     0  ;
-            0    1/4   1/2 ]'*sz(2)
-
-            x1 = 1/4 //++ used by xstringb to set up text position
-        end
-        xpolys(xx,yy) //++ contour
-        xfpoly(xx(1,:),yy(1,:)) //++ fill
-        gh_e = gce()
-        if coli <> []
-            gh_e.fill_mode = "on"
-            gh_e.background = coli
-        end
-        xstringb(orig(1)+x1*sz(1),orig(2),tg,(1-x1)*sz(1),sz(2));
-
-
-        //++ Draw input and output ports
-        xf   = 60
-        yf   = 40
-        nin  = 0
-        nout = 1
-
-        if orient then  //++ standard orientation
-
-            // set port shape
-            out = [ 0    -1/14
-            1/7   0
-            0     1/14
-            0    -1/14]*diag([xf,yf])
-            in =  [-1/7  -1/14
-            0     0
-            -1/7   1/14
-            -1/7  -1/14]*diag([xf,yf])
-
-            xset("pattern",default_color(1)) //++ default_color(1) = 1
-
-            //++ Draw output ports
-            dy = sz(2)/(nout+1)
-            for k = 1:nout
-                xfpoly(out(:,1) + ones(4,1)*(orig(1)+sz(1)),..
-                out(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-            //++ Draw input ports
-            dy = sz(2)/(nin+1)
-            for k = 1:nin
-                xfpoly(in(:,1) + ones(4,1)*orig(1),..
-                in(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-        else //++ flipped orientation
-
-            out = [ 0    -1/14
-            -1/7   0
-            0     1/14
-            0    -1/14]*diag([xf,yf])
-            in =  [ 1/7  -1/14
-            0     0
-            1/7   1/14
-            1/7  -1/14]*diag([xf,yf])
-
-            xset("pattern",default_color(1)) //++ default_color(1) = 1
-
-            //++ Draw output ports
-            dy = sz(2)/(nout+1)
-            for k = 1:nout
-                xfpoly(out(:,1) + ones(4,1)*orig(1)-1,..
-                out(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-            //++ Draw input ports
-            dy = sz(2)/(nin+1)
-            for k = 1:nin
-                xfpoly(in(:,1) + ones(4,1)*(orig(1)+sz(1))+1,..
-                in(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-        end
-
-        //++ Restore previously used pattern
-        xset("pattern",pat)
-
-        //** ------- Identification ---------------------------
-        ident   = o.graphics.id
-        gh_axes = gca() //** get the Axes proprieties
-
-        // draw Identification
-        if ident <> [] & ident <> ""  then
-
-            //** Save font state
-            axes_font_style = gh_axes.font_style
-            axes_font_size  = gh_axes.font_size
-            //** axes_font_color = gh_axes.font_color ; //** optional
-
-            gh_axes.font_style = options.ID(1)(1)
-            gh_axes.font_size  = options.ID(1)(2)
-            //** font color not yet used
-            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)
-
-            //** Restore font state
-            gh_axes.font_style = axes_font_style
-            gh_axes.font_size  = axes_font_size
-            //** gh_axes.font_color = axes_font_color //** optional
-
-        end
-        //** ----- Identification End -----------------------------
-
-    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,tag,exprs]=scicos_getvalue("Set parameters",..
             ["Tag"],..
             list("str",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+                if model.opar<>list(tag) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag)
                 x.model=model
@@ -216,7 +65,7 @@ function [x,y,typ]=FROM(job,arg1,arg2)
 
         exprs=["A"]
 
-        gr_i="";
+        gr_i=[];
         x=standard_define([2 1],model,exprs,gr_i)
         x.graphics.id="From"
     end
index 1287958..5aaf60b 100644 (file)
 //
 
 function [x,y,typ]=FROMMO(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[]
     select job
-    case "plot" then
-        pat=xget("pattern"); xset("pattern",default_color(0))
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-        tg="["+arg1.graphics.exprs(1)+"]";
-        if orient then
-            xx=orig(1)+[0 0 0;0 1/2 3/4;3/4 7/8 1;1 7/8 3/4;3/4 1/2 0]'*sz(1);
-            yy=orig(2)+[0 1/2 1;1 1 1;1 3/4 1/2;1/2 1/4 0;0 0 0]'*sz(2);
-            x1=0
-        else
-            xx=orig(1)+[0 1/8 1/4;1/4 1/2 1;1 1 1;1 1/2 1/4;1/4 1/8 0]'*sz(1);
-            yy=orig(2)+[1/2 3/4 1 ;1 1 1;1 1/2 0;0 0 0;0 1/4 1/2]'*sz(2);
-            x1=0
-        end
-        xpolys(xx,yy)
-        xstringb(orig(1)+x1*sz(1),orig(2),tg,(1-x1)*sz(1),sz(2));
-
-        xf=60
-        yf=40
-        nin=0;nout=1
-
-        // set port shape
-        out=[0   -1/14
-        1/7 -1/14
-        1/7 1/14
-        0   1/14
-        0   -1/14]*diag([xf,yf])
-        in= [-1/7  -1/14
-        0     -1/14
-        0      1/14
-        -1/7   1/14
-        -1/7  -1/14]*diag([xf,yf])
-        dy=sz(2)/(nout+1)
-        xset("pattern",default_color(1))
-        if orient then  //standard orientation
-            for k=1:nout
-                xpoly(out(:,1)+ones(5,1)*(orig(1)+sz(1)),..
-                out(:,2)+ones(5,1)*(orig(2)+sz(2)-dy*k),"lines",1)
-            end
-        else //tilded orientation
-            for k=1:nout
-                xpoly(out(:,1)+ones(5,1)*orig(1)-1/7*xf,..
-                out(:,2)+ones(5,1)*(orig(2)+sz(2)-dy*k),"lines",1)
-            end
-        end
-        xset("pattern",pat)
-        //** ------- Identification ---------------------------
-        ident = o.graphics.id
-        gh_axes = gca(); //** get the Axes proprieties
-
-        // draw Identification
-        if ident <> []& ident <> ""  then
-
-            //** Save font state
-            axes_font_style = gh_axes.font_style ;
-            axes_font_size  = gh_axes.font_size  ;
-            //** axes_font_color = gh_axes.font_color ; //** optional
-
-            gh_axes.font_style = options.ID(1)(1) ;
-            gh_axes.font_size  = options.ID(1)(2) ;
-            //** font color not yet used
-            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) ;
-
-            //** Restore font state
-            gh_axes.font_style = axes_font_style ;
-            gh_axes.font_size  = axes_font_size  ;
-            //** gh_axes.font_color = axes_font_color ; //** optional
-
-        end
-        //** ----- Identification End -----------------------------
-
-    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,tag,exprs]=scicos_getvalue("Set parameters",..
             ["Tag"],..
             list("str",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+                if model.opar<>list(tag) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag)
                 x.model=model
@@ -140,7 +67,7 @@ function [x,y,typ]=FROMMO(job,arg1,arg2)
         mo.outputs="n"
         exprs=["A"]
 
-        gr_i="";
+        gr_i=[];
         x=standard_define([2 1],model,exprs,gr_i)
         x.graphics.out_implicit=["I"]
     end
index 4a6e885..b9ce884 100644 (file)
 //
 
 function [x,y,typ]=GOTO(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[]
     select job
-    case "plot" then
-        //++ Save current pattern in 'pat' and set up a new one
-        pat    = xget("pattern"); xset("pattern",default_color(0)); //++ pat = 34 (white); default_color(0) = 1
-        orig   = arg1.graphics.orig       //++ position
-        sz     = arg1.graphics.sz         //++ size
-        orient = arg1.graphics.flip       //++ orientation
-        tg     = arg1.graphics.exprs(1)
-        forma  = ["[","{","","]","}",""]
-        tg     = forma(evstr(arg1.graphics.exprs(2)))+tg+forma(evstr(arg1.graphics.exprs(2))+3)
-        gr_i   = arg1.graphics.gr_i
-
-        if type(gr_i) == 15 & gr_i(2) <> 36 then
-            [gr_i, coli] = gr_i(1:2)
-        else
-            coli = []
-        end
-
-        //++ Draw contour +  variable name & scope/visibility
-        if orient then //++ standard orientation
-
-            xx = orig(1) + [  0    1/8   1/4 ;
-            1/4   1/2    1  ;
-            1     1     1  ;
-            1    1/2   1/4 ;
-            1/4   1/8    0   ]'*sz(1)
-
-            yy = orig(2) + [ 1/2   3/4    1  ;
-            1     1     1  ;
-            1    1/2    0  ;
-            0     0     0  ;
-            0    1/4   1/2 ]'*sz(2)
-
-            x1 = 0 //++ used by xstringb to set up text position
-
-        else //++ flipped orientation
-
-            xx = orig(1) + [  0     0     0  ;
-            0    1/2   3/4 ;
-            3/4   7/8    1  ;
-            1    7/8   3/4 ;
-            3/4   1/2    0  ]'*sz(1)
-
-            yy = orig(2) + [  0    1/2    1  ;
-            1     1     1  ;
-            1    3/4   1/2 ;
-            1/2   1/4    0  ;
-            0     0     0  ]'*sz(2)
-
-            x1 = 1/4 //++ used by xstringb to set up text position
-        end
-        xpolys(xx,yy) //++ contour
-        xfpoly(xx(1,:),yy(1,:)) //++ fill
-        gh_e = gce()
-        if coli <> []
-            gh_e.fill_mode = "on"
-            gh_e.background = coli
-        end
-        xstringb(orig(1)+x1*sz(1), orig(2), tg, (1-x1)*sz(1), sz(2)) //++ variable name & scope/visibility
-
-
-        //++ Draw input and output ports
-        xf   = 60
-        yf   = 40
-        nin  = 1
-        nout = 0
-
-        if orient then  //++ standard orientation
-
-            // set port shape
-            out = [ 0    -1/14
-            1/7   0
-            0     1/14
-            0    -1/14]*diag([xf,yf])
-            in =  [-1/7  -1/14
-            0     0
-            -1/7   1/14
-            -1/7  -1/14]*diag([xf,yf])
-
-            xset("pattern",default_color(1)) //++ default_color(1) = 1
-
-            //++ Draw output ports
-            dy = sz(2)/(nout+1)
-            for k = 1:nout
-                xfpoly(out(:,1) + ones(4,1)*(orig(1)+sz(1)),..
-                out(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-            //++ Draw input ports
-            dy = sz(2)/(nin+1)
-            for k = 1:nin
-                xfpoly(in(:,1) + ones(4,1)*orig(1),..
-                in(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-        else //++ flipped orientation
-
-            out = [ 0    -1/14
-            -1/7   0
-            0     1/14
-            0    -1/14]*diag([xf,yf])
-            in =  [ 1/7  -1/14
-            0     0
-            1/7   1/14
-            1/7  -1/14]*diag([xf,yf])
-
-            xset("pattern",default_color(1)) //++ default_color(1) = 1
-
-            //++ Draw output ports
-            dy = sz(2)/(nout+1)
-            for k = 1:nout
-                xfpoly(out(:,1) + ones(4,1)*orig(1)-1,..
-                out(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-
-            //++ Draw input ports
-            dy = sz(2)/(nin+1)
-            for k = 1:nin
-                xfpoly(in(:,1) + ones(4,1)*(orig(1)+sz(1))+1,..
-                in(:,2) + ones(4,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-        end
-
-        //++ Restore previously used pattern
-        xset("pattern",pat)
-
-        //** ------- Identification ---------------------------
-        ident   = o.graphics.id
-        gh_axes = gca() //** get the Axes proprieties
-
-        // draw Identification
-        if ident <> [] & ident <> ""  then
-
-            //** Save font state
-            axes_font_style = gh_axes.font_style
-            axes_font_size  = gh_axes.font_size
-            //** axes_font_color = gh_axes.font_color ; //** optional
-
-            gh_axes.font_style = options.ID(1)(1)
-            gh_axes.font_size  = options.ID(1)(2)
-            //** font color not yet used
-            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)
-
-            //** Restore font state
-            gh_axes.font_style = axes_font_style
-            gh_axes.font_size  = axes_font_size
-            //** gh_axes.font_color = axes_font_color //** optional
-
-        end
-        //** ----- Identification End -----------------------------
-
-    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,tag,tagvis,exprs]=scicos_getvalue("Set parameters",..
             ["Tag";"Tag Visibility(1=Local 2=scoped 3= global)"],..
             list("str",-1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             tagvis=int(tagvis)
             if ((tagvis<1)|(tagvis>3)) then
                 message("Tag Visibility must be between 1 and 3");ok=%f;
             end
             if ok then
-                if ((model.ipar<>tagvis)|(model.opar<>list(tag))) then needcompile=4;y=needcompile,end
+                if ((model.ipar<>tagvis)|(model.opar<>list(tag))) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag)
                 model.ipar=tagvis
@@ -222,7 +71,7 @@ function [x,y,typ]=GOTO(job,arg1,arg2)
 
         exprs=["A";sci2exp(1)]
 
-        gr_i="";
+        gr_i=[];
         x=standard_define([2 1],model,exprs,gr_i)
         x.graphics.id="Goto"
     end
index 4898df0..3974304 100644 (file)
 //
 
 function [x,y,typ]=GOTOMO(job,arg1,arg2)
-    x=[];y=[];typ=[]
+    x=[];
+    y=[];
+    typ=[]
     select job
-    case "plot" then
-        pat=xget("pattern"); xset("pattern",default_color(0))
-        orig=arg1.graphics.orig;
-        sz=arg1.graphics.sz;
-        orient=arg1.graphics.flip;
-        tg=arg1.graphics.exprs(1);
-        forma=["[","{","","]","}",""]
-        tg=forma(evstr(arg1.graphics.exprs(2)))+tg+forma(evstr(arg1.graphics.exprs(2))+3)
-        if orient then
-            xx=orig(1)+[0 1/8 1/4;1/4 1/2 1;1 1 1;1 1/2 1/4;1/4 1/8 0]'*sz(1);
-            yy=orig(2)+[1/2 3/4 1 ;1 1 1;1 1/2 0;0 0 0;0 1/4 1/2]'*sz(2);
-            x1=0
-        else
-            xx=orig(1)+[0 0 0;0 1/2 3/4;3/4 7/8 1;1 7/8 3/4;3/4 1/2 0]'*sz(1);
-            yy=orig(2)+[0 1/2 1;1 1 1;1 3/4 1/2;1/2 1/4 0;0 0 0]'*sz(2);
-            x1=0
-        end
-        xpolys(xx,yy)
-        xstringb(orig(1)+x1*sz(1),orig(2),tg,(1-x1)*sz(1),sz(2));
-
-        xf=60
-        yf=40
-        nin=1;nout=0
-
-        // set port shape
-        out=[0   -1/14
-        1/7 -1/14
-        1/7 1/14
-        0   1/14
-        0   -1/14]*diag([xf,yf])
-        in= [-1/7  -1/14
-        0     -1/14
-        0      1/14
-        -1/7   1/14
-        -1/7  -1/14]*diag([xf,yf])
-        dy=sz(2)/(nin+1)
-        xset("pattern",default_color(1))
-        if orient then  //standard orientation
-            for k=1:nin
-                xfpoly(in(:,1)+ones(5,1)*orig(1),..
-                in(:,2)+ones(5,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-        else //tilded orientation
-            for k=1:nin
-                xfpoly(in(:,1)+ones(5,1)*(orig(1)+sz(1)+1/7*xf),..
-                in(:,2)+ones(5,1)*(orig(2)+sz(2)-dy*k),1)
-            end
-        end
-        xset("pattern",pat)
-        //** ------- Identification ---------------------------
-        ident = o.graphics.id
-        gh_axes = gca(); //** get the Axes proprieties
-
-        // draw Identification
-        if ident <> []& ident <> ""  then
-
-            //** Save font state
-            axes_font_style = gh_axes.font_style ;
-            axes_font_size  = gh_axes.font_size  ;
-            //** axes_font_color = gh_axes.font_color ; //** optional
-
-            gh_axes.font_style = options.ID(1)(1) ;
-            gh_axes.font_size  = options.ID(1)(2) ;
-            //** font color not yet used
-            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) ;
-
-            //** Restore font state
-            gh_axes.font_style = axes_font_style ;
-            gh_axes.font_size  = axes_font_size  ;
-            //** gh_axes.font_color = axes_font_color ; //** optional
-
-        end
-        //** ----- Identification End -----------------------------
-
-    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,tag,tagvis,exprs]=scicos_getvalue("Set parameters",..
             ["Tag";"Tag Visibility(1=Local 2=scoped 3= global)"],..
             list("str",-1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             tagvis=int(tagvis)
             if ((tagvis<1)|(tagvis>3)) then
                 message("Tag Visibility must be between 1 and 3");ok=%f;
             end
             if ok then
-                if ((model.ipar<>tagvis)|(model.opar<>list(tag))) then needcompile=4;y=needcompile,end
+                if ((model.ipar<>tagvis)|(model.opar<>list(tag))) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag)
                 model.ipar=tagvis
@@ -148,7 +73,7 @@ function [x,y,typ]=GOTOMO(job,arg1,arg2)
         mo.inputs="p"
         exprs=["A";sci2exp(1)]
 
-        gr_i="";
+        gr_i=[];
         x=standard_define([2 1],model,exprs,gr_i)
         x.graphics.in_implicit=["I"]
     end
index 20f57e2..daa1136 100644 (file)
 //
 
 function [x,y,typ]=GotoTagVisibility(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,tag,exprs]=scicos_getvalue("Set parameters",..
             ["GotoTag"],..
             list("str",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+                if model.opar<>list(tag) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag);
-                x.graphics=graphics;x.model=model;
+                x.graphics=graphics;
+                x.model=model;
                 break
             end
         end
@@ -63,21 +64,7 @@ function [x,y,typ]=GotoTagVisibility(job,arg1,arg2)
         model.firing=%f
         model.dep_ut=[%f %f]
         exprs="A"
-        gr_i=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');"
-        "txt=[''Goto Tag'';''Visibility'' ];"
-        "style=5;"
-        "gh_axes = gca();"
-        "axes_font_style = gh_axes.font_style ;"
-        "axes_font_size  = gh_axes.font_size  ;"
-        "gh_axes.font_style = 5;"
-        "gh_axes.font_size  = 1;"
-        "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-5,txt,w,h,''fill'');"
-        "gh_axes.font_style = axes_font_style ;"
-        "gh_axes.font_size  = axes_font_size  ;"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 5dd0742..72c0092 100644 (file)
 //
 
 function [x,y,typ]=GotoTagVisibilityMO(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,tag,exprs]=scicos_getvalue("Set parameters",..
             ["GotoTag"],..
             list("str",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if ok then
-                if model.opar<>list(tag) then needcompile=4;y=needcompile,end
+                if model.opar<>list(tag) then
+                    needcompile=4;
+                    y=needcompile,
+                end
                 graphics.exprs=exprs;
                 model.opar=list(tag);
-                x.graphics=graphics;x.model=model;
+                x.graphics=graphics;
+                x.model=model;
                 break
             end
         end
@@ -63,31 +64,7 @@ function [x,y,typ]=GotoTagVisibilityMO(job,arg1,arg2)
         model.firing=%f
         model.dep_ut=[%f %f]
         exprs="A"
-        gr_i=["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
-        "wd=xget(''wdim'').*[1.016,1.12];";
-        "thick=xget(''thickness'');xset(''thickness'',2);";
-        "p=wd(2)/wd(1);p=1;";
-        "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(3));";
-        "txt=[''Goto Tag'';''Visibility'' ];"
-        "style=5;"
-        "gh_axes = gca();"
-        "axes_font_style = gh_axes.font_style ;"
-        "axes_font_size  = gh_axes.font_size  ;"
-        "gh_axes.font_style = 5;"
-        "gh_axes.font_size  = 1;"
-        "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-5,txt,w,h,''fill'');"
-        "gh_axes.font_style = axes_font_style ;"
-        "gh_axes.font_size  = axes_font_size  ;"
-        "xset(''thickness'',thick)"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index bac4168..976511a 100644 (file)
 //
 
 function [x,y,typ]=ISELECT_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,nout,z0,exprs]=scicos_getvalue("Set parameters",..
             ["number of outputs";"initial connected output"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nout|z0<=0 then
                 message("initial connected input is not a valid input port number")
             else
@@ -46,7 +43,8 @@ function [x,y,typ]=ISELECT_f(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs;
                     model.dstate=z0-1,
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -65,7 +63,7 @@ function [x,y,typ]=ISELECT_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(nout);string(z0+1)]
-        gr_i=["xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index c0272cc..97efbbf 100644 (file)
 //
 
 function [x,y,typ]=ISELECT_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;
         while %t do
             [ok,typ,nout,z0,exprs]=scicos_getvalue("Set parameters",..
             ["Datatype(1= real double  2=Complex 3=int32 ...)";"number of outputs";"initial connected output"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nout|z0<=0 then
                 message("initial connected input is not a valid input port number")
-            elseif ((typ<1)|(typ>8)) message("Datatype is not supported");ok=%f;
+            elseif ((typ<1)|(typ>8)) then
+                message("Datatype is not supported");
+                ok=%f;
             else
                 it=typ
                 ot=typ*ones(1,nout)
@@ -52,7 +51,8 @@ function [x,y,typ]=ISELECT_m(job,arg1,arg2)
                     if ok then
                         graphics.exprs=exprs;
                         model.dstate=z0,
-                        x.graphics=graphics;x.model=model
+                        x.graphics=graphics;
+                        x.model=model
                         break
                     end
                 end
@@ -81,7 +81,7 @@ function [x,y,typ]=ISELECT_m(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[sci2exp(1);sci2exp(nout);sci2exp(z0)]
-        gr_i=["xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index d8162c3..b685235 100644 (file)
 //
 
 function [x,y,typ]=MUX(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,in,exprs]=scicos_getvalue("Set MUX block parameters",..
             "number of input ports or vector of sizes",list("intvec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(in,"*")==1 then
                 if in<2|in>31 then
                     message("Block must have at least two input ports and at most 31")
@@ -51,14 +48,22 @@ function [x,y,typ]=MUX(job,arg1,arg2)
                     "and at most 31. Size 0 is not allowed. "])
                     ok=%f
                 else
-                    if min(in)<0 then nout=0,else nout=sum(in),end
+                    if min(in)<0 then
+                        nout=0,
+                    else
+                        nout=sum(in),
+                    end
                     [model,graphics,ok]=check_io(model,graphics,in(:),nout,[],[])
-                    if ok then in=size(in,"*"),end
+                    if ok then
+                        in=size(in,"*"),
+                    end
                 end
             end
             if ok then
-                graphics.exprs=exprs;model.ipar=in
-                x.graphics=graphics;x.model=model
+                graphics.exprs=exprs;
+                model.ipar=in
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -73,15 +78,7 @@ function [x,y,typ]=MUX(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=string(in)
-        gr_i=["txt=''Mux'';"
-        "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,exprs,gr_i)
     end
 endfunction
index be90f74..0b27f23 100644 (file)
 //
 
 function [x,y,typ]=MUX_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,in,exprs]=scicos_getvalue("Set MUX block parameters",..
             "number of input ports or vector of sizes",list("vec",-1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if size(in,"*")==1 then
                 if in<2|in>8 then
                     message("Block must have at least two input ports and at most eight")
@@ -51,14 +48,22 @@ function [x,y,typ]=MUX_f(job,arg1,arg2)
                     "and at most eight, and size 0 is not allowed. "])
                     ok=%f
                 else
-                    if min(in)<0 then nout=0,else nout=sum(in),end
+                    if min(in)<0 then
+                        nout=0,
+                    else
+                        nout=sum(in),
+                    end
                     [model,graphics,ok]=check_io(model,graphics,in(:),nout,[],[])
-                    if ok then in=size(in,"*"),end
+                    if ok then
+                        in=size(in,"*"),
+                    end
                 end
             end
             if ok then
-                graphics.exprs=exprs;model.ipar=in
-                x.graphics=graphics;x.model=model
+                graphics.exprs=exprs;
+                model.ipar=in
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -73,7 +78,7 @@ function [x,y,typ]=MUX_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=string(in)
-        gr_i="xstringb(orig(1),orig(2),''Mux'',sz(1),sz(2),''fill'')"
+        gr_i=[]
         x=standard_define([0.5 2],model,exprs,gr_i)
     end
 endfunction
index 6624e65..d3150c7 100644 (file)
 //
 
 function [x,y,typ]=M_SWITCH(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,nin,base,rule,exprs]=scicos_getvalue("Set parameters",..
             ["number of inputs";"zero base indexing (0), otherwise 1";..
             "rounding rule: int (0), round (1), ceil (2), floor (3)"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
-            nin=int(nin);base=int(base);
+            if ~ok then
+                break,
+            end
+            nin=int(nin);
+            base=int(base);
             if nin<1 then
                 message("Number of inputs must be >=1 ")
             elseif ~((base==1)|(base==0)) then
@@ -49,10 +47,13 @@ function [x,y,typ]=M_SWITCH(job,arg1,arg2)
                 message("incorrect rounding rule")
             else
                 if nin==1 then
-                    in=[1 1;-1 1];out=[1 1];
+                    in=[1 1;-1 1];
+                    out=[1 1];
                 else
-                    in1=[1;-ones(nin,1)];in2=[1;-2*ones(nin,1)];
-                    in=[in1 in2];out=[-1 -2];
+                    in1=[1;-ones(nin,1)];
+                    in2=[1;-2*ones(nin,1)];
+                    in=[in1 in2];
+                    out=[-1 -2];
                 end
                 it=[-1;-2*ones(nin,1)];
                 ot=-2;
@@ -61,7 +62,8 @@ function [x,y,typ]=M_SWITCH(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs;
                     model.ipar=[base;rule],
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -81,10 +83,7 @@ function [x,y,typ]=M_SWITCH(job,arg1,arg2)
 
         exprs=[string(nin);string(ipar)]
 
-        gr_i=["d=sz(2)/(1+evstr(arg1.graphics.exprs(1)))";
-        "xsegs([orig(1),orig(1)+sz(1)],[orig(2)+sz(2)-d,orig(2)+sz(2)-d])";
-        "xstringb(orig(1),orig(2)+sz(2)-d,''control'',sz(1),d,''fill'')";
-        "xstringb(orig(1),orig(2),[''M_Port'';''switch''],sz(1),sz(2)-d,''fill'');"]
+        gr_i=[]
         x=standard_define([2.5 2],model,exprs,gr_i)
     end
 endfunction
index 6191a18..e02427b 100644 (file)
 //
 
 function [x,y,typ]=NRMSOM_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,nin,exprs]=scicos_getvalue("Set parameters",..
             ["number of inputs"],list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             [model,graphics,ok]=check_io(model,graphics,-ones(nin,1),-1,[],[])
             if ok then
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break;
             end
         end
@@ -56,7 +54,7 @@ function [x,y,typ]=NRMSOM_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(nin)]
-        gr_i=" "
+        gr_i=[]
         x=standard_define([.2 2],model,exprs,gr_i)
     end
 endfunction
index 160adda..50a728b 100644 (file)
 //
 
 function [x,y,typ]=RELAY_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;ipar=model.ipar
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
+        model=arg1.model;
+        ipar=model.ipar
         while %t do
             [ok,nin,z0,exprs]=scicos_getvalue("Set parameters",..
             ["number of inputs";"initial connected input"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nin|z0<=0 then
                 message("initial connected input is not a valid input port number")
             else
@@ -46,7 +44,8 @@ function [x,y,typ]=RELAY_f(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs;
                     model.dstate=z0-1
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -66,7 +65,7 @@ function [x,y,typ]=RELAY_f(job,arg1,arg2)
         model.dep_ut=[%t %t]
 
         exprs=[string(nin);string(i0+1)]
-        gr_i=["xstringb(orig(1),orig(2),''Relay'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 8c51023..ac3534d 100644 (file)
 //
 
 function [x,y,typ]=SCALAR2VECTOR(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,nout,exprs]=..
             scicos_getvalue("Set block parameters",..
             ["size of output (-1: if don''t know)"],..
             list("vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             nout=int(nout)
             if(nout<>-1 & (nout<=0)) then
                 message("size of output must be -1 or >0")
@@ -50,7 +47,8 @@ function [x,y,typ]=SCALAR2VECTOR(job,arg1,arg2)
             end
             if ok then
                 graphics.exprs=exprs;// Correction ED le 24/11/04
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -64,8 +62,7 @@ function [x,y,typ]=SCALAR2VECTOR(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string([nout])]
-        gr_i=["txt=[''Scalar'';''  to '';''vector''];";
-        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"]
+        gr_i=[]
 
         x=standard_define([3 2],model,exprs,gr_i)
     end
index 183da3c..dce35ad 100644 (file)
 //
 
 function [x,y,typ]=SELECT_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,nin,z0,exprs]=scicos_getvalue("Set parameters",..
             ["number of inputs";"initial connected input"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nin|z0<=0 then
                 message("initial connected input is not a valid input port number")
             else
@@ -46,7 +43,8 @@ function [x,y,typ]=SELECT_f(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs;
                     model.dstate=z0-1,
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -66,7 +64,7 @@ function [x,y,typ]=SELECT_f(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[string(nin);string(z0+1)]
-        gr_i=["xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 6e03da7..be30bdc 100644 (file)
 //
 
 function [x,y,typ]=SELECT_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;
         while %t do
             [ok,typ,nin,z0,exprs]=scicos_getvalue("Set parameters",..
             ["Datatype(1= real double  2=Complex 3=int32 ..)";"number of inputs";"initial connected input"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nin|z0<=0 then
                 message("initial connected input is not a valid input port number")
-            elseif ((typ<1)|(typ>8))& (typ<>-1) message("Datatype is not supported");ok=%f;
+            elseif ((typ<1)|(typ>8))& (typ<>-1) then
+                message("Datatype is not supported");
+                ok=%f;
             else
                 it=typ*ones(1,nin)
                 ot=typ
@@ -52,7 +51,8 @@ function [x,y,typ]=SELECT_m(job,arg1,arg2)
                     if ok then
                         graphics.exprs=exprs;
                         model.dstate=z0,
-                        x.graphics=graphics;x.model=model
+                        x.graphics=graphics;
+                        x.model=model
                         break
                     end
                 end
@@ -81,7 +81,7 @@ function [x,y,typ]=SELECT_m(job,arg1,arg2)
         model.dep_ut=[%t %f]
 
         exprs=[sci2exp(1);sci2exp(nin);sci2exp(z0)]
-        gr_i=["xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([3 2],model,exprs,gr_i)
     end
 endfunction
index 504a618..52af071 100644 (file)
@@ -44,14 +44,6 @@ function [x,y,typ]=SELF_SWITCH(job,arg1,arg2)
         diagram.objs(7) = scicos_link(xx=[0, 0], yy=[0, 0], from=[4, 1], to=[2, 1]);
     endfunction
     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;
         stateOpen = x.model.opar(1);
@@ -71,8 +63,7 @@ function [x,y,typ]=SELF_SWITCH(job,arg1,arg2)
         x = scicos_block()
         x.gui="SELF_SWITCH"
         x.graphics.sz=[2,2]
-        x.graphics.gr_i=list("xstringb(orig(1),orig(2),''CUT'',sz(1),s"+...
-        "z(2),''fill'')",8)
+        x.graphics.gr_i=[]
         x.graphics.pin=0
         x.graphics.pout=0
         x.model.sim="csuper"
index 551f4eb..1182036 100644 (file)
 //
 
 function [x,y,typ]=SWITCH2(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,rule,thra,nzz,exprs]=scicos_getvalue("Set parameters",..
             ["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)";..
             "threshold a";"use zero crossing: yes (1), no (0)"],..
             list("vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             rule=int(rule);
-            if (rule<0) then rule=0, end
-            if (rule>2) then rule=2, end
+            if (rule<0) then
+                rule=0,
+            end
+            if (rule>2) then
+                rule=2,
+            end
             graphics.exprs=exprs;
             model.ipar=rule
             model.rpar=thra
@@ -53,7 +54,8 @@ function [x,y,typ]=SWITCH2(job,arg1,arg2)
                 model.nmode=0
                 model.nzcross=0
             end
-            x.graphics=graphics;x.model=model
+            x.graphics=graphics;
+            x.model=model
             break
         end
     case "define" then
@@ -75,7 +77,7 @@ function [x,y,typ]=SWITCH2(job,arg1,arg2)
 
         exprs=[string(ipar);string(rpar);string(nzz)]
 
-        gr_i=["xstringb(orig(1),orig(2),[''switch''],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index 29d79fb..c2682df 100644 (file)
 //
 
 function [x,y,typ]=SWITCH2_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;
         while %t do
             [ok,ot,rule,thra,nzz,exprs]=scicos_getvalue("Set parameters",..
             ["Datatype (1=real double  2=complex 3=int32 ...)";"pass first input if: u2>=a (0), u2>a (1), u2~=a (2)";..
             "threshold a";"use zero crossing: yes (1), no (0)"],..
             list("vec",1,"vec",1,"vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             rule=int(rule);
-            if (rule<0) then rule=0, end
-            if (rule>2) then rule=2, end
+            if (rule<0) then
+                rule=0,
+            end
+            if (rule>2) then
+                rule=2,
+            end
             graphics.exprs=exprs;
             model.ipar=rule
             model.rpar=thra
@@ -53,7 +54,10 @@ function [x,y,typ]=SWITCH2_m(job,arg1,arg2)
                 model.nmode=0
                 model.nzcross=0
             end
-            if ((ot<1)|(ot>8))&(ot<>-1) message("Datatype is not supported");ok=%f;end
+            if ((ot<1)|(ot>8))&(ot<>-1) then
+                message("Datatype is not supported");
+                ok=%f;
+            end
             if ok then
                 it(1)=ot;
                 it(2)=1;
@@ -63,7 +67,8 @@ function [x,y,typ]=SWITCH2_m(job,arg1,arg2)
                 [model,graphics,ok]=set_io(model,graphics,list(in,it),list(out,ot),[],[])
             end
             if ok then
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model
                 break
             end
         end
@@ -89,7 +94,7 @@ function [x,y,typ]=SWITCH2_m(job,arg1,arg2)
 
         exprs=[sci2exp(1);string(ipar);string(rpar);string(nzz)]
 
-        gr_i=["xstringb(orig(1),orig(2),[''switch''],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction
index c497cbf..2ab5234 100644 (file)
 //
 
 function [x,y,typ]=SWITCH_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;ipar=model.ipar
+        graphics=arg1.graphics;
+        exprs=graphics.exprs
+        model=arg1.model;
+        ipar=model.ipar
         while %t do
             [ok,nin,z0,exprs]=scicos_getvalue("Set switch parameters",..
             ["number of inputs";"connected input"],..
             list("vec",1,"vec",1),exprs)
-            if ~ok then break,end
+            if ~ok then
+                break,
+            end
             if z0>nin|z0<=0 then
                 message("initial connected input is not a valid input port number")
             else
@@ -46,7 +44,8 @@ function [x,y,typ]=SWITCH_f(job,arg1,arg2)
                 if ok then
                     graphics.exprs=exprs;
                     model.ipar=z0-1
-                    x.graphics=graphics;x.model=model
+                    x.graphics=graphics;
+                    x.model=model
                     break
                 end
             end
@@ -65,7 +64,7 @@ function [x,y,typ]=SWITCH_f(job,arg1,arg2)
         model.dep_ut=[%t %t]
 
         exprs=[string(nin);string(i0+1)]
-        gr_i=["xstringb(orig(1),orig(2),[''switch'';string(model.ipar+1)],sz(1),sz(2),''fill'');"]
+        gr_i=[]
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction