Clean CONST_f block interface. 25/13225/2
Bruno JOFRET [Tue, 26 Nov 2013 08:53:54 +0000 (09:53 +0100)]
Change-Id: Ib5264a0ce65587dba6fd083c27854103bd84b27b

scilab/modules/scicos_blocks/macros/Sources/CONST_f.sci

index 315888c..b06cdd8 100644 (file)
 //
 
 function [x,y,typ]=CONST_f(job,arg1,arg2)
-    x=[];y=[];typ=[];
+    x=[];
+    y=[];
+    typ=[];
     select job
-    case "plot" then
-        C=arg1.graphics.exprs;
-        standard_draw(arg1)
-    case "getinputs" then
-        x=[];y=[];typ=[];
-    case "getoutputs" then
-        [x,y,typ]=standard_outputs(arg1)
-    case "getorigin" then
-        [x,y]=standard_origin(arg1)
     case "set" then
         x=arg1;
-        graphics=arg1.graphics;exprs=graphics.exprs
+        graphics=arg1.graphics;
+        exprs=graphics.exprs;
         model=arg1.model;
         while %t do
             [ok,C,exprs]=scicos_getvalue(["Set Contant Block"],..
@@ -43,9 +37,11 @@ function [x,y,typ]=CONST_f(job,arg1,arg2)
             if nout==0 then
                 message("C must have at least one element")
             else
-                model.rpar=C(:);model.out=nout
+                model.rpar=C(:);
+                model.out=nout;
                 graphics.exprs=exprs;
-                x.graphics=graphics;x.model=model
+                x.graphics=graphics;
+                x.model=model;
                 break;
             end
         end
@@ -61,10 +57,7 @@ function [x,y,typ]=CONST_f(job,arg1,arg2)
         model.dep_ut=[%f %f]
 
         exprs=strcat(sci2exp(C))
-        gr_i=["dx=sz(1)/5;dy=sz(2)/10;";
-        "w=sz(1)-2*dx;h=sz(2)-2*dy;";
-        "txt=C;"
-        "xstringb(orig(1)+dx,orig(2)+dy,txt,w,h,''fill'');"]
+        gr_i=[];
         x=standard_define([2 2],model,exprs,gr_i)
     end
 endfunction