summaryrefslogtreecommitdiff
path: root/js/Sinks
diff options
context:
space:
mode:
authorSunil Shetye2018-06-25 12:08:56 +0530
committerSunil Shetye2018-06-25 12:45:27 +0530
commit7c70459c10aed0d74ee03896abaf47fefdbf7c8f (patch)
tree6f6acc6a5087295c6e59f0f94bfda5025049d5fa /js/Sinks
parent870479a2e4b932426a904b2ebae7e4ee72037326 (diff)
downloadsci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip
separate out code for getvalue
Diffstat (limited to 'js/Sinks')
-rw-r--r--js/Sinks/AFFICH_m.js108
-rw-r--r--js/Sinks/BARXY.js84
-rw-r--r--js/Sinks/CANIMXY.js146
-rw-r--r--js/Sinks/CANIMXY3D.js172
-rw-r--r--js/Sinks/CEVENTSCOPE.js120
-rw-r--r--js/Sinks/CFSCOPE.js132
-rw-r--r--js/Sinks/CLKOUTV_f.js50
-rw-r--r--js/Sinks/CLKOUT_f.js54
-rw-r--r--js/Sinks/CMAT3D.js92
-rw-r--r--js/Sinks/CMATVIEW.js86
-rw-r--r--js/Sinks/CMSCOPE.js188
-rw-r--r--js/Sinks/CSCOPE.js134
-rw-r--r--js/Sinks/CSCOPXY.js144
-rw-r--r--js/Sinks/CSCOPXY3D.js176
-rw-r--r--js/Sinks/OUTIMPL_f.js70
-rw-r--r--js/Sinks/OUT_f.js58
-rw-r--r--js/Sinks/TOWS_c.js86
-rw-r--r--js/Sinks/TRASH_f.js22
-rw-r--r--js/Sinks/WFILE_f.js124
-rw-r--r--js/Sinks/WRITEAU_f.js94
-rw-r--r--js/Sinks/WRITEC_f.js126
21 files changed, 1133 insertions, 1133 deletions
diff --git a/js/Sinks/AFFICH_m.js b/js/Sinks/AFFICH_m.js
index 64fa7827..b55ea10a 100644
--- a/js/Sinks/AFFICH_m.js
+++ b/js/Sinks/AFFICH_m.js
@@ -1,78 +1,78 @@
/* autogenerated from "macros/Sinks/AFFICH_m.sci" */
function AFFICH_m() {
AFFICH_m.prototype.define = function AFFICH_m() {
-font=1;
-fontsize=1;
-colr=1;
-nt=5;
-nd=1;
-in1=[1,1];
-model=scicos_model();
-model.sim=list("affich2",4);
-model.in1=in1[1-1][1-1];
-model.in2=in1[1-1][2-1];
-model.evtin=1;
-model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
-model.ipar=[[font],[fontsize],[colr],[1000],[nt],[nd],[in1[1-1][1-1]]];
-model.blocktype="c";
-model.firing=[];
-model.dep_ut=[true,false];
-model.label="";
-exprs=[[sci2exp([model.in1,model.in2])],[string(font)],[string(fontsize)],[string(colr)],[string(nt)],[string(nd)],[string(0)]];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ font = 1;
+ fontsize = 1;
+ colr = 1;
+ nt = 5;
+ nd = 1;
+ in1 = [1,1];
+ model = scicos_model();
+ model.sim = list("affich2",4);
+ model.in1 = in1[1-1][1-1];
+ model.in2 = in1[1-1][2-1];
+ model.evtin = 1;
+ model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
+ model.ipar = [[font],[fontsize],[colr],[1000],[nt],[nd],[in1[1-1][1-1]]];
+ model.blocktype = "c";
+ model.firing = [];
+ model.dep_ut = [true,false];
+ model.label = "";
+ exprs = [[sci2exp([model.in1,model.in2])],[string(font)],[string(fontsize)],[string(colr)],[string(nt)],[string(nd)],[string(0)]];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
AFFICH_m.prototype.details = function AFFICH_m() {
}
AFFICH_m.prototype.get = function AFFICH_m() {
}
AFFICH_m.prototype.set = function AFFICH_m() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,in1,font,fontsize,colr,nt,nd,herit,exprs]=scicos_getvalue("Set parameters",[["Input Size","Font number"],["Font size"],["Color"],["Total number of digits"],["Number of rational part digits"],["Block inherits (1) or not (0)"]],list("mat",[1,2],"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,in1,font,fontsize,colr,nt,nd,herit,exprs] = scicos_getvalue("Set parameters",[["Input Size","Font number"],["Font size"],["Color"],["Total number of digits"],["Number of rational part digits"],["Block inherits (1) or not (0)"]],list("mat",[1,2],"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (font<=0) {
-mess=[[mess],["Font number must be positive"],[" "]];
-ok=false;
+ mess = [];
+ if (font<=0) {
+ mess = [[mess],["Font number must be positive"],[" "]];
+ ok = false;
}
-if (fontsize<=0) {
-mess=[[mess],["Font size must be positive"],[" "]];
-ok=false;
+ if (fontsize<=0) {
+ mess = [[mess],["Font size must be positive"],[" "]];
+ ok = false;
}
-if (nt<=3) {
-mess=[[mess],["Total number of digits must be greater than 3"],[" "]];
-ok=false;
+ if (nt<=3) {
+ mess = [[mess],["Total number of digits must be greater than 3"],[" "]];
+ ok = false;
}
-if (nd<0) {
-mess=[[mess],["Number of rational part digits must be ","greater or equal 0"],[" "]];
-ok=false;
+ if (nd<0) {
+ mess = [[mess],["Number of rational part digits must be ","greater or equal 0"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (!or(herit==[0,1])) {
-mess=[[mess],["Accept inherited values are 0 and 1"],[" "]];
-ok=false;
+ if (!or(herit==[0,1])) {
+ mess = [[mess],["Accept inherited values are 0 and 1"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-[model,graphics,ok]=set_io(model,graphics,list(in1,1),list(),ones(1-herit,1),[]);
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list(in1,1),list(),ones(1-herit,1),[]);
}
-if (ok) {
-model.ipar=[[font],[fontsize],[colr],[nt],[nd],[in1[1-1][1-1]]];
-model.dstate=[[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
-model.evtin=ones(1-herit,1);
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ model.ipar = [[font],[fontsize],[colr],[nt],[nd],[in1[1-1][1-1]]];
+ model.dstate = [[-1],[0],[0],[1],[1],[0],[zeros(in1[1-1][1-1]*in1[1-1][2-1],1)]];
+ model.evtin = ones(1-herit,1);
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/BARXY.js b/js/Sinks/BARXY.js
index b6400145..3cdddd4d 100644
--- a/js/Sinks/BARXY.js
+++ b/js/Sinks/BARXY.js
@@ -1,60 +1,60 @@
/* autogenerated from "macros/Sinks/BARXY.sci" */
function BARXY() {
BARXY.prototype.define = function BARXY() {
-model=scicos_model();
-xmin=-15;
-xmax=15;
-ymin=-15;
-ymax=15;
-model.sim=list("BARXY_sim",5);
-model.blocktype="d";
-model.dep_ut=[true,false];
-model.in1=[[-1],[-1]];
-model.intyp=[1];
-model.out=[];
-model.evtin=[1];
-model.rpar=[[xmin],[xmax],[ymin],[ymax]];
-model.ipar=1;
-x=standard_define([2,2],model,[],[]);
-x.graphics.in_implicit=["E","E"];
-x.graphics.out_implicit=[];
-x.graphics.exprs=[["-15"],["15"],["-15"],["15"],["1"]];
+ model = scicos_model();
+ xmin = -15;
+ xmax = 15;
+ ymin = -15;
+ ymax = 15;
+ model.sim = list("BARXY_sim",5);
+ model.blocktype = "d";
+ model.dep_ut = [true,false];
+ model.in1 = [[-1],[-1]];
+ model.intyp = [1];
+ model.out = [];
+ model.evtin = [1];
+ model.rpar = [[xmin],[xmax],[ymin],[ymax]];
+ model.ipar = 1;
+ x = standard_define([2,2],model,[],[]);
+ x.graphics.in_implicit = ["E","E"];
+ x.graphics.out_implicit = [];
+ x.graphics.exprs = [["-15"],["15"],["-15"],["15"],["1"]];
}
BARXY.prototype.details = function BARXY() {
}
BARXY.prototype.get = function BARXY() {
}
BARXY.prototype.set = function BARXY() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,xmin,xmax,ymin,ymax,thickness,exprs]=scicos_getvalue("Set Scope parameters",[["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Segs Thickness"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,xmin,xmax,ymin,ymax,thickness,exprs] = scicos_getvalue("Set Scope parameters",[["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Segs Thickness"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (ymin>=ymax) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ mess = [];
+ if (ymin>=ymax) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (xmin>=xmax) {
-mess=[[mess],["Xmax must be greater than Xmin"],[" "]];
-ok=false;
+ if (xmin>=xmax) {
+ mess = [[mess],["Xmax must be greater than Xmin"],[" "]];
+ ok = false;
}
-if (thickness<=0) {
-mess=[[mess],["Thickness must be strictly positive."]];
-ok=false;
+ if (thickness<=0) {
+ mess = [[mess],["Thickness must be strictly positive."]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message(mess);
-} else {
-model.rpar=[[xmin],[xmax],[ymin],[ymax]];
-model.ipar=thickness;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ model.rpar = [[xmin],[xmax],[ymin],[ymax]];
+ model.ipar = thickness;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CANIMXY.js b/js/Sinks/CANIMXY.js
index b60096d4..4fe1aa55 100644
--- a/js/Sinks/CANIMXY.js
+++ b/js/Sinks/CANIMXY.js
@@ -1,98 +1,98 @@
/* autogenerated from "macros/Sinks/CANIMXY.sci" */
function CANIMXY() {
CANIMXY.prototype.define = function CANIMXY() {
-win=-1;
-clrs=-4;
-N=2;
-siz=1;
-wpos=[[-1],[-1]];
-wdim=[[-1],[-1]];
-xmin=-15;
-xmax=15;
-ymin=-15;
-ymax=+15;
-nbr_curves=1;
-model=scicos_model();
-model.sim=list("canimxy",4);
-model.in1=[[1],[1]];
-model.in2=[[1],[1]];
-model.intyp=[[1],[1]];
-model.evtin=1;
-model.rpar=[[xmin],[xmax],[ymin],[ymax]];
-model.ipar=[[win],[1],[N],[clrs],[siz],[0],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-exprs=[[string(nbr_curves)],[string(clrs)],[string(siz)],[string(win)],["[]"],["[]"],[string(xmin)],[string(xmax)],[string(ymin)],[string(ymax)],[string(N)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ clrs = -4;
+ N = 2;
+ siz = 1;
+ wpos = [[-1],[-1]];
+ wdim = [[-1],[-1]];
+ xmin = -15;
+ xmax = 15;
+ ymin = -15;
+ ymax = +15;
+ nbr_curves = 1;
+ model = scicos_model();
+ model.sim = list("canimxy",4);
+ model.in1 = [[1],[1]];
+ model.in2 = [[1],[1]];
+ model.intyp = [[1],[1]];
+ model.evtin = 1;
+ model.rpar = [[xmin],[xmax],[ymin],[ymax]];
+ model.ipar = [[win],[1],[N],[clrs],[siz],[0],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ exprs = [[string(nbr_curves)],[string(clrs)],[string(siz)],[string(win)],["[]"],["[]"],[string(xmin)],[string(xmax)],[string(ymin)],[string(ymax)],[string(N)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CANIMXY.prototype.details = function CANIMXY() {
}
CANIMXY.prototype.get = function CANIMXY() {
}
CANIMXY.prototype.set = function CANIMXY() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,nbr_curves,clrs,siz,win,wpos,wdim,xmin,xmax,ymin,ymax,N,exprs]=scicos_getvalue("Set Scope parameters",[["Number of Curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Buffer size"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,nbr_curves,clrs,siz,win,wpos,wdim,xmin,xmax,ymin,ymax,N,exprs] = scicos_getvalue("Set Scope parameters",[["Number of Curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Buffer size"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (nbr_curves<=0) {
-mess=[[mess],["Number of curves cannot be negative or null"],[" "]];
-ok=false;
+ if (nbr_curves<=0) {
+ mess = [[mess],["Number of curves cannot be negative or null"],[" "]];
+ ok = false;
}
-if (N<1) {
-mess=[[mess],["Buffer size must be at least 1"],[" "]];
-ok=false;
+ if (N<1) {
+ mess = [[mess],["Buffer size must be at least 1"],[" "]];
+ ok = false;
}
-if (N==1&&clrs>0) {
-mess=[[mess],["Buffer size must be at least 2"],[" "]];
-ok=false;
+ if (N==1&&clrs>0) {
+ mess = [[mess],["Buffer size must be at least 2"],[" "]];
+ ok = false;
}
-if (ymin>=ymax) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ if (ymin>=ymax) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (xmin>=xmax) {
-mess=[[mess],["Xmax must be greater than Xmin"],[" "]];
-ok=false;
+ if (xmin>=xmax) {
+ mess = [[mess],["Xmax must be greater than Xmin"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message(mess);
-} else {
-in1=nbr_curves*ones(2,1);
-in2=ones(2,1);
-[model,graphics,ok]=set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]);
-if (wpos==[]) {
-wpos=[[-1],[-1]];
+ } else {
+ in1 = nbr_curves*ones(2,1);
+ in2 = ones(2,1);
+ [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]);
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
}
-rpar=[[xmin],[xmax],[ymin],[ymax]];
-ipar=[[win],[1],[N],[clrs],[siz],[0],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ rpar = [[xmin],[xmax],[ymin],[ymax]];
+ ipar = [[win],[1],[N],[clrs],[siz],[0],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CANIMXY3D.js b/js/Sinks/CANIMXY3D.js
index df6166aa..8d86f3b9 100644
--- a/js/Sinks/CANIMXY3D.js
+++ b/js/Sinks/CANIMXY3D.js
@@ -1,115 +1,115 @@
/* autogenerated from "macros/Sinks/CANIMXY3D.sci" */
function CANIMXY3D() {
CANIMXY3D.prototype.define = function CANIMXY3D() {
-win=-1;
-N=2;
-clrs=[[1],[2],[3],[4],[5],[6],[7],[13]];
-siz=[[1],[1],[1],[1],[1],[1],[1],[1]];
-wpos=[[-1],[-1]];
-wdim=[[-1],[-1]];
-param3ds=[[50],[280]];
-vec_x=[[-15],[15]];
-vec_y=[[-15],[15]];
-vec_z=[[-15],[15]];
-nbr_curves=1;
-model=scicos_model();
-model.sim=list("canimxy3d",4);
-model.in1=[[1],[1],[1]];
-model.evtin=1;
-model.in2=[[1],[1],[1]];
-model.intyp=[[1],[1],[1]];
-model.rpar=[[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
-model.ipar=[[win],[8],[N],[clrs.slice()],[siz.slice()],[8],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-exprs=[[string(nbr_curves)],[strcat(string(clrs)," ")],[strcat(string(siz)," ")],[string(win)],["[]"],["[]"],[strcat(string(vec_x)," ")],[strcat(string(vec_y)," ")],[strcat(string(vec_z)," ")],[strcat(string(param3ds)," ")],[string(N)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ N = 2;
+ clrs = [[1],[2],[3],[4],[5],[6],[7],[13]];
+ siz = [[1],[1],[1],[1],[1],[1],[1],[1]];
+ wpos = [[-1],[-1]];
+ wdim = [[-1],[-1]];
+ param3ds = [[50],[280]];
+ vec_x = [[-15],[15]];
+ vec_y = [[-15],[15]];
+ vec_z = [[-15],[15]];
+ nbr_curves = 1;
+ model = scicos_model();
+ model.sim = list("canimxy3d",4);
+ model.in1 = [[1],[1],[1]];
+ model.evtin = 1;
+ model.in2 = [[1],[1],[1]];
+ model.intyp = [[1],[1],[1]];
+ model.rpar = [[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
+ model.ipar = [[win],[8],[N],[clrs.slice()],[siz.slice()],[8],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ exprs = [[string(nbr_curves)],[strcat(string(clrs)," ")],[strcat(string(siz)," ")],[string(win)],["[]"],["[]"],[strcat(string(vec_x)," ")],[strcat(string(vec_y)," ")],[strcat(string(vec_z)," ")],[strcat(string(param3ds)," ")],[string(N)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CANIMXY3D.prototype.details = function CANIMXY3D() {
}
CANIMXY3D.prototype.get = function CANIMXY3D() {
}
CANIMXY3D.prototype.set = function CANIMXY3D() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,nbr_curves,clrs,siz,win,wpos,wdim,vec_x,vec_y,vec_z,param3ds,N,exprs]=scicos_getvalue("Set Scope parameters",[["Number of curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin and Xmax"],["Ymin and Ymax"],["Zmin and Zmax"],["Alpha and Theta"],["Buffer size"]],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,nbr_curves,clrs,siz,win,wpos,wdim,vec_x,vec_y,vec_z,param3ds,N,exprs] = scicos_getvalue("Set Scope parameters",[["Number of curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin and Xmax"],["Ymin and Ymax"],["Zmin and Zmax"],["Alpha and Theta"],["Buffer size"]],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (size(clrs,"*")!=size(siz,"*")) {
-mess=[[mess],["Colors and Size must have same size"],[" "]];
-ok=false;
+ if (size(clrs,"*")!=size(siz,"*")) {
+ mess = [[mess],["Colors and Size must have same size"],[" "]];
+ ok = false;
}
-if (nbr_curves<=0) {
-mess=[[mess],["Number of curves cannot be negative or null"],[" "]];
-ok=false;
+ if (nbr_curves<=0) {
+ mess = [[mess],["Number of curves cannot be negative or null"],[" "]];
+ ok = false;
}
-if (size(clrs,"*")<nbr_curves) {
-mess=[[mess],["You must have at least same size for clrs and the number of curves"],[" "]];
-ok=false;
+ if (size(clrs,"*")<nbr_curves) {
+ mess = [[mess],["You must have at least same size for clrs and the number of curves"],[" "]];
+ ok = false;
}
-if (N<1) {
-mess=[[mess],["Buffer size must be at least 1"],[" "]];
-ok=false;
+ if (N<1) {
+ mess = [[mess],["Buffer size must be at least 1"],[" "]];
+ ok = false;
}
-if (N<2) {
+ if (N<2) {
for (i=1;i<=nbr_curves;i+=1) {
-if (clrs[i-1]>0) {
-mess=[[mess],["Buffer size must be at least 2 or Change a color (must be <0)"],[" "]];
-ok=false;
+ if (clrs[i-1]>0) {
+ mess = [[mess],["Buffer size must be at least 2 or Change a color (must be <0)"],[" "]];
+ ok = false;
}
}
}
-if (vec_y[1-1]>=vec_y[2-1]) {
-mess=[[mess],["Ymax must be higher than Ymin"],[" "]];
-ok=false;
+ if (vec_y[1-1]>=vec_y[2-1]) {
+ mess = [[mess],["Ymax must be higher than Ymin"],[" "]];
+ ok = false;
}
-if (vec_x[1-1]>=vec_x[2-1]) {
-mess=[[mess],["Xmax must be higher than Xmin"],[" "]];
-ok=false;
+ if (vec_x[1-1]>=vec_x[2-1]) {
+ mess = [[mess],["Xmax must be higher than Xmin"],[" "]];
+ ok = false;
}
-if (vec_z[1-1]>=vec_z[2-1]) {
-mess=[[mess],["Zmax must be higher than Zmin"],[" "]];
-ok=false;
+ if (vec_z[1-1]>=vec_z[2-1]) {
+ mess = [[mess],["Zmax must be higher than Zmin"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message(mess);
-} else {
-in1=nbr_curves*ones(3,1);
-in2=ones(3,1);
-[model,graphics,ok]=set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]);
-if (wpos==[]) {
-wpos=[[-1],[-1]];
-}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
-}
-rpar=[[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
-size_siz=size(siz,"*");
-ipar=[[win],[size_siz],[N],[clrs.slice()],[siz.slice()],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ in1 = nbr_curves*ones(3,1);
+ in2 = ones(3,1);
+ [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]);
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
+}
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
+}
+ rpar = [[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
+ size_siz = size(siz,"*");
+ ipar = [[win],[size_siz],[N],[clrs.slice()],[siz.slice()],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CEVENTSCOPE.js b/js/Sinks/CEVENTSCOPE.js
index 73e5f90a..23559306 100644
--- a/js/Sinks/CEVENTSCOPE.js
+++ b/js/Sinks/CEVENTSCOPE.js
@@ -1,84 +1,84 @@
/* autogenerated from "macros/Sinks/CEVENTSCOPE.sci" */
function CEVENTSCOPE() {
CEVENTSCOPE.prototype.define = function CEVENTSCOPE() {
-nclock=1;
-win=-1;
-clrs=[[1],[3],[5],[7],[9],[11],[13],[15]];
-wdim=[[600],[400]];
-wpos=[[-1],[-1]];
-per=30;
-model=scicos_model();
-model.sim=list("cevscpe",4);
-model.evtin=1;
-model.rpar=per;
-model.ipar=[[win],[1],[clrs[nclock-1]],[wpos.slice()],[wdim.slice()]];
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=[[sci2exp(nclock)],[strcat(sci2exp(clrs[nclock-1])," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(per)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ nclock = 1;
+ win = -1;
+ clrs = [[1],[3],[5],[7],[9],[11],[13],[15]];
+ wdim = [[600],[400]];
+ wpos = [[-1],[-1]];
+ per = 30;
+ model = scicos_model();
+ model.sim = list("cevscpe",4);
+ model.evtin = 1;
+ model.rpar = per;
+ model.ipar = [[win],[1],[clrs[nclock-1]],[wpos.slice()],[wdim.slice()]];
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = [[sci2exp(nclock)],[strcat(sci2exp(clrs[nclock-1])," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(per)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CEVENTSCOPE.prototype.details = function CEVENTSCOPE() {
}
CEVENTSCOPE.prototype.get = function CEVENTSCOPE() {
}
CEVENTSCOPE.prototype.set = function CEVENTSCOPE() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,nclock,clrs,win,wpos,wdim,per,exprs]=scicos_getvalue("Set Scope parameters",[["Number of event inputs"],["colors c (>0) or mark (<0)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Refresh period"]],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs);
-nclock=int(nclock);
-clrs=int(clrs);
-win=int(win);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,nclock,clrs,win,wpos,wdim,per,exprs] = scicos_getvalue("Set Scope parameters",[["Number of event inputs"],["colors c (>0) or mark (<0)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Refresh period"]],list("vec",1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",1),exprs);
+ nclock = int(nclock);
+ clrs = int(clrs);
+ win = int(win);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (nclock<=0) {
-mess=[[mess],["Block must have at least one input event"],[" "]];
-ok=false;
+ if (nclock<=0) {
+ mess = [[mess],["Block must have at least one input event"],[" "]];
+ ok = false;
}
-if (size(clrs,"*")!=nclock) {
-mess=[[mess],["Inputs color c size must be equal to Number of inputs"],[" "]];
-ok=false;
+ if (size(clrs,"*")!=nclock) {
+ mess = [[mess],["Inputs color c size must be equal to Number of inputs"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (per<=0) {
-mess=[[mess],["Refresh period must be positive"],[" "]];
-ok=false;
+ if (per<=0) {
+ mess = [[mess],["Refresh period must be positive"],[" "]];
+ ok = false;
}
-if (ok) {
-[model,graphics,ok]=set_io(model,graphics,list(),list(),ones(nclock,1),[]);
-} else {
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list(),list(),ones(nclock,1),[]);
+ } else {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-if (wpos==[]) {
-wpos=[[-1],[-1]];
+ if (ok) {
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
}
-rpar=per;
-ipar=[[win],[1],[clrs.slice()],[wpos.slice()],[wdim.slice()]];
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ rpar = per;
+ ipar = [[win],[1],[clrs.slice()],[wpos.slice()],[wdim.slice()]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CFSCOPE.js b/js/Sinks/CFSCOPE.js
index 69e91a44..e2cf054d 100644
--- a/js/Sinks/CFSCOPE.js
+++ b/js/Sinks/CFSCOPE.js
@@ -1,93 +1,93 @@
/* autogenerated from "macros/Sinks/CFSCOPE.sci" */
function CFSCOPE() {
CFSCOPE.prototype.define = function CFSCOPE() {
-win=-1;
-wdim=[[600],[400]];
-wpos=[[-1],[-1]];
-clrs=[[1],[3],[5],[7],[9],[11],[13],[15]];
-N=2;
-ymin=-15;
-ymax=+15;
-per=30;
-model=scicos_model();
-model.sim=list("cfscope",4);
-model.evtin=1;
-model.rpar=[[0],[ymin],[ymax],[per]];
-model.ipar=[[win],[1],[N],[clrs],[wpos],[wdim],[1],[1]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(ymin)],[string(ymax)],[string(per)],[string(N)],[string([1])]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ wdim = [[600],[400]];
+ wpos = [[-1],[-1]];
+ clrs = [[1],[3],[5],[7],[9],[11],[13],[15]];
+ N = 2;
+ ymin = -15;
+ ymax = +15;
+ per = 30;
+ model = scicos_model();
+ model.sim = list("cfscope",4);
+ model.evtin = 1;
+ model.rpar = [[0],[ymin],[ymax],[per]];
+ model.ipar = [[win],[1],[N],[clrs],[wpos],[wdim],[1],[1]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(ymin)],[string(ymax)],[string(per)],[string(N)],[string([1])]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CFSCOPE.prototype.details = function CFSCOPE() {
}
CFSCOPE.prototype.get = function CFSCOPE() {
}
CFSCOPE.prototype.set = function CFSCOPE() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,clrs,win,wpos,wdim,ymin,ymax,per,N,wu,exprs]=scicos_getvalue("Set Scope parameters",[["Color (>0) or mark (<0) vector (8 entries)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin"],["Ymax"],["Refresh period"],["Buffer size","Links to view"]],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",-1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,clrs,win,wpos,wdim,ymin,ymax,per,N,wu,exprs] = scicos_getvalue("Set Scope parameters",[["Color (>0) or mark (<0) vector (8 entries)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin"],["Ymax"],["Refresh period"],["Buffer size","Links to view"]],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",-1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (per<=0) {
-mess=[[mess],["Refresh period must be positive"],[" "]];
-ok=false;
+ if (per<=0) {
+ mess = [[mess],["Refresh period must be positive"],[" "]];
+ ok = false;
}
-if (N<2) {
-mess=[[mess],["Buffer size must be at least 2"],[" "]];
-ok=false;
+ if (N<2) {
+ mess = [[mess],["Buffer size must be at least 2"],[" "]];
+ ok = false;
}
-if (ymin>=ymax) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ if (ymin>=ymax) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (wu<0) {
-mess=[[mess],["Link to view must be positive"],[" "]];
-ok=false;
+ if (wu<0) {
+ mess = [[mess],["Link to view must be positive"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-if (wpos==[]) {
-wpos=[[-1],[-1]];
+ if (ok) {
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
}
-rpar=[[0],[ymin],[ymax],[per]];
-if (size(clrs,"*")>8) {
-clrs=clrs.slice(1-1,8);
+ rpar = [[0],[ymin],[ymax],[per]];
+ if (size(clrs,"*")>8) {
+ clrs = clrs.slice(1-1,8);
}
-if (size(clrs,"*")<8) {
-clrs[8-1]=0;
+ if (size(clrs,"*")<8) {
+ clrs[8-1] = 0;
}
-ipar=[[win],[1],[N],[clrs.slice()],[wpos.slice()],[wdim.slice()],[size(wu,"*")],[wu.slice()]];
-model.rpar=rpar;
-model.ipar=ipar;
-model.firing=[];
-model.dep_ut=[true,false];
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ ipar = [[win],[1],[N],[clrs.slice()],[wpos.slice()],[wdim.slice()],[size(wu,"*")],[wu.slice()]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.firing = [];
+ model.dep_ut = [true,false];
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CLKOUTV_f.js b/js/Sinks/CLKOUTV_f.js
index 4f64a8b7..0c98a1b9 100644
--- a/js/Sinks/CLKOUTV_f.js
+++ b/js/Sinks/CLKOUTV_f.js
@@ -1,40 +1,40 @@
/* autogenerated from "macros/Sinks/CLKOUTV_f.sci" */
function CLKOUTV_f() {
CLKOUTV_f.prototype.define = function CLKOUTV_f() {
-prt=1;
-model=scicos_model();
-model.sim="output";
-model.evtin=1;
-model.ipar=prt;
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-exprs=string(prt);
-x=standard_define([1,1],model,exprs," ");
+ prt = 1;
+ model = scicos_model();
+ model.sim = "output";
+ model.evtin = 1;
+ model.ipar = prt;
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ exprs = string(prt);
+ x = standard_define([1,1],model,exprs," ");
}
CLKOUTV_f.prototype.details = function CLKOUTV_f() {
}
CLKOUTV_f.prototype.get = function CLKOUTV_f() {
}
CLKOUTV_f.prototype.set = function CLKOUTV_f() {
-x=arg1;
-graphics=arg1.graphics;
-model=arg1.model;
-exprs=graphics.exprs;
-while (true) {
-[ok,prt,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLKOUTV_f")],[" "],[gettext("Event output port")]],gettext("Port number"),list("vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ model = arg1.model;
+ exprs = graphics.exprs;
+ while (true) {
+ [ok,prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLKOUTV_f")],[" "],[gettext("Event output port")]],gettext("Port number"),list("vec",1),exprs);
+ if (!ok) {
break;
}
-prt=int(prt);
-if (prt<=0) {
+ prt = int(prt);
+ if (prt<=0) {
block_parameter_error(msprintf(gettext("Wrong value for \'Port Number\' parameter: %d."),prt),gettext("Strictly positive integer expected."));
-} else {
-model.ipar=prt;
-model.evtin=1;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ model.ipar = prt;
+ model.evtin = 1;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CLKOUT_f.js b/js/Sinks/CLKOUT_f.js
index a1d85634..d9f5d2a9 100644
--- a/js/Sinks/CLKOUT_f.js
+++ b/js/Sinks/CLKOUT_f.js
@@ -1,42 +1,42 @@
/* autogenerated from "macros/Sinks/CLKOUT_f.sci" */
function CLKOUT_f() {
CLKOUT_f.prototype.define = function CLKOUT_f() {
-prt=1;
-model=scicos_model();
-model.sim="output";
-model.evtin=1;
-model.ipar=prt;
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-exprs=string(prt);
-x=standard_define([1,1],model,exprs," ");
+ prt = 1;
+ model = scicos_model();
+ model.sim = "output";
+ model.evtin = 1;
+ model.ipar = prt;
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ exprs = string(prt);
+ x = standard_define([1,1],model,exprs," ");
}
CLKOUT_f.prototype.details = function CLKOUT_f() {
}
CLKOUT_f.prototype.get = function CLKOUT_f() {
}
CLKOUT_f.prototype.set = function CLKOUT_f() {
-x=arg1;
-graphics=arg1.graphics;
-model=arg1.model;
-exprs=graphics.exprs;
-exprs=exprs[1-1];
-while (true) {
-[ok,prt,exprs]=scicos_getvalue("Set Event Output block parameters","Port number",list("vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ model = arg1.model;
+ exprs = graphics.exprs;
+ exprs = exprs[1-1];
+ while (true) {
+ [ok,prt,exprs] = scicos_getvalue("Set Event Output block parameters","Port number",list("vec",1),exprs);
+ if (!ok) {
break;
}
-prt=int(prt);
-if (prt<=0) {
+ prt = int(prt);
+ if (prt<=0) {
message("Port number must be a positive integer");
-} else {
-model.ipar=prt;
-model.evtin=1;
-model.firing=[];
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ model.ipar = prt;
+ model.evtin = 1;
+ model.firing = [];
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CMAT3D.js b/js/Sinks/CMAT3D.js
index 422c1443..44dcfcb4 100644
--- a/js/Sinks/CMAT3D.js
+++ b/js/Sinks/CMAT3D.js
@@ -1,64 +1,64 @@
/* autogenerated from "macros/Sinks/CMAT3D.sci" */
function CMAT3D() {
CMAT3D.prototype.define = function CMAT3D() {
-cmin=0;
-cmax=100;
-colormap=this.jetcolormap[25-1];
-size_c=25;
-x=-1;
-y=-1;
-size_x=1;
-size_y=1;
-model=scicos_model();
-model.sim=list("cmat3d",4);
-model.in1=-1;
-model.in2=-2;
-model.intyp=1;
-model.evtin=1;
-model.ipar=[[cmin],[cmax],[size_c],[size_x],[size_y]];
-model.rpar=[[colormap.slice()],[x],[y]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(string(x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(cmin)],[string(cmax)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ cmin = 0;
+ cmax = 100;
+ colormap = this.jetcolormap[25-1];
+ size_c = 25;
+ x = -1;
+ y = -1;
+ size_x = 1;
+ size_y = 1;
+ model = scicos_model();
+ model.sim = list("cmat3d",4);
+ model.in1 = -1;
+ model.in2 = -2;
+ model.intyp = 1;
+ model.evtin = 1;
+ model.ipar = [[cmin],[cmax],[size_c],[size_x],[size_y]];
+ model.rpar = [[colormap.slice()],[x],[y]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(string(x)," ")],[strcat(string(y)," ")],[string("jetcolormap(25)")],[string(cmin)],[string(cmax)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CMAT3D.prototype.details = function CMAT3D() {
}
CMAT3D.prototype.get = function CMAT3D() {
}
CMAT3D.prototype.set = function CMAT3D() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,vec_x,vec_y,colormap,cmin,cmax,exprs]=scicos_getvalue("Set Scope parameters",[["Bounds Vector X (-1 for standard)"],["Bounds Vector Y (-1 for standard)"],["ColorMap"],["Zmin"],["Zmax"]],list("vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,vec_x,vec_y,colormap,cmin,cmax,exprs] = scicos_getvalue("Set Scope parameters",[["Bounds Vector X (-1 for standard)"],["Bounds Vector Y (-1 for standard)"],["ColorMap"],["Zmin"],["Zmax"]],list("vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(vec_x,"*")!=size(vec_y,"*")) {
-mess=[[mess],["Vector X and Vector Y must have the same size"],[" "]];
-ok=false;
+ mess = [];
+ if (size(vec_x,"*")!=size(vec_y,"*")) {
+ mess = [[mess],["Vector X and Vector Y must have the same size"],[" "]];
+ ok = false;
}
-if (cmax<=cmin) {
-mess=[[mess],["Error with minimum and maximum value"],[" "]];
-ok=false;
+ if (cmax<=cmin) {
+ mess = [[mess],["Error with minimum and maximum value"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-size_x=size(vec_x,"*");
-size_c=size(colormap.slice(),1);
-ipar=[[cmin],[cmax],[size_c],[size_x]];
-rpar=[[colormap.slice()],[vec_x.slice()],[vec_y.slice()]];
-model.ipar=ipar;
-model.rpar=rpar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ size_x = size(vec_x,"*");
+ size_c = size(colormap.slice(),1);
+ ipar = [[cmin],[cmax],[size_c],[size_x]];
+ rpar = [[colormap.slice()],[vec_x.slice()],[vec_y.slice()]];
+ model.ipar = ipar;
+ model.rpar = rpar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CMATVIEW.js b/js/Sinks/CMATVIEW.js
index eaa522ba..f92782e5 100644
--- a/js/Sinks/CMATVIEW.js
+++ b/js/Sinks/CMATVIEW.js
@@ -1,60 +1,60 @@
/* autogenerated from "macros/Sinks/CMATVIEW.sci" */
function CMATVIEW() {
CMATVIEW.prototype.define = function CMATVIEW() {
-cmin=0;
-cmax=100;
-size_c=25;
-colormap=this.jetcolormap[size_c-1];
-alpha_c=0.24;
-beta_c=1;
-model=scicos_model();
-model.sim=list("cmatview",4);
-model.in1=-1;
-model.in2=-2;
-model.intyp=1;
-model.evtin=1;
-model.ipar=[[cmin],[cmax],[size_c]];
-model.rpar=[[alpha_c],[beta_c],[colormap.slice()]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string("jetcolormap(25)")],[string(cmin)],[string(cmax)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ cmin = 0;
+ cmax = 100;
+ size_c = 25;
+ colormap = this.jetcolormap[size_c-1];
+ alpha_c = 0.24;
+ beta_c = 1;
+ model = scicos_model();
+ model.sim = list("cmatview",4);
+ model.in1 = -1;
+ model.in2 = -2;
+ model.intyp = 1;
+ model.evtin = 1;
+ model.ipar = [[cmin],[cmax],[size_c]];
+ model.rpar = [[alpha_c],[beta_c],[colormap.slice()]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string("jetcolormap(25)")],[string(cmin)],[string(cmax)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CMATVIEW.prototype.details = function CMATVIEW() {
}
CMATVIEW.prototype.get = function CMATVIEW() {
}
CMATVIEW.prototype.set = function CMATVIEW() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,colormap,cmin,cmax,exprs]=scicos_getvalue("Set Scope parameters",[["ColorMap"],["Minimum level range"],["Maximum level range"]],list("vec",-1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,colormap,cmin,cmax,exprs] = scicos_getvalue("Set Scope parameters",[["ColorMap"],["Minimum level range"],["Maximum level range"]],list("vec",-1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (cmax<=cmin) {
-mess=[[mess],["Error with minimum and maximum value"],[" "]];
-ok=false;
+ mess = [];
+ if (cmax<=cmin) {
+ mess = [[mess],["Error with minimum and maximum value"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-size_c=size(colormap.slice(),1);
-sol=inv([[cmin,1],[cmax,1]])*[[1],[size_c/3]];
-alpha_c=sol[1-1];
-beta_c=sol[2-1];
-ipar=[[cmin],[cmax],[size_c]];
-rpar=[[alpha_c],[beta_c],[colormap.slice()]];
-model.ipar=ipar;
-model.rpar=rpar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ size_c = size(colormap.slice(),1);
+ sol = inv([[cmin,1],[cmax,1]])*[[1],[size_c/3]];
+ alpha_c = sol[1-1];
+ beta_c = sol[2-1];
+ ipar = [[cmin],[cmax],[size_c]];
+ rpar = [[alpha_c],[beta_c],[colormap.slice()]];
+ model.ipar = ipar;
+ model.rpar = rpar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CMSCOPE.js b/js/Sinks/CMSCOPE.js
index b81edfce..cfef200f 100644
--- a/js/Sinks/CMSCOPE.js
+++ b/js/Sinks/CMSCOPE.js
@@ -1,123 +1,123 @@
/* autogenerated from "macros/Sinks/CMSCOPE.sci" */
function CMSCOPE() {
CMSCOPE.prototype.define = function CMSCOPE() {
-win=-1;
-in1=[[1],[1]];
-wdim=[[-1],[-1]];
-wpos=[[-1],[-1]];
-clrs=[[1],[3],[5],[7],[9],[11],[13],[15]];
-N=20;
-ymin=[[-1],[-5]];
-ymax=[[1],[5]];
-per=[[30],[30]];
-yy=[[transpose(ymin.slice())],[transpose(ymax.slice())]];
-period=transpose(per.slice());
-model=scicos_model();
-model.sim=list("cmscope",4);
-model.in1=in1;
-model.in2=[[1],[1]];
-model.intyp=[[1],[1]];
-model.evtin=1;
-model.rpar=[[0],[period.slice()],[yy.slice()]];
-model.ipar=[[win],[size(in1,"*")],[N],[wpos.slice()],[wdim.slice()],[in1.slice()],[clrs.slice(1-1,sum(in1))]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(string(in1)," ")],[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp([])],[strcat(string(ymin)," ")],[strcat(string(ymax)," ")],[strcat(string(per)," ")],[string(N)],[string(0)],[emptystr()]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ in1 = [[1],[1]];
+ wdim = [[-1],[-1]];
+ wpos = [[-1],[-1]];
+ clrs = [[1],[3],[5],[7],[9],[11],[13],[15]];
+ N = 20;
+ ymin = [[-1],[-5]];
+ ymax = [[1],[5]];
+ per = [[30],[30]];
+ yy = [[transpose(ymin.slice())],[transpose(ymax.slice())]];
+ period = transpose(per.slice());
+ model = scicos_model();
+ model.sim = list("cmscope",4);
+ model.in1 = in1;
+ model.in2 = [[1],[1]];
+ model.intyp = [[1],[1]];
+ model.evtin = 1;
+ model.rpar = [[0],[period.slice()],[yy.slice()]];
+ model.ipar = [[win],[size(in1,"*")],[N],[wpos.slice()],[wdim.slice()],[in1.slice()],[clrs.slice(1-1,sum(in1))]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(string(in1)," ")],[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp([])],[strcat(string(ymin)," ")],[strcat(string(ymax)," ")],[strcat(string(per)," ")],[string(N)],[string(0)],[emptystr()]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CMSCOPE.prototype.details = function CMSCOPE() {
}
CMSCOPE.prototype.get = function CMSCOPE() {
}
CMSCOPE.prototype.set = function CMSCOPE() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,in1,clrs,win,wpos,wdim,ymin,ymax,per,N,heritance,nom,exprs]=scicos_getvalue("Set Scope parameters",[["Input ports sizes"],["Drawing colors (>0) or mark (<0)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin vector"],["Ymax vector"],["Refresh period"],["Buffer size"],["Accept herited events 0/1","Name of Scope (label&Id)"]],list("vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec",1,"vec",1,"str",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,in1,clrs,win,wpos,wdim,ymin,ymax,per,N,heritance,nom,exprs] = scicos_getvalue("Set Scope parameters",[["Input ports sizes"],["Drawing colors (>0) or mark (<0)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin vector"],["Ymax vector"],["Refresh period"],["Buffer size"],["Accept herited events 0/1","Name of Scope (label&Id)"]],list("vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec","size(%1,\'*\')","vec",1,"vec",1,"str",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(in1,"*")<=0) {
-mess=[[mess],["Block must have at least one input port"],[" "]];
-ok=false;
+ mess = [];
+ if (size(in1,"*")<=0) {
+ mess = [[mess],["Block must have at least one input port"],[" "]];
+ ok = false;
}
-if (min(in1)<=0) {
-mess=[[mess],["Port sizes must be positive"],[" "]];
-ok=false;
+ if (min(in1)<=0) {
+ mess = [[mess],["Port sizes must be positive"],[" "]];
+ ok = false;
}
-if (size(clrs,"*")<sum(in1)) {
-mess=[[mess],["Not enough colors defined (at least "+string(sum(in1))+")"],[" "]];
-ok=false;
+ if (size(clrs,"*")<sum(in1)) {
+ mess = [[mess],["Not enough colors defined (at least "+string(sum(in1))+")"],[" "]];
+ ok = false;
}
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number can\'t be < -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number can\'t be < -1"],[" "]];
+ ok = false;
}
-if (size(per,"*")!=size(ymin,"*")) {
-mess=[[mess],["Size of Refresh Period must equal size of Ymin/Ymax vector"],[" "]];
-ok=false;
+ if (size(per,"*")!=size(ymin,"*")) {
+ mess = [[mess],["Size of Refresh Period must equal size of Ymin/Ymax vector"],[" "]];
+ ok = false;
}
for (i=1;i<=size(per,"*");i+=1) {
-if ((per[i-1]<=0)) {
-mess=[[mess],["Refresh Period must be positive"],[" "]];
-ok=false;
+ if ((per[i-1]<=0)) {
+ mess = [[mess],["Refresh Period must be positive"],[" "]];
+ ok = false;
}
}
-if (N<2) {
-mess=[[mess],["Buffer size must be at least 2"],[" "]];
-ok=false;
+ if (N<2) {
+ mess = [[mess],["Buffer size must be at least 2"],[" "]];
+ ok = false;
}
-if (or(ymin>=ymax)) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ if (or(ymin>=ymax)) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (!or(heritance==[0,1])) {
-mess=[[mess],["Accept herited events must be 0 or 1"],[" "]];
-ok=false;
+ if (!or(heritance==[0,1])) {
+ mess = [[mess],["Accept herited events must be 0 or 1"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-in1=in1.slice();
-a=size(in1,1);
-in2=ones(a,1);
-[model,graphics,ok]=set_io(model,graphics,list([in1,in2],ones(a,1)),list(),ones(1-heritance,1),[]);
-}
-if (ok) {
-if (wpos==[]) {
-wpos=[[-1],[-1]];
-}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
-}
-if (ok) {
-period=transpose(per.slice());
-yy=[[transpose(ymin.slice())],[transpose(ymax.slice())]];
-rpar=[[0],[period.slice()],[yy.slice()]];
-clrs=clrs.slice(1-1,sum(in1));
-ipar=[[win],[size(in1,"*")],[N],[wpos.slice()],[wdim.slice()],[in1.slice()],[clrs.slice()],[heritance]];
-model.evtin=ones(1-heritance,1);
-model.dstate=[];
-model.rpar=rpar;
-model.ipar=ipar;
-model.label=nom;
-graphics.id=nom;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ in1 = in1.slice();
+ a = size(in1,1);
+ in2 = ones(a,1);
+ [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(a,1)),list(),ones(1-heritance,1),[]);
+}
+ if (ok) {
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
+}
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
+}
+ if (ok) {
+ period = transpose(per.slice());
+ yy = [[transpose(ymin.slice())],[transpose(ymax.slice())]];
+ rpar = [[0],[period.slice()],[yy.slice()]];
+ clrs = clrs.slice(1-1,sum(in1));
+ ipar = [[win],[size(in1,"*")],[N],[wpos.slice()],[wdim.slice()],[in1.slice()],[clrs.slice()],[heritance]];
+ model.evtin = ones(1-heritance,1);
+ model.dstate = [];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.label = nom;
+ graphics.id = nom;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CSCOPE.js b/js/Sinks/CSCOPE.js
index a1461183..7b82402f 100644
--- a/js/Sinks/CSCOPE.js
+++ b/js/Sinks/CSCOPE.js
@@ -1,93 +1,93 @@
/* autogenerated from "macros/Sinks/CSCOPE.sci" */
function CSCOPE() {
CSCOPE.prototype.define = function CSCOPE() {
-win=-1;
-wdim=[[600],[400]];
-wpos=[[-1],[-1]];
-clrs=[[1],[3],[5],[7],[9],[11],[13],[15]];
-N=20;
-ymin=-15;
-ymax=+15;
-per=30;
-model=scicos_model();
-model.sim=list("cscope",4);
-model.in1=-1;
-model.in2=1;
-model.evtin=1;
-model.rpar=[[0],[ymin],[ymax],[per]];
-model.ipar=[[win],[1],[N],[clrs],[wpos],[wdim]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(ymin)],[string(ymax)],[string(per)],[string(N)],[transpose(string(0))],[emptystr()]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ wdim = [[600],[400]];
+ wpos = [[-1],[-1]];
+ clrs = [[1],[3],[5],[7],[9],[11],[13],[15]];
+ N = 20;
+ ymin = -15;
+ ymax = +15;
+ per = 30;
+ model = scicos_model();
+ model.sim = list("cscope",4);
+ model.in1 = -1;
+ model.in2 = 1;
+ model.evtin = 1;
+ model.rpar = [[0],[ymin],[ymax],[per]];
+ model.ipar = [[win],[1],[N],[clrs],[wpos],[wdim]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(string(clrs)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(ymin)],[string(ymax)],[string(per)],[string(N)],[transpose(string(0))],[emptystr()]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CSCOPE.prototype.details = function CSCOPE() {
}
CSCOPE.prototype.get = function CSCOPE() {
}
CSCOPE.prototype.set = function CSCOPE() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,clrs,win,wpos,wdim,ymin,ymax,per,N,heritance,nom,exprs]=scicos_getvalue("Set Scope parameters",[["Color (>0) or mark (<0) vector (8 entries)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin"],["Ymax"],["Refresh period"],["Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"]],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"str",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,clrs,win,wpos,wdim,ymin,ymax,per,N,heritance,nom,exprs] = scicos_getvalue("Set Scope parameters",[["Color (>0) or mark (<0) vector (8 entries)"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Ymin"],["Ymax"],["Refresh period"],["Buffer size","Accept herited events 0/1","Name of Scope (label&Id)"]],list("vec",8,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"str",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number can\'t be < -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number can\'t be < -1"],[" "]];
+ ok = false;
}
-if (per<=0) {
-mess=[[mess],["Refresh period must be positive"],[" "]];
-ok=false;
+ if (per<=0) {
+ mess = [[mess],["Refresh period must be positive"],[" "]];
+ ok = false;
}
-if (N<2) {
-mess=[[mess],["Buffer size must be at least 2"],[" "]];
-ok=false;
+ if (N<2) {
+ mess = [[mess],["Buffer size must be at least 2"],[" "]];
+ ok = false;
}
-if (ymin>=ymax) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ if (ymin>=ymax) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (!or(heritance==[0,1])) {
-mess=[[mess],["Accept herited events must be 0 or 1"],[" "]];
-ok=false;
+ if (!or(heritance==[0,1])) {
+ mess = [[mess],["Accept herited events must be 0 or 1"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message([["Some specified values are inconsistent:"],[" "],[mess]]);
}
-if (ok) {
-[model,graphics,ok]=set_io(model,graphics,list([-1,1],1),list(),ones(1-heritance,1),[]);
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list([-1,1],1),list(),ones(1-heritance,1),[]);
}
-if (ok) {
-if (wpos==[]) {
-wpos=[[-1],[-1]];
+ if (ok) {
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
}
-rpar=[[0],[ymin],[ymax],[per]];
-ipar=[[win],[1],[N],[clrs.slice()],[wpos.slice()],[wdim.slice()]];
-model.rpar=rpar;
-model.ipar=ipar;
-model.evtin=ones(1-heritance,1);
-model.label=nom;
-graphics.id=nom;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ rpar = [[0],[ymin],[ymax],[per]];
+ ipar = [[win],[1],[N],[clrs.slice()],[wpos.slice()],[wdim.slice()]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.evtin = ones(1-heritance,1);
+ model.label = nom;
+ graphics.id = nom;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CSCOPXY.js b/js/Sinks/CSCOPXY.js
index da57c497..2802f5a4 100644
--- a/js/Sinks/CSCOPXY.js
+++ b/js/Sinks/CSCOPXY.js
@@ -1,97 +1,97 @@
/* autogenerated from "macros/Sinks/CSCOPXY.sci" */
function CSCOPXY() {
CSCOPXY.prototype.define = function CSCOPXY() {
-win=-1;
-clrs=4;
-siz=1;
-wdim=[[600],[400]];
-wpos=[[-1],[-1]];
-N=2;
-xmin=-15;
-xmax=15;
-ymin=-15;
-ymax=+15;
-nbr_curves=1;
-model=scicos_model();
-model.sim=list("cscopxy",4);
-model.in1=[[1],[1]];
-model.in2=[[1],[1]];
-model.intyp=[[1],[1]];
-model.evtin=1;
-model.rpar=[[xmin],[xmax],[ymin],[ymax]];
-model.ipar=[[win],[1],[N],[clrs],[siz],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=[[string(nbr_curves)],[sci2exp(clrs)],[sci2exp(siz)],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(xmin)],[string(xmax)],[string(ymin)],[string(ymax)],[string(N)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ clrs = 4;
+ siz = 1;
+ wdim = [[600],[400]];
+ wpos = [[-1],[-1]];
+ N = 2;
+ xmin = -15;
+ xmax = 15;
+ ymin = -15;
+ ymax = +15;
+ nbr_curves = 1;
+ model = scicos_model();
+ model.sim = list("cscopxy",4);
+ model.in1 = [[1],[1]];
+ model.in2 = [[1],[1]];
+ model.intyp = [[1],[1]];
+ model.evtin = 1;
+ model.rpar = [[xmin],[xmax],[ymin],[ymax]];
+ model.ipar = [[win],[1],[N],[clrs],[siz],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = [[string(nbr_curves)],[sci2exp(clrs)],[sci2exp(siz)],[string(win)],[sci2exp([])],[sci2exp(wdim)],[string(xmin)],[string(xmax)],[string(ymin)],[string(ymax)],[string(N)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CSCOPXY.prototype.details = function CSCOPXY() {
}
CSCOPXY.prototype.get = function CSCOPXY() {
}
CSCOPXY.prototype.set = function CSCOPXY() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,nbr_curves,clrs,siz,win,wpos,wdim,xmin,xmax,ymin,ymax,N,exprs]=scicos_getvalue("Set Scope parameters",[["Number of Curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Buffer size"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,nbr_curves,clrs,siz,win,wpos,wdim,xmin,xmax,ymin,ymax,N,exprs] = scicos_getvalue("Set Scope parameters",[["Number of Curves"],["color (>0) or mark (<0)"],["line or mark size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin"],["Xmax"],["Ymin"],["Ymax"],["Buffer size"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (nbr_curves<=0) {
-mess=[[mess],["Number of Curves cannot be negative or null"],[" "]];
-ok=false;
+ if (nbr_curves<=0) {
+ mess = [[mess],["Number of Curves cannot be negative or null"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (N<1) {
-mess=[[mess],["Buffer size must be at least 1"],[" "]];
-ok=false;
+ if (N<1) {
+ mess = [[mess],["Buffer size must be at least 1"],[" "]];
+ ok = false;
}
-if (N==1&&clrs>0) {
-mess=[[mess],["Buffer size must be at least 2"],[" "]];
-ok=false;
+ if (N==1&&clrs>0) {
+ mess = [[mess],["Buffer size must be at least 2"],[" "]];
+ ok = false;
}
-if (ymin>=ymax) {
-mess=[[mess],["Ymax must be greater than Ymin"],[" "]];
-ok=false;
+ if (ymin>=ymax) {
+ mess = [[mess],["Ymax must be greater than Ymin"],[" "]];
+ ok = false;
}
-if (xmin>=xmax) {
-mess=[[mess],["Xmax must be greater than Xmin"],[" "]];
-ok=false;
+ if (xmin>=xmax) {
+ mess = [[mess],["Xmax must be greater than Xmin"],[" "]];
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
message(mess);
-} else {
-in1=nbr_curves*ones(2,1);
-in2=ones(2,1);
-[model,graphics,ok]=set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]);
-if (wpos==[]) {
-wpos=[[-1],[-1]];
+ } else {
+ in1 = nbr_curves*ones(2,1);
+ in2 = ones(2,1);
+ [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(2,1)),list(),ones(1,1),[]);
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
}
-rpar=[[xmin],[xmax],[ymin],[ymax]];
-ipar=[[win],[1],[N],[clrs],[siz],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ rpar = [[xmin],[xmax],[ymin],[ymax]];
+ ipar = [[win],[1],[N],[clrs],[siz],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/CSCOPXY3D.js b/js/Sinks/CSCOPXY3D.js
index 7c8be672..79af931a 100644
--- a/js/Sinks/CSCOPXY3D.js
+++ b/js/Sinks/CSCOPXY3D.js
@@ -1,110 +1,110 @@
/* autogenerated from "macros/Sinks/CSCOPXY3D.sci" */
function CSCOPXY3D() {
CSCOPXY3D.prototype.define = function CSCOPXY3D() {
-win=-1;
-clrs=[[1],[2],[3],[4],[5],[6],[7],[13]];
-siz=[[1],[1],[1],[1],[1],[1],[1],[1]];
-wdim=[[600],[400]];
-wpos=[[-1],[-1]];
-N=2;
-param3ds=[[50],[280]];
-vec_x=[[-15],[15]];
-vec_y=[[-15],[15]];
-vec_z=[[-15],[15]];
-nbr_curves=1;
-model=scicos_model();
-model.sim=list("cscopxy3d",4);
-model.in1=[[1],[1],[1]];
-model.in2=[[1],[1],[1]];
-model.intyp=[[1],[1],[1]];
-model.evtin=1;
-model.rpar=[[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
-model.ipar=[[win],[8],[N],[clrs.slice()],[siz.slice()],[8],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=[[string(nbr_curves)],[strcat(string(clrs)," ")],[strcat(string(siz)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[strcat(string(vec_x)," ")],[strcat(string(vec_y)," ")],[strcat(string(vec_z)," ")],[strcat(string(param3ds)," ")],[string(N)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ win = -1;
+ clrs = [[1],[2],[3],[4],[5],[6],[7],[13]];
+ siz = [[1],[1],[1],[1],[1],[1],[1],[1]];
+ wdim = [[600],[400]];
+ wpos = [[-1],[-1]];
+ N = 2;
+ param3ds = [[50],[280]];
+ vec_x = [[-15],[15]];
+ vec_y = [[-15],[15]];
+ vec_z = [[-15],[15]];
+ nbr_curves = 1;
+ model = scicos_model();
+ model.sim = list("cscopxy3d",4);
+ model.in1 = [[1],[1],[1]];
+ model.in2 = [[1],[1],[1]];
+ model.intyp = [[1],[1],[1]];
+ model.evtin = 1;
+ model.rpar = [[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
+ model.ipar = [[win],[8],[N],[clrs.slice()],[siz.slice()],[8],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = [[string(nbr_curves)],[strcat(string(clrs)," ")],[strcat(string(siz)," ")],[string(win)],[sci2exp([])],[sci2exp(wdim)],[strcat(string(vec_x)," ")],[strcat(string(vec_y)," ")],[strcat(string(vec_z)," ")],[strcat(string(param3ds)," ")],[string(N)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
CSCOPXY3D.prototype.details = function CSCOPXY3D() {
}
CSCOPXY3D.prototype.get = function CSCOPXY3D() {
}
CSCOPXY3D.prototype.set = function CSCOPXY3D() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,nbr_curves,clrs,siz,win,wpos,wdim,vec_x,vec_y,vec_z,param3ds,N,exprs]=scicos_getvalue("Set Scope parameters",[["Number of curves"],["color (>0) or mark (<0)"],["Line or Mark Size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin and Xmax"],["Ymin and Ymax"],["Zmin and Zmax"],["Alpha and Theta"],["Buffer size"]],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",2,"vec",2,"vec",2,"vec",2,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,nbr_curves,clrs,siz,win,wpos,wdim,vec_x,vec_y,vec_z,param3ds,N,exprs] = scicos_getvalue("Set Scope parameters",[["Number of curves"],["color (>0) or mark (<0)"],["Line or Mark Size"],["Output window number (-1 for automatic)"],["Output window position"],["Output window sizes"],["Xmin and Xmax"],["Ymin and Ymax"],["Zmin and Zmax"],["Alpha and Theta"],["Buffer size"]],list("vec",1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",2,"vec",2,"vec",2,"vec",2,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
-mess=[[mess],["Window position must be [] or a 2 vector"],[" "]];
-ok=false;
+ mess = [];
+ if (size(wpos,"*")!=0&&size(wpos,"*")!=2) {
+ mess = [[mess],["Window position must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
-mess=[[mess],["Window dim must be [] or a 2 vector"],[" "]];
-ok=false;
+ if (size(wdim,"*")!=0&&size(wdim,"*")!=2) {
+ mess = [[mess],["Window dim must be [] or a 2 vector"],[" "]];
+ ok = false;
}
-if (size(clrs,"*")!=size(siz,"*")) {
-mess=[[mess],["Colors and Size must have same size"],[" "]];
-ok=false;
+ if (size(clrs,"*")!=size(siz,"*")) {
+ mess = [[mess],["Colors and Size must have same size"],[" "]];
+ ok = false;
}
-if (nbr_curves<=0) {
-mess=[[mess],["Number of curves cannot be negative or null"],[" "]];
-ok=false;
+ if (nbr_curves<=0) {
+ mess = [[mess],["Number of curves cannot be negative or null"],[" "]];
+ ok = false;
}
-if (win<-1) {
-mess=[[mess],["Window number cannot be inferior than -1"],[" "]];
-ok=false;
+ if (win<-1) {
+ mess = [[mess],["Window number cannot be inferior than -1"],[" "]];
+ ok = false;
}
-if (N<1) {
-mess=[[mess],["Buffer size must be at least 1"],[" "]];
-ok=false;
+ if (N<1) {
+ mess = [[mess],["Buffer size must be at least 1"],[" "]];
+ ok = false;
}
-if (N<2) {
+ if (N<2) {
for (i=1;i<=size(clrs,"*");i+=1) {
-if (clrs[i-1]>0) {
-mess=[[mess],["Buffer size must be at least 2 or Change a color (must be >0)"],[" "]];
-ok=false;
-}
-}
-}
-if (vec_y[1-1]>=vec_y[2-1]) {
-mess=[[mess],["Ymax must be higher than Ymin"],[" "]];
-ok=false;
-}
-if (vec_x[1-1]>=vec_x[2-1]) {
-mess=[[mess],["Xmax must be higher than Xmin"],[" "]];
-ok=false;
-}
-if (vec_z[1-1]>=vec_z[2-1]) {
-mess=[[mess],["Zmax must be higher than Zmin"],[" "]];
-ok=false;
-}
-if (ok) {
-in1=nbr_curves*ones(3,1);
-in2=ones(3,1);
-[model,graphics,ok]=set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]);
-if (wpos==[]) {
-wpos=[[-1],[-1]];
-}
-if (wdim==[]) {
-wdim=[[-1],[-1]];
-}
-rpar=[[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
-size_siz=size(siz,"*");
-ipar=[[win],[size_siz],[N],[clrs.slice()],[siz.slice()],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (clrs[i-1]>0) {
+ mess = [[mess],["Buffer size must be at least 2 or Change a color (must be >0)"],[" "]];
+ ok = false;
+}
+}
+}
+ if (vec_y[1-1]>=vec_y[2-1]) {
+ mess = [[mess],["Ymax must be higher than Ymin"],[" "]];
+ ok = false;
+}
+ if (vec_x[1-1]>=vec_x[2-1]) {
+ mess = [[mess],["Xmax must be higher than Xmin"],[" "]];
+ ok = false;
+}
+ if (vec_z[1-1]>=vec_z[2-1]) {
+ mess = [[mess],["Zmax must be higher than Zmin"],[" "]];
+ ok = false;
+}
+ if (ok) {
+ in1 = nbr_curves*ones(3,1);
+ in2 = ones(3,1);
+ [model,graphics,ok] = set_io(model,graphics,list([in1,in2],ones(3,1)),list(),ones(1,1),[]);
+ if (wpos==[]) {
+ wpos = [[-1],[-1]];
+}
+ if (wdim==[]) {
+ wdim = [[-1],[-1]];
+}
+ rpar = [[vec_x.slice()],[vec_y.slice()],[vec_z.slice()],[param3ds.slice()]];
+ size_siz = size(siz,"*");
+ ipar = [[win],[size_siz],[N],[clrs.slice()],[siz.slice()],[1],[wpos.slice()],[wdim.slice()],[nbr_curves]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
-} else {
+ } else {
message(mess);
}
}
diff --git a/js/Sinks/OUTIMPL_f.js b/js/Sinks/OUTIMPL_f.js
index ba56dbeb..7bc12dad 100644
--- a/js/Sinks/OUTIMPL_f.js
+++ b/js/Sinks/OUTIMPL_f.js
@@ -1,52 +1,52 @@
/* autogenerated from "macros/Sinks/OUTIMPL_f.sci" */
function OUTIMPL_f() {
OUTIMPL_f.prototype.define = function OUTIMPL_f() {
-model=scicos_model();
-model.in1=[-1];
-model.in2=[1];
-prt=1;
-model.sim="outimpl";
-model.ipar=[1];
-model.blocktype="c";
-model.dep_ut=[false,false];
-mo=modelica();
-mo.model="PORT";
-mo.inputs="n";
-model.equations=mo;
-exprs="1";
-gr_i=[];
-x=standard_define([1,1],model,exprs,gr_i);
-x.graphics.in_implicit=["I"];
+ model = scicos_model();
+ model.in1 = [-1];
+ model.in2 = [1];
+ prt = 1;
+ model.sim = "outimpl";
+ model.ipar = [1];
+ model.blocktype = "c";
+ model.dep_ut = [false,false];
+ mo = modelica();
+ mo.model = "PORT";
+ mo.inputs = "n";
+ model.equations = mo;
+ exprs = "1";
+ gr_i = [];
+ x = standard_define([1,1],model,exprs,gr_i);
+ x.graphics.in_implicit = ["I"];
}
OUTIMPL_f.prototype.details = function OUTIMPL_f() {
}
OUTIMPL_f.prototype.get = function OUTIMPL_f() {
}
OUTIMPL_f.prototype.set = function OUTIMPL_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==2) {
-exprs=exprs[1-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==2) {
+ exprs = exprs[1-1];
}
-while (true) {
-[ok,prt,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"OUTIMPL_f")],[" "],[gettext("Implicit output port")]],gettext("Port number"),list("vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"OUTIMPL_f")],[" "],[gettext("Implicit output port")]],gettext("Port number"),list("vec",1),exprs);
+ if (!ok) {
break;
}
-prt=int(prt);
-if (prt<=0) {
+ prt = int(prt);
+ if (prt<=0) {
block_parameter_error(msprintf(gettext("Wrong value for \'Port Number\' parameter: %d."),prt),gettext("Strictly positive integer expected."));
-} else {
-if (model.ipar!=prt) {
-needcompile=4;
-y=needcompile;
+ } else {
+ if (model.ipar!=prt) {
+ needcompile = 4;
+ y = needcompile;
}
-model.ipar=prt;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.ipar = prt;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/OUT_f.js b/js/Sinks/OUT_f.js
index 0a620928..b2ff10e3 100644
--- a/js/Sinks/OUT_f.js
+++ b/js/Sinks/OUT_f.js
@@ -1,45 +1,45 @@
/* autogenerated from "macros/Sinks/OUT_f.sci" */
function OUT_f() {
OUT_f.prototype.define = function OUT_f() {
-n=-1;
-prt=1;
-model=scicos_model();
-model.sim="output";
-model.in1=-1;
-model.in2=-2;
-model.intyp=-1;
-model.ipar=prt;
-model.blocktype="c";
-model.dep_ut=[false,false];
-exprs=string(prt);
-gr_i=[];
-x=standard_define([1,1],model,exprs,gr_i);
+ n = -1;
+ prt = 1;
+ model = scicos_model();
+ model.sim = "output";
+ model.in1 = -1;
+ model.in2 = -2;
+ model.intyp = -1;
+ model.ipar = prt;
+ model.blocktype = "c";
+ model.dep_ut = [false,false];
+ exprs = string(prt);
+ gr_i = [];
+ x = standard_define([1,1],model,exprs,gr_i);
}
OUT_f.prototype.details = function OUT_f() {
}
OUT_f.prototype.get = function OUT_f() {
}
OUT_f.prototype.set = function OUT_f() {
-x=arg1;
-graphics=arg1.graphics;
-model=arg1.model;
-exprs=graphics.exprs;
-if (size(exprs,"*")==2) {
-exprs=exprs[1-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ model = arg1.model;
+ exprs = graphics.exprs;
+ if (size(exprs,"*")==2) {
+ exprs = exprs[1-1];
}
-while (true) {
-[ok,prt,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"OUT_f")],[" "],[gettext("Regular output port")]],gettext("Port number"),list("vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"OUT_f")],[" "],[gettext("Regular output port")]],gettext("Port number"),list("vec",1),exprs);
+ if (!ok) {
break;
}
-prt=int(prt);
-if (prt<=0) {
+ prt = int(prt);
+ if (prt<=0) {
block_parameter_error(msprintf(gettext("Wrong value for \'Port Number\' parameter: %d."),prt),gettext("Strictly positive integer expected."));
-} else {
-model.ipar=prt;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ model.ipar = prt;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/TOWS_c.js b/js/Sinks/TOWS_c.js
index 59701dd5..d69b9110 100644
--- a/js/Sinks/TOWS_c.js
+++ b/js/Sinks/TOWS_c.js
@@ -1,63 +1,63 @@
/* autogenerated from "macros/Sinks/TOWS_c.sci" */
function TOWS_c() {
TOWS_c.prototype.define = function TOWS_c() {
-nu=-1;
-nz=128;
-varnam="A";
-herit=0;
-model=scicos_model();
-model.sim=list("tows_c",4);
-model.in1=[nu];
-model.in2=-2;
-model.intyp=-1;
-model.out=[];
-model.evtin=[1];
-model.evtout=[];
-model.rpar=[];
-model.ipar=[[nz],[length(varnam)],[transpose(this.ascii[varnam-1])]];
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-gr_i=[];
-exprs=[[string(nz)],[string(varnam)],[string(herit)]];
-x=standard_define([4,2],model,exprs,gr_i);
+ nu = -1;
+ nz = 128;
+ varnam = "A";
+ herit = 0;
+ model = scicos_model();
+ model.sim = list("tows_c",4);
+ model.in1 = [nu];
+ model.in2 = -2;
+ model.intyp = -1;
+ model.out = [];
+ model.evtin = [1];
+ model.evtout = [];
+ model.rpar = [];
+ model.ipar = [[nz],[length(varnam)],[transpose(this.ascii[varnam-1])]];
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ gr_i = [];
+ exprs = [[string(nz)],[string(varnam)],[string(herit)]];
+ x = standard_define([4,2],model,exprs,gr_i);
}
TOWS_c.prototype.details = function TOWS_c() {
}
TOWS_c.prototype.get = function TOWS_c() {
}
TOWS_c.prototype.set = function TOWS_c() {
-x=arg1;
-graphics=arg1.graphics;
-model=arg1.model;
-exprs=graphics.exprs;
-while (true) {
-[ok,nz,varnam,herit,exprs]=scicos_getvalue("Set Xcos buffer block",[["Size of buffer"],["Scilab variable name"],["Inherit (no:0, yes:1)"]],list("vec",1,"str",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ model = arg1.model;
+ exprs = graphics.exprs;
+ while (true) {
+ [ok,nz,varnam,herit,exprs] = scicos_getvalue("Set Xcos buffer block",[["Size of buffer"],["Scilab variable name"],["Inherit (no:0, yes:1)"]],list("vec",1,"str",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if ((nz<=0)) {
+ if ((nz<=0)) {
message("Size of buffer must be positive");
-ok=false;
+ ok = false;
}
-r=false;
-ierr=execstr("r = validvar(varnam)","errcatch");
-if (!r||ierr!=0||length(varnam)>19) {
+ r = false;
+ ierr = execstr("r = validvar(varnam)","errcatch");
+ if (!r||ierr!=0||length(varnam)>19) {
message([["Invalid variable name."],["Please choose another variable name."]]);
-ok=false;
+ ok = false;
}
execstr("if type("+varnam+") <> 17 | or(fieldnames("+varnam+") <> [\"values\"; \"time\"]) then"+" message([\"Protected variable name.\"; \"Please choose another variable name.\"]);"+" ok = %f;"+" end","errcatch");
-if (ok) {
-[model,graphics,ok]=set_io(model,graphics,list([-1,-2],-1),list(),ones(1-herit,1),[]);
-if (herit==1) {
-model.blocktype="x";
-} else {
-model.blocktype="d";
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list([-1,-2],-1),list(),ones(1-herit,1),[]);
+ if (herit==1) {
+ model.blocktype = "x";
+ } else {
+ model.blocktype = "d";
}
-model.ipar=[[nz],[length(varnam)],[transpose(this.ascii[varnam-1])]];
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.ipar = [[nz],[length(varnam)],[transpose(this.ascii[varnam-1])]];
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/TRASH_f.js b/js/Sinks/TRASH_f.js
index 00fb8452..691a96af 100644
--- a/js/Sinks/TRASH_f.js
+++ b/js/Sinks/TRASH_f.js
@@ -1,22 +1,22 @@
/* autogenerated from "macros/Sinks/TRASH_f.sci" */
function TRASH_f() {
TRASH_f.prototype.define = function TRASH_f() {
-in1=-1;
-model=scicos_model();
-model.sim="trash";
-model.in1=in1;
-model.evtin=1;
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = "trash";
+ model.in1 = in1;
+ model.evtin = 1;
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
TRASH_f.prototype.details = function TRASH_f() {
}
TRASH_f.prototype.get = function TRASH_f() {
}
TRASH_f.prototype.set = function TRASH_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/Sinks/WFILE_f.js b/js/Sinks/WFILE_f.js
index 85b4c901..9acdb952 100644
--- a/js/Sinks/WFILE_f.js
+++ b/js/Sinks/WFILE_f.js
@@ -1,23 +1,23 @@
/* autogenerated from "macros/Sinks/WFILE_f.sci" */
function WFILE_f() {
WFILE_f.prototype.define = function WFILE_f() {
-in1=1;
-nin=sum(in1);
-frmt="(7(e10.3,1x))";
-fname="foo";
-lunit=0;
-N=2;
-model=scicos_model();
-model.sim="writef";
-model.in1=in1;
-model.evtin=1;
-model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[length(frmt)],[0],[N],[this._str2code[fname-1]],[this._str2code[frmt-1]]];
-model.blocktype="d";
-model.dep_ut=[true,false];
-exprs=[[sci2exp(in1)],[fname],[frmt],[string(N)]];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ in1 = 1;
+ nin = sum(in1);
+ frmt = "(7(e10.3,1x))";
+ fname = "foo";
+ lunit = 0;
+ N = 2;
+ model = scicos_model();
+ model.sim = "writef";
+ model.in1 = in1;
+ model.evtin = 1;
+ model.dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
+ model.ipar = [[length(fname)],[length(frmt)],[0],[N],[this._str2code[fname-1]],[this._str2code[frmt-1]]];
+ model.blocktype = "d";
+ model.dep_ut = [true,false];
+ exprs = [[sci2exp(in1)],[fname],[frmt],[string(N)]];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
WFILE_f.prototype.details = function WFILE_f() {
}
@@ -25,64 +25,64 @@ x=standard_define([3,2],model,exprs,gr_i);
}
WFILE_f.prototype.set = function WFILE_f() {
warnobsolete("WRITEC_f","6.0.0");
-warnMessage=msprintf(_("Feature %s is obsolete."),"WFILE_f");
-warnAdvise=msprintf(_("Please use %s instead."),"WRITEC_f");
-warnXcosMessage=msprintf("%s %s",warnMessage,warnAdvise);
+ warnMessage = msprintf(_("Feature %s is obsolete."),"WFILE_f");
+ warnAdvise = msprintf(_("Please use %s instead."),"WRITEC_f");
+ warnXcosMessage = msprintf("%s %s",warnMessage,warnAdvise);
warnBlockByUID(arg1.model.label,warnXcosMessage);
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-dstate=model.dstate;
-lunit=dstate[2-1];
-fname=exprs[2-1];
-frmt=exprs[3-1];
-while (true) {
-[ok,in1,fname1,frmt1,N,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WFILE_f")],[" "],[gettext("Write to output file")],[" "],[gettext("Write is done on:")],[gettext("&nbsp; - A binary file if no format given")],[gettext("&nbsp; - A formatted text file if a format (Fortran type) is given")]],[[gettext("Input Size")],[gettext("Output File Name")],[gettext("Output Format")],[gettext("Buffer Size")]],list("vec",1,"str",1,"str",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ dstate = model.dstate;
+ lunit = dstate[2-1];
+ fname = exprs[2-1];
+ frmt = exprs[3-1];
+ while (true) {
+ [ok,in1,fname1,frmt1,N,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WFILE_f")],[" "],[gettext("Write to output file")],[" "],[gettext("Write is done on:")],[gettext("&nbsp; - A binary file if no format given")],[gettext("&nbsp; - A formatted text file if a format (Fortran type) is given")]],[[gettext("Input Size")],[gettext("Output File Name")],[gettext("Output Format")],[gettext("Buffer Size")]],list("vec",1,"str",1,"str",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-in1=int(in1);
-nin=in1;
-fname1=pathconvert(stripblanks(fname1),false,true);
-frmt1=stripblanks(frmt1);
-if (lunit>0&&min(length(frmt),1)!=min(length(frmt1),1)) {
+ in1 = int(in1);
+ nin = in1;
+ fname1 = pathconvert(stripblanks(fname1),false,true);
+ frmt1 = stripblanks(frmt1);
+ if (lunit>0&&min(length(frmt),1)!=min(length(frmt1),1)) {
block_parameter_error(gettext("Simulation running !!! You cannot switch<br />between formatted and unformatted when running"),gettext("End current simulation first."));
-ok=false;
-} else if (lunit>0&&fname1!=fname) {
+ ok = false;
+ } else if (lunit>0&&fname1!=fname) {
block_parameter_error(gettext("You cannot modify \'Output File Name\' when running."),gettext("End current simulation first."));
-ok=false;
-} else if (fname1=="") {
+ ok = false;
+ } else if (fname1=="") {
block_parameter_error(gettext("Wrong value for \'Output File Name\' parameter"),gettext("You must provide a filename."));
-ok=false;
-} else if (fileparts(fname1)!="") {
-[pa,fn,ex]=fileparts(fname1);
-if (!this.isdir[pa-1]) {
+ ok = false;
+ } else if (fileparts(fname1)!="") {
+ [pa,fn,ex] = fileparts(fname1);
+ if (!this.isdir[pa-1]) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),msprintf(gettext("Directory \'%s\' does not exist"),pa));
-ok=false;
+ ok = false;
}
-} else if (frmt1!=""&&(part(frmt1,1)!="("||part(frmt1,length(frmt1))!=")")) {
+ } else if (frmt1!=""&&(part(frmt1,1)!="("||part(frmt1,length(frmt1))!=")")) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),frmt1),gettext("You must enclose the format\'s string between parentheses."));
-ok=false;
-} else if (N<2) {
+ ok = false;
+ } else if (N<2) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),N),gettext("Must be greater than 1."));
-ok=false;
-} else if (in1<=0) {
+ ok = false;
+ } else if (in1<=0) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Input Size"),in1),gettext("Strictly positive integer expected."));
-ok=false;
+ ok = false;
}
-if (ok) {
-ipar=[[length(fname1)],[length(frmt1)],[0],[N],[this._str2code[fname1-1]],[this._str2code[frmt1-1]]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
-dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
+ if (ok) {
+ ipar = [[length(fname1)],[length(frmt1)],[0],[N],[this._str2code[fname1-1]],[this._str2code[frmt1-1]]];
+ if (prod(size(dstate))!=(nin+1)*N+2) {
+ dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
}
-model.in1=nin;
-model.dstate=dstate;
-model.ipar=ipar;
-model.dep_ut=[true,false];
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.in1 = nin;
+ model.dstate = dstate;
+ model.ipar = ipar;
+ model.dep_ut = [true,false];
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/WRITEAU_f.js b/js/Sinks/WRITEAU_f.js
index b4bbafec..847a2140 100644
--- a/js/Sinks/WRITEAU_f.js
+++ b/js/Sinks/WRITEAU_f.js
@@ -1,67 +1,67 @@
/* autogenerated from "macros/Sinks/WRITEAU_f.sci" */
function WRITEAU_f() {
WRITEAU_f.prototype.define = function WRITEAU_f() {
-in1=1;
-nin=sum(in1);
-frmt="uc ";
-fname="/dev/audio";
-swap=0;
-lunit=0;
-N=2;
-model=scicos_model();
-model.sim=list("writeau",2);
-model.in1=in1;
-model.evtin=1;
-model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[this._str2code[frmt-1]],[N],[swap],[this._str2code[fname-1]]];
-model.blocktype="d";
-model.dep_ut=[true,false];
-exprs=[string(N),string(swap)];
-gr_i=[];
-x=standard_define([4,2],model,exprs,gr_i);
+ in1 = 1;
+ nin = sum(in1);
+ frmt = "uc ";
+ fname = "/dev/audio";
+ swap = 0;
+ lunit = 0;
+ N = 2;
+ model = scicos_model();
+ model.sim = list("writeau",2);
+ model.in1 = in1;
+ model.evtin = 1;
+ model.dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
+ model.ipar = [[length(fname)],[this._str2code[frmt-1]],[N],[swap],[this._str2code[fname-1]]];
+ model.blocktype = "d";
+ model.dep_ut = [true,false];
+ exprs = [string(N),string(swap)];
+ gr_i = [];
+ x = standard_define([4,2],model,exprs,gr_i);
}
WRITEAU_f.prototype.details = function WRITEAU_f() {
}
WRITEAU_f.prototype.get = function WRITEAU_f() {
}
WRITEAU_f.prototype.set = function WRITEAU_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-ipar=model.ipar;
-dstate=model.dstate;
-lunit=dstate[2-1];
-while (true) {
-[ok,N,swap,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WRITEAU_f")],[" "],[gettext("Write \'.au\' sound file on audio device")]],[[gettext("Buffer Size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ ipar = model.ipar;
+ dstate = model.dstate;
+ lunit = dstate[2-1];
+ while (true) {
+ [ok,N,swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WRITEAU_f")],[" "],[gettext("Write \'.au\' sound file on audio device")]],[[gettext("Buffer Size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-nin=1;
-fname1="/dev/audio";
-frmt1="uc ";
-if (this.alreadyran&&(N!=ipar[5-1])) {
+ nin = 1;
+ fname1 = "/dev/audio";
+ frmt1 = "uc ";
+ if (this.alreadyran&&(N!=ipar[5-1])) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first"));
-ok=false;
-} else if (N<1) {
+ ok = false;
+ } else if (N<1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),N),gettext("Strictly positive integer expected."));
-ok=false;
+ ok = false;
}
-if (swap!=0&&swap!=1) {
+ if (swap!=0&&swap!=1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
-ok=false;
+ ok = false;
}
-if (ok) {
-ipar=[[length(fname1)],[this._str2code[frmt1-1]],[N],[swap],[this._str2code[fname1-1]]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
-dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
+ if (ok) {
+ ipar = [[length(fname1)],[this._str2code[frmt1-1]],[N],[swap],[this._str2code[fname1-1]]];
+ if (prod(size(dstate))!=(nin+1)*N+2) {
+ dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
}
-model.in1=1;
-model.dstate=dstate;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.in1 = 1;
+ model.dstate = dstate;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Sinks/WRITEC_f.js b/js/Sinks/WRITEC_f.js
index baaa2687..dfe9db07 100644
--- a/js/Sinks/WRITEC_f.js
+++ b/js/Sinks/WRITEC_f.js
@@ -1,88 +1,88 @@
/* autogenerated from "macros/Sinks/WRITEC_f.sci" */
function WRITEC_f() {
WRITEC_f.prototype.define = function WRITEC_f() {
-in1=1;
-nin=sum(in1);
-frmt="c ";
-fname="foo";
-swap=0;
-lunit=0;
-N=2;
-model=scicos_model();
-model.sim=list("writec",2);
-model.in1=in1;
-model.evtin=1;
-model.dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
-model.ipar=[[length(fname)],[this._str2code[frmt-1]],[N],[swap],[this._str2code[fname-1]]];
-model.blocktype="d";
-model.dep_ut=[true,false];
-exprs=[[sci2exp(in1)],[fname],[frmt],[string(N),string(swap)]];
-gr_i=[];
-x=standard_define([4,2],model,exprs,gr_i);
+ in1 = 1;
+ nin = sum(in1);
+ frmt = "c ";
+ fname = "foo";
+ swap = 0;
+ lunit = 0;
+ N = 2;
+ model = scicos_model();
+ model.sim = list("writec",2);
+ model.in1 = in1;
+ model.evtin = 1;
+ model.dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
+ model.ipar = [[length(fname)],[this._str2code[frmt-1]],[N],[swap],[this._str2code[fname-1]]];
+ model.blocktype = "d";
+ model.dep_ut = [true,false];
+ exprs = [[sci2exp(in1)],[fname],[frmt],[string(N),string(swap)]];
+ gr_i = [];
+ x = standard_define([4,2],model,exprs,gr_i);
}
WRITEC_f.prototype.details = function WRITEC_f() {
}
WRITEC_f.prototype.get = function WRITEC_f() {
}
WRITEC_f.prototype.set = function WRITEC_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-ipar=model.ipar;
-dstate=model.dstate;
-lunit=dstate[2-1];
-fname=exprs[2-1];
-frmt=exprs[3-1];
-while (true) {
-[ok,in1,fname1,frmt1,N,swap,exprs]=scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WRITEC_f")],[" "],[gettext("Write to C binary file")]],[[gettext("Input Size")],[gettext("Output File Name")],[gettext("Output Format")],[gettext("Buffer Size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",1,"str",1,"str",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ ipar = model.ipar;
+ dstate = model.dstate;
+ lunit = dstate[2-1];
+ fname = exprs[2-1];
+ frmt = exprs[3-1];
+ while (true) {
+ [ok,in1,fname1,frmt1,N,swap,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"WRITEC_f")],[" "],[gettext("Write to C binary file")]],[[gettext("Input Size")],[gettext("Output File Name")],[gettext("Output Format")],[gettext("Buffer Size")],[gettext("Swap Mode (0:No, 1:Yes)")]],list("vec",1,"str",1,"str",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-in1=int(in1);
-nin=in1;
-fname1=pathconvert(stripblanks(fname1),false,true);
-frmt1=stripblanks(frmt1);
-fmts=["s","l","d","f","c","us","ul","uc","ull","uls","ubl","ubs","dl","fl","ll","sl","db","fb","lb","sb"];
-if (and(frmt1!=fmts)) {
+ in1 = int(in1);
+ nin = in1;
+ fname1 = pathconvert(stripblanks(fname1),false,true);
+ frmt1 = stripblanks(frmt1);
+ fmts = ["s","l","d","f","c","us","ul","uc","ull","uls","ubl","ubs","dl","fl","ll","sl","db","fb","lb","sb"];
+ if (and(frmt1!=fmts)) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),frmt1),gettext("Valid formats are: "+strcat(fmts,", ")));
-ok=false;
-} else if (this.alreadyran&&fname1!=fname) {
+ ok = false;
+ } else if (this.alreadyran&&fname1!=fname) {
block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running"),gettext("Input Format")),gettext("End current simulation first."));
-ok=false;
-} else if (this.alreadyran&&N!=ipar[5-1]) {
+ ok = false;
+ } else if (this.alreadyran&&N!=ipar[5-1]) {
block_parameter_error(msprintf(gettext("You cannot modify \'Buffer Size\' when running."),gettext("Buffer Size")),gettext("End current simulation first"));
-ok=false;
-} else if (fname1=="") {
+ ok = false;
+ } else if (fname1=="") {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),gettext("You must provide a filename."));
-} else if (fileparts(fname1)!="") {
-[pa,fn,ex]=fileparts(fname1);
-if (!this.isdir[pa-1]) {
+ } else if (fileparts(fname1)!="") {
+ [pa,fn,ex] = fileparts(fname1);
+ if (!this.isdir[pa-1]) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Output File Name")),msprintf(gettext("Directory \'%s\' does not exist"),pa));
-ok=false;
+ ok = false;
}
-} else if (N<1) {
+ } else if (N<1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),N),gettext("Strictly positive integer expected."));
-ok=false;
-} else if (in1<=0) {
+ ok = false;
+ } else if (in1<=0) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Input Size"),in1),gettext("Strictly positive integer expected."));
-ok=false;
-} else if (swap!=0&&swap!=1) {
+ ok = false;
+ } else if (swap!=0&&swap!=1) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
-ok=false;
+ ok = false;
}
-frmt1=part(frmt1,1,3);
-if (ok) {
-ipar=[[length(fname1)],[this._str2code[frmt1-1]],[N],[swap],[this._str2code[fname1-1]]];
-if (prod(size(dstate))!=(nin+1)*N+2) {
-dstate=[[-1],[lunit],[zeros((nin+1)*N,1)]];
+ frmt1 = part(frmt1,1,3);
+ if (ok) {
+ ipar = [[length(fname1)],[this._str2code[frmt1-1]],[N],[swap],[this._str2code[fname1-1]]];
+ if (prod(size(dstate))!=(nin+1)*N+2) {
+ dstate = [[-1],[lunit],[zeros((nin+1)*N,1)]];
}
-model.in1=nin;
-model.dstate=dstate;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.in1 = nin;
+ model.dstate = dstate;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}