summaryrefslogtreecommitdiff
path: root/js/Misc
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/Misc
parent870479a2e4b932426a904b2ebae7e4ee72037326 (diff)
downloadsci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2
sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip
separate out code for getvalue
Diffstat (limited to 'js/Misc')
-rw-r--r--js/Misc/AUTOMAT.js188
-rw-r--r--js/Misc/BACKLASH.js60
-rw-r--r--js/Misc/BOUNCE.js150
-rw-r--r--js/Misc/BOUNCEXY.js136
-rw-r--r--js/Misc/BPLATFORM.js86
-rw-r--r--js/Misc/CBLOCK.js194
-rw-r--r--js/Misc/CBLOCK4.js158
-rw-r--r--js/Misc/CONSTRAINT2_c.js90
-rw-r--r--js/Misc/CONSTRAINT_c.js64
-rw-r--r--js/Misc/DEADBAND.js70
-rw-r--r--js/Misc/DEBUG.js50
-rw-r--r--js/Misc/DEBUG_SCICOS.js6
-rw-r--r--js/Misc/DIFF_f.js46
-rw-r--r--js/Misc/DSUPER.js58
-rw-r--r--js/Misc/EDGETRIGGER.js48
-rw-r--r--js/Misc/EDGE_TRIGGER.js244
-rw-r--r--js/Misc/ENDBLK.js104
-rw-r--r--js/Misc/Extract_Activation.js164
-rw-r--r--js/Misc/HYSTHERESIS.js64
-rw-r--r--js/Misc/IMPSPLIT_f.js26
-rw-r--r--js/Misc/LOGICAL_OP.js164
-rw-r--r--js/Misc/MBLOCK.js342
-rw-r--r--js/Misc/MEMORY_f.js74
-rw-r--r--js/Misc/MPBLOCK.js328
-rw-r--r--js/Misc/PAL_f.js36
-rw-r--r--js/Misc/PENDULUM_ANIM.js86
-rw-r--r--js/Misc/RATELIMITER.js54
-rw-r--r--js/Misc/RELATIONALOP.js138
-rw-r--r--js/Misc/SPLIT_f.js16
-rw-r--r--js/Misc/SUPER_f.js38
-rw-r--r--js/Misc/TEXT_f.js90
-rw-r--r--js/Misc/c_block.js106
-rw-r--r--js/Misc/fortran_block.js88
-rw-r--r--js/Misc/func_block.js40
-rw-r--r--js/Misc/generic_block.js140
-rw-r--r--js/Misc/generic_block2.js144
-rw-r--r--js/Misc/generic_block3.js144
-rw-r--r--js/Misc/scifunc_block.js140
-rw-r--r--js/Misc/scifunc_block_m.js146
39 files changed, 2160 insertions, 2160 deletions
diff --git a/js/Misc/AUTOMAT.js b/js/Misc/AUTOMAT.js
index 284a982b..b46f9ce9 100644
--- a/js/Misc/AUTOMAT.js
+++ b/js/Misc/AUTOMAT.js
@@ -1,132 +1,132 @@
/* autogenerated from "macros/Misc/AUTOMAT.sci" */
function AUTOMAT() {
AUTOMAT.prototype.define = function AUTOMAT() {
-NMode=2;
-this.Minitial=1;
-NX=1;
-this.X0=[0.0];
-this.XP=[[1],[1]];
-C1=[2];
-C2=[1];
-exprs=[[string(NMode)],[string(this.Minitial)],[string(NX)],[sci2exp(this.X0)],[sci2exp(this.XP)],[sci2exp(C1)],[sci2exp(C2)]];
-ipar=[[NMode],[this.Minitial],[NX],[this.XP],[C1],[C2]];
-rpar=[this.X0];
-model=scicos_model();
-model.sim=list("automat",10004);
-model.in1=[[2*NX+1],[2*NX+1]];
-model.out=[[2],[2*NX]];
-model.state=ones(2*NX,1);
-model.nzcross=1;
-model.blocktype="c";
-model.evtout=1;
-model.firing=-1;
-model.dep_ut=[false,true];
-model.ipar=ipar;
-model.rpar=rpar;
-gr_i=[];
-x=standard_define([4,2],model,exprs,gr_i);
+ NMode = 2;
+ this.Minitial = 1;
+ NX = 1;
+ this.X0 = [0.0];
+ this.XP = [[1],[1]];
+ C1 = [2];
+ C2 = [1];
+ exprs = [[string(NMode)],[string(this.Minitial)],[string(NX)],[sci2exp(this.X0)],[sci2exp(this.XP)],[sci2exp(C1)],[sci2exp(C2)]];
+ ipar = [[NMode],[this.Minitial],[NX],[this.XP],[C1],[C2]];
+ rpar = [this.X0];
+ model = scicos_model();
+ model.sim = list("automat",10004);
+ model.in1 = [[2*NX+1],[2*NX+1]];
+ model.out = [[2],[2*NX]];
+ model.state = ones(2*NX,1);
+ model.nzcross = 1;
+ model.blocktype = "c";
+ model.evtout = 1;
+ model.firing = -1;
+ model.dep_ut = [false,true];
+ model.ipar = ipar;
+ model.rpar = rpar;
+ gr_i = [];
+ x = standard_define([4,2],model,exprs,gr_i);
}
AUTOMAT.prototype.details = function AUTOMAT() {
}
AUTOMAT.prototype.get = function AUTOMAT() {
}
AUTOMAT.prototype.set = function AUTOMAT() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-ipar=model.ipar;
-NMode=ipar[1-1];
-NX=ipar[3-1];
-while (true) {
-CX="C1";
-MSG0="\'Jump from Mode ";
-MSG2=":[..;M_final(Guard=In(";
-MSG3=").i);..]\'";
-MSG=MSG0+"1"+MSG2+"1"+MSG3;
-VEC="\'mat\',[-1,1]";
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ ipar = model.ipar;
+ NMode = ipar[1-1];
+ NX = ipar[3-1];
+ while (true) {
+ CX = "C1";
+ MSG0 = "\'Jump from Mode ";
+ MSG2 = ":[..;M_final(Guard=In(";
+ MSG3 = ").i);..]\'";
+ MSG = MSG0+"1"+MSG2+"1"+MSG3;
+ VEC = "\'mat\',[-1,1]";
for (i=2;i<=NMode;i+=1) {
-CX=CX+","+"C"+string(i);
-MSG=MSG+";"+MSG0+string(i)+MSG2+string(i)+MSG3;
-VEC=VEC+","+"\'mat\',[-1,1]";
+ CX = CX+","+"C"+string(i);
+ MSG = MSG+";"+MSG0+string(i)+MSG2+string(i)+MSG3;
+ VEC = VEC+","+"\'mat\',[-1,1]";
}
-GTV="[ok,NMode,Minitial,NX,X0,XP,"+CX+",exprs]=scicos_getvalue(\'Set Finite state machine model\', [\'Number (finite-state) Modes\';\'Initial Mode\';\'Number of continuous-time states\';\'Continuous-time states intial values\';\'Xproperties of continuous-time states in each Mode\';"+MSG+"], list(\'vec\',1,\'vec\',1,\'vec\',1,\'mat\',[-1,-1],\'mat\',[-1,-1],"+VEC+"),exprs)";
+ GTV = "[ok,NMode,Minitial,NX,X0,XP,"+CX+",exprs]=scicos_getvalue(\'Set Finite state machine model\', [\'Number (finite-state) Modes\';\'Initial Mode\';\'Number of continuous-time states\';\'Continuous-time states intial values\';\'Xproperties of continuous-time states in each Mode\';"+MSG+"], list(\'vec\',1,\'vec\',1,\'vec\',1,\'mat\',[-1,-1],\'mat\',[-1,-1],"+VEC+"),exprs)";
execstr(GTV);
-if (!this.ok) {
+ if (!this.ok) {
break;
}
-NMode_old=size(exprs,"*")-5;
-ModifEncore=false;
-if ((NMode_old>NMode)) {
-exprs.slice(NMode+6-1,NMode_old+5)=[];
-ModifEncore=true;
+ NMode_old = size(exprs,"*")-5;
+ ModifEncore = false;
+ if ((NMode_old>NMode)) {
+ exprs.slice(NMode+6-1,NMode_old+5) = [];
+ ModifEncore = true;
}
-if ((NMode_old<NMode)) {
-exprs.slice(NMode_old+6-1,NMode+5)=exprs[NMode_old+4-1];
-ModifEncore=true;
+ if ((NMode_old<NMode)) {
+ exprs.slice(NMode_old+6-1,NMode+5) = exprs[NMode_old+4-1];
+ ModifEncore = true;
}
-if ((NX!=size(this.X0,"*"))) {
+ if ((NX!=size(this.X0,"*"))) {
messagebox("the size of intial continuous-time states should be NX="+string(NX),"modal","error");
-ModifEncore=true;
+ ModifEncore = true;
}
-[rXP,cXP]=size(this.XP);
-if (cXP!=NX) {
+ [rXP,cXP] = size(this.XP);
+ if (cXP!=NX) {
messagebox("Xproperty matrix is not valid: it should have NX="+string(NX)+" columns","modal","error");
-ModifEncore=true;
-} else if (((rXP!=NMode)&&(rXP>1))) {
+ ModifEncore = true;
+ } else if (((rXP!=NMode)&&(rXP>1))) {
messagebox("Xproperty matrix is not valid: it should have NMode="+string(NMode)+" or 1 row(s)","modal","error");
-ModifEncore=true;
-} else if ((rXP==1)) {
+ ModifEncore = true;
+ } else if ((rXP==1)) {
for (i=1;i<=NMode-1;i+=1) {
-this.XP=[[this.XP],[this.XP[1-1].slice()]];
+ this.XP = [[this.XP],[this.XP[1-1].slice()]];
}
}
-if ((NMode_old==NMode)&&(!ModifEncore)) {
-this.XP=matrix(transpose(this.XP),NMode*NX,1);
-ipar=[[NMode],[this.Minitial],[NX],[this.XP]];
-rpar=matrix(this.X0,NX,1);
-INP=ones(NMode,1);
-if (NX>0) {
-OUT=[[2],[2*NX]];
-} else {
-OUT=[2];
+ if ((NMode_old==NMode)&&(!ModifEncore)) {
+ this.XP = matrix(transpose(this.XP),NMode*NX,1);
+ ipar = [[NMode],[this.Minitial],[NX],[this.XP]];
+ rpar = matrix(this.X0,NX,1);
+ INP = ones(NMode,1);
+ if (NX>0) {
+ OUT = [[2],[2*NX]];
+ } else {
+ OUT = [2];
}
-MaxModes=1;
-nzcross=0;
+ MaxModes = 1;
+ nzcross = 0;
for (i=1;i<=NMode;i+=1) {
-Ci=evstr(exprs[5+i-1]);
-ipar=[[ipar],[Ci]];
-INP[i-1][1-1]=2*NX+length(Ci);
-if ((nzcross<length(Ci))) {
-nzcross=length(Ci);
+ Ci = evstr(exprs[5+i-1]);
+ ipar = [[ipar],[Ci]];
+ INP[i-1][1-1] = 2*NX+length(Ci);
+ if ((nzcross<length(Ci))) {
+ nzcross = length(Ci);
}
-if ((MaxModes<max(Ci))) {
-MaxModes=max(Ci);
-imax=i;
+ if ((MaxModes<max(Ci))) {
+ MaxModes = max(Ci);
+ imax = i;
}
}
-if (MaxModes>NMode) {
+ if (MaxModes>NMode) {
messagebox([["Number of Modes should be "+string(MaxModes)],["A destination Mode in Mode#"+string(imax)+"\'s targets is invalid!"]],"modal","error");
-ModifEncore=true;
+ ModifEncore = true;
}
-if (MaxModes<NMode) {
+ if (MaxModes<NMode) {
messagebox(["There is an unused Mode or the Number of Modes should be "+string(MaxModes)],"modal","error");
-ModifEncore=true;
+ ModifEncore = true;
}
}
-if (!ModifEncore) {
-[model,graphics,this.ok]=check_io(model,graphics,INP,OUT,[],[1]);
-if (!this.ok) {
+ if (!ModifEncore) {
+ [model,graphics,this.ok] = check_io(model,graphics,INP,OUT,[],[1]);
+ if (!this.ok) {
break;
}
-model.nzcross=nzcross;
-model.state=ones(2*NX,1);
-graphics.gr_i[1-1][1-1]="txt=[\'Automaton\';\'nM="+string(NMode)+",nX="+string(NX)+"\'];";
-graphics.exprs=exprs;
-x.graphics=graphics;
-model.ipar=ipar;
-model.rpar=rpar;
-x.model=model;
+ model.nzcross = nzcross;
+ model.state = ones(2*NX,1);
+ graphics.gr_i[1-1][1-1] = "txt=[\'Automaton\';\'nM="+string(NMode)+",nX="+string(NX)+"\'];";
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ model.ipar = ipar;
+ model.rpar = rpar;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/BACKLASH.js b/js/Misc/BACKLASH.js
index a8f07cf1..bea4e1af 100644
--- a/js/Misc/BACKLASH.js
+++ b/js/Misc/BACKLASH.js
@@ -1,45 +1,45 @@
/* autogenerated from "macros/Misc/BACKLASH.sci" */
function BACKLASH() {
BACKLASH.prototype.define = function BACKLASH() {
-exprs=[["0"],["1"],["1"]];
-model=scicos_model();
-model.sim=list("backlash",4);
-model.in1=1;
-model.out=1;
-model.rpar=[[0],[1]];
-model.nzcross=2;
-model.blocktype="c";
-model.dep_ut=[true,false];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ exprs = [["0"],["1"],["1"]];
+ model = scicos_model();
+ model.sim = list("backlash",4);
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = [[0],[1]];
+ model.nzcross = 2;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
BACKLASH.prototype.details = function BACKLASH() {
}
BACKLASH.prototype.get = function BACKLASH() {
}
BACKLASH.prototype.set = function BACKLASH() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-rpar=model.rpar;
-while (true) {
-[ok,ini,gap,zcr,exprs]=scicos_getvalue("Set backlash parameters",[["initial output"],["gap"],["use zero-crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ rpar = model.rpar;
+ while (true) {
+ [ok,ini,gap,zcr,exprs] = scicos_getvalue("Set backlash parameters",[["initial output"],["gap"],["use zero-crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (ok) {
-graphics.exprs=exprs;
-rpar[1-1]=ini;
-rpar[2-1]=gap;
-if (zcr!=0) {
-model.nzcross=2;
-} else {
-model.nzcross=0;
+ if (ok) {
+ graphics.exprs = exprs;
+ rpar[1-1] = ini;
+ rpar[2-1] = gap;
+ if (zcr!=0) {
+ model.nzcross = 2;
+ } else {
+ model.nzcross = 0;
}
-model.rpar=rpar;
-x.graphics=graphics;
-x.model=model;
+ model.rpar = rpar;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js
index 580b3272..465860d4 100644
--- a/js/Misc/BOUNCE.js
+++ b/js/Misc/BOUNCE.js
@@ -1,105 +1,105 @@
/* autogenerated from "macros/Misc/BOUNCE.sci" */
function BOUNCE() {
BOUNCE.prototype.define = function BOUNCE() {
-n=2;
-k=1;
-ipar=[];
+ n = 2;
+ k = 1;
+ ipar = [];
for (i=1;i<=n;i+=1) {
for (j=i+1;j<=n;j+=1) {
-ipar[k-1]=i;
-k=k+1;
-ipar[k-1]=j;
-k=k+1;
+ ipar[k-1] = i;
+ k = k+1;
+ ipar[k-1] = j;
+ k = k+1;
}
}
-walls=[[0],[5],[0],[5]];
-x=[[2],[2.5]];
-xd=[[0],[0]];
-y=[[3],[5]];
-yd=[[0],[0]];
-g=9.81;
-C=0;
-rpar1=ones(n,1);
-rpar2=rpar1;
-state=[x,xd,y,yd];
-state=transpose(state);
-model=scicos_model();
-model.sim=list("bounce_ball",4);
-model.in1=[];
-model.out=[[n],[n]];
-model.state=state.slice();
-model.rpar=[[rpar1],[rpar2],[walls],[g],[C]];
-model.ipar=ipar;
-model.nzcross=n*(n-1)/2+4*n;
-model.blocktype="c";
-model.dep_ut=[false,true];
-exprs=[[strcat(sci2exp(rpar1))],[strcat(sci2exp(rpar2))],[strcat(sci2exp(walls))],[strcat(sci2exp(x))],[strcat(sci2exp(xd))],[strcat(sci2exp(y))],[strcat(sci2exp(yd))]];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ walls = [[0],[5],[0],[5]];
+ x = [[2],[2.5]];
+ xd = [[0],[0]];
+ y = [[3],[5]];
+ yd = [[0],[0]];
+ g = 9.81;
+ C = 0;
+ rpar1 = ones(n,1);
+ rpar2 = rpar1;
+ state = [x,xd,y,yd];
+ state = transpose(state);
+ model = scicos_model();
+ model.sim = list("bounce_ball",4);
+ model.in1 = [];
+ model.out = [[n],[n]];
+ model.state = state.slice();
+ model.rpar = [[rpar1],[rpar2],[walls],[g],[C]];
+ model.ipar = ipar;
+ model.nzcross = n*(n-1)/2+4*n;
+ model.blocktype = "c";
+ model.dep_ut = [false,true];
+ exprs = [[strcat(sci2exp(rpar1))],[strcat(sci2exp(rpar2))],[strcat(sci2exp(walls))],[strcat(sci2exp(x))],[strcat(sci2exp(xd))],[strcat(sci2exp(y))],[strcat(sci2exp(yd))]];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
BOUNCE.prototype.details = function BOUNCE() {
}
BOUNCE.prototype.get = function BOUNCE() {
}
BOUNCE.prototype.set = function BOUNCE() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")<9) {
-exprs[8-1]="9.81";
-exprs[9-1]="0";
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")<9) {
+ exprs[8-1] = "9.81";
+ exprs[9-1] = "0";
}
-while (true) {
-[ok,rpar1,rpar2,walls,xt,xd,y,yd,g,C,exprs]=scicos_getvalue(["Set Bounce Block"],[["Mass"],["Radius"],["[xmin,xmax,ymin,ymax]"],["xpos"],["xdpos"],["ypos"],["ydpos"],["g (gravity)"],["C (aerodynamic coeff"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,rpar1,rpar2,walls,xt,xd,y,yd,g,C,exprs] = scicos_getvalue(["Set Bounce Block"],[["Mass"],["Radius"],["[xmin,xmax,ymin,ymax]"],["xpos"],["xdpos"],["ypos"],["ydpos"],["g (gravity)"],["C (aerodynamic coeff"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-xt=xt.slice();
-y=y.slice();
-xd=xd.slice();
-yd=yd.slice();
-rpar1=rpar1.slice();
-rpar2=rpar2.slice();
-n=size(xt,"*");
-walls=walls.slice();
-if (walls[1-1]>walls[2-1]) {
-walls=walls[[2,1]-1];
+ xt = xt.slice();
+ y = y.slice();
+ xd = xd.slice();
+ yd = yd.slice();
+ rpar1 = rpar1.slice();
+ rpar2 = rpar2.slice();
+ n = size(xt,"*");
+ walls = walls.slice();
+ if (walls[1-1]>walls[2-1]) {
+ walls = walls[[2,1]-1];
}
-if (walls[3-1]>walls[3-1]) {
-walls=walls[[3,4]-1];
+ if (walls[3-1]>walls[3-1]) {
+ walls = walls[[3,4]-1];
}
-if (n!=size(y,"*")||n!=size(rpar1,"*")||n!=size(rpar2,"*")||n!=size(xd,"*")||n!=size(yd,"*")) {
+ if (n!=size(y,"*")||n!=size(rpar1,"*")||n!=size(rpar2,"*")||n!=size(xd,"*")||n!=size(yd,"*")) {
message("All vectors must have equal size");
-ok=false;
-} else if (!(min([[rpar1],[rpar2]])>0)) {
+ ok = false;
+ } else if (!(min([[rpar1],[rpar2]])>0)) {
message("Mass and radius must be >0");
-ok=false;
+ ok = false;
}
-if (!ok) {
+ if (!ok) {
break;
}
-[model,graphics,ok]=check_io(model,graphics,[],[n,n],[],[]);
-if (ok) {
-k=1;
-ipar=[];
+ [model,graphics,ok] = check_io(model,graphics,[],[n,n],[],[]);
+ if (ok) {
+ k = 1;
+ ipar = [];
for (i=1;i<=n;i+=1) {
for (j=i+1;j<=n;j+=1) {
-ipar[k-1]=i;
-k=k+1;
-ipar[k-1]=j;
-k=k+1;
+ ipar[k-1] = i;
+ k = k+1;
+ ipar[k-1] = j;
+ k = k+1;
}
}
-model.rpar=[[rpar1],[rpar2],[walls],[g],[C]];
-model.ipar=ipar;
-state=[xt,xd,y,yd];
-state=transpose(state);
-model.state=state.slice();
-model.nzcross=n*(n-1)/2+4*n;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.rpar = [[rpar1],[rpar2],[walls],[g],[C]];
+ model.ipar = ipar;
+ state = [xt,xd,y,yd];
+ state = transpose(state);
+ model.state = state.slice();
+ model.nzcross = n*(n-1)/2+4*n;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/BOUNCEXY.js b/js/Misc/BOUNCEXY.js
index 18a0174c..f8845bfc 100644
--- a/js/Misc/BOUNCEXY.js
+++ b/js/Misc/BOUNCEXY.js
@@ -1,91 +1,91 @@
/* autogenerated from "macros/Misc/BOUNCEXY.sci" */
function BOUNCEXY() {
BOUNCEXY.prototype.define = function BOUNCEXY() {
-win=-1;
-imode=1;
-clrs=[[1],[2]];
-siz=[[1],[1]];
-xmin=-5;
-xmax=5;
-ymin=0;
-ymax=15;
-model=scicos_model();
-model.sim=list("bouncexy",4);
-model.in1=[[-1],[-1]];
-model.in2=[[1],[1]];
-model.intyp=[[1],[1]];
-model.evtin=1;
-z=[];
+ win = -1;
+ imode = 1;
+ clrs = [[1],[2]];
+ siz = [[1],[1]];
+ xmin = -5;
+ xmax = 5;
+ ymin = 0;
+ ymax = 15;
+ model = scicos_model();
+ model.sim = list("bouncexy",4);
+ model.in1 = [[-1],[-1]];
+ model.in2 = [[1],[1]];
+ model.intyp = [[1],[1]];
+ model.evtin = 1;
+ z = [];
for (i=1;i<=size(clrs,"*");i+=1) {
-z[6*(i-1)+1-1]=0;
-z[6*(i-1)+2-1]=0;
-z[6*(i-1)+3-1]=2*siz[i-1];
-z[6*(i-1)+4-1]=2*siz[i-1];
-z[6*(i-1)+5-1]=0.000;
-z[6*(i-1)+6-1]=64.0*360.000;
+ z[6*(i-1)+1-1] = 0;
+ z[6*(i-1)+2-1] = 0;
+ z[6*(i-1)+3-1] = 2*siz[i-1];
+ z[6*(i-1)+4-1] = 2*siz[i-1];
+ z[6*(i-1)+5-1] = 0.000;
+ z[6*(i-1)+6-1] = 64.0*360.000;
}
-model.dstate=z;
-model.rpar=[[xmin],[xmax],[ymin],[ymax]];
-model.ipar=[[win],[imode],[clrs.slice()]];
-model.blocktype="d";
-model.firing=[];
-model.dep_ut=[false,false];
-exprs=[[strcat(sci2exp(clrs))],[strcat(sci2exp(siz))],[strcat(sci2exp(win))],[strcat(sci2exp(1))],[strcat(sci2exp(xmin))],[strcat(sci2exp(xmax))],[strcat(sci2exp(ymin))],[strcat(sci2exp(ymax))]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ model.dstate = z;
+ model.rpar = [[xmin],[xmax],[ymin],[ymax]];
+ model.ipar = [[win],[imode],[clrs.slice()]];
+ model.blocktype = "d";
+ model.firing = [];
+ model.dep_ut = [false,false];
+ exprs = [[strcat(sci2exp(clrs))],[strcat(sci2exp(siz))],[strcat(sci2exp(win))],[strcat(sci2exp(1))],[strcat(sci2exp(xmin))],[strcat(sci2exp(xmax))],[strcat(sci2exp(ymin))],[strcat(sci2exp(ymax))]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
BOUNCEXY.prototype.details = function BOUNCEXY() {
}
BOUNCEXY.prototype.get = function BOUNCEXY() {
}
BOUNCEXY.prototype.set = function BOUNCEXY() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-dstate=model.dstate;
-while (true) {
-[ok,clrs,siz,win,imode,xmin,xmax,ymin,ymax,exprs]=scicos_getvalue("Set Scope parameters",[["colors"],["radii"],["window number (-1 for automatic)"],["animation mode (0,1)"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("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;
+ dstate = model.dstate;
+ while (true) {
+ [ok,clrs,siz,win,imode,xmin,xmax,ymin,ymax,exprs] = scicos_getvalue("Set Scope parameters",[["colors"],["radii"],["window number (-1 for automatic)"],["animation mode (0,1)"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("vec",-1,"vec",-1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (size(clrs,"*")!=size(siz,"*")) {
-mess=[[mess],["colors and radii must have equal size (number of balls)"],[" "]];
-ok=false;
+ mess = [];
+ if (size(clrs,"*")!=size(siz,"*")) {
+ mess = [[mess],["colors and radii must have equal size (number of balls)"],[" "]];
+ 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 (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 {
-rpar=[[xmin],[xmax],[ymin],[ymax]];
-ipar=[[win],[imode],[clrs.slice()]];
-z=[];
+ } else {
+ rpar = [[xmin],[xmax],[ymin],[ymax]];
+ ipar = [[win],[imode],[clrs.slice()]];
+ z = [];
for (i=1;i<=size(clrs,"*");i+=1) {
-z[6*(i-1)+1-1]=0;
-z[6*(i-1)+2-1]=0;
-z[6*(i-1)+3-1]=2*siz[i-1];
-z[6*(i-1)+4-1]=2*siz[i-1];
-z[6*(i-1)+5-1]=0.000;
-z[6*(i-1)+6-1]=64.0*360.000;
+ z[6*(i-1)+1-1] = 0;
+ z[6*(i-1)+2-1] = 0;
+ z[6*(i-1)+3-1] = 2*siz[i-1];
+ z[6*(i-1)+4-1] = 2*siz[i-1];
+ z[6*(i-1)+5-1] = 0.000;
+ z[6*(i-1)+6-1] = 64.0*360.000;
}
-model.dstate=z;
-model.rpar=rpar;
-model.ipar=ipar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.dstate = z;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/BPLATFORM.js b/js/Misc/BPLATFORM.js
index eddd8902..b0a0a517 100644
--- a/js/Misc/BPLATFORM.js
+++ b/js/Misc/BPLATFORM.js
@@ -1,61 +1,61 @@
/* autogenerated from "macros/Misc/BPLATFORM.sci" */
function BPLATFORM() {
BPLATFORM.prototype.define = function BPLATFORM() {
-plen=2;
-csiz=2;
-phi=0;
-xmin=-5;
-xmax=5;
-ymin=0;
-ymax=15;
-model=scicos_model();
-model.sim=list("bplatform2",5);
-model.in1=[[1],[1]];
-model.evtin=1;
-model.dstate=0;
-model.rpar=[[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=string(model.rpar);
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ plen = 2;
+ csiz = 2;
+ phi = 0;
+ xmin = -5;
+ xmax = 5;
+ ymin = 0;
+ ymax = 15;
+ model = scicos_model();
+ model.sim = list("bplatform2",5);
+ model.in1 = [[1],[1]];
+ model.evtin = 1;
+ model.dstate = 0;
+ model.rpar = [[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = string(model.rpar);
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
BPLATFORM.prototype.details = function BPLATFORM() {
}
BPLATFORM.prototype.get = function BPLATFORM() {
}
BPLATFORM.prototype.set = function BPLATFORM() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-dstate=model.dstate;
-while (true) {
-[ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=scicos_getvalue("Set Scope parameters",[["pendulum length"],["cart size (square side)"],["slope"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("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;
+ dstate = model.dstate;
+ while (true) {
+ [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs] = scicos_getvalue("Set Scope parameters",[["pendulum length"],["cart size (square side)"],["slope"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (plen<=0||csiz<=0) {
-mess=[[mess],["Pendulum length and cart size must be positive."],[" "]];
-ok=false;
+ mess = [];
+ if (plen<=0||csiz<=0) {
+ mess = [[mess],["Pendulum length and cart size must be positive."],[" "]];
+ 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 {
-rpar=[[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
-model.rpar=rpar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ rpar = [[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
+ model.rpar = rpar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js
index 8e3eb3ad..42f8c884 100644
--- a/js/Misc/CBLOCK.js
+++ b/js/Misc/CBLOCK.js
@@ -1,126 +1,126 @@
/* autogenerated from "macros/Misc/CBLOCK.sci" */
function CBLOCK() {
CBLOCK.prototype.define = function CBLOCK() {
-in1=1;
-out=1;
-clkin=[];
-clkout=[];
-x0=[];
-z0=[];
-typ="c";
-auto=[];
-rpar=[];
-ipar=[];
-funam="toto";
-ng=0;
-model=scicos_model();
-model.sim=list(" ",2004);
-model.in1=in1;
-model.out=out;
-model.evtin=clkin;
-model.evtout=clkout;
-model.state=x0;
-model.dstate=z0;
-model.rpar=rpar;
-model.ipar=ipar;
-model.blocktype=typ;
-model.firing=auto;
-model.dep_ut=[true,false];
-model.nzcross=ng;
-label=list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(rpar),sci2exp(ipar),sci2exp(auto),"y","n"]),[]);
-gr_i=[];
-x=standard_define([4,2],model,label,gr_i);
+ in1 = 1;
+ out = 1;
+ clkin = [];
+ clkout = [];
+ x0 = [];
+ z0 = [];
+ typ = "c";
+ auto = [];
+ rpar = [];
+ ipar = [];
+ funam = "toto";
+ ng = 0;
+ model = scicos_model();
+ model.sim = list(" ",2004);
+ model.in1 = in1;
+ model.out = out;
+ model.evtin = clkin;
+ model.evtout = clkout;
+ model.state = x0;
+ model.dstate = z0;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.blocktype = typ;
+ model.firing = auto;
+ model.dep_ut = [true,false];
+ model.nzcross = ng;
+ label = list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(rpar),sci2exp(ipar),sci2exp(auto),"y","n"]),[]);
+ gr_i = [];
+ x = standard_define([4,2],model,label,gr_i);
}
CBLOCK.prototype.details = function CBLOCK() {
}
CBLOCK.prototype.get = function CBLOCK() {
}
CBLOCK.prototype.set = function CBLOCK() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-while (true) {
-[ok,function_name,impli,i,o,ci,co,xx,ng,z,rpar,ipar,auto0,depu,dept,lab]=scicos_getvalue("Set C-Block2 block parameters",[["simulation function"],["is block implicit? (y,n)"],["input ports sizes"],["output ports sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["number of zero crossing surfaces"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"str",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label[1-1]);
-if (!ok) {
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ while (true) {
+ [ok,function_name,impli,i,o,ci,co,xx,ng,z,rpar,ipar,auto0,depu,dept,lab] = scicos_getvalue("Set C-Block2 block parameters",[["simulation function"],["is block implicit? (y,n)"],["input ports sizes"],["output ports sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["number of zero crossing surfaces"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"str",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label[1-1]);
+ if (!ok) {
break;
}
-label[1-1]=lab;
-funam=stripblanks(function_name);
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-ipar=int(ipar.slice());
-nx=size(xx,1);
-nz=size(z,1);
-i=int(i.slice());
-o=int(o.slice());
-nout=size(o,1);
-ci=int(ci.slice());
-nevin=size(ci,1);
-co=int(co.slice());
-nevout=size(co,1);
-if (part(impli,1)=="y") {
-funtyp=12004;
-} else {
-funtyp=2004;
+ label[1-1] = lab;
+ funam = stripblanks(function_name);
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ ipar = int(ipar.slice());
+ nx = size(xx,1);
+ nz = size(z,1);
+ i = int(i.slice());
+ o = int(o.slice());
+ nout = size(o,1);
+ ci = int(ci.slice());
+ nevin = size(ci,1);
+ co = int(co.slice());
+ nevout = size(co,1);
+ if (part(impli,1)=="y") {
+ funtyp = 12004;
+ } else {
+ funtyp = 2004;
}
-if ([[ci],[co]]!=[]) {
-if (max([[ci],[co]])>1) {
+ if ([[ci],[co]]!=[]) {
+ if (max([[ci],[co]])>1) {
message("vector event links not supported");
-ok=false;
+ ok = false;
}
}
-depu=stripblanks(depu);
-if (part(depu,1)=="y") {
-depu=true;
-} else {
-depu=false;
+ depu = stripblanks(depu);
+ if (part(depu,1)=="y") {
+ depu = true;
+ } else {
+ depu = false;
}
-dept=stripblanks(dept);
-if (part(dept,1)=="y") {
-dept=true;
-} else {
-dept=false;
+ dept = stripblanks(dept);
+ if (part(dept,1)=="y") {
+ dept = true;
+ } else {
+ dept = false;
}
-dep_ut=[depu,dept];
-if (funam==" ") {
+ dep_ut = [depu,dept];
+ if (funam==" ") {
break;
}
-if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=ng||sign(size(model.evtout,"*"))!=sign(nevout)) {
-tt=[];
+ if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=ng||sign(size(model.evtout,"*"))!=sign(nevout)) {
+ tt = [];
}
-tt=label[2-1];
-while (true) {
-[ok,tt,cancel]=CFORTR2(funam,tt);
-if (!ok) {
-if (cancel) {
+ tt = label[2-1];
+ while (true) {
+ [ok,tt,cancel] = CFORTR2(funam,tt);
+ if (!ok) {
+ if (cancel) {
break;
}
-} else {
-[model,graphics,ok]=check_io(model,graphics,i,o,ci,co);
-if (ok) {
-model.sim=list(funam,funtyp);
-model.in1=i;
-model.out=o;
-model.evtin=ci;
-model.evtout=co;
-model.state=xx;
-model.dstate=z;
-model.rpar=rpar;
-model.ipar=ipar;
-model.firing=auto0;
-model.dep_ut=dep_ut;
-model.nzcross=ng;
-label[2-1]=tt;
-x.model=model;
-graphics.exprs=label;
-x.graphics=graphics;
+ } else {
+ [model,graphics,ok] = check_io(model,graphics,i,o,ci,co);
+ if (ok) {
+ model.sim = list(funam,funtyp);
+ model.in1 = i;
+ model.out = o;
+ model.evtin = ci;
+ model.evtout = co;
+ model.state = xx;
+ model.dstate = z;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.firing = auto0;
+ model.dep_ut = dep_ut;
+ model.nzcross = ng;
+ label[2-1] = tt;
+ x.model = model;
+ graphics.exprs = label;
+ x.graphics = graphics;
break;
}
}
}
-if (ok||cancel) {
+ if (ok||cancel) {
break;
}
}
diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js
index f375d946..92b58837 100644
--- a/js/Misc/CBLOCK4.js
+++ b/js/Misc/CBLOCK4.js
@@ -1,107 +1,107 @@
/* autogenerated from "macros/Misc/CBLOCK4.sci" */
function CBLOCK4() {
CBLOCK4.prototype.define = function CBLOCK4() {
-funam="toto";
-model=scicos_model();
-model.sim=list(" ",2004);
-model.in1=1;
-model.in2=1;
-model.intyp=1;
-model.out=1;
-model.out2=1;
-model.outtyp=1;
-model.dep_ut=[true,false];
-label=list([[funam],["n"],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2])],[sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]],[]);
-gr_i=[];
-x=standard_define([4,2],model,label,gr_i);
+ funam = "toto";
+ model = scicos_model();
+ model.sim = list(" ",2004);
+ model.in1 = 1;
+ model.in2 = 1;
+ model.intyp = 1;
+ model.out = 1;
+ model.out2 = 1;
+ model.outtyp = 1;
+ model.dep_ut = [true,false];
+ label = list([[funam],["n"],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2])],[sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]],[]);
+ gr_i = [];
+ x = standard_define([4,2],model,label,gr_i);
}
CBLOCK4.prototype.details = function CBLOCK4() {
}
CBLOCK4.prototype.get = function CBLOCK4() {
}
CBLOCK4.prototype.set = function CBLOCK4() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-while (true) {
-[ok,function_name,impli,in1,it,out,ot,ci,co,xx,z,oz,rpar,ipar,opar,nmode,nzcr,auto0,depu,dept,lab]=scicos_getvalue("Set C-Block4 block parameters",[["Simulation function"],["Is block implicit? (y,n)"],["Input ports sizes"],["Input ports type"],["Output port sizes"],["Output ports type"],["Input event ports sizes"],["Output events ports sizes"],["Initial continuous state"],["Initial discrete state"],["Initial object state"],["Real parameters vector"],["Integer parameters vector"],["Object parameters list"],["Number of modes"],["Number of zero crossings"],["Initial firing vector (<0 for no firing)"],["Direct feedthrough (y or n)"],["Time dependence (y or n)"]],list("str",1,"str",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label[1-1]);
-if (!ok) {
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ while (true) {
+ [ok,function_name,impli,in1,it,out,ot,ci,co,xx,z,oz,rpar,ipar,opar,nmode,nzcr,auto0,depu,dept,lab] = scicos_getvalue("Set C-Block4 block parameters",[["Simulation function"],["Is block implicit? (y,n)"],["Input ports sizes"],["Input ports type"],["Output port sizes"],["Output ports type"],["Input event ports sizes"],["Output events ports sizes"],["Initial continuous state"],["Initial discrete state"],["Initial object state"],["Real parameters vector"],["Integer parameters vector"],["Object parameters list"],["Number of modes"],["Number of zero crossings"],["Initial firing vector (<0 for no firing)"],["Direct feedthrough (y or n)"],["Time dependence (y or n)"]],list("str",1,"str",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label[1-1]);
+ if (!ok) {
break;
}
-label[1-1]=lab;
-funam=stripblanks(function_name);
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-ipar=int(ipar.slice());
-nx=size(xx,1);
-nz=size(z,1);
-ci=int(ci.slice());
-nevin=size(ci,1);
-co=int(co.slice());
-nevout=size(co,1);
-if (part(impli,1)=="y") {
-funtyp=12004;
-} else {
-funtyp=2004;
-}
-if ([[ci],[co]]!=[]) {
-if (max([[ci],[co]])>1) {
+ label[1-1] = lab;
+ funam = stripblanks(function_name);
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ ipar = int(ipar.slice());
+ nx = size(xx,1);
+ nz = size(z,1);
+ ci = int(ci.slice());
+ nevin = size(ci,1);
+ co = int(co.slice());
+ nevout = size(co,1);
+ if (part(impli,1)=="y") {
+ funtyp = 12004;
+ } else {
+ funtyp = 2004;
+}
+ if ([[ci],[co]]!=[]) {
+ if (max([[ci],[co]])>1) {
message("vector event links not supported");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-depu=stripblanks(depu);
-if (part(depu,1)=="y") {
-depu=true;
-} else {
-depu=false;
+ if (ok) {
+ depu = stripblanks(depu);
+ if (part(depu,1)=="y") {
+ depu = true;
+ } else {
+ depu = false;
}
-dept=stripblanks(dept);
-if (part(dept,1)=="y") {
-dept=true;
-} else {
-dept=false;
+ dept = stripblanks(dept);
+ if (part(dept,1)=="y") {
+ dept = true;
+ } else {
+ dept = false;
}
-dep_ut=[depu,dept];
-if (funam==" ") {
+ dep_ut = [depu,dept];
+ if (funam==" ") {
break;
}
-if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=nzcr||sign(size(model.evtout,"*"))!=sign(nevout)) {
-tt=[];
+ if (model.sim[1-1]!=funam||sign(size(model.state,"*"))!=sign(nx)||sign(size(model.dstate,"*"))!=sign(nz)||model.nzcross!=nzcr||sign(size(model.evtout,"*"))!=sign(nevout)) {
+ tt = [];
}
-tt=label[2-1];
-[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ci,co);
+ tt = label[2-1];
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ci,co);
}
-if (ok) {
-while (true) {
-[ok,tt,cancel]=this.CC4[funam-1][tt-1];
-if (!ok) {
-if (cancel) {
+ if (ok) {
+ while (true) {
+ [ok,tt,cancel] = this.CC4[funam-1][tt-1];
+ if (!ok) {
+ if (cancel) {
break;
}
-} else {
-model.sim=list(funam,funtyp);
-model.state=xx;
-model.dstate=z;
-model.odstate=oz;
-model.rpar=rpar;
-model.ipar=ipar;
-model.opar=opar;
-model.firing=auto0;
-model.nzcross=nzcr;
-model.nmode=nmode;
-model.dep_ut=dep_ut;
-label[2-1]=tt;
-x.model=model;
-graphics.exprs=label;
-x.graphics=graphics;
+ } else {
+ model.sim = list(funam,funtyp);
+ model.state = xx;
+ model.dstate = z;
+ model.odstate = oz;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.opar = opar;
+ model.firing = auto0;
+ model.nzcross = nzcr;
+ model.nmode = nmode;
+ model.dep_ut = dep_ut;
+ label[2-1] = tt;
+ x.model = model;
+ graphics.exprs = label;
+ x.graphics = graphics;
break;
}
}
-if (ok||cancel) {
+ if (ok||cancel) {
break;
}
}
diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js
index d0f0a2ca..4d755545 100644
--- a/js/Misc/CONSTRAINT2_c.js
+++ b/js/Misc/CONSTRAINT2_c.js
@@ -1,70 +1,70 @@
/* autogenerated from "macros/Misc/CONSTRAINT2_c.sci" */
function CONSTRAINT2_c() {
CONSTRAINT2_c.prototype.define = function CONSTRAINT2_c() {
-x0=[0];
-xd0=[0];
-id=[0];
-model=scicos_model();
-model.sim=list("constraint_c",10004);
-model.in1=1;
-model.out=[[1],[1]];
-model.state=[[x0],[xd0]];
-model.ipar=id;
-model.blocktype="c";
-model.dep_ut=[false,true];
-exprs=list(strcat(sci2exp(x0)),strcat(sci2exp(xd0)),strcat(sci2exp(id)));
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ x0 = [0];
+ xd0 = [0];
+ id = [0];
+ model = scicos_model();
+ model.sim = list("constraint_c",10004);
+ model.in1 = 1;
+ model.out = [[1],[1]];
+ model.state = [[x0],[xd0]];
+ model.ipar = id;
+ model.blocktype = "c";
+ model.dep_ut = [false,true];
+ exprs = list(strcat(sci2exp(x0)),strcat(sci2exp(xd0)),strcat(sci2exp(id)));
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
CONSTRAINT2_c.prototype.details = function CONSTRAINT2_c() {
}
CONSTRAINT2_c.prototype.get = function CONSTRAINT2_c() {
}
CONSTRAINT2_c.prototype.set = function CONSTRAINT2_c() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-ask_again=false;
-[ok,x0,xd0,id,exprs]=scicos_getvalue("Set Constraint block parameters",[["Initial guess values of states x"],["Initial guess values of derivative x\'"],["Id(i)=1: if x\'(i) is present in the feedback, else Id(i)=0"]],list("vec",-1,"vec",-1,"vec",-1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ ask_again = false;
+ [ok,x0,xd0,id,exprs] = scicos_getvalue("Set Constraint block parameters",[["Initial guess values of states x"],["Initial guess values of derivative x\'"],["Id(i)=1: if x\'(i) is present in the feedback, else Id(i)=0"]],list("vec",-1,"vec",-1,"vec",-1),exprs);
+ if (!ok) {
break;
}
-x0=x0.slice();
-N=size(x0,"*");
-xd0=xd0.slice();
-Nxd=size(xd0,"*");
-id=id.slice();
-Nid=size(id,"*");
-if ((N!=Nxd)||(N!=Nid)) {
+ x0 = x0.slice();
+ N = size(x0,"*");
+ xd0 = xd0.slice();
+ Nxd = size(xd0,"*");
+ id = id.slice();
+ Nid = size(id,"*");
+ if ((N!=Nxd)||(N!=Nid)) {
message("incompatible sizes, states, their derivatives, and ID should be the same size ");
-ask_again=true;
+ ask_again = true;
}
-if ((N<=0&&!ask_again)) {
+ if ((N<=0&&!ask_again)) {
x_message("number of states (constraints) must be > 0 ");
-ask_again=true;
+ ask_again = true;
}
-if ((!ask_again)) {
+ if ((!ask_again)) {
for (i=1;i<=N;i+=1) {
-if (!((id[i-1]==0)||(id[i-1]==1))) {
-ask_again=true;
+ if (!((id[i-1]==0)||(id[i-1]==1))) {
+ ask_again = true;
x_message([["Id(i) must be either"],["0 when x\'(i) is not present in the feedback"],["1: when x\'(i) is present in the feedback"]]);
break;
}
-if ((id[i-1]==0)) {
-id[i-1]=-1;
+ if ((id[i-1]==0)) {
+ id[i-1] = -1;
}
}
}
-if (!ask_again) {
-graphics.exprs=exprs;
-model.state=[[x0],[xd0]];
-model.out=[[N],[N]];
-model.in1=N;
-model.ipar=id;
-x.graphics=graphics;
-x.model=model;
+ if (!ask_again) {
+ graphics.exprs = exprs;
+ model.state = [[x0],[xd0]];
+ model.out = [[N],[N]];
+ model.in1 = N;
+ model.ipar = id;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/CONSTRAINT_c.js b/js/Misc/CONSTRAINT_c.js
index 53ec7ebd..40deaf9c 100644
--- a/js/Misc/CONSTRAINT_c.js
+++ b/js/Misc/CONSTRAINT_c.js
@@ -1,47 +1,47 @@
/* autogenerated from "macros/Misc/CONSTRAINT_c.sci" */
function CONSTRAINT_c() {
CONSTRAINT_c.prototype.define = function CONSTRAINT_c() {
-x0=[[0],[0]];
-model=scicos_model();
-model.sim=list("constraint_c",10004);
-model.in1=1;
-model.out=1;
-model.ipar=0;
-model.state=x0;
-model.blocktype="c";
-model.dep_ut=[false,true];
-exprs="0";
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ x0 = [[0],[0]];
+ model = scicos_model();
+ model.sim = list("constraint_c",10004);
+ model.in1 = 1;
+ model.out = 1;
+ model.ipar = 0;
+ model.state = x0;
+ model.blocktype = "c";
+ model.dep_ut = [false,true];
+ exprs = "0";
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
CONSTRAINT_c.prototype.details = function CONSTRAINT_c() {
}
CONSTRAINT_c.prototype.get = function CONSTRAINT_c() {
}
CONSTRAINT_c.prototype.set = function CONSTRAINT_c() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,x0,exprs]=scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,x0,exprs] = scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),exprs);
+ if (!ok) {
break;
}
-x0=x0.slice();
-N=size(x0,"*");
-if (N<=0) {
+ x0 = x0.slice();
+ N = size(x0,"*");
+ if (N<=0) {
message("number of states (constraints) must be > 0 ");
-} else {
-[model,graphics,ok]=check_io(model,graphics,N,N,[],[]);
-if (ok) {
-graphics.exprs=exprs;
-model.state=[[x0],[zeros(N,1)]];
-model.out=N;
-model.in1=N;
-model.ipar=-1*ones(N,1);
-x.graphics=graphics;
-x.model=model;
+ } else {
+ [model,graphics,ok] = check_io(model,graphics,N,N,[],[]);
+ if (ok) {
+ graphics.exprs = exprs;
+ model.state = [[x0],[zeros(N,1)]];
+ model.out = N;
+ model.in1 = N;
+ model.ipar = -1*ones(N,1);
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js
index e4cb6a10..c83ce6aa 100644
--- a/js/Misc/DEADBAND.js
+++ b/js/Misc/DEADBAND.js
@@ -1,51 +1,51 @@
/* autogenerated from "macros/Misc/DEADBAND.sci" */
function DEADBAND() {
DEADBAND.prototype.define = function DEADBAND() {
-minp=-.5;
-maxp=.5;
-rpar=[[maxp],[minp]];
-model=scicos_model();
-model.sim=list("deadband",4);
-model.in1=1;
-model.nzcross=2;
-model.nmode=1;
-model.out=1;
-model.rpar=rpar;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(maxp)],[string(minp)],[string(model.nmode)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ minp = -.5;
+ maxp = .5;
+ rpar = [[maxp],[minp]];
+ model = scicos_model();
+ model.sim = list("deadband",4);
+ model.in1 = 1;
+ model.nzcross = 2;
+ model.nmode = 1;
+ model.out = 1;
+ model.rpar = rpar;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(maxp)],[string(minp)],[string(model.nmode)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
DEADBAND.prototype.details = function DEADBAND() {
}
DEADBAND.prototype.get = function DEADBAND() {
}
DEADBAND.prototype.set = function DEADBAND() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,maxp,minp,zeroc,exprs]=scicos_getvalue("Set Deadband parameters",[["End of dead band"],["Start of dead band"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,maxp,minp,zeroc,exprs] = scicos_getvalue("Set Deadband parameters",[["End of dead band"],["Start of dead band"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (maxp<=minp) {
+ if (maxp<=minp) {
message("Upper limit must be > Lower limit");
-} else {
-rpar=[[maxp],[minp]];
-model.rpar=rpar;
-if (zeroc!=0) {
-model.nzcross=2;
-model.nmode=1;
-} else {
-model.nzcross=0;
-model.nmode=0;
+ } else {
+ rpar = [[maxp],[minp]];
+ model.rpar = rpar;
+ if (zeroc!=0) {
+ model.nzcross = 2;
+ model.nmode = 1;
+ } else {
+ model.nzcross = 0;
+ model.nmode = 0;
}
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js
index 8b2bf634..5ea59058 100644
--- a/js/Misc/DEBUG.js
+++ b/js/Misc/DEBUG.js
@@ -1,48 +1,48 @@
/* autogenerated from "macros/Misc/DEBUG.sci" */
function DEBUG() {
DEBUG.prototype.define = function DEBUG() {
-model=scicos_model();
-model.sim=list("%debug_scicos",99);
-model.blocktype="d";
-exprs=list("","xcos_debug_gui(flag,block);");
-gr_i=[];
-x=standard_define([8,2],model,exprs,gr_i);
+ model = scicos_model();
+ model.sim = list("%debug_scicos",99);
+ model.blocktype = "d";
+ exprs = list("","xcos_debug_gui(flag,block);");
+ gr_i = [];
+ x = standard_define([8,2],model,exprs,gr_i);
}
DEBUG.prototype.details = function DEBUG() {
}
DEBUG.prototype.get = function DEBUG() {
}
DEBUG.prototype.set = function DEBUG() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-textmp=exprs[2-1];
-ok=true;
-while (1==1) {
-[txt]=this.dialog[[["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]]-1][textmp-1];
-if (txt!=[]) {
-tt=["block=debug_scicos(block,flag)"];
-if (execstr("deff(tt,txt)","errcatch")==0) {
-warnMode=warning("query");
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ textmp = exprs[2-1];
+ ok = true;
+ while (1==1) {
+ [txt] = this.dialog[[["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]]-1][textmp-1];
+ if (txt!=[]) {
+ tt = ["block=debug_scicos(block,flag)"];
+ if (execstr("deff(tt,txt)","errcatch")==0) {
+ warnMode = warning("query");
warning("off");
save(this.TMPDIR+"/debug_scicos",this.debug_scicos);
warning(warnMode);
-exprs[2-1]=txt;
-if ((scicos_debug()!=2&&scicos_debug()!=3)) {
+ exprs[2-1] = txt;
+ if ((scicos_debug()!=2&&scicos_debug()!=3)) {
scicos_debug(2);
}
break;
-} else {
+ } else {
message([["Error in the instructions"],[lasterror()]]);
}
-} else {
-ok=false;
+ } else {
+ ok = false;
break;
}
}
-if (ok) {
-graphics.exprs=exprs;
-x.graphics=graphics;
+ if (ok) {
+ graphics.exprs = exprs;
+ x.graphics = graphics;
}
}
}
diff --git a/js/Misc/DEBUG_SCICOS.js b/js/Misc/DEBUG_SCICOS.js
index fdc690a8..dba81ebc 100644
--- a/js/Misc/DEBUG_SCICOS.js
+++ b/js/Misc/DEBUG_SCICOS.js
@@ -1,14 +1,14 @@
/* autogenerated from "macros/Misc/DEBUG_SCICOS.sci" */
function DEBUG_SCICOS() {
DEBUG_SCICOS.prototype.define = function DEBUG_SCICOS() {
-x=DEBUG("define");
+ x = DEBUG("define");
}
DEBUG_SCICOS.prototype.details = function DEBUG_SCICOS() {
}
DEBUG_SCICOS.prototype.get = function DEBUG_SCICOS() {
}
DEBUG_SCICOS.prototype.set = function DEBUG_SCICOS() {
-arg1.gui="DEBUG";
-[x,y,typ]=DEBUG("set",arg1);
+ arg1.gui = "DEBUG";
+ [x,y,typ] = DEBUG("set",arg1);
}
}
diff --git a/js/Misc/DIFF_f.js b/js/Misc/DIFF_f.js
index 1d5279f3..ee0cd582 100644
--- a/js/Misc/DIFF_f.js
+++ b/js/Misc/DIFF_f.js
@@ -1,38 +1,38 @@
/* autogenerated from "macros/Misc/DIFF_f.sci" */
function DIFF_f() {
DIFF_f.prototype.define = function DIFF_f() {
-x0=[[0],[0]];
-model=scicos_model();
-model.sim=list("diffblk",10001);
-model.in1=1;
-model.out=1;
-model.state=x0;
-model.blocktype="c";
-model.dep_ut=[false,true];
-exprs=[[strcat(sci2exp(x0[1-1]))],[strcat(sci2exp(x0[2-1]))]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ x0 = [[0],[0]];
+ model = scicos_model();
+ model.sim = list("diffblk",10001);
+ model.in1 = 1;
+ model.out = 1;
+ model.state = x0;
+ model.blocktype = "c";
+ model.dep_ut = [false,true];
+ exprs = [[strcat(sci2exp(x0[1-1]))],[strcat(sci2exp(x0[2-1]))]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
DIFF_f.prototype.details = function DIFF_f() {
}
DIFF_f.prototype.get = function DIFF_f() {
}
DIFF_f.prototype.set = function DIFF_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,x0,xd0,exprs]=scicos_getvalue("Set continuous linear system parameters",[["Initial state"],["Initial Derivative"]],list("vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,x0,xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",[["Initial state"],["Initial Derivative"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-graphics.exprs=exprs;
-model.state=[[x0.slice()],[xd0.slice()]];
-x.graphics=graphics;
-x.model=model;
+ graphics.exprs = exprs;
+ model.state = [[x0.slice()],[xd0.slice()]];
+ x.graphics = graphics;
+ x.model = model;
break;
}
-x.model.firing=[];
+ x.model.firing = [];
}
}
diff --git a/js/Misc/DSUPER.js b/js/Misc/DSUPER.js
index 00dad0ab..7835a291 100644
--- a/js/Misc/DSUPER.js
+++ b/js/Misc/DSUPER.js
@@ -7,45 +7,45 @@ function DSUPER() {
DSUPER.prototype.get = function DSUPER() {
}
DSUPER.prototype.set = function DSUPER() {
-y=this.needcompile;
-typ=list();
-graphics=arg1.graphics;
-if ((length(graphics.exprs)==0)) {
+ y = this.needcompile;
+ typ = list();
+ graphics = arg1.graphics;
+ if ((length(graphics.exprs)==0)) {
warnBlockByUID(arg1.model.label,gettext("Invalid masked block."));
-x=arg1;
+ x = arg1;
return;
}
-exprs=graphics.exprs[1-1];
-exprs0=graphics.exprs[2-1][1-1];
-btitre=graphics.exprs[2-1][2-1][1-1];
-bitems=graphics.exprs[2-1][2-1].slice(2-1,$);
-if (exprs0==[]) {
-x=arg1;
+ exprs = graphics.exprs[1-1];
+ exprs0 = graphics.exprs[2-1][1-1];
+ btitre = graphics.exprs[2-1][2-1][1-1];
+ bitems = graphics.exprs[2-1][2-1].slice(2-1,$);
+ if (exprs0==[]) {
+ x = arg1;
return;
}
-context=[arg1.model.rpar.props.context];
-[PREVAR_scicos_context,ierr]=script2var(context,PREVAR_scicos_context);
-if (ierr!=0) {
-x=arg1;
+ context = [arg1.model.rpar.props.context];
+ [PREVAR_scicos_context,ierr] = script2var(context,PREVAR_scicos_context);
+ if (ierr!=0) {
+ x = arg1;
return;
}
-tt="scicos_context."+exprs0[1-1];
+ tt = "scicos_context."+exprs0[1-1];
for (i=2;i<=size(exprs0,1);i+=1) {
-tt=tt+",scicos_context."+exprs0[i-1];
+ tt = tt+",scicos_context."+exprs0[i-1];
}
-ss=graphics.exprs[2-1][3-1];
-scicos_context=PREVAR_scicos_context;
+ ss = graphics.exprs[2-1][3-1];
+ scicos_context = PREVAR_scicos_context;
execstr("[ok,"+tt+",exprs]=scicos_getvalue(btitre,bitems,ss,exprs)");
-if (this.ok) {
-x=arg1;
-PREVAR_scicos_context=scicos_context;
-sblock=x.model.rpar;
-[sblock,%w,needcompile2,this.ok]=do_eval(sblock,list(),scicos_context);
-y=max(2,this.needcompile,needcompile2);
-x.graphics.exprs[1-1]=exprs;
-x.model.rpar=sblock;
-} else {
-x=arg1;
+ if (this.ok) {
+ x = arg1;
+ PREVAR_scicos_context = scicos_context;
+ sblock = x.model.rpar;
+ [sblock,%w,needcompile2,this.ok] = do_eval(sblock,list(),scicos_context);
+ y = max(2,this.needcompile,needcompile2);
+ x.graphics.exprs[1-1] = exprs;
+ x.model.rpar = sblock;
+ } else {
+ x = arg1;
}
}
}
diff --git a/js/Misc/EDGETRIGGER.js b/js/Misc/EDGETRIGGER.js
index e8cbd733..fc4f063f 100644
--- a/js/Misc/EDGETRIGGER.js
+++ b/js/Misc/EDGETRIGGER.js
@@ -1,38 +1,38 @@
/* autogenerated from "macros/Misc/EDGETRIGGER.sci" */
function EDGETRIGGER() {
EDGETRIGGER.prototype.define = function EDGETRIGGER() {
-edge=1;
-model=scicos_model();
-model.sim=list("edgetrig",4);
-model.in1=1;
-model.out=1;
-model.dstate=0;
-model.nzcross=1;
-model.ipar=sign(edge);
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[string(edge)];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ edge = 1;
+ model = scicos_model();
+ model.sim = list("edgetrig",4);
+ model.in1 = 1;
+ model.out = 1;
+ model.dstate = 0;
+ model.nzcross = 1;
+ model.ipar = sign(edge);
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [string(edge)];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
EDGETRIGGER.prototype.details = function EDGETRIGGER() {
}
EDGETRIGGER.prototype.get = function EDGETRIGGER() {
}
EDGETRIGGER.prototype.set = function EDGETRIGGER() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,edge,exprs]=scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,edge,exprs] = scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),exprs);
+ if (!ok) {
break;
}
-model.ipar=sign(edge);
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ model.ipar = sign(edge);
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/EDGE_TRIGGER.js b/js/Misc/EDGE_TRIGGER.js
index aebcc2d2..0f24996b 100644
--- a/js/Misc/EDGE_TRIGGER.js
+++ b/js/Misc/EDGE_TRIGGER.js
@@ -1,84 +1,84 @@
/* autogenerated from "macros/Misc/EDGE_TRIGGER.sci" */
function EDGE_TRIGGER() {
EDGE_TRIGGER.prototype.define = function EDGE_TRIGGER() {
-scs_m_1=scicos_diagram();
-scs_m_1.objs[1-1]=this.EDGETRIGGER["define"-1];
-scs_m_1.objs[2-1]=IFTHEL_f("define");
-scs_m_1.objs[3-1]=IN_f("define");
-scs_m_1.objs[4-1]=CLKOUTV_f("define");
-scs_m_1.objs[5-1]=scicos_link();
-scs_m_1.objs[6-1]=scicos_link();
-scs_m_1.objs[7-1]=scicos_link();
-blk=scs_m_1.objs[1-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[60,0];
-graphics.sz=[60,40];
-graphics.exprs="0";
-model.ipar=0;
-graphics.pin=5;
-graphics.pout=6;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[1-1]=blk;
-blk=scs_m_1.objs[2-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[160,0];
-graphics.sz=[60,40];
-graphics.exprs=[["0"],["0"]];
-model.evtin=[];
-model.nzcross=0;
-model.nmode=0;
-graphics.pin=6;
-graphics.peout=[[7],[0]];
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[2-1]=blk;
-blk=scs_m_1.objs[3-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[0,10];
-graphics.sz=[20,20];
-graphics.exprs=["1"];
-model.ipar=1;
-graphics.pout=5;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[3-1]=blk;
-blk=scs_m_1.objs[4-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[170,-60];
-graphics.sz=[20,20];
-graphics.exprs=["1"];
-model.ipar=1;
-graphics.pein=7;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[4-1]=blk;
-lnk=scs_m_1.objs[5-1];
-lnk.from=[3,1,0];
-lnk.to=[1,1,1];
-scs_m_1.objs[5-1]=lnk;
-lnk=scs_m_1.objs[6-1];
-lnk.from=[1,1,0];
-lnk.to=[2,1,1];
-scs_m_1.objs[6-1]=lnk;
-lnk=scs_m_1.objs[7-1];
-lnk.ct=[5,-1];
-lnk.from=[2,1,0];
-lnk.to=[4,1,1];
-scs_m_1.objs[7-1]=lnk;
+ scs_m_1 = scicos_diagram();
+ scs_m_1.objs[1-1] = this.EDGETRIGGER["define"-1];
+ scs_m_1.objs[2-1] = IFTHEL_f("define");
+ scs_m_1.objs[3-1] = IN_f("define");
+ scs_m_1.objs[4-1] = CLKOUTV_f("define");
+ scs_m_1.objs[5-1] = scicos_link();
+ scs_m_1.objs[6-1] = scicos_link();
+ scs_m_1.objs[7-1] = scicos_link();
+ blk = scs_m_1.objs[1-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [60,0];
+ graphics.sz = [60,40];
+ graphics.exprs = "0";
+ model.ipar = 0;
+ graphics.pin = 5;
+ graphics.pout = 6;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[1-1] = blk;
+ blk = scs_m_1.objs[2-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [160,0];
+ graphics.sz = [60,40];
+ graphics.exprs = [["0"],["0"]];
+ model.evtin = [];
+ model.nzcross = 0;
+ model.nmode = 0;
+ graphics.pin = 6;
+ graphics.peout = [[7],[0]];
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[2-1] = blk;
+ blk = scs_m_1.objs[3-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [0,10];
+ graphics.sz = [20,20];
+ graphics.exprs = ["1"];
+ model.ipar = 1;
+ graphics.pout = 5;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[3-1] = blk;
+ blk = scs_m_1.objs[4-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [170,-60];
+ graphics.sz = [20,20];
+ graphics.exprs = ["1"];
+ model.ipar = 1;
+ graphics.pein = 7;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[4-1] = blk;
+ lnk = scs_m_1.objs[5-1];
+ lnk.from = [3,1,0];
+ lnk.to = [1,1,1];
+ scs_m_1.objs[5-1] = lnk;
+ lnk = scs_m_1.objs[6-1];
+ lnk.from = [1,1,0];
+ lnk.to = [2,1,1];
+ scs_m_1.objs[6-1] = lnk;
+ lnk = scs_m_1.objs[7-1];
+ lnk.ct = [5,-1];
+ lnk.from = [2,1,0];
+ lnk.to = [4,1,1];
+ scs_m_1.objs[7-1] = lnk;
blk={};
lnk={};
-model=scicos_model();
-model.sim="csuper";
-model.in1=1;
-model.evtout=1;
-model.rpar=scs_m_1;
-gr_i=[];
-x=standard_define([3,2],model,[],gr_i);
+ model = scicos_model();
+ model.sim = "csuper";
+ model.in1 = 1;
+ model.evtout = 1;
+ model.rpar = scs_m_1;
+ gr_i = [];
+ x = standard_define([3,2],model,[],gr_i);
}
EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() {
}
@@ -86,71 +86,71 @@ x=standard_define([3,2],model,[],gr_i);
}
EDGE_TRIGGER.prototype.set = function EDGE_TRIGGER() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs[i-1];
-if (typeof(o)=="Block"&&o.gui=="EDGETRIGGER") {
-ppath=list(i);
+ o = arg1.model.rpar.objs[i-1];
+ if (typeof(o)=="Block"&&o.gui=="EDGETRIGGER") {
+ ppath = list(i);
break;
}
}
-newpar=list();
-y=0;
-for (path in ppath) {
-np=size(path,"*");
-spath=list();
+ newpar = list();
+ y = 0;
+ for (path in ppath) {
+ np = size(path,"*");
+ spath = list();
for (k=1;k<=np;k+=1) {
-spath[$+1-1]="model";
-spath[$+1-1]="rpar";
-spath[$+1-1]="objs";
-spath[$+1-1]=path[k-1];
+ spath[$+1-1] = "model";
+ spath[$+1-1] = "rpar";
+ spath[$+1-1] = "objs";
+ spath[$+1-1] = path[k-1];
}
-xx=arg1[spath-1];
+ xx = arg1[spath-1];
execstr("xxn="+xx.gui+"(\'set\',xx)");
-if (diffobjs(this.xxn,xx)) {
-model=xx.model;
-model_n=this.xxn.model;
-if (!is_modelica_block(xx)) {
-modified=or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label);
-if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) {
-needcompile=1;
+ if (diffobjs(this.xxn,xx)) {
+ model = xx.model;
+ model_n = this.xxn.model;
+ if (!is_modelica_block(xx)) {
+ modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label);
+ if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) {
+ needcompile = 1;
}
-if (or(model.firing!=model_n.firing)) {
-needcompile=2;
+ if (or(model.firing!=model_n.firing)) {
+ needcompile = 2;
}
-if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) {
-needcompile=4;
+ if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))) {
+ needcompile = 4;
}
-if (model.sim=="input"||model.sim=="output") {
-if (model.ipar!=model_n.ipar) {
-needcompile=4;
+ if (model.sim=="input"||model.sim=="output") {
+ if (model.ipar!=model_n.ipar) {
+ needcompile = 4;
}
}
-if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
-needcompile=4;
+ if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
+ needcompile = 4;
}
-if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
-needcompile=4;
+ if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
+ needcompile = 4;
}
-if (prod(size(model_n.sim))>1) {
-if (model_n.sim[2-1]>1000) {
-if (model.sim[1-1]!=model_n.sim[1-1]) {
-needcompile=4;
+ if (prod(size(model_n.sim))>1) {
+ if (model_n.sim[2-1]>1000) {
+ if (model.sim[1-1]!=model_n.sim[1-1]) {
+ needcompile = 4;
}
}
}
-} else {
-modified=or(model_n!=model);
-eq=model.equations;
-eqn=model_n.equations;
-if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
-needcompile=4;
+ } else {
+ modified = or(model_n!=model);
+ eq = model.equations;
+ eqn = model_n.equations;
+ if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
+ needcompile = 4;
}
}
-arg1[spath-1]=this.xxn;
-newpar[size(newpar)+1-1]=path;
-y=max(y,needcompile);
+ arg1[spath-1] = this.xxn;
+ newpar[size(newpar)+1-1] = path;
+ y = max(y,needcompile);
}
}
-x=arg1;
-typ=newpar;
+ x = arg1;
+ typ = newpar;
}
}
diff --git a/js/Misc/ENDBLK.js b/js/Misc/ENDBLK.js
index 6fa4b1ab..3ee25214 100644
--- a/js/Misc/ENDBLK.js
+++ b/js/Misc/ENDBLK.js
@@ -1,12 +1,12 @@
/* autogenerated from "macros/Misc/ENDBLK.sci" */
function ENDBLK() {
ENDBLK.prototype.define = function ENDBLK() {
-scs_m_1=scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-159.096,811.104,-121.216,617.984,1323,1008,331,284,630,480,0,7,1.4],Title="ENDBLK",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list()));
-scs_m_1.objs[1-1]=scicos_block(gui="END_c",graphics=scicos_graphics(orig=[272.104,249.11733],sz=[40,40],flip=true,theta=0,exprs="1.000E+08",pin=[],pout=[],pein=2,peout=2,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim=list("scicosexit",4),in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=1.000e+08,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
-scs_m_1.objs[2-1]=scicos_link(xx=[[292.104],[292.104],[261.83733],[261.83733],[292.104],[292.104]],yy=[[243.40305],[234.45067],[234.45067],[305.584],[305.584],[294.83162]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]);
-model=scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list());
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[-159.096,811.104,-121.216,617.984,1323,1008,331,284,630,480,0,7,1.4],Title="ENDBLK",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list()));
+ scs_m_1.objs[1-1] = scicos_block(gui="END_c",graphics=scicos_graphics(orig=[272.104,249.11733],sz=[40,40],flip=true,theta=0,exprs="1.000E+08",pin=[],pout=[],pein=2,peout=2,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim=list("scicosexit",4),in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=1.000e+08,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list());
+ scs_m_1.objs[2-1] = scicos_link(xx=[[292.104],[292.104],[261.83733],[261.83733],[292.104],[292.104]],yy=[[243.40305],[234.45067],[234.45067],[305.584],[305.584],[294.83162]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[1,1,1]);
+ model = scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list());
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
ENDBLK.prototype.details = function ENDBLK() {
}
@@ -14,71 +14,71 @@ x=standard_define([2,2],model,[],gr_i);
}
ENDBLK.prototype.set = function ENDBLK() {
for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
-o=arg1.model.rpar.objs[i-1];
-if (typeof(o)=="Block"&&o.gui=="END_c") {
-ppath=list(i);
+ o = arg1.model.rpar.objs[i-1];
+ if (typeof(o)=="Block"&&o.gui=="END_c") {
+ ppath = list(i);
break;
}
}
-newpar=list();
-y=0;
-for (path in ppath) {
-np=size(path,"*");
-spath=list();
+ newpar = list();
+ y = 0;
+ for (path in ppath) {
+ np = size(path,"*");
+ spath = list();
for (k=1;k<=np;k+=1) {
-spath[$+1-1]="model";
-spath[$+1-1]="rpar";
-spath[$+1-1]="objs";
-spath[$+1-1]=path[k-1];
+ spath[$+1-1] = "model";
+ spath[$+1-1] = "rpar";
+ spath[$+1-1] = "objs";
+ spath[$+1-1] = path[k-1];
}
-xx=arg1[spath-1];
+ xx = arg1[spath-1];
execstr("xxn="+xx.gui+"(\'set\',xx)");
-if (!this.isequalbitwise[this.xxn-1][xx-1]) {
-model=xx.model;
-model_n=this.xxn.model;
-if (!is_modelica_block(xx)) {
-modified=or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label);
-if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) {
-needcompile=1;
+ if (!this.isequalbitwise[this.xxn-1][xx-1]) {
+ model = xx.model;
+ model_n = this.xxn.model;
+ if (!is_modelica_block(xx)) {
+ modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.odstate,model_n.odstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.opar,model_n.opar)||!isequal(model.label,model_n.label);
+ if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)||or(model.in2!=model_n.in2)||or(model.out2!=model_n.out2)||or(model.outtyp!=model_n.outtyp)||or(model.intyp!=model_n.intyp)) {
+ needcompile = 1;
}
-if (or(model.firing!=model_n.firing)) {
-needcompile=2;
+ if (or(model.firing!=model_n.firing)) {
+ needcompile = 2;
}
-if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))||(size(model.evtin,"*")!=size(model_n.evtin,"*"))) {
-needcompile=4;
+ if ((size(model.in1,"*")!=size(model_n.in1,"*"))||(size(model.out,"*")!=size(model_n.out,"*"))||(size(model.evtin,"*")!=size(model_n.evtin,"*"))) {
+ needcompile = 4;
}
-if (model.sim=="input"||model.sim=="output") {
-if (model.ipar!=model_n.ipar) {
-needcompile=4;
+ if (model.sim=="input"||model.sim=="output") {
+ if (model.ipar!=model_n.ipar) {
+ needcompile = 4;
}
}
-if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
-needcompile=4;
+ if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
+ needcompile = 4;
}
-if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
-needcompile=4;
+ if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
+ needcompile = 4;
}
-if (prod(size(model_n.sim))>1) {
-if (model_n.sim[2-1]>1000) {
-if (model.sim[1-1]!=model_n.sim[1-1]) {
-needcompile=4;
+ if (prod(size(model_n.sim))>1) {
+ if (model_n.sim[2-1]>1000) {
+ if (model.sim[1-1]!=model_n.sim[1-1]) {
+ needcompile = 4;
}
}
}
-} else {
-modified=or(model_n!=model);
-eq=model.equations;
-eqn=model_n.equations;
-if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
-needcompile=4;
+ } else {
+ modified = or(model_n!=model);
+ eq = model.equations;
+ eqn = model_n.equations;
+ if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
+ needcompile = 4;
}
}
-arg1[spath-1]=this.xxn;
-newpar[size(newpar)+1-1]=path;
-y=max(y,needcompile);
+ arg1[spath-1] = this.xxn;
+ newpar[size(newpar)+1-1] = path;
+ y = max(y,needcompile);
}
}
-x=arg1;
-typ=newpar;
+ x = arg1;
+ typ = newpar;
}
}
diff --git a/js/Misc/Extract_Activation.js b/js/Misc/Extract_Activation.js
index 684f2ee9..db78ee5e 100644
--- a/js/Misc/Extract_Activation.js
+++ b/js/Misc/Extract_Activation.js
@@ -1,95 +1,95 @@
/* autogenerated from "macros/Misc/Extract_Activation.sci" */
function Extract_Activation() {
Extract_Activation.prototype.define = function Extract_Activation() {
-scs_m_1=scicos_diagram();
-scs_m_1.objs[1-1]=IFTHEL_f("define");
-scs_m_1.objs[2-1]=CLKSOMV_f("define");
-scs_m_1.objs[3-1]=IN_f("define");
-scs_m_1.objs[4-1]=CLKOUTV_f("define");
-scs_m_1.objs[5-1]=scicos_link();
-scs_m_1.objs[6-1]=scicos_link();
-scs_m_1.objs[7-1]=scicos_link();
-scs_m_1.objs[8-1]=scicos_link();
-blk=scs_m_1.objs[1-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[80,0];
-graphics.sz=[60,40];
-graphics.exprs=[["0"],["0"]];
-model.evtin=[];
-model.nzcross=0;
-model.nmode=0;
-graphics.pin=7;
-graphics.peout=[[5],[6]];
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[1-1]=blk;
-blk=scs_m_1.objs[2-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[80,-80];
-graphics.sz=[80,40];
-graphics.pein=[[5],[6]];
-graphics.peout=8;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[2-1]=blk;
-blk=scs_m_1.objs[3-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[0,10];
-graphics.sz=[20,20];
-graphics.exprs=["1"];
-model.ipar=1;
-graphics.pout=7;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[3-1]=blk;
-blk=scs_m_1.objs[4-1];
-graphics=blk.graphics;
-model=blk.model;
-graphics.orig=[110,-140];
-graphics.sz=[20,20];
-graphics.exprs=["1"];
-model.ipar=1;
-graphics.pein=8;
-blk.graphics=graphics;
-blk.model=model;
-scs_m_1.objs[4-1]=blk;
-lnk=scs_m_1.objs[5-1];
-lnk.ct=[5,-1];
-lnk.from=[1,1,0];
-lnk.to=[2,1,1];
-scs_m_1.objs[5-1]=lnk;
-lnk=scs_m_1.objs[6-1];
-lnk.ct=[5,-1];
-lnk.from=[1,2,0];
-lnk.to=[2,2,1];
-scs_m_1.objs[6-1]=lnk;
-lnk=scs_m_1.objs[7-1];
-lnk.from=[3,1,0];
-lnk.to=[1,1,1];
-scs_m_1.objs[7-1]=lnk;
-lnk=scs_m_1.objs[8-1];
-lnk.ct=[5,-1];
-lnk.from=[2,1,0];
-lnk.to=[4,1,1];
-scs_m_1.objs[8-1]=lnk;
+ scs_m_1 = scicos_diagram();
+ scs_m_1.objs[1-1] = IFTHEL_f("define");
+ scs_m_1.objs[2-1] = CLKSOMV_f("define");
+ scs_m_1.objs[3-1] = IN_f("define");
+ scs_m_1.objs[4-1] = CLKOUTV_f("define");
+ scs_m_1.objs[5-1] = scicos_link();
+ scs_m_1.objs[6-1] = scicos_link();
+ scs_m_1.objs[7-1] = scicos_link();
+ scs_m_1.objs[8-1] = scicos_link();
+ blk = scs_m_1.objs[1-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [80,0];
+ graphics.sz = [60,40];
+ graphics.exprs = [["0"],["0"]];
+ model.evtin = [];
+ model.nzcross = 0;
+ model.nmode = 0;
+ graphics.pin = 7;
+ graphics.peout = [[5],[6]];
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[1-1] = blk;
+ blk = scs_m_1.objs[2-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [80,-80];
+ graphics.sz = [80,40];
+ graphics.pein = [[5],[6]];
+ graphics.peout = 8;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[2-1] = blk;
+ blk = scs_m_1.objs[3-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [0,10];
+ graphics.sz = [20,20];
+ graphics.exprs = ["1"];
+ model.ipar = 1;
+ graphics.pout = 7;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[3-1] = blk;
+ blk = scs_m_1.objs[4-1];
+ graphics = blk.graphics;
+ model = blk.model;
+ graphics.orig = [110,-140];
+ graphics.sz = [20,20];
+ graphics.exprs = ["1"];
+ model.ipar = 1;
+ graphics.pein = 8;
+ blk.graphics = graphics;
+ blk.model = model;
+ scs_m_1.objs[4-1] = blk;
+ lnk = scs_m_1.objs[5-1];
+ lnk.ct = [5,-1];
+ lnk.from = [1,1,0];
+ lnk.to = [2,1,1];
+ scs_m_1.objs[5-1] = lnk;
+ lnk = scs_m_1.objs[6-1];
+ lnk.ct = [5,-1];
+ lnk.from = [1,2,0];
+ lnk.to = [2,2,1];
+ scs_m_1.objs[6-1] = lnk;
+ lnk = scs_m_1.objs[7-1];
+ lnk.from = [3,1,0];
+ lnk.to = [1,1,1];
+ scs_m_1.objs[7-1] = lnk;
+ lnk = scs_m_1.objs[8-1];
+ lnk.ct = [5,-1];
+ lnk.from = [2,1,0];
+ lnk.to = [4,1,1];
+ scs_m_1.objs[8-1] = lnk;
blk={};
lnk={};
-model=scicos_model();
-model.sim="csuper";
-model.in1=1;
-model.evtout=1;
-model.rpar=scs_m_1;
-gr_i=[];
-x=standard_define([3,2],model,[],gr_i);
+ model = scicos_model();
+ model.sim = "csuper";
+ model.in1 = 1;
+ model.evtout = 1;
+ model.rpar = scs_m_1;
+ gr_i = [];
+ x = standard_define([3,2],model,[],gr_i);
}
Extract_Activation.prototype.details = function Extract_Activation() {
}
Extract_Activation.prototype.get = function Extract_Activation() {
}
Extract_Activation.prototype.set = function Extract_Activation() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js
index 6083d128..cb53ebca 100644
--- a/js/Misc/HYSTHERESIS.js
+++ b/js/Misc/HYSTHERESIS.js
@@ -1,48 +1,48 @@
/* autogenerated from "macros/Misc/HYSTHERESIS.sci" */
function HYSTHERESIS() {
HYSTHERESIS.prototype.define = function HYSTHERESIS() {
-in1=1;
-ipar=[0];
-nzz=2;
-rpar=[[1],[0],[1],[0]];
-model=scicos_model();
-model.sim=list("hystheresis",4);
-model.in1=in1;
-model.out=1;
-model.rpar=rpar;
-model.nzcross=nzz;
-model.nmode=1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(rpar)],[string(sign(nzz))]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ ipar = [0];
+ nzz = 2;
+ rpar = [[1],[0],[1],[0]];
+ model = scicos_model();
+ model.sim = list("hystheresis",4);
+ model.in1 = in1;
+ model.out = 1;
+ model.rpar = rpar;
+ model.nzcross = nzz;
+ model.nmode = 1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(rpar)],[string(sign(nzz))]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
HYSTHERESIS.prototype.details = function HYSTHERESIS() {
}
HYSTHERESIS.prototype.get = function HYSTHERESIS() {
}
HYSTHERESIS.prototype.set = function HYSTHERESIS() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,high_lim,low_lim,out_high,out_low,nzz,exprs]=scicos_getvalue("Set parameters",[["switch on at"],["switch off at"],["output when on"],["output when off"],["use zero crossing: yes (1), no (0)"]],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,high_lim,low_lim,out_high,out_low,nzz,exprs] = scicos_getvalue("Set parameters",[["switch on at"],["switch off at"],["output when on"],["output when off"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (low_lim>high_lim) {
+ if (low_lim>high_lim) {
message("switch on value must be larger than switch off value");
-} else {
-graphics.exprs=exprs;
-model.rpar=transpose([high_lim,low_lim,out_high,out_low]);
-if (nzz>0) {
-nzz=2;
+ } else {
+ graphics.exprs = exprs;
+ model.rpar = transpose([high_lim,low_lim,out_high,out_low]);
+ if (nzz>0) {
+ nzz = 2;
}
-model.nzcross=nzz;
-x.graphics=graphics;
-x.model=model;
+ model.nzcross = nzz;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/IMPSPLIT_f.js b/js/Misc/IMPSPLIT_f.js
index 4c741509..25e4799d 100644
--- a/js/Misc/IMPSPLIT_f.js
+++ b/js/Misc/IMPSPLIT_f.js
@@ -1,24 +1,24 @@
/* autogenerated from "macros/Misc/IMPSPLIT_f.sci" */
function IMPSPLIT_f() {
IMPSPLIT_f.prototype.define = function IMPSPLIT_f() {
-model=scicos_model();
-model.sim="limpsplit";
-mo=modelica();
-mo.model="limpsplit";
-mo.inputs="n";
-mo.outputs=[["n"],["n"]];
-model.equations=mo;
-model.in1=ones(size(mo.inputs,"*"),1);
-model.out=ones(size(mo.outputs,"*"),1);
-x=standard_define([1,1]/3,model,[],[]);
-x.graphics.in_implicit=["I"];
-x.graphics.out_implicit=["I","I"];
+ model = scicos_model();
+ model.sim = "limpsplit";
+ mo = modelica();
+ mo.model = "limpsplit";
+ mo.inputs = "n";
+ mo.outputs = [["n"],["n"]];
+ model.equations = mo;
+ model.in1 = ones(size(mo.inputs,"*"),1);
+ model.out = ones(size(mo.outputs,"*"),1);
+ x = standard_define([1,1]/3,model,[],[]);
+ x.graphics.in_implicit = ["I"];
+ x.graphics.out_implicit = ["I","I"];
}
IMPSPLIT_f.prototype.details = function IMPSPLIT_f() {
}
IMPSPLIT_f.prototype.get = function IMPSPLIT_f() {
}
IMPSPLIT_f.prototype.set = function IMPSPLIT_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js
index 98b17ddc..25ee74a3 100644
--- a/js/Misc/LOGICAL_OP.js
+++ b/js/Misc/LOGICAL_OP.js
@@ -1,109 +1,109 @@
/* autogenerated from "macros/Misc/LOGICAL_OP.sci" */
function LOGICAL_OP() {
LOGICAL_OP.prototype.define = function LOGICAL_OP() {
-in1=[[-1],[-1]];
-ipar=[0];
-nin=2;
-model=scicos_model();
-model.sim=list("logicalop",4);
-model.in1=in1;
-model.out=-1;
-model.ipar=ipar;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(nin)],[string(ipar)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = [[-1],[-1]];
+ ipar = [0];
+ nin = 2;
+ model = scicos_model();
+ model.sim = list("logicalop",4);
+ model.in1 = in1;
+ model.out = -1;
+ model.ipar = ipar;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(nin)],[string(ipar)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
LOGICAL_OP.prototype.details = function LOGICAL_OP() {
}
LOGICAL_OP.prototype.get = function LOGICAL_OP() {
}
LOGICAL_OP.prototype.set = function LOGICAL_OP() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,1)==2) {
-exprs=[[exprs],[sci2exp(1)],[sci2exp(0)]];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,1)==2) {
+ exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]];
}
-while (true) {
-[ok,nin,rule,Datatype,tp,exprs]=scicos_getvalue("Set parameters",[["number of inputs"],["Operator: AND (0), OR (1), NAND (2), NOR (3), XOR (4), NOT (5)","Datatype (1=double 3=int32 ...)"],["Bitwise Rule(0=No 1=yes)"]],list("vec",1,"vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,nin,rule,Datatype,tp,exprs] = scicos_getvalue("Set parameters",[["number of inputs"],["Operator: AND (0), OR (1), NAND (2), NOR (3), XOR (4), NOT (5)","Datatype (1=double 3=int32 ...)"],["Bitwise Rule(0=No 1=yes)"]],list("vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-nin=int(nin);
-rule=int(rule);
-tp=int(tp);
-if (nin<1) {
+ nin = int(nin);
+ rule = int(rule);
+ tp = int(tp);
+ if (nin<1) {
message("Number of inputs must be >=1 ");
-ok=false;
-} else if ((rule<0)||(rule>5)) {
+ ok = false;
+ } else if ((rule<0)||(rule>5)) {
message("Incorrect operator "+string(rule)+" ; must be 0 to 5.");
-ok=false;
-} else if ((rule==5)&&(nin>1)) {
+ ok = false;
+ } else if ((rule==5)&&(nin>1)) {
message("Only one input allowed for NOT operation");
-nin=1;
-} else if (((Datatype==1)&&(tp!=0))) {
+ nin = 1;
+ } else if (((Datatype==1)&&(tp!=0))) {
message("Bitwise Rule is only activated when Data type is integer");
-ok=false;
+ ok = false;
}
-if (ok) {
-if ((tp!=0)) {
-tp=1;
+ if (ok) {
+ if ((tp!=0)) {
+ tp = 1;
}
-if (Datatype==1) {
-model.sim=list("logicalop",4);
-model.ipar=[rule];
-} else {
-if (Datatype==3) {
-model.sim=list("logicalop_i32",4);
-} else if (Datatype==4) {
-model.sim=list("logicalop_i16",4);
-} else if (Datatype==5) {
-model.sim=list("logicalop_i8",4);
-} else if (Datatype==6) {
-model.sim=list("logicalop_ui32",4);
-} else if (Datatype==7) {
-model.sim=list("logicalop_ui16",4);
-} else if (Datatype==8) {
-model.sim=list("logicalop_ui8",4);
-} else {
+ if (Datatype==1) {
+ model.sim = list("logicalop",4);
+ model.ipar = [rule];
+ } else {
+ if (Datatype==3) {
+ model.sim = list("logicalop_i32",4);
+ } else if (Datatype==4) {
+ model.sim = list("logicalop_i16",4);
+ } else if (Datatype==5) {
+ model.sim = list("logicalop_i8",4);
+ } else if (Datatype==6) {
+ model.sim = list("logicalop_ui32",4);
+ } else if (Datatype==7) {
+ model.sim = list("logicalop_ui16",4);
+ } else if (Datatype==8) {
+ model.sim = list("logicalop_ui8",4);
+ } else {
message("Datatype is not supported");
-ok=false;
+ ok = false;
}
-model.ipar=[[rule],[tp]];
+ model.ipar = [[rule],[tp]];
}
-if (ok) {
-it=Datatype*ones(nin,1);
-ot=Datatype;
-in1=[-ones(nin,1),-2*ones(nin,1)];
-if ((rule!=5)&&(nin==1)) {
-out=[1,1];
-[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
-} else {
-out=[-1,-2];
-[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+ if (ok) {
+ it = Datatype*ones(nin,1);
+ ot = Datatype;
+ in1 = [-ones(nin,1),-2*ones(nin,1)];
+ if ((rule!=5)&&(nin==1)) {
+ out = [1,1];
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+ } else {
+ out = [-1,-2];
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
}
-if (ok) {
-if (rule==0) {
-label="AND";
-} else if (rule==1) {
-label="OR";
-} else if (rule==2) {
-label="NAND";
-} else if (rule==3) {
-label="NOR";
-} else if (rule==4) {
-label="XOR";
-} else if (rule==5) {
-label="NOT";
+ if (ok) {
+ if (rule==0) {
+ label = "AND";
+ } else if (rule==1) {
+ label = "OR";
+ } else if (rule==2) {
+ label = "NAND";
+ } else if (rule==3) {
+ label = "NOR";
+ } else if (rule==4) {
+ label = "XOR";
+ } else if (rule==5) {
+ label = "NOT";
}
-graphics.exprs=exprs;
-graphics.style=["blockWithLabel;displayedLabel="+label];
-x.graphics=graphics;
-x.model=model;
+ graphics.exprs = exprs;
+ graphics.style = ["blockWithLabel;displayedLabel="+label];
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js
index f4d2b319..17c1ffc5 100644
--- a/js/Misc/MBLOCK.js
+++ b/js/Misc/MBLOCK.js
@@ -1,271 +1,271 @@
/* autogenerated from "macros/Misc/MBLOCK.sci" */
function MBLOCK() {
MBLOCK.prototype.define = function MBLOCK() {
-this.in1=["u1"];
-this.intype=["I"];
-this.out=[["y1"],["y2"]];
-this.outtype=[["I"],["E"]];
-param=[["R"],["L"]];
-paramv=list(0.1,.0001);
-pprop=[[0],[0]];
-nameF="generic";
-exprs=tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]);
-model=scicos_model();
-model.blocktype="c";
-model.dep_ut=[false,true];
-model.rpar=[];
+ this.in1 = ["u1"];
+ this.intype = ["I"];
+ this.out = [["y1"],["y2"]];
+ this.outtype = [["I"],["E"]];
+ param = [["R"],["L"]];
+ paramv = list(0.1,.0001);
+ pprop = [[0],[0]];
+ nameF = "generic";
+ exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]);
+ model = scicos_model();
+ model.blocktype = "c";
+ model.dep_ut = [false,true];
+ model.rpar = [];
for (i=1;i<=lstsize(paramv);i+=1) {
-model.rpar=[[model.rpar],[paramv[i-1].slice()]];
-}
-mo=modelica();
-mo.model=nameF;
-mo.parameters=list(param,paramv);
-model.sim=list(mo.model,30004);
-mo.inputs=this.in1;
-mo.outputs=this.out;
-model.in1=ones(size(mo.inputs,"r"),1);
-model.out=ones(size(mo.outputs,"r"),1);
-model.equations=mo;
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
-x.graphics.in_implicit=this.intype;
-x.graphics.out_implicit=this.outtype;
+ model.rpar = [[model.rpar],[paramv[i-1].slice()]];
+}
+ mo = modelica();
+ mo.model = nameF;
+ mo.parameters = list(param,paramv);
+ model.sim = list(mo.model,30004);
+ mo.inputs = this.in1;
+ mo.outputs = this.out;
+ model.in1 = ones(size(mo.inputs,"r"),1);
+ model.out = ones(size(mo.outputs,"r"),1);
+ model.equations = mo;
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
+ x.graphics.in_implicit = this.intype;
+ x.graphics.out_implicit = this.outtype;
}
MBLOCK.prototype.details = function MBLOCK() {
}
MBLOCK.prototype.get = function MBLOCK() {
}
MBLOCK.prototype.set = function MBLOCK() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-if (this.type[exprs-1]==15) {
-paramv=list();
-pprop=[];
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ if (this.type[exprs-1]==15) {
+ paramv = list();
+ pprop = [];
for (i=1;i<=size(model.rpar,"*");i+=1) {
-paramv[$+1-1]=string(model.rpar[i-1]);
-pprop[$+1-1]=0;
+ paramv[$+1-1] = string(model.rpar[i-1]);
+ pprop[$+1-1] = 0;
}
-exprs=tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]);
+ exprs = tlist(["MBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]);
}
-lab_1=list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF);
-lab_2=exprs.paramv;
-while (true) {
-[ok,Tin,Tintype,Tout,Touttype,Tparam,pprop,Tfunam,lab_1]=scicos_getvalue("Set Modelica generic block parameters",[["Input variables: "],["Input variables types: "],["Output variables: "],["Output variables types:"],["Parameters in Modelica:"],["Parameters properties: "],["Function name: "]],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),lab_1);
-if (!ok) {
+ lab_1 = list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF);
+ lab_2 = exprs.paramv;
+ while (true) {
+ [ok,Tin,Tintype,Tout,Touttype,Tparam,pprop,Tfunam,lab_1] = scicos_getvalue("Set Modelica generic block parameters",[["Input variables: "],["Input variables types: "],["Output variables: "],["Output variables types:"],["Parameters in Modelica:"],["Parameters properties: "],["Function name: "]],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),lab_1);
+ if (!ok) {
break;
}
-ierr=execstr("in=stripblanks(evstr(Tin)); intype=stripblanks(evstr(Tintype)); out=stripblanks(evstr(Tout)); outtype=stripblanks(evstr(Touttype)); param=stripblanks(evstr(Tparam)); funam=stripblanks(Tfunam)","errcatch");
-if (ierr!=0) {
+ ierr = execstr("in=stripblanks(evstr(Tin)); intype=stripblanks(evstr(Tintype)); out=stripblanks(evstr(Tout)); outtype=stripblanks(evstr(Touttype)); param=stripblanks(evstr(Tparam)); funam=stripblanks(Tfunam)","errcatch");
+ if (ierr!=0) {
messagebox("Error in evaluation of variables.","modal","error");
-ok=false;
+ ok = false;
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.in1,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(in(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(in(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
messagebox([["Invalid variable name for the input "+string(i)+"."],["\""+this.in1[i-1]+"\""],["Please choose another variable name."]],"modal","error");
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.out,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(out(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(out(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
messagebox([["Invalid variable name for the output "+string(i)+"."],["\""+this.out[i-1]+"\""],["Please choose another variable name."]],"modal","error");
}
}
-if (ok) {
-param=param.slice();
+ if (ok) {
+ param = param.slice();
for (i=1;i<=size(param,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(param(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(param(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
messagebox([["Invalid variable name for the parameter "+string(i)+"."],["\""+param[i-1]+"\""],["Please choose another variable name."]],"modal","error");
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.intype,"*");i+=1) {
-if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") {
+ if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") {
messagebox("Input type should be \'E\' or \'I\'!","modal","error");
-ok=false;
+ ok = false;
break;
}
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.outtype,"*");i+=1) {
-if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") {
+ if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") {
messagebox("Output type should be \'E\' or \'I\'!","modal","error");
-ok=false;
+ ok = false;
break;
}
}
}
-if (ok) {
-if (or(size(this.intype)!=size(this.in1))) {
+ if (ok) {
+ if (or(size(this.intype)!=size(this.in1))) {
messagebox("Input variables are not well defined!","modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (or(size(this.outtype)!=size(this.out))) {
+ if (ok) {
+ if (or(size(this.outtype)!=size(this.out))) {
messagebox("Output variables are not well defined!","modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-pprop=pprop.slice();
-if ((size(param,"*")!=size(pprop,"*"))) {
+ if (ok) {
+ pprop = pprop.slice();
+ if ((size(param,"*")!=size(pprop,"*"))) {
messagebox([["There is differences in"],["size of param and size "],["of param properties."]],"modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (max(pprop)>2||min(pprop)<0) {
+ if (ok) {
+ if (max(pprop)>2||min(pprop)<0) {
messagebox([["Parameters properties must be :"],["0 : for simple paramater,"],["1 : for initial state value,"],["2 : for a fixed initial state value."]],"modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (this.funam=="") {
+ if (ok) {
+ if (this.funam=="") {
messagebox("The filename is not defined!","modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-[dirF,nameF,extF]=fileparts(this.funam);
-if ((extF!=""&&extF!=".mo")||(dirF!=""&&extF!=".mo")) {
+ if (ok) {
+ [dirF,nameF,extF] = fileparts(this.funam);
+ if ((extF!=""&&extF!=".mo")||(dirF!=""&&extF!=".mo")) {
messagebox("Filename extention should be \'.mo \' !","modal","error");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-intypex=find(this.intype=="I");
-outtypex=find(this.outtype=="I");
-[model,graphics,ok]=set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex);
+ if (ok) {
+ intypex = find(this.intype=="I");
+ outtypex = find(this.outtype=="I");
+ [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex);
}
-if (ok) {
-Tparam_lab=evstr(Tparam);
-Tparam_sz=size(Tparam_lab,"*");
-if (Tparam_sz>lstsize(lab_2)) {
+ if (ok) {
+ Tparam_lab = evstr(Tparam);
+ Tparam_sz = size(Tparam_lab,"*");
+ if (Tparam_sz>lstsize(lab_2)) {
for (i=1;i<=(Tparam_sz-lstsize(lab_2));i+=1) {
-lab_2[$+1-1]="0";
+ lab_2[$+1-1] = "0";
}
-} else if (Tparam_sz<lstsize(lab_2)) {
-lab_2_tmp=list();
-if (Tparam_sz!=0) {
+ } else if (Tparam_sz<lstsize(lab_2)) {
+ lab_2_tmp = list();
+ if (Tparam_sz!=0) {
for (i=1;i<=(lstsize(lab_2)-Tparam_sz);i+=1) {
-lab_2_tmp[i-1]=lab_2[i-1];
+ lab_2_tmp[i-1] = lab_2[i-1];
}
}
-lab_2=lab_2_tmp;
+ lab_2 = lab_2_tmp;
}
-if (Tparam_sz!=0) {
-lhs_txt="";
-lab_txt="";
-rhs_txt="";
+ if (Tparam_sz!=0) {
+ lhs_txt = "";
+ lab_txt = "";
+ rhs_txt = "";
for (i=1;i<=Tparam_sz;i+=1) {
-lhs_txt=lhs_txt+"%v"+string(i)+",";
-if (pprop[i-1]==0) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+"\';";
-} else if (pprop[i-1]==1) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';";
-} else if (pprop[i-1]==2) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';";
-}
-rhs_txt=rhs_txt+"\'vec\',-1,";
-}
-lhs_txt=part(lhs_txt,1,length(lhs_txt)-1);
-lab_txt=part(lab_txt,1,length(lab_txt)-1);
-rhs_txt=part(rhs_txt,1,length(rhs_txt)-1);
-getvalue_txt="[ok,"+lhs_txt+",lab_2]=scicos_getvalue(\'Set parameters values\',["+lab_txt+"],"+"list("+rhs_txt+"),lab_2)";
+ lhs_txt = lhs_txt+"%v"+string(i)+",";
+ if (pprop[i-1]==0) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';";
+ } else if (pprop[i-1]==1) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';";
+ } else if (pprop[i-1]==2) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';";
+}
+ rhs_txt = rhs_txt+"\'vec\',-1,";
+}
+ lhs_txt = part(lhs_txt,1,length(lhs_txt)-1);
+ lab_txt = part(lab_txt,1,length(lab_txt)-1);
+ rhs_txt = part(rhs_txt,1,length(rhs_txt)-1);
+ getvalue_txt = "[ok,"+lhs_txt+",lab_2]=scicos_getvalue(\'Set parameters values\',["+lab_txt+"],"+"list("+rhs_txt+"),lab_2)";
execstr(getvalue_txt);
-if (!ok) {
-lab_2=exprs.paramv;
+ if (!ok) {
+ lab_2 = exprs.paramv;
}
}
}
-if (ok) {
-paramv=list();
+ if (ok) {
+ paramv = list();
for (i=1;i<=Tparam_sz;i+=1) {
execstr("paramv("+string(i)+")=%v"+string(i));
}
}
-if (ok) {
-if (extF==".mo"&&fileinfo(this.funam)!=[]) {
-tt=mgetl(this.funam);
-} else {
-tt=exprs.funtxt;
-mo=model.equations;
-if (mo.model!=nameF) {
-tt=[];
+ if (ok) {
+ if (extF==".mo"&&fileinfo(this.funam)!=[]) {
+ tt = mgetl(this.funam);
+ } else {
+ tt = exprs.funtxt;
+ mo = model.equations;
+ if (mo.model!=nameF) {
+ tt = [];
}
}
-[ok,tt]=MODCOM(this.funam,tt,this.in1,this.out,param,paramv,pprop);
-if (!ok) {
+ [ok,tt] = MODCOM(this.funam,tt,this.in1,this.out,param,paramv,pprop);
+ if (!ok) {
break;
}
}
-if (ok) {
-mo=modelica();
-mo.model=nameF;
-mo.inputs=this.in1;
-mo.outputs=this.out;
-if (max(pprop)>0) {
-mo.parameters=list(transpose(param),paramv,transpose(pprop));
-} else {
-mo.parameters=list(transpose(param),paramv);
+ if (ok) {
+ mo = modelica();
+ mo.model = nameF;
+ mo.inputs = this.in1;
+ mo.outputs = this.out;
+ if (max(pprop)>0) {
+ mo.parameters = list(transpose(param),paramv,transpose(pprop));
+ } else {
+ mo.parameters = list(transpose(param),paramv);
}
-model.equations=mo;
-model.rpar=[];
+ model.equations = mo;
+ model.rpar = [];
for (i=1;i<=lstsize(paramv);i+=1) {
-model.rpar=[[model.rpar],[paramv[i-1].slice()]];
-}
-model.sim[1-1]=this.funam;
-exprs.in1=lab_1[1-1];
-exprs.intype=lab_1[2-1];
-exprs.out=lab_1[3-1];
-exprs.outtype=lab_1[4-1];
-exprs.param=lab_1[5-1];
-exprs.paramv=list();
-if (Tparam_sz!=0) {
-if (this.type[lab_2-1]==15) {
+ model.rpar = [[model.rpar],[paramv[i-1].slice()]];
+}
+ model.sim[1-1] = this.funam;
+ exprs.in1 = lab_1[1-1];
+ exprs.intype = lab_1[2-1];
+ exprs.out = lab_1[3-1];
+ exprs.outtype = lab_1[4-1];
+ exprs.param = lab_1[5-1];
+ exprs.paramv = list();
+ if (Tparam_sz!=0) {
+ if (this.type[lab_2-1]==15) {
for (i=1;i<=lstsize(lab_2);i+=1) {
-exprs.paramv[i-1]=lab_2[i-1];
+ exprs.paramv[i-1] = lab_2[i-1];
}
-} else {
+ } else {
for (i=1;i<=size(lab_2,"*");i+=1) {
-exprs.paramv[i-1]=lab_2[i-1];
+ exprs.paramv[i-1] = lab_2[i-1];
}
}
}
-exprs.pprop=lab_1[6-1];
-exprs.nameF=lab_1[7-1];
-exprs.funtxt=tt;
-x.model=model;
-graphics.gr_i[1-1][1-1]="txt=[\'Modelica\';\' "+nameF+" \'];";
-graphics.in_implicit=this.intype;
-graphics.out_implicit=this.outtype;
-graphics.exprs=exprs;
-x.graphics=graphics;
+ exprs.pprop = lab_1[6-1];
+ exprs.nameF = lab_1[7-1];
+ exprs.funtxt = tt;
+ x.model = model;
+ graphics.gr_i[1-1][1-1] = "txt=[\'Modelica\';\' "+nameF+" \'];";
+ graphics.in_implicit = this.intype;
+ graphics.out_implicit = this.outtype;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/Misc/MEMORY_f.js b/js/Misc/MEMORY_f.js
index b125a2c6..70c670db 100644
--- a/js/Misc/MEMORY_f.js
+++ b/js/Misc/MEMORY_f.js
@@ -1,54 +1,54 @@
/* autogenerated from "macros/Misc/MEMORY_f.sci" */
function MEMORY_f() {
MEMORY_f.prototype.define = function MEMORY_f() {
-z=0;
-in1=1;
-exprs=[[string(z)],[string(1)]];
-model=scicos_model();
-model.sim="memo";
-model.in1=in1;
-model.out=in1;
-model.evtin=1;
-model.dstate=0;
-model.rpar=z;
-model.blocktype="m";
-model.dep_ut=[false,false];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ z = 0;
+ in1 = 1;
+ exprs = [[string(z)],[string(1)]];
+ model = scicos_model();
+ model.sim = "memo";
+ model.in1 = in1;
+ model.out = in1;
+ model.evtin = 1;
+ model.dstate = 0;
+ model.rpar = z;
+ model.blocktype = "m";
+ model.dep_ut = [false,false];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
MEMORY_f.prototype.details = function MEMORY_f() {
}
MEMORY_f.prototype.get = function MEMORY_f() {
}
MEMORY_f.prototype.set = function MEMORY_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,a,inh,exprs]=scicos_getvalue("Set memory block parameters",[["initial condition"],["Inherit (1: no, 0: yes)"]],list("vec",-1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,a,inh,exprs] = scicos_getvalue("Set memory block parameters",[["initial condition"],["Inherit (1: no, 0: yes)"]],list("vec",-1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (inh==0) {
-inh=[];
-} else {
-inh=1;
+ if (inh==0) {
+ inh = [];
+ } else {
+ inh = 1;
}
-[model,graphics,ok]=check_io(model,graphics,-1,-1,inh,[]);
-out=size(a,"*");
-if (out==0) {
-ok=false;
+ [model,graphics,ok] = check_io(model,graphics,-1,-1,inh,[]);
+ out = size(a,"*");
+ if (out==0) {
+ ok = false;
messagebox("Initial condition empty","modal","error");
}
-in1=out;
-if (ok) {
-graphics.exprs=exprs;
-model.rpar=a;
-model.in1=in1;
-model.out=out;
-x.graphics=graphics;
-x.model=model;
+ in1 = out;
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ model.in1 = in1;
+ model.out = out;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js
index 2342fd37..ff8df8e0 100644
--- a/js/Misc/MPBLOCK.js
+++ b/js/Misc/MPBLOCK.js
@@ -1,263 +1,263 @@
/* autogenerated from "macros/Misc/MPBLOCK.sci" */
function MPBLOCK() {
MPBLOCK.prototype.define = function MPBLOCK() {
-this.in1=["u"];
-this.intype=["I"];
-this.out=[["y1"],["y2"]];
-this.outtype=[["I"],["I"]];
-param=[];
-paramv=list();
-pprop=[];
-nameF="myModel";
-exprs=tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]);
-model=scicos_model();
-model.blocktype="c";
-model.dep_ut=[true,true];
-model.rpar=[];
+ this.in1 = ["u"];
+ this.intype = ["I"];
+ this.out = [["y1"],["y2"]];
+ this.outtype = [["I"],["I"]];
+ param = [];
+ paramv = list();
+ pprop = [];
+ nameF = "myModel";
+ exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]);
+ model = scicos_model();
+ model.blocktype = "c";
+ model.dep_ut = [true,true];
+ model.rpar = [];
for (i=1;i<=lstsize(paramv);i+=1) {
-model.rpar=[[model.rpar],[paramv[i-1].slice()]];
-}
-mo=modelica();
-mo.model=nameF;
-mo.parameters=list(param,paramv);
-model.sim=list(mo.model,10004);
-mo.inputs=this.in1;
-mo.outputs=this.out;
-model.in1=ones(size(mo.inputs,"r"),1);
-model.out=ones(size(mo.outputs,"r"),1);
-model.equations=mo;
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
-x.graphics.in_implicit=this.intype;
-x.graphics.out_implicit=this.outtype;
+ model.rpar = [[model.rpar],[paramv[i-1].slice()]];
+}
+ mo = modelica();
+ mo.model = nameF;
+ mo.parameters = list(param,paramv);
+ model.sim = list(mo.model,10004);
+ mo.inputs = this.in1;
+ mo.outputs = this.out;
+ model.in1 = ones(size(mo.inputs,"r"),1);
+ model.out = ones(size(mo.outputs,"r"),1);
+ model.equations = mo;
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
+ x.graphics.in_implicit = this.intype;
+ x.graphics.out_implicit = this.outtype;
}
MPBLOCK.prototype.details = function MPBLOCK() {
}
MPBLOCK.prototype.get = function MPBLOCK() {
}
MPBLOCK.prototype.set = function MPBLOCK() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-if (this.type[exprs-1]==15) {
-paramv=list();
-pprop=[];
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ if (this.type[exprs-1]==15) {
+ paramv = list();
+ pprop = [];
for (i=1;i<=size(model.rpar,"*");i+=1) {
-paramv[$+1-1]=string(model.rpar[i-1]);
-pprop[$+1-1]=0;
+ paramv[$+1-1] = string(model.rpar[i-1]);
+ pprop[$+1-1] = 0;
}
-exprs=tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]);
+ exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]);
}
-lab_1=list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF);
-lab_2=exprs.paramv;
-while (true) {
-[ok,Tin,Tintype,Tout,Touttype,Tparam,pprop,Tfunam,lab_1]=getvalue("Set Modelica generic block parameters",[["Input variables: "],["Input variables types: "],["Output variables: "],["Output variables types:"],["Parameters in Modelica:"],["Parameters properties: "],["Model name in packages:"]],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),lab_1);
-if (!ok) {
+ lab_1 = list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF);
+ lab_2 = exprs.paramv;
+ while (true) {
+ [ok,Tin,Tintype,Tout,Touttype,Tparam,pprop,Tfunam,lab_1] = getvalue("Set Modelica generic block parameters",[["Input variables: "],["Input variables types: "],["Output variables: "],["Output variables types:"],["Parameters in Modelica:"],["Parameters properties: "],["Model name in packages:"]],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),lab_1);
+ if (!ok) {
break;
}
-ierr=execstr("in=stripblanks(evstr(Tin)); intype=stripblanks(evstr(Tintype)); out=stripblanks(evstr(Tout)); outtype=stripblanks(evstr(Touttype)); param=stripblanks(evstr(Tparam)); funam=stripblanks(Tfunam)","errcatch");
-if (ierr!=0) {
+ ierr = execstr("in=stripblanks(evstr(Tin)); intype=stripblanks(evstr(Tintype)); out=stripblanks(evstr(Tout)); outtype=stripblanks(evstr(Touttype)); param=stripblanks(evstr(Tparam)); funam=stripblanks(Tfunam)","errcatch");
+ if (ierr!=0) {
x_message("Error in evaluation of variables.");
-ok=false;
+ ok = false;
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.in1,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(in(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(in(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
x_message([["Invalid variable name for the input "+string(i)+"."],["\""+this.in1[i-1]+"\""],["Please choose another variable name."]]);
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.out,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(out(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(out(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
x_message([["Invalid variable name for the output "+string(i)+"."],["\""+this.out[i-1]+"\""],["Please choose another variable name."]]);
}
}
-if (ok) {
-param=param.slice();
+ if (ok) {
+ param = param.slice();
for (i=1;i<=size(param,"*");i+=1) {
-r=false;
-ierr=execstr("r=validvar(param(i))","errcatch");
-if (!r) {
-ok=false;
+ r = false;
+ ierr = execstr("r=validvar(param(i))","errcatch");
+ if (!r) {
+ ok = false;
break;
}
}
-if (!ok) {
+ if (!ok) {
x_message([["Invalid variable name for the parameter "+string(i)+"."],["\""+param[i-1]+"\""],["Please choose another variable name."]]);
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.intype,"*");i+=1) {
-if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") {
+ if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") {
x_message("Input type should be \'E\' or \'I\'!");
-ok=false;
+ ok = false;
break;
}
}
}
-if (ok) {
+ if (ok) {
for (i=1;i<=size(this.outtype,"*");i+=1) {
-if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") {
+ if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") {
x_message("Output type should be \'E\' or \'I\'!");
-ok=false;
+ ok = false;
break;
}
}
}
-if (ok) {
-if (or(size(this.intype)!=size(this.in1))) {
+ if (ok) {
+ if (or(size(this.intype)!=size(this.in1))) {
x_message("Input variables are not well defined!");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (or(size(this.outtype)!=size(this.out))) {
+ if (ok) {
+ if (or(size(this.outtype)!=size(this.out))) {
x_message("Output variables are not well defined!");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-pprop=pprop.slice();
-if ((size(param,"*")!=size(pprop,"*"))) {
+ if (ok) {
+ pprop = pprop.slice();
+ if ((size(param,"*")!=size(pprop,"*"))) {
x_message([["There is differences in"],["size of param and size "],["of param properties."]]);
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (max(pprop)>2||min(pprop)<0) {
+ if (ok) {
+ if (max(pprop)>2||min(pprop)<0) {
x_message([["Parameters properties must be :"],["0 : if it is a paramaters"],["1 : if it is an initial value of state,"],["2 : it it is a fixed initial state value."]]);
-ok=false;
+ ok = false;
}
}
-if (ok) {
-if (this.funam=="") {
+ if (ok) {
+ if (this.funam=="") {
x_message("The model name is not defined!");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-[dirF,nameF,extF]=fileparts(this.funam);
-if ((extF!="")||(dirF!="")) {
+ if (ok) {
+ [dirF,nameF,extF] = fileparts(this.funam);
+ if ((extF!="")||(dirF!="")) {
x_message("Invalid model name!");
-ok=false;
+ ok = false;
}
}
-if (ok) {
-intypex=find(this.intype=="I");
-outtypex=find(this.outtype=="I");
-[model,graphics,ok]=set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex);
+ if (ok) {
+ intypex = find(this.intype=="I");
+ outtypex = find(this.outtype=="I");
+ [model,graphics,ok] = set_io(model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex);
}
-if (ok) {
-Tparam_lab=evstr(Tparam);
-Tparam_sz=size(Tparam_lab,"*");
-if (Tparam_sz>lstsize(lab_2)) {
+ if (ok) {
+ Tparam_lab = evstr(Tparam);
+ Tparam_sz = size(Tparam_lab,"*");
+ if (Tparam_sz>lstsize(lab_2)) {
for (i=1;i<=(Tparam_sz-lstsize(lab_2));i+=1) {
-lab_2[$+1-1]="0";
+ lab_2[$+1-1] = "0";
}
-} else if (Tparam_sz<lstsize(lab_2)) {
-lab_2_tmp=list();
-if (Tparam_sz!=0) {
+ } else if (Tparam_sz<lstsize(lab_2)) {
+ lab_2_tmp = list();
+ if (Tparam_sz!=0) {
for (i=1;i<=Tparam_sz;i+=1) {
-ee=evstr(exprs.param);
+ ee = evstr(exprs.param);
for (j=1;j<=size(ee,"r");j+=1) {
-if (ee[j-1]==Tparam_lab[i-1]) {
-lab_2_tmp[i-1]=lab_2[j-1];
+ if (ee[j-1]==Tparam_lab[i-1]) {
+ lab_2_tmp[i-1] = lab_2[j-1];
}
}
}
-lab_2=lab_2_tmp;
+ lab_2 = lab_2_tmp;
}
}
-if (Tparam_sz!=0) {
-lhs_txt="";
-lab_txt="";
-rhs_txt="";
+ if (Tparam_sz!=0) {
+ lhs_txt = "";
+ lab_txt = "";
+ rhs_txt = "";
for (i=1;i<=Tparam_sz;i+=1) {
-lhs_txt=lhs_txt+"%v"+string(i)+",";
-if (pprop[i-1]==0) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+"\';";
-} else if (pprop[i-1]==1) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';";
-} else if (pprop[i-1]==2) {
-lab_txt=lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';";
-}
-rhs_txt=rhs_txt+"\'vec\',-1,";
-}
-lhs_txt=part(lhs_txt,1,length(lhs_txt)-1);
-lab_txt=part(lab_txt,1,length(lab_txt)-1);
-rhs_txt=part(rhs_txt,1,length(rhs_txt)-1);
-getvalue_txt="[ok,"+lhs_txt+",lab_2]=scicos_getvalue(\'Set parameters values\',["+lab_txt+"],"+"list("+rhs_txt+"),lab_2)";
+ lhs_txt = lhs_txt+"%v"+string(i)+",";
+ if (pprop[i-1]==0) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';";
+ } else if (pprop[i-1]==1) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';";
+ } else if (pprop[i-1]==2) {
+ lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';";
+}
+ rhs_txt = rhs_txt+"\'vec\',-1,";
+}
+ lhs_txt = part(lhs_txt,1,length(lhs_txt)-1);
+ lab_txt = part(lab_txt,1,length(lab_txt)-1);
+ rhs_txt = part(rhs_txt,1,length(rhs_txt)-1);
+ getvalue_txt = "[ok,"+lhs_txt+",lab_2]=scicos_getvalue(\'Set parameters values\',["+lab_txt+"],"+"list("+rhs_txt+"),lab_2)";
execstr(getvalue_txt);
-if (!ok) {
-lab_2=exprs.paramv;
+ if (!ok) {
+ lab_2 = exprs.paramv;
}
}
}
-if (ok) {
-paramv=list();
+ if (ok) {
+ paramv = list();
for (i=1;i<=Tparam_sz;i+=1) {
execstr("paramv("+string(i)+")=%v"+string(i));
}
}
-if (ok) {
-mo=modelica();
-mo.model=nameF;
-mo.inputs=this.in1;
-mo.outputs=this.out;
-if (pprop!=[]) {
-if (max(pprop)>0) {
-mo.parameters=list(transpose(param),paramv,transpose(pprop));
-} else {
-mo.parameters=list(transpose(param),paramv);
+ if (ok) {
+ mo = modelica();
+ mo.model = nameF;
+ mo.inputs = this.in1;
+ mo.outputs = this.out;
+ if (pprop!=[]) {
+ if (max(pprop)>0) {
+ mo.parameters = list(transpose(param),paramv,transpose(pprop));
+ } else {
+ mo.parameters = list(transpose(param),paramv);
}
}
-model.equations=mo;
-model.rpar=[];
+ model.equations = mo;
+ model.rpar = [];
for (i=1;i<=lstsize(paramv);i+=1) {
-model.rpar=[[model.rpar],[double(paramv[i-1].slice())]];
-}
-model.sim[1-1]=this.funam;
-exprs.in1=lab_1[1-1];
-exprs.intype=lab_1[2-1];
-exprs.out=lab_1[3-1];
-exprs.outtype=lab_1[4-1];
-exprs.param=lab_1[5-1];
-exprs.paramv=list();
-if (Tparam_sz!=0) {
-if (this.type[lab_2-1]==15) {
+ model.rpar = [[model.rpar],[double(paramv[i-1].slice())]];
+}
+ model.sim[1-1] = this.funam;
+ exprs.in1 = lab_1[1-1];
+ exprs.intype = lab_1[2-1];
+ exprs.out = lab_1[3-1];
+ exprs.outtype = lab_1[4-1];
+ exprs.param = lab_1[5-1];
+ exprs.paramv = list();
+ if (Tparam_sz!=0) {
+ if (this.type[lab_2-1]==15) {
for (i=1;i<=lstsize(lab_2);i+=1) {
-exprs.paramv[i-1]=lab_2[i-1];
+ exprs.paramv[i-1] = lab_2[i-1];
}
-} else {
+ } else {
for (i=1;i<=size(lab_2,"*");i+=1) {
-exprs.paramv[i-1]=lab_2[i-1];
+ exprs.paramv[i-1] = lab_2[i-1];
}
}
}
-exprs.pprop=lab_1[6-1];
-exprs.nameF=lab_1[7-1];
-exprs.funtxt="";
-x.model=model;
-graphics.gr_i[1-1][1-1]="txt=[\' "+nameF+" \'];";
-graphics.in_implicit=this.intype;
-graphics.out_implicit=this.outtype;
-graphics.exprs=exprs;
-x.graphics=graphics;
+ exprs.pprop = lab_1[6-1];
+ exprs.nameF = lab_1[7-1];
+ exprs.funtxt = "";
+ x.model = model;
+ graphics.gr_i[1-1][1-1] = "txt=[\' "+nameF+" \'];";
+ graphics.in_implicit = this.intype;
+ graphics.out_implicit = this.outtype;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/Misc/PAL_f.js b/js/Misc/PAL_f.js
index 6a75f8c7..3550fbc4 100644
--- a/js/Misc/PAL_f.js
+++ b/js/Misc/PAL_f.js
@@ -1,30 +1,30 @@
/* autogenerated from "macros/Misc/PAL_f.sci" */
function PAL_f() {
PAL_f.prototype.define = function PAL_f() {
-scs=scicos_diagram();
-scs.props.title="Palette";
-model=scicos_model();
-model.sim="palette";
-model.in1=[];
-model.out=[];
-model.rpar=scs;
-model.blocktype="h";
-model.dep_ut=[false,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
-x.graphics.id=scs.props.title[1-1];
+ scs = scicos_diagram();
+ scs.props.title = "Palette";
+ model = scicos_model();
+ model.sim = "palette";
+ model.in1 = [];
+ model.out = [];
+ model.rpar = scs;
+ model.blocktype = "h";
+ model.dep_ut = [false,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
+ x.graphics.id = scs.props.title[1-1];
}
PAL_f.prototype.details = function PAL_f() {
}
PAL_f.prototype.get = function PAL_f() {
}
PAL_f.prototype.set = function PAL_f() {
-[x,newparameters,needcompile,edited]=scicos(arg1.model.rpar);
-arg1.graphics.id=x.props.title[1-1];
-arg1.model.rpar=x;
-x=arg1;
-y=[];
-typ=[];
+ [x,newparameters,needcompile,edited] = scicos(arg1.model.rpar);
+ arg1.graphics.id = x.props.title[1-1];
+ arg1.model.rpar = x;
+ x = arg1;
+ y = [];
+ typ = [];
%exit=resume(false)
}
}
diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js
index b5c3b29b..79896033 100644
--- a/js/Misc/PENDULUM_ANIM.js
+++ b/js/Misc/PENDULUM_ANIM.js
@@ -1,61 +1,61 @@
/* autogenerated from "macros/Misc/PENDULUM_ANIM.sci" */
function PENDULUM_ANIM() {
PENDULUM_ANIM.prototype.define = function PENDULUM_ANIM() {
-plen=2;
-csiz=2;
-phi=0;
-xmin=-5;
-xmax=5;
-ymin=-5;
-ymax=5;
-model=scicos_model();
-model.sim=list("anim_pen",5);
-model.in1=[[1],[1]];
-model.evtin=1;
-model.dstate=0;
-model.rpar=[[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
-model.blocktype="d";
-model.dep_ut=[false,false];
-exprs=string(model.rpar);
-gr_i=[];
-x=standard_define([3,3],model,exprs,gr_i);
+ plen = 2;
+ csiz = 2;
+ phi = 0;
+ xmin = -5;
+ xmax = 5;
+ ymin = -5;
+ ymax = 5;
+ model = scicos_model();
+ model.sim = list("anim_pen",5);
+ model.in1 = [[1],[1]];
+ model.evtin = 1;
+ model.dstate = 0;
+ model.rpar = [[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
+ model.blocktype = "d";
+ model.dep_ut = [false,false];
+ exprs = string(model.rpar);
+ gr_i = [];
+ x = standard_define([3,3],model,exprs,gr_i);
}
PENDULUM_ANIM.prototype.details = function PENDULUM_ANIM() {
}
PENDULUM_ANIM.prototype.get = function PENDULUM_ANIM() {
}
PENDULUM_ANIM.prototype.set = function PENDULUM_ANIM() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-dstate=model.dstate;
-while (true) {
-[ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs]=scicos_getvalue("Set Scope parameters",[["pendulum length"],["cart size (square side)"],["slope"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("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;
+ dstate = model.dstate;
+ while (true) {
+ [ok,plen,csiz,phi,xmin,xmax,ymin,ymax,exprs] = scicos_getvalue("Set Scope parameters",[["pendulum length"],["cart size (square side)"],["slope"],["Xmin"],["Xmax"],["Ymin"],["Ymax"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-mess=[];
-if (plen<=0||csiz<=0) {
-mess=[[mess],["Pendulum length and cart size must be positive."],[" "]];
-ok=false;
+ mess = [];
+ if (plen<=0||csiz<=0) {
+ mess = [[mess],["Pendulum length and cart size must be positive."],[" "]];
+ 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 {
-rpar=[[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
-model.rpar=rpar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ rpar = [[plen],[csiz],[phi],[xmin],[xmax],[ymin],[ymax]];
+ model.rpar = rpar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/RATELIMITER.js b/js/Misc/RATELIMITER.js
index df9b3d18..15037528 100644
--- a/js/Misc/RATELIMITER.js
+++ b/js/Misc/RATELIMITER.js
@@ -1,42 +1,42 @@
/* autogenerated from "macros/Misc/RATELIMITER.sci" */
function RATELIMITER() {
RATELIMITER.prototype.define = function RATELIMITER() {
-minp=-1;
-maxp=1;
-rpar=[[maxp],[minp]];
-model=scicos_model();
-model.sim=list("ratelimiter",4);
-model.in1=1;
-model.out=1;
-model.rpar=rpar;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(maxp)],[string(minp)]];
-gr_i=[];
-x=standard_define([3.5,2],model,exprs,gr_i);
+ minp = -1;
+ maxp = 1;
+ rpar = [[maxp],[minp]];
+ model = scicos_model();
+ model.sim = list("ratelimiter",4);
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = rpar;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(maxp)],[string(minp)]];
+ gr_i = [];
+ x = standard_define([3.5,2],model,exprs,gr_i);
}
RATELIMITER.prototype.details = function RATELIMITER() {
}
RATELIMITER.prototype.get = function RATELIMITER() {
}
RATELIMITER.prototype.set = function RATELIMITER() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,maxp,minp,exprs]=scicos_getvalue("Set rate limiter parameters",[["max slope"],["min slope"]],list("vec",1,"vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,maxp,minp,exprs] = scicos_getvalue("Set rate limiter parameters",[["max slope"],["min slope"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (maxp<=minp||maxp<=0||minp>=0) {
+ if (maxp<=minp||maxp<=0||minp>=0) {
message("We must have max_slope> 0 > min_slope.");
-} else {
-rpar=[[maxp],[minp]];
-model.rpar=rpar;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ rpar = [[maxp],[minp]];
+ model.rpar = rpar;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/RELATIONALOP.js b/js/Misc/RELATIONALOP.js
index 7f0c3ac3..7eb02adc 100644
--- a/js/Misc/RELATIONALOP.js
+++ b/js/Misc/RELATIONALOP.js
@@ -1,91 +1,91 @@
/* autogenerated from "macros/Misc/RELATIONALOP.sci" */
function RELATIONALOP() {
RELATIONALOP.prototype.define = function RELATIONALOP() {
-ipar=[2];
-label="&lt";
-model=scicos_model();
-model.sim=list("relationalop",4);
-model.in1=[[1],[1]];
-model.out=1;
-model.ipar=ipar;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(ipar)],[string(0)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
-x.graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
+ ipar = [2];
+ label = "&lt";
+ model = scicos_model();
+ model.sim = list("relationalop",4);
+ model.in1 = [[1],[1]];
+ model.out = 1;
+ model.ipar = ipar;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(ipar)],[string(0)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
+ x.graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label];
}
RELATIONALOP.prototype.details = function RELATIONALOP() {
}
RELATIONALOP.prototype.get = function RELATIONALOP() {
}
RELATIONALOP.prototype.set = function RELATIONALOP() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,1)==2) {
-exprs=[[exprs],[sci2exp(1)]];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,1)==2) {
+ exprs = [[exprs],[sci2exp(1)]];
}
-while (true) {
-[ok,rule,zcr,Datatype,exprs]=scicos_getvalue("Set parameters",[["Operator: == (0), ~= (1), < (2), <= (3), > (4), >= (5)"],["Use zero crossing (no: 0), (yes: 1)","Datatype (1=double 3=int32 ...)"]],list("vec",1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,rule,zcr,Datatype,exprs] = scicos_getvalue("Set parameters",[["Operator: == (0), ~= (1), < (2), <= (3), > (4), >= (5)"],["Use zero crossing (no: 0), (yes: 1)","Datatype (1=double 3=int32 ...)"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-rule=int(rule);
-if (zcr!=0) {
-zcr=1;
+ rule = int(rule);
+ if (zcr!=0) {
+ zcr = 1;
}
-if ((rule<0)||(rule>5)) {
+ if ((rule<0)||(rule>5)) {
message("Incorrect operator "+string(rule)+" ; must be 0 to 5.");
-ok=false;
+ ok = false;
}
-if ((Datatype==1)) {
-model.sim=list("relational_op",4);
-} else if ((Datatype==3||Datatype==9)) {
-model.sim=list("relational_op_i32",4);
-} else if ((Datatype==4)) {
-model.sim=list("relational_op_i16",4);
-} else if ((Datatype==5)) {
-model.sim=list("relational_op_i8",4);
-} else if ((Datatype==6)) {
-model.sim=list("relational_op_ui32",4);
-} else if ((Datatype==7)) {
-model.sim=list("relational_op_ui16",4);
-} else if ((Datatype==8)) {
-model.sim=list("relational_op_ui8",4);
-} else {
+ if ((Datatype==1)) {
+ model.sim = list("relational_op",4);
+ } else if ((Datatype==3||Datatype==9)) {
+ model.sim = list("relational_op_i32",4);
+ } else if ((Datatype==4)) {
+ model.sim = list("relational_op_i16",4);
+ } else if ((Datatype==5)) {
+ model.sim = list("relational_op_i8",4);
+ } else if ((Datatype==6)) {
+ model.sim = list("relational_op_ui32",4);
+ } else if ((Datatype==7)) {
+ model.sim = list("relational_op_ui16",4);
+ } else if ((Datatype==8)) {
+ model.sim = list("relational_op_ui8",4);
+ } else {
message("Datatype is not supported");
-ok=false;
+ ok = false;
}
-if (ok) {
-it=Datatype*ones(1,2);
-ot=Datatype;
-in1=[[-1,-2],[-1,-2]];
-out=[-1,-2];
-[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+ if (ok) {
+ it = Datatype*ones(1,2);
+ ot = Datatype;
+ in1 = [[-1,-2],[-1,-2]];
+ out = [-1,-2];
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
-if (ok) {
-if (rule==0) {
-label="==";
-} else if (rule==1) {
-label="~=";
-} else if (rule==2) {
-label="&#60;";
-} else if (rule==3) {
-label="&#8804;";
-} else if (rule==4) {
-label="&#62;";
-} else if (rule==5) {
-label="&#8805;";
+ if (ok) {
+ if (rule==0) {
+ label = "==";
+ } else if (rule==1) {
+ label = "~=";
+ } else if (rule==2) {
+ label = "&#60;";
+ } else if (rule==3) {
+ label = "&#8804;";
+ } else if (rule==4) {
+ label = "&#62;";
+ } else if (rule==5) {
+ label = "&#8805;";
}
-graphics.exprs=exprs;
-graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
-model.ipar=[rule];
-model.nzcross=zcr;
-model.nmode=zcr;
-x.graphics=graphics;
-x.model=model;
+ graphics.exprs = exprs;
+ graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label];
+ model.ipar = [rule];
+ model.nzcross = zcr;
+ model.nmode = zcr;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/SPLIT_f.js b/js/Misc/SPLIT_f.js
index 44374442..0a6da420 100644
--- a/js/Misc/SPLIT_f.js
+++ b/js/Misc/SPLIT_f.js
@@ -1,19 +1,19 @@
/* autogenerated from "macros/Misc/SPLIT_f.sci" */
function SPLIT_f() {
SPLIT_f.prototype.define = function SPLIT_f() {
-model=scicos_model();
-model.sim="lsplit";
-model.in1=-1;
-model.out=[[-1],[-1],[-1]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-x=standard_define([1,1]/3,model,[],[]);
+ model = scicos_model();
+ model.sim = "lsplit";
+ model.in1 = -1;
+ model.out = [[-1],[-1],[-1]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ x = standard_define([1,1]/3,model,[],[]);
}
SPLIT_f.prototype.details = function SPLIT_f() {
}
SPLIT_f.prototype.get = function SPLIT_f() {
}
SPLIT_f.prototype.set = function SPLIT_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/Misc/SUPER_f.js b/js/Misc/SUPER_f.js
index 2cbd25ff..2d42dcb2 100644
--- a/js/Misc/SUPER_f.js
+++ b/js/Misc/SUPER_f.js
@@ -1,25 +1,25 @@
/* autogenerated from "macros/Misc/SUPER_f.sci" */
function SUPER_f() {
SUPER_f.prototype.define = function SUPER_f() {
-scs=scicos_diagram();
-scs.props.title="Super Block";
-in1=IN_f("define");
-in1.graphics.orig=[40,40];
-in1.graphics.sz=[20,20];
-out=OUT_f("define");
-out.graphics.orig=[240,40];
-out.graphics.sz=[20,20];
-scs.objs[1-1]=in1;
-scs.objs[2-1]=out;
-model=scicos_model();
-model.sim="super";
-model.in1=1;
-model.out=1;
-model.rpar=scs;
-model.blocktype="h";
-model.dep_ut=[false,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ scs = scicos_diagram();
+ scs.props.title = "Super Block";
+ in1 = IN_f("define");
+ in1.graphics.orig = [40,40];
+ in1.graphics.sz = [20,20];
+ out = OUT_f("define");
+ out.graphics.orig = [240,40];
+ out.graphics.sz = [20,20];
+ scs.objs[1-1] = in1;
+ scs.objs[2-1] = out;
+ model = scicos_model();
+ model.sim = "super";
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = scs;
+ model.blocktype = "h";
+ model.dep_ut = [false,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
SUPER_f.prototype.details = function SUPER_f() {
}
diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js
index 7fc54bdf..6e3dfeed 100644
--- a/js/Misc/TEXT_f.js
+++ b/js/Misc/TEXT_f.js
@@ -1,64 +1,64 @@
/* autogenerated from "macros/Misc/TEXT_f.sci" */
function TEXT_f() {
TEXT_f.prototype.define = function TEXT_f() {
-font=2;
-siz=1;
-model=scicos_model();
-model.sim="text";
-model.rpar="Text";
-model.ipar=[[font],[siz]];
-exprs=[["Text"],[string(font)],[string(siz)]];
-graphics=scicos_graphics();
-graphics.orig=[0,0];
-graphics.sz=[2,1];
-graphics.exprs=exprs;
-x=mlist(["Text","graphics","model","void","gui"],graphics,model," ","TEXT_f");
+ font = 2;
+ siz = 1;
+ model = scicos_model();
+ model.sim = "text";
+ model.rpar = "Text";
+ model.ipar = [[font],[siz]];
+ exprs = [["Text"],[string(font)],[string(siz)]];
+ graphics = scicos_graphics();
+ graphics.orig = [0,0];
+ graphics.sz = [2,1];
+ graphics.exprs = exprs;
+ x = mlist(["Text","graphics","model","void","gui"],graphics,model," ","TEXT_f");
}
TEXT_f.prototype.details = function TEXT_f() {
}
TEXT_f.prototype.get = function TEXT_f() {
}
TEXT_f.prototype.set = function TEXT_f() {
-x=arg1;
-graphics=arg1.graphics;
-orig=graphics.orig;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==1) {
-exprs=[[exprs],["3"],["1"]];
+ x = arg1;
+ graphics = arg1.graphics;
+ orig = graphics.orig;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==1) {
+ exprs = [[exprs],["3"],["1"]];
}
-while (true) {
-[ok,txt,font,siz,exprs]=scicos_getvalue("Set Text block parameters",[["Text"],["Font number"],["Font size"]],list("str",-1,"vec",1,"vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,txt,font,siz,exprs] = scicos_getvalue("Set Text block parameters",[["Text"],["Font number"],["Font size"]],list("str",-1,"vec",1,"vec",1),exprs);
+ if (!ok) {
break;
}
-if (font<=0||font>6) {
+ if (font<=0||font>6) {
message("Font number must be greater than 0 and less than 7");
-ok=false;
+ ok = false;
}
-if (siz<0) {
+ if (siz<0) {
message("Font size must be positive");
-ok=false;
+ ok = false;
}
-if (ok) {
-graphics.exprs=exprs;
-gh_winpal=gca();
-default_font_style=gh_winpal.font_style;
-default_font_size=gh_winpal.font_size;
-default_font_color=gh_winpal.font_color;
-gh_winpal.font_style=font;
-gh_winpal.font_size=siz;
-r=xstringl(0,0,exprs[1-1],evstr(exprs[2-1]),evstr(exprs[3-1]));
-gh_winpal.font_style=default_font_style;
-gh_winpal.font_size=default_font_size;
-gh_winpal.font_color=default_font_color;
-sz=r.slice(3-1,4);
-graphics.sz=sz;
-x.graphics=graphics;
-ipar=[[font],[siz]];
-model.rpar=txt;
-model.ipar=ipar;
-x.model=model;
+ if (ok) {
+ graphics.exprs = exprs;
+ gh_winpal = gca();
+ default_font_style = gh_winpal.font_style;
+ default_font_size = gh_winpal.font_size;
+ default_font_color = gh_winpal.font_color;
+ gh_winpal.font_style = font;
+ gh_winpal.font_size = siz;
+ r = xstringl(0,0,exprs[1-1],evstr(exprs[2-1]),evstr(exprs[3-1]));
+ gh_winpal.font_style = default_font_style;
+ gh_winpal.font_size = default_font_size;
+ gh_winpal.font_color = default_font_color;
+ sz = r.slice(3-1,4);
+ graphics.sz = sz;
+ x.graphics = graphics;
+ ipar = [[font],[siz]];
+ model.rpar = txt;
+ model.ipar = ipar;
+ x.model = model;
break;
}
}
diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js
index e3e5252c..fa1655c1 100644
--- a/js/Misc/c_block.js
+++ b/js/Misc/c_block.js
@@ -1,72 +1,72 @@
/* autogenerated from "macros/Misc/c_block.sci" */
function c_block() {
c_block.prototype.define = function c_block() {
-in1=1;
-out=1;
-clkin=[];
-clkout=[];
-x0=[];
-z0=[];
-typ="c";
-auto=[];
-rpar=[];
-funam="toto";
-model=scicos_model();
-model.sim=list(" ",2001);
-model.in1=in1;
-model.out=out;
-model.evtin=clkin;
-model.evtout=clkout;
-model.state=x0;
-model.dstate=z0;
-model.rpar=rpar;
-model.ipar=0;
-model.blocktype=typ;
-model.firing=auto;
-model.dep_ut=[true,false];
-label=list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(rpar))],[funam]],list([]));
-gr_i=[];
-x=standard_define([3,2],model,label,gr_i);
+ in1 = 1;
+ out = 1;
+ clkin = [];
+ clkout = [];
+ x0 = [];
+ z0 = [];
+ typ = "c";
+ auto = [];
+ rpar = [];
+ funam = "toto";
+ model = scicos_model();
+ model.sim = list(" ",2001);
+ model.in1 = in1;
+ model.out = out;
+ model.evtin = clkin;
+ model.evtout = clkout;
+ model.state = x0;
+ model.dstate = z0;
+ model.rpar = rpar;
+ model.ipar = 0;
+ model.blocktype = typ;
+ model.firing = auto;
+ model.dep_ut = [true,false];
+ label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(rpar))],[funam]],list([]));
+ gr_i = [];
+ x = standard_define([3,2],model,label,gr_i);
}
c_block.prototype.details = function c_block() {
}
c_block.prototype.get = function c_block() {
}
c_block.prototype.set = function c_block() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-while (true) {
-[ok,i,o,rpar,funam,lab]=scicos_getvalue("Set C_block parameters",[["input ports sizes"],["output port sizes"],["System parameters vector"],["function name"]],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]);
-if (!ok) {
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ while (true) {
+ [ok,i,o,rpar,funam,lab] = scicos_getvalue("Set C_block parameters",[["input ports sizes"],["output port sizes"],["System parameters vector"],["function name"]],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]);
+ if (!ok) {
break;
}
-if (funam==" ") {
+ if (funam==" ") {
break;
}
-label[1-1]=lab;
-rpar=rpar.slice();
-i=int(i.slice());
-ni=size(i,1);
-o=int(o.slice());
-no=size(o,1);
-tt=label[2-1];
-if (model.sim[1-1]!=funam||size(model.in1,"*")!=size(i,"*")||size(model.out,"*")!=size(o,"*")) {
-tt=[];
+ label[1-1] = lab;
+ rpar = rpar.slice();
+ i = int(i.slice());
+ ni = size(i,1);
+ o = int(o.slice());
+ no = size(o,1);
+ tt = label[2-1];
+ if (model.sim[1-1]!=funam||size(model.in1,"*")!=size(i,"*")||size(model.out,"*")!=size(o,"*")) {
+ tt = [];
}
-[ok,tt]=CFORTR(funam,tt,i,o);
-if (!ok) {
+ [ok,tt] = CFORTR(funam,tt,i,o);
+ if (!ok) {
break;
}
-[model,graphics,ok]=check_io(model,graphics,i,o,[],[]);
-if (ok) {
-model.sim[1-1]=funam;
-model.rpar=rpar;
-label[2-1]=tt;
-x.model=model;
-graphics.exprs=label;
-x.graphics=graphics;
+ [model,graphics,ok] = check_io(model,graphics,i,o,[],[]);
+ if (ok) {
+ model.sim[1-1] = funam;
+ model.rpar = rpar;
+ label[2-1] = tt;
+ x.model = model;
+ graphics.exprs = label;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/Misc/fortran_block.js b/js/Misc/fortran_block.js
index ee371811..d974716f 100644
--- a/js/Misc/fortran_block.js
+++ b/js/Misc/fortran_block.js
@@ -1,63 +1,63 @@
/* autogenerated from "macros/Misc/fortran_block.sci" */
function fortran_block() {
fortran_block.prototype.define = function fortran_block() {
-model=scicos_model();
-model.sim=list(" ",1001);
-model.in1=1;
-model.out=1;
-model.evtin=[];
-model.evtout=[];
-model.state=[];
-model.dstate=[];
-model.rpar=[];
-model.ipar=0;
-model.blocktype="c";
-model.firing=[];
-model.dep_ut=[true,false];
-funam="forty";
-label=list([[sci2exp(model.in1)],[sci2exp(model.out)],[strcat(sci2exp(model.rpar))],[funam]],list([]));
-gr_i=[];
-x=standard_define([4,2],model,label,gr_i);
+ model = scicos_model();
+ model.sim = list(" ",1001);
+ model.in1 = 1;
+ model.out = 1;
+ model.evtin = [];
+ model.evtout = [];
+ model.state = [];
+ model.dstate = [];
+ model.rpar = [];
+ model.ipar = 0;
+ model.blocktype = "c";
+ model.firing = [];
+ model.dep_ut = [true,false];
+ funam = "forty";
+ label = list([[sci2exp(model.in1)],[sci2exp(model.out)],[strcat(sci2exp(model.rpar))],[funam]],list([]));
+ gr_i = [];
+ x = standard_define([4,2],model,label,gr_i);
}
fortran_block.prototype.details = function fortran_block() {
}
fortran_block.prototype.get = function fortran_block() {
}
fortran_block.prototype.set = function fortran_block() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-while (true) {
-[ok,i,o,rpar,funam,lab]=scicos_getvalue("Set fortran_block parameters",[["input ports sizes"],["output port sizes"],["System parameters vector"],["function name"]],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]);
-if (!ok) {
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ while (true) {
+ [ok,i,o,rpar,funam,lab] = scicos_getvalue("Set fortran_block parameters",[["input ports sizes"],["output port sizes"],["System parameters vector"],["function name"]],list("vec",-1,"vec",-1,"vec",-1,"str",-1),label[1-1]);
+ if (!ok) {
break;
}
-if (funam==" ") {
+ if (funam==" ") {
break;
}
-label[1-1]=lab;
-rpar=rpar.slice();
-i=int(i.slice());
-ni=size(i,1);
-o=int(o.slice());
-no=size(o,1);
-tt=label[2-1];
-if (model.sim[1-1]!=funam||size(model.in1,"*")!=size(i,"*")||size(model.out,"*")!=size(o,"*")) {
-tt=[];
+ label[1-1] = lab;
+ rpar = rpar.slice();
+ i = int(i.slice());
+ ni = size(i,1);
+ o = int(o.slice());
+ no = size(o,1);
+ tt = label[2-1];
+ if (model.sim[1-1]!=funam||size(model.in1,"*")!=size(i,"*")||size(model.out,"*")!=size(o,"*")) {
+ tt = [];
}
-[ok,tt]=FORTR(funam,tt,i,o);
-if (!ok) {
+ [ok,tt] = FORTR(funam,tt,i,o);
+ if (!ok) {
break;
}
-[model,graphics,ok]=check_io(model,graphics,i,o,[],[]);
-if (ok) {
-model.sim[1-1]=funam;
-model.rpar=rpar;
-label[2-1]=tt;
-x.model=model;
-graphics.exprs=label;
-x.graphics=graphics;
+ [model,graphics,ok] = check_io(model,graphics,i,o,[],[]);
+ if (ok) {
+ model.sim[1-1] = funam;
+ model.rpar = rpar;
+ label[2-1] = tt;
+ x.model = model;
+ graphics.exprs = label;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/Misc/func_block.js b/js/Misc/func_block.js
index 1d1f2889..42332455 100644
--- a/js/Misc/func_block.js
+++ b/js/Misc/func_block.js
@@ -1,32 +1,32 @@
/* autogenerated from "macros/Misc/func_block.sci" */
function func_block() {
func_block.prototype.define = function func_block() {
-model=scicos_model();
-model.sim=" ";
-model.in1=1;
-model.out=1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs="v=sin(u);y=u*v";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ model = scicos_model();
+ model.sim = " ";
+ model.in1 = 1;
+ model.out = 1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = "v=sin(u);y=u*v";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
func_block.prototype.details = function func_block() {
}
func_block.prototype.get = function func_block() {
}
func_block.prototype.set = function func_block() {
-model=arg1.model;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-x=arg1;
-model=x.model;
-[ok,mac,exprs]=this.genfunc[exprs-1];
-if (ok) {
-model.sim=mac;
-graphics.exprs=exprs;
-x.model=model;
-x.graphics=graphics;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ x = arg1;
+ model = x.model;
+ [ok,mac,exprs] = this.genfunc[exprs-1];
+ if (ok) {
+ model.sim = mac;
+ graphics.exprs = exprs;
+ x.model = model;
+ x.graphics = graphics;
}
}
}
diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js
index 43b51b77..1d319a0c 100644
--- a/js/Misc/generic_block.js
+++ b/js/Misc/generic_block.js
@@ -1,94 +1,94 @@
/* autogenerated from "macros/Misc/generic_block.sci" */
function generic_block() {
generic_block.prototype.define = function generic_block() {
-model=scicos_model();
-function_name="sinblk";
-funtyp=1;
-model.sim=list(function_name,funtyp);
-model.in1=1;
-model.out=1;
-model.evtin=[];
-model.evtout=[];
-model.state=[];
-model.dstate=[];
-model.rpar=[];
-model.ipar=[];
-model.blocktype="c";
-model.firing=[];
-model.dep_ut=[true,false];
-label=[[function_name],[sci2exp(funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.firing)],["y"],["n"]];
-gr_i=[];
-x=standard_define([2,2],model,label,gr_i);
+ model = scicos_model();
+ function_name = "sinblk";
+ funtyp = 1;
+ model.sim = list(function_name,funtyp);
+ model.in1 = 1;
+ model.out = 1;
+ model.evtin = [];
+ model.evtout = [];
+ model.state = [];
+ model.dstate = [];
+ model.rpar = [];
+ model.ipar = [];
+ model.blocktype = "c";
+ model.firing = [];
+ model.dep_ut = [true,false];
+ label = [[function_name],[sci2exp(funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.firing)],["y"],["n"]];
+ gr_i = [];
+ x = standard_define([2,2],model,label,gr_i);
}
generic_block.prototype.details = function generic_block() {
}
generic_block.prototype.get = function generic_block() {
}
generic_block.prototype.set = function generic_block() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-if (size(label,"*")==14) {
-label[9-1]=[];
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ if (size(label,"*")==14) {
+ label[9-1] = [];
}
-while (true) {
-[ok,function_name,funtyp,i,o,ci,co,xx,z,rpar,ipar,auto0,depu,dept,lab]=scicos_getvalue("Set GENERIC block parameters",[["simulation function"],["function type (0,1,2,..)"],["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label);
-if (!ok) {
+ while (true) {
+ [ok,function_name,funtyp,i,o,ci,co,xx,z,rpar,ipar,auto0,depu,dept,lab] = scicos_getvalue("Set GENERIC block parameters",[["simulation function"],["function type (0,1,2,..)"],["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%6)","str",1,"str",1),label);
+ if (!ok) {
break;
}
-label=lab;
-function_name=stripblanks(function_name);
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-ipar=int(ipar.slice());
-i=int(i.slice());
-o=int(o.slice());
-ci=int(ci.slice());
-co=int(co.slice());
-funtyp=int(funtyp);
-if (funtyp<0) {
+ label = lab;
+ function_name = stripblanks(function_name);
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ ipar = int(ipar.slice());
+ i = int(i.slice());
+ o = int(o.slice());
+ ci = int(ci.slice());
+ co = int(co.slice());
+ funtyp = int(funtyp);
+ if (funtyp<0) {
message("function type cannot be negative");
-ok=false;
+ ok = false;
}
-if ([[ci],[co]]!=[]) {
-if (max([[ci],[co]])>1) {
+ if ([[ci],[co]]!=[]) {
+ if (max([[ci],[co]])>1) {
message("vector event links not supported");
-ok=false;
+ ok = false;
}
}
-depu=stripblanks(depu);
-if (part(depu,1)=="y") {
-depu=true;
-} else {
-depu=false;
+ depu = stripblanks(depu);
+ if (part(depu,1)=="y") {
+ depu = true;
+ } else {
+ depu = false;
}
-dept=stripblanks(dept);
-if (part(dept,1)=="y") {
-dept=true;
-} else {
-dept=false;
+ dept = stripblanks(dept);
+ if (part(dept,1)=="y") {
+ dept = true;
+ } else {
+ dept = false;
}
-dep_ut=[depu,dept];
-if (ok) {
-[model,graphics,ok]=check_io(model,graphics,i,o,ci,co);
+ dep_ut = [depu,dept];
+ if (ok) {
+ [model,graphics,ok] = check_io(model,graphics,i,o,ci,co);
}
-if (ok) {
-if (funtyp==3) {
-needcompile=4;
+ if (ok) {
+ if (funtyp==3) {
+ needcompile = 4;
}
-model.sim=list(function_name,funtyp);
-model.state=xx;
-model.dstate=z;
-model.rpar=rpar;
-model.ipar=ipar;
-model.firing=auto0;
-model.dep_ut=dep_ut;
-arg1.model=model;
-graphics.exprs=label;
-arg1.graphics=graphics;
-x=arg1;
+ model.sim = list(function_name,funtyp);
+ model.state = xx;
+ model.dstate = z;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.firing = auto0;
+ model.dep_ut = dep_ut;
+ arg1.model = model;
+ graphics.exprs = label;
+ arg1.graphics = graphics;
+ x = arg1;
break;
}
}
diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js
index c1bb7346..19b3a7e6 100644
--- a/js/Misc/generic_block2.js
+++ b/js/Misc/generic_block2.js
@@ -1,96 +1,96 @@
/* autogenerated from "macros/Misc/generic_block2.sci" */
function generic_block2() {
generic_block2.prototype.define = function generic_block2() {
-model=scicos_model();
-function_name="sinblk";
-funtyp=1;
-model.sim=list(function_name,funtyp);
-model.in1=1;
-model.out=1;
-model.evtin=[];
-model.evtout=[];
-model.state=[];
-model.dstate=[];
-model.rpar=[];
-model.ipar=[];
-model.blocktype="c";
-model.firing=[];
-model.dep_ut=[true,false];
-label=[[function_name],[sci2exp(funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]];
-gr_i=[];
-x=standard_define([2,2],model,label,gr_i);
+ model = scicos_model();
+ function_name = "sinblk";
+ funtyp = 1;
+ model.sim = list(function_name,funtyp);
+ model.in1 = 1;
+ model.out = 1;
+ model.evtin = [];
+ model.evtout = [];
+ model.state = [];
+ model.dstate = [];
+ model.rpar = [];
+ model.ipar = [];
+ model.blocktype = "c";
+ model.firing = [];
+ model.dep_ut = [true,false];
+ label = [[function_name],[sci2exp(funtyp)],[sci2exp(model.in1)],[sci2exp(model.out)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]];
+ gr_i = [];
+ x = standard_define([2,2],model,label,gr_i);
}
generic_block2.prototype.details = function generic_block2() {
}
generic_block2.prototype.get = function generic_block2() {
}
generic_block2.prototype.set = function generic_block2() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-if (size(label,"*")==14) {
-label[9-1]=[];
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ if (size(label,"*")==14) {
+ label[9-1] = [];
}
-while (true) {
-[ok,function_name,funtyp,i,o,ci,co,xx,z,rpar,ipar,nmode,nzcr,auto0,depu,dept,lab]=scicos_getvalue("Set GENERIC block parameters",[["simulation function"],["function type (0,1,2,..)"],["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["number of modes"],["number of zero_crossings"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec","sum(%6)","str",1,"str",1),label);
-if (!ok) {
+ while (true) {
+ [ok,function_name,funtyp,i,o,ci,co,xx,z,rpar,ipar,nmode,nzcr,auto0,depu,dept,lab] = scicos_getvalue("Set GENERIC block parameters",[["simulation function"],["function type (0,1,2,..)"],["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["Real parameters vector"],["Integer parameters vector"],["number of modes"],["number of zero_crossings"],["initial firing vector (<0 for no firing)"],["direct feedthrough (y or n)"],["time dependence (y or n)"]],list("str",1,"vec",1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1,"vec",1,"vec","sum(%6)","str",1,"str",1),label);
+ if (!ok) {
break;
}
-label=lab;
-function_name=stripblanks(function_name);
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-ipar=int(ipar.slice());
-i=int(i.slice());
-o=int(o.slice());
-ci=int(ci.slice());
-co=int(co.slice());
-funtyp=int(funtyp);
-if (funtyp<0) {
+ label = lab;
+ function_name = stripblanks(function_name);
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ ipar = int(ipar.slice());
+ i = int(i.slice());
+ o = int(o.slice());
+ ci = int(ci.slice());
+ co = int(co.slice());
+ funtyp = int(funtyp);
+ if (funtyp<0) {
message("function type cannot be negative");
-ok=false;
+ ok = false;
}
-if ([[ci],[co]]!=[]) {
-if (max([[ci],[co]])>1) {
+ if ([[ci],[co]]!=[]) {
+ if (max([[ci],[co]])>1) {
message("vector event links not supported");
-ok=false;
+ ok = false;
}
}
-depu=stripblanks(depu);
-if (part(depu,1)=="y") {
-depu=true;
-} else {
-depu=false;
+ depu = stripblanks(depu);
+ if (part(depu,1)=="y") {
+ depu = true;
+ } else {
+ depu = false;
}
-dept=stripblanks(dept);
-if (part(dept,1)=="y") {
-dept=true;
-} else {
-dept=false;
+ dept = stripblanks(dept);
+ if (part(dept,1)=="y") {
+ dept = true;
+ } else {
+ dept = false;
}
-dep_ut=[depu,dept];
-if (ok) {
-[model,graphics,ok]=check_io(model,graphics,i,o,ci,co);
+ dep_ut = [depu,dept];
+ if (ok) {
+ [model,graphics,ok] = check_io(model,graphics,i,o,ci,co);
}
-if (ok) {
-if (funtyp==3) {
-needcompile=4;
+ if (ok) {
+ if (funtyp==3) {
+ needcompile = 4;
}
-model.sim=list(function_name,funtyp);
-model.state=xx;
-model.dstate=z;
-model.rpar=rpar;
-model.ipar=ipar;
-model.firing=auto0;
-model.nzcross=nzcr;
-model.nmode=nmode;
-model.dep_ut=dep_ut;
-arg1.model=model;
-graphics.exprs=label;
-arg1.graphics=graphics;
-x=arg1;
+ model.sim = list(function_name,funtyp);
+ model.state = xx;
+ model.dstate = z;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.firing = auto0;
+ model.nzcross = nzcr;
+ model.nmode = nmode;
+ model.dep_ut = dep_ut;
+ arg1.model = model;
+ graphics.exprs = label;
+ arg1.graphics = graphics;
+ x = arg1;
break;
}
}
diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js
index ec554743..6e4c62dc 100644
--- a/js/Misc/generic_block3.js
+++ b/js/Misc/generic_block3.js
@@ -1,100 +1,100 @@
/* autogenerated from "macros/Misc/generic_block3.sci" */
function generic_block3() {
generic_block3.prototype.define = function generic_block3() {
-model=scicos_model();
-function_name="sinblk";
-funtyp=4;
-model.sim=list(function_name,funtyp);
-model.in1=1;
-model.in2=1;
-model.intyp=1;
-model.out=1;
-model.out2=1;
-model.outtyp=1;
-model.dep_ut=[true,false];
-label=[[function_name],[sci2exp(funtyp)],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2]),sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]];
-gr_i=[];
-x=standard_define([4,2],model,label,gr_i);
+ model = scicos_model();
+ function_name = "sinblk";
+ funtyp = 4;
+ model.sim = list(function_name,funtyp);
+ model.in1 = 1;
+ model.in2 = 1;
+ model.intyp = 1;
+ model.out = 1;
+ model.out2 = 1;
+ model.outtyp = 1;
+ model.dep_ut = [true,false];
+ label = [[function_name],[sci2exp(funtyp)],[sci2exp([model.in1,model.in2])],[sci2exp(model.intyp)],[sci2exp([model.out,model.out2]),sci2exp(model.outtyp)],[sci2exp(model.evtin)],[sci2exp(model.evtout)],[sci2exp(model.state)],[sci2exp(model.dstate)],[sci2exp(model.odstate)],[sci2exp(model.rpar)],[sci2exp(model.ipar)],[sci2exp(model.opar)],[sci2exp(model.nmode)],[sci2exp(model.nzcross)],[sci2exp(model.firing)],["y"],["n"]];
+ gr_i = [];
+ x = standard_define([4,2],model,label,gr_i);
}
generic_block3.prototype.details = function generic_block3() {
}
generic_block3.prototype.get = function generic_block3() {
}
generic_block3.prototype.set = function generic_block3() {
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-label=graphics.exprs;
-if (size(label,"*")==14) {
-label[9-1]=[];
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ label = graphics.exprs;
+ if (size(label,"*")==14) {
+ label[9-1] = [];
}
-while (true) {
-[ok,function_name,funtyp,in1,it,out,ot,ci,co,xx,z,oz,rpar,ipar,opar,nmode,nzcr,auto0,depu,dept,lab]=scicos_getvalue("Set GENERIC block parameters",[["Simulation function"],["Function type (0,1,2,..)"],["Input ports sizes"],["Input ports type"],["Output port sizes"],["Output ports type"],["Input event ports sizes"],["Output events ports sizes"],["Initial continuous state"],["Initial discrete state"],["Initial object state"],["Real parameters vector"],["Integer parameters vector"],["Object parameters list"],["Number of modes"],["Number of zero crossings"],["Initial firing vector (<0 for no firing)"],["Direct feedthrough (y or n)"],["Time dependence (y or n)"]],list("str",1,"vec",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label);
-if (!ok) {
+ while (true) {
+ [ok,function_name,funtyp,in1,it,out,ot,ci,co,xx,z,oz,rpar,ipar,opar,nmode,nzcr,auto0,depu,dept,lab] = scicos_getvalue("Set GENERIC block parameters",[["Simulation function"],["Function type (0,1,2,..)"],["Input ports sizes"],["Input ports type"],["Output port sizes"],["Output ports type"],["Input event ports sizes"],["Output events ports sizes"],["Initial continuous state"],["Initial discrete state"],["Initial object state"],["Real parameters vector"],["Integer parameters vector"],["Object parameters list"],["Number of modes"],["Number of zero crossings"],["Initial firing vector (<0 for no firing)"],["Direct feedthrough (y or n)"],["Time dependence (y or n)"]],list("str",1,"vec",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label);
+ if (!ok) {
break;
}
-label=lab;
-function_name=stripblanks(function_name);
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-ipar=int(ipar.slice());
-ci=int(ci.slice());
-co=int(co.slice());
-funtyp=funtyp;
-if (funtyp<0) {
+ label = lab;
+ function_name = stripblanks(function_name);
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ ipar = int(ipar.slice());
+ ci = int(ci.slice());
+ co = int(co.slice());
+ funtyp = funtyp;
+ if (funtyp<0) {
message("function type cannot be negative");
-ok=false;
+ ok = false;
}
-if ([[ci],[co]]!=[]) {
-if (max([[ci],[co]])>1) {
+ if ([[ci],[co]]!=[]) {
+ if (max([[ci],[co]])>1) {
message("vector event links not supported");
-ok=false;
+ ok = false;
}
}
-if (this.type[opar-1]!=15) {
+ if (this.type[opar-1]!=15) {
message("object parameter must be a list");
-ok=false;
+ ok = false;
}
-if (this.type[oz-1]!=15) {
+ if (this.type[oz-1]!=15) {
message("discrete object state must be a list");
-ok=false;
+ ok = false;
}
-depu=stripblanks(depu);
-if (part(depu,1)=="y") {
-depu=true;
-} else {
-depu=false;
+ depu = stripblanks(depu);
+ if (part(depu,1)=="y") {
+ depu = true;
+ } else {
+ depu = false;
}
-dept=stripblanks(dept);
-if (part(dept,1)=="y") {
-dept=true;
-} else {
-dept=false;
+ dept = stripblanks(dept);
+ if (part(dept,1)=="y") {
+ dept = true;
+ } else {
+ dept = false;
}
-dep_ut=[depu,dept];
-if (ok) {
-[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ci,co);
+ dep_ut = [depu,dept];
+ if (ok) {
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ci,co);
}
-if (ok) {
-if (funtyp==3) {
-needcompile=4;
+ if (ok) {
+ if (funtyp==3) {
+ needcompile = 4;
}
-model.sim=list(function_name,funtyp);
-model.state=xx;
-model.dstate=z;
-model.odstate=oz;
-model.rpar=rpar;
-model.ipar=ipar;
-model.opar=opar;
-model.firing=auto0;
-model.nzcross=nzcr;
-model.nmode=nmode;
-model.dep_ut=dep_ut;
-arg1.model=model;
-graphics.exprs=label;
-arg1.graphics=graphics;
-x=arg1;
+ model.sim = list(function_name,funtyp);
+ model.state = xx;
+ model.dstate = z;
+ model.odstate = oz;
+ model.rpar = rpar;
+ model.ipar = ipar;
+ model.opar = opar;
+ model.firing = auto0;
+ model.nzcross = nzcr;
+ model.nmode = nmode;
+ model.dep_ut = dep_ut;
+ arg1.model = model;
+ graphics.exprs = label;
+ arg1.graphics = graphics;
+ x = arg1;
break;
}
}
diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js
index 12da9da6..9e45f43e 100644
--- a/js/Misc/scifunc_block.js
+++ b/js/Misc/scifunc_block.js
@@ -1,89 +1,89 @@
/* autogenerated from "macros/Misc/scifunc_block.sci" */
function scifunc_block() {
scifunc_block.prototype.define = function scifunc_block() {
-in1=1;
-out=1;
-clkin=[];
-clkout=[];
-x0=[];
-z0=[];
-typ="c";
-auto=[];
-rpar=[];
-model=scicos_model();
-model.sim=list("scifunc",3);
-model.in1=in1;
-model.out=out;
-model.evtin=clkin;
-model.evtout=clkout;
-model.state=x0;
-model.dstate=z0;
-model.rpar=rpar;
-model.ipar=0;
-model.opar=list();
-model.blocktype=typ;
-model.firing=auto;
-model.dep_ut=[true,false];
-exprs=list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ out = 1;
+ clkin = [];
+ clkout = [];
+ x0 = [];
+ z0 = [];
+ typ = "c";
+ auto = [];
+ rpar = [];
+ model = scicos_model();
+ model.sim = list("scifunc",3);
+ model.in1 = in1;
+ model.out = out;
+ model.evtin = clkin;
+ model.evtout = clkout;
+ model.state = x0;
+ model.dstate = z0;
+ model.rpar = rpar;
+ model.ipar = 0;
+ model.opar = list();
+ model.blocktype = typ;
+ model.firing = auto;
+ model.dep_ut = [true,false];
+ exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
scifunc_block.prototype.details = function scifunc_block() {
}
scifunc_block.prototype.get = function scifunc_block() {
}
scifunc_block.prototype.set = function scifunc_block() {
-needcompile=0;
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-if (size(exprs[1-1],"*")==8) {
-exprs[1-1][9-1]="0";
+ needcompile = 0;
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ if (size(exprs[1-1],"*")==8) {
+ exprs[1-1][9-1] = "0";
}
-while (true) {
-[ok,i,o,ci,co,xx,z,rpar,auto0,deptime,lab]=scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],[["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["System parameters vector"],["initial firing vector (<0 for no firing)"],["is block always active (0:no, 1:yes)"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%4)","vec",1),exprs[1-1]);
-if (!ok) {
+ while (true) {
+ [ok,i,o,ci,co,xx,z,rpar,auto0,deptime,lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],[["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["System parameters vector"],["initial firing vector (<0 for no firing)"],["is block always active (0:no, 1:yes)"]],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec","sum(%4)","vec",1),exprs[1-1]);
+ if (!ok) {
break;
}
-exprs[1-1]=lab;
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-nrp=prod(size(rpar));
-i=int(i.slice());
-ni=size(i,1);
-o=int(o.slice());
-no=size(o,1);
-ci=int(ci.slice());
-nci=size(ci,1);
-co=int(co.slice());
-nco=size(co,1);
-[ok,tt,dep_ut]=genfunc1(exprs[2-1],i,o,nci,nco,size(xx,1),size(z,1),nrp,"c");
-dep_ut[2-1]=(1==deptime);
-if (!ok) {
+ exprs[1-1] = lab;
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ nrp = prod(size(rpar));
+ i = int(i.slice());
+ ni = size(i,1);
+ o = int(o.slice());
+ no = size(o,1);
+ ci = int(ci.slice());
+ nci = size(ci,1);
+ co = int(co.slice());
+ nco = size(co,1);
+ [ok,tt,dep_ut] = genfunc1(exprs[2-1],i,o,nci,nco,size(xx,1),size(z,1),nrp,"c");
+ dep_ut[2-1] = (1==deptime);
+ if (!ok) {
break;
}
-[model,graphics,ok]=check_io(model,graphics,i,o,ci,co);
-if (ok) {
-auto=auto0;
-model.state=xx;
-model.dstate=z;
-model.rpar=rpar;
-if (model.ipar!=0) {
-model.opar=model.ipar;
-model.ipar=0;
+ [model,graphics,ok] = check_io(model,graphics,i,o,ci,co);
+ if (ok) {
+ auto = auto0;
+ model.state = xx;
+ model.dstate = z;
+ model.rpar = rpar;
+ if (model.ipar!=0) {
+ model.opar = model.ipar;
+ model.ipar = 0;
}
-if (or(model.opar!=tt)) {
-needcompile=4;
+ if (or(model.opar!=tt)) {
+ needcompile = 4;
}
-model.opar=tt;
-model.firing=auto;
-model.dep_ut=dep_ut;
-x.model=model;
-exprs[2-1]=tt;
-graphics.exprs=exprs;
-x.graphics=graphics;
+ model.opar = tt;
+ model.firing = auto;
+ model.dep_ut = dep_ut;
+ x.model = model;
+ exprs[2-1] = tt;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js
index e9d6bd44..1a181dc5 100644
--- a/js/Misc/scifunc_block_m.js
+++ b/js/Misc/scifunc_block_m.js
@@ -1,91 +1,91 @@
/* autogenerated from "macros/Misc/scifunc_block_m.sci" */
function scifunc_block_m() {
scifunc_block_m.prototype.define = function scifunc_block_m() {
-in1=1;
-out=1;
-clkin=[];
-clkout=[];
-x0=[];
-z0=[];
-typ="c";
-auto=[];
-rpar=[];
-it=1;
-model=scicos_model();
-model.sim=list("scifunc",3);
-model.in1=in1;
-model.in2=in1;
-model.intyp=it;
-model.out=out;
-model.out2=out;
-model.outtyp=it;
-model.evtin=clkin;
-model.evtout=clkout;
-model.state=x0;
-model.dstate=z0;
-model.rpar=rpar;
-model.ipar=0;
-model.opar=list();
-model.blocktype=typ;
-model.firing=auto;
-model.dep_ut=[true,false];
-exprs=list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
-gr_i=[];
-x=standard_define([4,2],model,exprs,gr_i);
+ in1 = 1;
+ out = 1;
+ clkin = [];
+ clkout = [];
+ x0 = [];
+ z0 = [];
+ typ = "c";
+ auto = [];
+ rpar = [];
+ it = 1;
+ model = scicos_model();
+ model.sim = list("scifunc",3);
+ model.in1 = in1;
+ model.in2 = in1;
+ model.intyp = it;
+ model.out = out;
+ model.out2 = out;
+ model.outtyp = it;
+ model.evtin = clkin;
+ model.evtout = clkout;
+ model.state = x0;
+ model.dstate = z0;
+ model.rpar = rpar;
+ model.ipar = 0;
+ model.opar = list();
+ model.blocktype = typ;
+ model.firing = auto;
+ model.dep_ut = [true,false];
+ exprs = list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
+ gr_i = [];
+ x = standard_define([4,2],model,exprs,gr_i);
}
scifunc_block_m.prototype.details = function scifunc_block_m() {
}
scifunc_block_m.prototype.get = function scifunc_block_m() {
}
scifunc_block_m.prototype.set = function scifunc_block_m() {
-needcompile=0;
-x=arg1;
-model=arg1.model;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-while (true) {
-[ok,i,o,ci,co,xx,z,rpar,auto0,deptime,lab]=scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],[["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["System parameters vector"],["initial firing vector (<0 for no firing)"],["is block always active (0:no, 1:yes)"]],list("mat",[-1,2],"mat",[-2,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs[1-1]);
-if (!ok) {
+ needcompile = 0;
+ x = arg1;
+ model = arg1.model;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ while (true) {
+ [ok,i,o,ci,co,xx,z,rpar,auto0,deptime,lab] = scicos_getvalue([["Set scifunc_block parameters"],["only regular blocks supported"]],[["input ports sizes"],["output port sizes"],["input event ports sizes"],["output events ports sizes"],["initial continuous state"],["initial discrete state"],["System parameters vector"],["initial firing vector (<0 for no firing)"],["is block always active (0:no, 1:yes)"]],list("mat",[-1,2],"mat",[-2,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",1),exprs[1-1]);
+ if (!ok) {
break;
}
-exprs[1-1]=lab;
-xx=xx.slice();
-z=z.slice();
-rpar=rpar.slice();
-it=ones(1,size(i,1));
-ot=ones(1,size(o,1));
-nrp=prod(size(rpar));
-ni=size(i,1);
-no=size(o,1);
-ci=int(ci.slice());
-nci=size(ci,1);
-co=int(co.slice());
-nco=size(co,1);
-[ok,tt,dep_ut]=genfunc2(exprs[2-1],i,o,nci,nco,size(xx,1),size(z,1),nrp,"c");
-dep_ut[2-1]=(1==deptime);
-if (!ok) {
+ exprs[1-1] = lab;
+ xx = xx.slice();
+ z = z.slice();
+ rpar = rpar.slice();
+ it = ones(1,size(i,1));
+ ot = ones(1,size(o,1));
+ nrp = prod(size(rpar));
+ ni = size(i,1);
+ no = size(o,1);
+ ci = int(ci.slice());
+ nci = size(ci,1);
+ co = int(co.slice());
+ nco = size(co,1);
+ [ok,tt,dep_ut] = genfunc2(exprs[2-1],i,o,nci,nco,size(xx,1),size(z,1),nrp,"c");
+ dep_ut[2-1] = (1==deptime);
+ if (!ok) {
break;
}
-[model,graphics,ok]=set_io(model,graphics,list(i,it),list(o,ot),ci,co);
-if (ok) {
-auto=auto0;
-model.state=xx;
-model.dstate=z;
-model.rpar=rpar;
-if (model.ipar!=0) {
-model.opar=model.ipar;
-model.ipar=0;
+ [model,graphics,ok] = set_io(model,graphics,list(i,it),list(o,ot),ci,co);
+ if (ok) {
+ auto = auto0;
+ model.state = xx;
+ model.dstate = z;
+ model.rpar = rpar;
+ if (model.ipar!=0) {
+ model.opar = model.ipar;
+ model.ipar = 0;
}
-if (or(model.opar!=tt)) {
-needcompile=4;
+ if (or(model.opar!=tt)) {
+ needcompile = 4;
}
-model.opar=tt;
-model.firing=auto;
-model.dep_ut=dep_ut;
-x.model=model;
-exprs[2-1]=tt;
-graphics.exprs=exprs;
-x.graphics=graphics;
+ model.opar = tt;
+ model.firing = auto;
+ model.dep_ut = dep_ut;
+ x.model = model;
+ exprs[2-1] = tt;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
break;
}
}