diff options
author | Sunil Shetye | 2018-07-11 13:05:13 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-11 15:21:08 +0530 |
commit | 079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch) | |
tree | 785ed59b5b238203a9e91f3e323da59d1083d86e /js/Misc | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/Misc')
61 files changed, 1476 insertions, 1488 deletions
diff --git a/js/Misc/AUTOMAT.js b/js/Misc/AUTOMAT.js index e34f5a85..654543e9 100644 --- a/js/Misc/AUTOMAT.js +++ b/js/Misc/AUTOMAT.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/Misc/AUTOMAT.sci" */ function AUTOMAT() { AUTOMAT.prototype.define = function AUTOMAT() { - NMode = 2; + var NMode = 2; this.Minitial = 1; - NX = 1; + var 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]; + var C1 = [2]; + var C2 = [1]; + var exprs = [[string(NMode)],[string(this.Minitial)],[string(NX)],[sci2exp(this.X0)],[sci2exp(this.XP)],[sci2exp(C1)],[sci2exp(C2)]]; + var ipar = [[NMode],[this.Minitial],[NX],[this.XP],[C1],[C2]]; + var rpar = [this.X0]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["automat"]), new ScilabDouble([10004])); this.model.in1 = new ScilabDouble([2*NX+1],[2*NX+1]); @@ -23,7 +23,7 @@ function AUTOMAT() { this.model.dep_ut = [false,true]; this.model.ipar = new ScilabDouble(ipar); this.model.rpar = rpar; - gr_i = []; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -37,50 +37,52 @@ function AUTOMAT() { } AUTOMAT.prototype.set = function AUTOMAT() { this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - ipar = this.model.ipar; - NMode = ipar[1-1]; - NX = ipar[3-1]; + var ipar = this.model.ipar; + var NMode = ipar[1-1]; + var 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]"; + var CX = "C1"; + var MSG0 = "\'Jump from Mode "; + var MSG2 = ":[..;M_final(Guard=In("; + var MSG3 = ").i);..]\'"; + var MSG = MSG0+"1"+MSG2+"1"+MSG3; + var 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]"; + var CX = CX+","+"C"+string(i); + var MSG = MSG+";"+MSG0+string(i)+MSG2+string(i)+MSG3; + var 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)"; + var 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) { break; } - NMode_old = size(exprs,"*")-5; - ModifEncore = false; + var NMode_old = size(exprs,"*")-5; + var ModifEncore = false; if ((NMode_old>NMode)) { exprs.slice(NMode+6-1,NMode_old+5) = []; - ModifEncore = true; + var ModifEncore = true; } if ((NMode_old<NMode)) { exprs.slice(NMode_old+6-1,NMode+5) = exprs[NMode_old+4-1]; - ModifEncore = true; + var ModifEncore = true; } if ((NX!=size(this.X0,"*"))) { messagebox("the size of intial continuous-time states should be NX="+string(NX),"modal","error"); - ModifEncore = true; + var ModifEncore = true; } - [rXP,cXP] = size(this.XP); + var tmpvar0 = size(this.XP) + var rXP = tmpvar0[0] + var cXP = tmpvar0[1]; if (cXP!=NX) { messagebox("Xproperty matrix is not valid: it should have NX="+string(NX)+" columns","modal","error"); - ModifEncore = true; + var 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; + var ModifEncore = true; } else if ((rXP==1)) { for (i=1;i<=NMode-1;i+=1) { this.XP = [[this.XP],[this.XP[1-1].slice()]]; @@ -88,39 +90,42 @@ function AUTOMAT() { } 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); + var ipar = [[NMode],[this.Minitial],[NX],[this.XP]]; + var rpar = matrix(this.X0,NX,1); + var INP = ones(NMode,1); if (NX>0) { - OUT = [[2],[2*NX]]; + var OUT = [[2],[2*NX]]; } else { - OUT = [2]; + var OUT = [2]; } - MaxModes = 1; - nzcross = 0; + var MaxModes = 1; + var nzcross = 0; for (i=1;i<=NMode;i+=1) { - Ci = evstr(exprs[5+i-1]); - ipar = [[ipar],[Ci]]; + var Ci = evstr(exprs[5+i-1]); + var ipar = [[ipar],[Ci]]; INP[i-1][1-1] = 2*NX+length(Ci); if ((nzcross<length(Ci))) { - nzcross = length(Ci); + var nzcross = length(Ci); } if ((MaxModes<max(Ci))) { - MaxModes = max(Ci); - imax = i; + var MaxModes = max(Ci); + var imax = i; } } 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; + var ModifEncore = true; } if (MaxModes<NMode) { messagebox(["There is an unused Mode or the Number of Modes should be "+string(MaxModes)],"modal","error"); - ModifEncore = true; + var ModifEncore = true; } } if (!ModifEncore) { - [this.model,graphics,this.ok] = check_io(this.model,graphics,INP,OUT,[],[1]); + var tmpvar1 = check_io(this.model,graphics,INP,OUT,[],[1]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + this.ok = tmpvar1[2]; if (!this.ok) { break; } diff --git a/js/Misc/AUTOMAT.pickle b/js/Misc/AUTOMAT.pickle index c7fee995..2ff4f2eb 100644 --- a/js/Misc/AUTOMAT.pickle +++ b/js/Misc/AUTOMAT.pickle @@ -31,51 +31,51 @@ NsS'rpar' p6 S'vector' p7 -sS'model.out' +sS'ModifEncore' p8 -S'matrix' +S'boolean' p9 -sS'exprs.slice(NMode_old+6-1,NMode+5)' +sS'model.out' p10 -g2 -sS'MSG' +S'matrix' p11 -S'string' +sS'exprs.slice(NMode_old+6-1,NMode+5)' p12 -sS'ModifEncore' +g2 +sS'MSG' p13 -S'boolean' +S'string' p14 -sS'MaxModes' +sS'XP' p15 +g11 +sS'MaxModes' +p16 g2 sS'nzcross' -p16 +p17 g2 sS'model.in1' -p17 -g9 -sS'MSG0' p18 -g12 -sS'MSG3' +g11 +sS'MSG0' p19 -g12 -sS'MSG2' +g14 +sS'MSG3' p20 -g12 -sS'model.nzcross' +g14 +sS'MSG2' p21 -g2 -sS'XP' +g14 +sS'model.nzcross' p22 -g9 +g2 sS'NX' p23 g2 sS'graphics.gr_i[1-1][1-1]' p24 -g12 +g14 sS'C2' p25 g7 @@ -98,84 +98,78 @@ g2 sS'model.rpar' p32 g7 -sS'y' -p33 -g7 sS'CX' -p34 -g12 +p33 +g14 sS'INP[i-1][1-1]' -p35 +p34 g2 sS'VEC' -p36 -g12 +p35 +g14 sS'GTV' -p37 -g12 +p36 +g14 sS'graphics' -p38 +p37 g4 sS'model.state' -p39 +p38 g2 sS'exprs.slice(NMode+6-1,NMode_old+5)' -p40 +p39 g7 sS'model.ipar' -p41 -g9 +p40 +g11 sS'typ' -p42 +p41 g7 sS'C1' -p43 +p42 g7 sS'NMode' -p44 +p43 g2 sS'Ci' -p45 +p44 g2 sS'model.blocktype' -p46 -g12 -sS'[this.model,graphics,this.ok]' -p47 -g30 +p45 +g14 sS'x.graphics' -p48 +p46 g4 sS'INP' -p49 +p47 g2 sS'x.model' -p50 +p48 g4 sS'model.dep_ut' -p51 +p49 g7 sS'exprs' -p52 -g9 +p50 +g11 sS'gr_i' -p53 +p51 g7 sS'ipar' -p54 -g9 -sS'[rXP,cXP]' -p55 -g2 +p52 +g11 +sS'y' +p53 +g7 sS'x' -p56 +p54 g2 sS'model' -p57 +p55 g4 sS'Minitial' -p58 +p56 g2 sS'imax' -p59 +p57 Ns.
\ No newline at end of file diff --git a/js/Misc/BACKLASH.js b/js/Misc/BACKLASH.js index bbdfb0f2..ffc9f0d7 100644 --- a/js/Misc/BACKLASH.js +++ b/js/Misc/BACKLASH.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/BACKLASH.sci" */ function BACKLASH() { BACKLASH.prototype.define = function BACKLASH() { - exprs = [["0"],["1"],["1"]]; + var exprs = [["0"],["1"],["1"]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["backlash"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -10,7 +10,7 @@ function BACKLASH() { this.model.nzcross = new ScilabDouble([2]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -30,10 +30,10 @@ function BACKLASH() { this.gap = arguments[0]["gap"] this.zcr = arguments[0]["zcr"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - rpar = this.model.rpar; + var rpar = this.model.rpar; while (true) { [ok,this.ini,this.gap,this.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) { diff --git a/js/Misc/BOUNCE.js b/js/Misc/BOUNCE.js index 3399948c..1cddf4f2 100644 --- a/js/Misc/BOUNCE.js +++ b/js/Misc/BOUNCE.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Misc/BOUNCE.sci" */ function BOUNCE() { BOUNCE.prototype.define = function BOUNCE() { - n = 2; - k = 1; - ipar = []; + var n = 2; + var k = 1; + var ipar = []; for (i=1;i<=n;i+=1) { for (j=i+1;j<=n;j+=1) { ipar[k-1] = i; - k = k+1; + var k = k+1; ipar[k-1] = j; - k = k+1; + var k = k+1; } } this.walls = [[0],[5],[0],[5]]; @@ -21,8 +21,8 @@ function BOUNCE() { this.C = 0; this.rpar1 = ones(n,1); this.rpar2 = this.rpar1; - state = [this.x,this.xd,this.y,this.yd]; - state = transpose(state); + var state = [this.x,this.xd,this.y,this.yd]; + var state = transpose(state); this.model = scicos_model(); this.model.sim = list(new ScilabString(["bounce_ball"]), new ScilabDouble([4])); this.model.in1 = []; @@ -33,8 +33,8 @@ function BOUNCE() { this.model.nzcross = new ScilabDouble([n*(n-1)/2+4*n]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.rpar1))],[strcat(sci2exp(this.rpar2))],[strcat(sci2exp(this.walls))],[strcat(sci2exp(this.x))],[strcat(sci2exp(this.xd))],[strcat(sci2exp(this.y))],[strcat(sci2exp(this.yd))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.rpar1))],[strcat(sci2exp(this.rpar2))],[strcat(sci2exp(this.walls))],[strcat(sci2exp(this.x))],[strcat(sci2exp(this.xd))],[strcat(sci2exp(this.y))],[strcat(sci2exp(this.yd))]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -66,8 +66,8 @@ function BOUNCE() { this.g = parseFloat(arguments[0]["g"]) this.C = parseFloat(arguments[0]["C"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")<9) { exprs[8-1] = "9.81"; @@ -84,7 +84,7 @@ function BOUNCE() { this.yd = this.yd.slice(); this.rpar1 = this.rpar1.slice(); this.rpar2 = this.rpar2.slice(); - n = size(this.xt,"*"); + var n = size(this.xt,"*"); this.walls = this.walls.slice(); if (this.walls[1-1]>this.walls[2-1]) { this.walls = this.walls[[2,1]-1]; @@ -94,30 +94,33 @@ function BOUNCE() { } if (n!=size(this.y,"*")||n!=size(this.rpar1,"*")||n!=size(this.rpar2,"*")||n!=size(this.xd,"*")||n!=size(this.yd,"*")) { message("All vectors must have equal size"); - ok = false; + var ok = false; } else if (!(min([[this.rpar1],[this.rpar2]])>0)) { message("Mass and radius must be >0"); - ok = false; + var ok = false; } if (!ok) { break; } - [this.model,graphics,ok] = check_io(this.model,graphics,[],[n,n],[],[]); + var tmpvar0 = check_io(this.model,graphics,[],[n,n],[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (ok) { - k = 1; - ipar = []; + var k = 1; + var ipar = []; for (i=1;i<=n;i+=1) { for (j=i+1;j<=n;j+=1) { ipar[k-1] = i; - k = k+1; + var k = k+1; ipar[k-1] = j; - k = k+1; + var k = k+1; } } this.model.rpar = new ScilabDouble([this.rpar1],[this.rpar2],[this.walls],[this.g],[this.C]); this.model.ipar = ipar; - state = [this.xt,this.xd,this.y,this.yd]; - state = transpose(state); + var state = [this.xt,this.xd,this.y,this.yd]; + var state = transpose(state); this.model.state = state.slice(); this.model.nzcross = new ScilabDouble([n*(n-1)/2+4*n]); graphics.exprs = exprs; diff --git a/js/Misc/BOUNCE.pickle b/js/Misc/BOUNCE.pickle index f718671d..18a1958e 100644 --- a/js/Misc/BOUNCE.pickle +++ b/js/Misc/BOUNCE.pickle @@ -70,76 +70,73 @@ p18 sS'C' p19 g13 -sS'[this.model,graphics,ok]' -p20 -g18 sS'yd' -p21 +p20 g5 sS'model.rpar' -p22 +p21 g5 sS'walls' -p23 +p22 g5 sS'rpar1' -p24 +p23 g13 sS'rpar2' -p25 +p24 g13 sS'graphics' -p26 +p25 g2 sS'model.ipar' -p27 +p26 g9 sS'typ' -p28 +p27 g9 sS'exprs[8-1]' -p29 +p28 g16 sS'ok' -p30 +p29 S'boolean' -p31 +p30 sS'model.blocktype' -p32 +p31 g16 sS'g' +p32 +g13 +sS'k' p33 g13 -sS'ipar[k-1]' +sS'model.dep_ut' p34 -NsS'model.dep_ut' -p35 g9 sS'n' -p36 +p35 g13 sS'exprs' -p37 +p36 g5 sS'gr_i' -p38 +p37 g9 sS'ipar' -p39 +p38 g9 sS'y' -p40 +p39 g5 sS'x' -p41 +p40 g13 sS'model' -p42 +p41 g2 -sS'k' +sS'ipar[k-1]' +p42 +NsS'model.state' p43 -g13 -sS'model.state' -p44 g9 s.
\ No newline at end of file diff --git a/js/Misc/BOUNCEXY.js b/js/Misc/BOUNCEXY.js index fae911bf..1295acf6 100644 --- a/js/Misc/BOUNCEXY.js +++ b/js/Misc/BOUNCEXY.js @@ -15,7 +15,7 @@ function BOUNCEXY() { this.model.in2 = new ScilabDouble([1],[1]); this.model.intyp = new ScilabDouble([1],[1]); this.model.evtin = new ScilabDouble([1]); - z = []; + var z = []; for (i=1;i<=size(this.clrs,"*");i+=1) { z[6*(i-1)+1-1] = 0; z[6*(i-1)+2-1] = 0; @@ -30,8 +30,8 @@ function BOUNCEXY() { this.model.blocktype = new ScilabString(["d"]); this.model.firing = []; this.model.dep_ut = [false,false]; - exprs = [[strcat(sci2exp(this.clrs))],[strcat(sci2exp(this.siz))],[strcat(sci2exp(this.win))],[strcat(sci2exp(1))],[strcat(sci2exp(this.xmin))],[strcat(sci2exp(this.xmax))],[strcat(sci2exp(this.ymin))],[strcat(sci2exp(this.ymax))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.clrs))],[strcat(sci2exp(this.siz))],[strcat(sci2exp(this.win))],[strcat(sci2exp(1))],[strcat(sci2exp(this.xmin))],[strcat(sci2exp(this.xmax))],[strcat(sci2exp(this.ymin))],[strcat(sci2exp(this.ymax))]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -61,38 +61,38 @@ function BOUNCEXY() { this.ymin = parseFloat(arguments[0]["ymin"]) this.ymax = parseFloat(arguments[0]["ymax"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - dstate = this.model.dstate; + var dstate = this.model.dstate; while (true) { [ok,this.clrs,this.siz,this.win,this.imode,this.xmin,this.xmax,this.ymin,this.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 = []; + var mess = []; if (size(this.clrs,"*")!=size(this.siz,"*")) { - mess = [[mess],["colors and radii must have equal size (number of balls)"],[" "]]; - ok = false; + var mess = [[mess],["colors and radii must have equal size (number of balls)"],[" "]]; + var ok = false; } if (this.win<-1) { - mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; - ok = false; + var mess = [[mess],["Window number cannot be inferior than -1"],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - ipar = [[this.win],[this.imode],[this.clrs.slice()]]; - z = []; + var rpar = [[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + var ipar = [[this.win],[this.imode],[this.clrs.slice()]]; + var z = []; for (i=1;i<=size(this.clrs,"*");i+=1) { z[6*(i-1)+1-1] = 0; z[6*(i-1)+2-1] = 0; diff --git a/js/Misc/BPLATFORM.js b/js/Misc/BPLATFORM.js index 6ea0a30a..02a231db 100644 --- a/js/Misc/BPLATFORM.js +++ b/js/Misc/BPLATFORM.js @@ -16,8 +16,8 @@ function BPLATFORM() { this.model.rpar = new ScilabDouble([this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = string(this.model.rpar); - gr_i = []; + var exprs = string(this.model.rpar); + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -45,32 +45,32 @@ function BPLATFORM() { this.ymin = parseFloat(arguments[0]["ymin"]) this.ymax = parseFloat(arguments[0]["ymax"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - dstate = this.model.dstate; + var dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.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 = []; + var mess = []; if (this.plen<=0||this.csiz<=0) { - mess = [[mess],["Pendulum length and cart size must be positive."],[" "]]; - ok = false; + var mess = [[mess],["Pendulum length and cart size must be positive."],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + var rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; this.model.rpar = new ScilabDouble(rpar); graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Misc/CBLOCK.js b/js/Misc/CBLOCK.js index 62d3d677..faf7b1e3 100644 --- a/js/Misc/CBLOCK.js +++ b/js/Misc/CBLOCK.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/Misc/CBLOCK.sci" */ function CBLOCK() { CBLOCK.prototype.define = function CBLOCK() { - in1 = 1; - out = 1; - clkin = []; - clkout = []; - x0 = []; - z0 = []; - typ = "c"; - auto = []; + var in1 = 1; + var out = 1; + var clkin = []; + var clkout = []; + var x0 = []; + var z0 = []; + var typ = "c"; + var auto = []; this.rpar = []; this.ipar = []; - funam = "toto"; + var funam = "toto"; this.ng = 0; this.model = scicos_model(); this.model.sim = list(new ScilabString([" "]), new ScilabDouble([2004])); @@ -27,8 +27,8 @@ function CBLOCK() { this.model.firing = auto; this.model.dep_ut = [true,false]; this.model.nzcross = new ScilabDouble([this.ng]); - label = list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(this.rpar),sci2exp(this.ipar),sci2exp(auto),"y","n"]),[]); - gr_i = []; + var label = list(transpose([funam,"n",sci2exp(in1),sci2exp(out),sci2exp(clkin),sci2exp(clkout),sci2exp(x0),sci2exp(0),sci2exp(z0),sci2exp(this.rpar),sci2exp(this.ipar),sci2exp(auto),"y","n"]),[]); + var gr_i = []; this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -72,37 +72,37 @@ function CBLOCK() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; while (true) { [ok,this.function_name,this.impli,this.i,this.o,this.ci,this.co,this.xx,this.ng,this.z,this.rpar,this.ipar,this.auto0,this.depu,this.dept,this.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] = this.lab; - funam = stripblanks(this.function_name); + var funam = stripblanks(this.function_name); this.xx = this.xx.slice(); this.z = this.z.slice(); this.rpar = this.rpar.slice(); this.ipar = int(this.ipar.slice()); - nx = size(this.xx,1); - nz = size(this.z,1); + var nx = size(this.xx,1); + var nz = size(this.z,1); this.i = int(this.i.slice()); this.o = int(this.o.slice()); - nout = size(this.o,1); + var nout = size(this.o,1); this.ci = int(this.ci.slice()); - nevin = size(this.ci,1); + var nevin = size(this.ci,1); this.co = int(this.co.slice()); - nevout = size(this.co,1); + var nevout = size(this.co,1); if (part(this.impli,1)=="y") { - funtyp = 12004; + var funtyp = 12004; } else { - funtyp = 2004; + var funtyp = 2004; } if ([[this.ci],[this.co]]!=[]) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); - ok = false; + var ok = false; } } this.depu = stripblanks(this.depu); @@ -117,22 +117,28 @@ function CBLOCK() { } else { this.dept = false; } - dep_ut = [this.depu,this.dept]; + var dep_ut = [this.depu,this.dept]; if (funam==" ") { break; } if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.ng||sign(size(this.model.evtout,"*"))!=sign(nevout)) { - tt = []; + var tt = []; } - tt = label[2-1]; + var tt = label[2-1]; while (true) { - [ok,tt,cancel] = CFORTR2(funam,tt); + var tmpvar0 = CFORTR2(funam,tt) + var ok = tmpvar0[0] + var tt = tmpvar0[1] + var cancel = tmpvar0[2]; if (!ok) { if (cancel) { break; } } else { - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); + var tmpvar1 = check_io(this.model,graphics,this.i,this.o,this.ci,this.co) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { this.model.sim = list(new ScilabDouble([funam]), new ScilabDouble([funtyp])); this.model.in1 = new ScilabDouble([this.i]); diff --git a/js/Misc/CBLOCK.pickle b/js/Misc/CBLOCK.pickle index 104370ff..3aefc656 100644 --- a/js/Misc/CBLOCK.pickle +++ b/js/Misc/CBLOCK.pickle @@ -115,100 +115,94 @@ g8 sS'model.evtin' p29 g8 -sS'label[2-1]' -p30 -g2 sS'model.firing' -p31 +p30 g8 sS'nevout' -p32 +p31 g2 sS'model.sim' -p33 +p32 g25 sS'model.evtout' -p34 +p33 g8 -sS'[ok,tt,cancel]' -p35 -g2 sS'clkout' -p36 +p34 g8 sS'auto' -p37 +p35 g8 -sS'[this.model,graphics,ok]' -p38 -g25 +sS'label[2-1]' +p36 +g2 sS'in1' -p39 +p37 g2 sS'model.rpar' -p40 +p38 g8 sS'model.state' -p41 +p39 g8 sS'graphics' -p42 +p40 g5 sS'x0' -p43 +p41 g8 sS'model.ipar' -p44 +p42 g8 sS'typ' -p45 +p43 g14 sS'ok' -p46 +p44 S'boolean' -p47 +p45 sS'model.blocktype' -p48 +p46 g14 sS'i' -p49 +p47 g2 sS'label[1-1]' -p50 +p48 NsS'x.model' -p51 +p49 g5 sS'o' -p52 +p50 g2 sS'depu' -p53 -g47 +p51 +g45 sS'dept' -p54 -g47 +p52 +g45 sS'gr_i' -p55 +p53 g8 sS'ipar' -p56 +p54 g8 sS'y' -p57 +p55 g8 sS'x' -p58 +p56 g2 sS'model' -p59 +p57 g5 sS'z' -p60 +p58 g8 sS'nout' -p61 +p59 g2 sS'dep_ut' -p62 +p60 g8 s.
\ No newline at end of file diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js index c99b5d9d..15889859 100644 --- a/js/Misc/CBLOCK4.js +++ b/js/Misc/CBLOCK4.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/CBLOCK4.sci" */ function CBLOCK4() { CBLOCK4.prototype.define = function CBLOCK4() { - funam = "toto"; + var funam = "toto"; this.model = scicos_model(); this.model.sim = list(new ScilabString([" "]), new ScilabDouble([2004])); this.model.in1 = new ScilabDouble([1]); @@ -11,8 +11,8 @@ function CBLOCK4() { this.model.out2 = new ScilabDouble([1]); this.model.outtyp = new ScilabDouble([1]); this.model.dep_ut = [true,false]; - label = list([[funam],["n"],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2])],[sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]],[]); - gr_i = []; + var label = list([[funam],["n"],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2])],[sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]],[]); + var gr_i = []; this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -66,34 +66,34 @@ function CBLOCK4() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; while (true) { [ok,this.function_name,this.impli,this.in1,this.it,this.out,this.ot,this.ci,this.co,this.xx,this.z,this.oz,this.rpar,this.ipar,this.opar,this.nmode,this.nzcr,this.auto0,this.depu,this.dept,this.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] = this.lab; - funam = stripblanks(this.function_name); + var funam = stripblanks(this.function_name); this.xx = this.xx.slice(); this.z = this.z.slice(); this.rpar = this.rpar.slice(); this.ipar = int(this.ipar.slice()); - nx = size(this.xx,1); - nz = size(this.z,1); + var nx = size(this.xx,1); + var nz = size(this.z,1); this.ci = int(this.ci.slice()); - nevin = size(this.ci,1); + var nevin = size(this.ci,1); this.co = int(this.co.slice()); - nevout = size(this.co,1); + var nevout = size(this.co,1); if (part(this.impli,1)=="y") { - funtyp = 12004; + var funtyp = 12004; } else { - funtyp = 2004; + var funtyp = 2004; } if ([[this.ci],[this.co]]!=[]) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); - ok = false; + var ok = false; } } if (ok) { @@ -109,19 +109,25 @@ function CBLOCK4() { } else { this.dept = false; } - dep_ut = [this.depu,this.dept]; + var dep_ut = [this.depu,this.dept]; if (funam==" ") { break; } if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.nzcr||sign(size(this.model.evtout,"*"))!=sign(nevout)) { - tt = []; + var tt = []; } - tt = label[2-1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + var tt = label[2-1]; + var tmpvar0 = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { while (true) { - [ok,tt,cancel] = this.CC4[funam-1][tt-1]; + var tmpvar1 = CC4(funam,tt) + var ok = tmpvar1[0] + var tt = tmpvar1[1] + var cancel = tmpvar1[2]; if (!ok) { if (cancel) { break; diff --git a/js/Misc/CBLOCK4.pickle b/js/Misc/CBLOCK4.pickle index e9c89e6b..791d370c 100644 --- a/js/Misc/CBLOCK4.pickle +++ b/js/Misc/CBLOCK4.pickle @@ -26,30 +26,28 @@ aS'nmode' p12 aS'z' p13 -aS'CC4' -p14 aS'xx' -p15 +p14 aS'nzcr' -p16 +p15 aS'depu' -p17 +p16 aS'dept' -p18 +p17 aS'opar' -p19 +p18 aS'oz' -p20 +p19 aS'ipar' -p21 +p20 aS'x' -p22 +p21 aS'model' -p23 +p22 aS'ot' -p24 -atp25 -Rp26 +p23 +atp24 +Rp25 .(dp0 S'model.odstate' p1 @@ -116,85 +114,79 @@ g3 sS'nz' p26 g3 -sS'label[2-1]' -p27 -g3 sS'model.firing' -p28 +p27 NsS'nevout' -p29 +p28 g3 sS'model.sim' -p30 +p29 g24 -sS'[ok,tt,cancel]' -p31 -g3 -sS'[this.model,graphics,ok]' -p32 +sS'label[2-1]' +p30 g3 sS'model.out2' -p33 +p31 g3 sS'model.nmode' -p34 +p32 NsS'model.rpar' -p35 +p33 g9 sS'model.outtyp' -p36 +p34 g3 sS'model.state' -p37 +p35 g9 sS'graphics' -p38 +p36 g6 sS'model.ipar' -p39 +p37 g3 sS'typ' -p40 +p38 g9 sS'model.opar' -p41 +p39 NsS'ok' -p42 +p40 S'boolean' -p43 +p41 sS'label[1-1]' -p44 +p42 NsS'x.model' -p45 +p43 g6 sS'model.dep_ut' -p46 +p44 g9 sS'depu' -p47 -g43 +p45 +g41 sS'dept' -p48 -g43 +p46 +g41 sS'gr_i' -p49 +p47 g9 sS'ipar' -p50 +p48 g3 sS'y' -p51 +p49 g9 sS'x' -p52 +p50 g3 sS'model' -p53 +p51 g6 sS'z' -p54 +p52 g9 sS'dep_ut' -p55 +p53 g9 s.
\ No newline at end of file diff --git a/js/Misc/CONSTRAINT2_c.js b/js/Misc/CONSTRAINT2_c.js index b21ab44f..012099d4 100644 --- a/js/Misc/CONSTRAINT2_c.js +++ b/js/Misc/CONSTRAINT2_c.js @@ -12,8 +12,8 @@ function CONSTRAINT2_c() { this.model.ipar = this.id; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); - gr_i = []; + var exprs = list(strcat(sci2exp(this.x0)),strcat(sci2exp(this.xd0)),strcat(sci2exp(this.id))); + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -33,33 +33,33 @@ function CONSTRAINT2_c() { this.xd0 = inverse(arguments[0]["xd0"]) this.id = inverse(arguments[0]["id"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { - ask_again = false; + var ask_again = false; [ok,this.x0,this.xd0,this.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; } this.x0 = this.x0.slice(); - N = size(this.x0,"*"); + var N = size(this.x0,"*"); this.xd0 = this.xd0.slice(); - Nxd = size(this.xd0,"*"); + var Nxd = size(this.xd0,"*"); this.id = this.id.slice(); - Nid = size(this.id,"*"); + var Nid = size(this.id,"*"); if ((N!=Nxd)||(N!=Nid)) { message("incompatible sizes, states, their derivatives, and ID should be the same size "); - ask_again = true; + var ask_again = true; } if ((N<=0&&!ask_again)) { x_message("number of states (constraints) must be > 0 "); - ask_again = true; + var ask_again = true; } if ((!ask_again)) { for (i=1;i<=N;i+=1) { if (!((this.id[i-1]==0)||(this.id[i-1]==1))) { - ask_again = true; + var 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; } diff --git a/js/Misc/CONSTRAINT_c.js b/js/Misc/CONSTRAINT_c.js index c3c453eb..b25271e6 100644 --- a/js/Misc/CONSTRAINT_c.js +++ b/js/Misc/CONSTRAINT_c.js @@ -10,8 +10,8 @@ function CONSTRAINT_c() { this.model.state = new ScilabDouble(this.x0); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = "0"; - gr_i = []; + var exprs = "0"; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -26,8 +26,8 @@ function CONSTRAINT_c() { CONSTRAINT_c.prototype.set = function CONSTRAINT_c() { this.x0 = inverse(arguments[0]["x0"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.x0,exprs] = scicos_getvalue("Set solver block parameters","Initial guess values",list("vec",-1),exprs); @@ -35,11 +35,14 @@ function CONSTRAINT_c() { break; } this.x0 = this.x0.slice(); - N = size(this.x0,"*"); + var N = size(this.x0,"*"); if (N<=0) { message("number of states (constraints) must be > 0 "); } else { - [this.model,graphics,ok] = check_io(this.model,graphics,N,N,[],[]); + var tmpvar0 = check_io(this.model,graphics,N,N,[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; if (ok) { graphics.exprs = exprs; this.model.state = new ScilabDouble([this.x0],[zeros(N,1)]); diff --git a/js/Misc/CONSTRAINT_c.pickle b/js/Misc/CONSTRAINT_c.pickle index 50efed9b..25921f7b 100644 --- a/js/Misc/CONSTRAINT_c.pickle +++ b/js/Misc/CONSTRAINT_c.pickle @@ -30,52 +30,49 @@ p8 sS'arg1' p9 g8 -sS'[this.model,graphics,ok]' -p10 -g2 sS'graphics.exprs' -p11 +p10 NsS'model.in1' -p12 +p11 g4 sS'model.dep_ut' -p13 +p12 S'vector' -p14 +p13 sS'N' -p15 +p14 g4 sS'exprs' -p16 +p15 g6 sS'x.model' -p17 +p16 NsS'gr_i' -p18 -g14 +p17 +g13 sS'model.state' -p19 +p18 S'matrix' -p20 +p19 sS'graphics' -p21 +p20 g8 sS'y' -p22 -g14 +p21 +g13 sS'x' -p23 +p22 g4 sS'model' -p24 +p23 g8 sS'model.ipar' -p25 +p24 g4 sS'typ' -p26 -g14 +p25 +g13 sS'x0' -p27 -g20 +p26 +g19 s.
\ No newline at end of file diff --git a/js/Misc/DEADBAND.js b/js/Misc/DEADBAND.js index a67aa2b0..6bf8c08d 100644 --- a/js/Misc/DEADBAND.js +++ b/js/Misc/DEADBAND.js @@ -3,7 +3,7 @@ function DEADBAND() { DEADBAND.prototype.define = function DEADBAND() { this.minp = -.5; this.maxp = .5; - rpar = [[this.maxp],[this.minp]]; + var rpar = [[this.maxp],[this.minp]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["deadband"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -13,8 +13,8 @@ function DEADBAND() { this.model.rpar = new ScilabDouble(rpar); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; - gr_i = []; + var exprs = [[string(this.maxp)],[string(this.minp)],[string(this.model.nmode)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,8 +34,8 @@ function DEADBAND() { this.minp = parseFloat(arguments[0]["minp"]) this.zeroc = arguments[0]["zeroc"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,this.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); @@ -45,7 +45,7 @@ function DEADBAND() { if (this.maxp<=this.minp) { message("Upper limit must be > Lower limit"); } else { - rpar = [[this.maxp],[this.minp]]; + var rpar = [[this.maxp],[this.minp]]; this.model.rpar = new ScilabDouble(rpar); if (this.zeroc!=0) { this.model.nzcross = new ScilabDouble([2]); diff --git a/js/Misc/DEBUG.js b/js/Misc/DEBUG.js index 9352edb5..fd7e7507 100644 --- a/js/Misc/DEBUG.js +++ b/js/Misc/DEBUG.js @@ -4,8 +4,8 @@ function DEBUG() { this.model = scicos_model(); this.model.sim = list(new ScilabString(["%debug_scicos"]), new ScilabDouble([99])); this.model.blocktype = new ScilabString(["d"]); - exprs = list("","xcos_debug_gui(flag,block);"); - gr_i = []; + var exprs = list("","xcos_debug_gui(flag,block);"); + var gr_i = []; this.x = standard_define([8,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -19,16 +19,17 @@ function DEBUG() { } DEBUG.prototype.set = function DEBUG() { this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; - textmp = exprs[2-1]; - ok = true; + var graphics = arg1.graphics; + var exprs = graphics.exprs; + var textmp = exprs[2-1]; + var ok = true; while (1==1) { - [txt] = this.dialog[[["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]]-1][textmp-1]; + var tmpvar0 = dialog([["Enter scilab instructions for debugging."],[" Inputs are block and flag, output is block"]],textmp) + var txt = tmpvar0[0]; if (txt!=[]) { - tt = ["block=debug_scicos(block,flag)"]; + var tt = ["block=debug_scicos(block,flag)"]; if (execstr("deff(tt,txt)","errcatch")==0) { - warnMode = warning("query"); + var warnMode = warning("query"); warning("off"); save(this.TMPDIR+"/debug_scicos",this.debug_scicos); warning(warnMode); @@ -41,7 +42,7 @@ function DEBUG() { message([["Error in the instructions"],[lasterror()]]); } } else { - ok = false; + var ok = false; break; } } diff --git a/js/Misc/DEBUG.pickle b/js/Misc/DEBUG.pickle index b2e30a30..f87b24a9 100644 --- a/js/Misc/DEBUG.pickle +++ b/js/Misc/DEBUG.pickle @@ -10,10 +10,8 @@ aS'model' p4 aS'TMPDIR' p5 -aS'dialog' -p6 -atp7 -Rp8 +atp6 +Rp7 .(dp0 S'exprs[2-1]' p1 @@ -44,33 +42,30 @@ sS'tt' p13 S'vector' p14 -sS'[txt]' +sS'graphics.exprs' p15 -g11 -sS'exprs' +NsS'exprs' p16 g3 sS'gr_i' p17 g14 -sS'graphics.exprs' +sS'graphics' p18 -NsS'graphics' -p19 g9 sS'y' -p20 +p19 g14 sS'x' -p21 +p20 g11 sS'model' -p22 +p21 g9 sS'typ' -p23 +p22 g14 sS'warnMode' -p24 +p23 g11 s.
\ No newline at end of file diff --git a/js/Misc/DEBUG_SCICOS.js b/js/Misc/DEBUG_SCICOS.js index 28944332..96f7b940 100644 --- a/js/Misc/DEBUG_SCICOS.js +++ b/js/Misc/DEBUG_SCICOS.js @@ -14,7 +14,10 @@ function DEBUG_SCICOS() { } DEBUG_SCICOS.prototype.set = function DEBUG_SCICOS() { arg1.gui = "DEBUG"; - [this.x,y,typ] = DEBUG("set",arg1); + var tmpvar0 = DEBUG("set",arg1) + this.x = tmpvar0[0] + var y = tmpvar0[1] + var typ = tmpvar0[2]; return new BasicBlock(this.x); } } diff --git a/js/Misc/DEBUG_SCICOS.pickle b/js/Misc/DEBUG_SCICOS.pickle index 0271cfca..4fc428a5 100644 --- a/js/Misc/DEBUG_SCICOS.pickle +++ b/js/Misc/DEBUG_SCICOS.pickle @@ -22,7 +22,4 @@ p6 sS'typ' p7 g2 -sS'[this.x,y,typ]' -p8 -g4 s.
\ No newline at end of file diff --git a/js/Misc/DIFF_f.js b/js/Misc/DIFF_f.js index 8410083c..b68a32d1 100644 --- a/js/Misc/DIFF_f.js +++ b/js/Misc/DIFF_f.js @@ -9,8 +9,8 @@ function DIFF_f() { this.model.state = new ScilabDouble(this.x0); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; - exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; - gr_i = []; + var exprs = [[strcat(sci2exp(this.x0[1-1]))],[strcat(sci2exp(this.x0[2-1]))]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -28,8 +28,8 @@ function DIFF_f() { this.x0 = inverse(arguments[0]["x0"]) this.xd0 = arguments[0]["xd0"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.x0,this.xd0,exprs] = scicos_getvalue("Set continuous linear system parameters",["Initial state","Initial Derivative"],list("vec",1,"vec",1),exprs); diff --git a/js/Misc/DSUPER.js b/js/Misc/DSUPER.js index 4d36f641..eaed8a54 100644 --- a/js/Misc/DSUPER.js +++ b/js/Misc/DSUPER.js @@ -12,41 +12,47 @@ function DSUPER() { return options; } DSUPER.prototype.set = function DSUPER() { - y = this.needcompile; - typ = list(); - graphics = arg1.graphics; + var y = this.needcompile; + var typ = list(); + var graphics = arg1.graphics; if ((length(graphics.exprs)==0)) { warnBlockByUID(arg1.model.label,"Invalid masked block."); this.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,$); + var exprs = graphics.exprs[1-1]; + var exprs0 = graphics.exprs[2-1][1-1]; + var btitre = graphics.exprs[2-1][2-1][1-1]; + var bitems = graphics.exprs[2-1][2-1].slice(2-1,$); if (exprs0==[]) { this.x = arg1; return; } - context = [arg1.model.rpar.props.context]; - [PREVAR_scicos_context,ierr] = script2var(context,PREVAR_scicos_context); + var context = [arg1.model.rpar.props.context]; + var tmpvar0 = script2var(context,PREVAR_scicos_context) + var PREVAR_scicos_context = tmpvar0[0] + var ierr = tmpvar0[1]; if (ierr!=0) { this.x = arg1; return; } - tt = "scicos_context."+exprs0[1-1]; + var tt = "scicos_context."+exprs0[1-1]; for (i=2;i<=size(exprs0,1);i+=1) { - tt = tt+",scicos_context."+exprs0[i-1]; + var tt = tt+",scicos_context."+exprs0[i-1]; } - ss = graphics.exprs[2-1][3-1]; - scicos_context = PREVAR_scicos_context; + var ss = graphics.exprs[2-1][3-1]; + var scicos_context = PREVAR_scicos_context; execstr("[ok,"+tt+",exprs]=scicos_getvalue(btitre,bitems,ss,exprs)"); if (this.ok) { this.x = arg1; - PREVAR_scicos_context = scicos_context; - sblock = this.x.model.rpar; - [sblock,%w,needcompile2,this.ok] = do_eval(sblock,list(),scicos_context); - y = max(2,this.needcompile,needcompile2); + var PREVAR_scicos_context = scicos_context; + var sblock = this.x.model.rpar; + var tmpvar1 = do_eval(sblock,list(),scicos_context) + var sblock = tmpvar1[0] + %w = tmpvar1[1] + var needcompile2 = tmpvar1[2] + this.ok = tmpvar1[3]; + var y = max(2,this.needcompile,needcompile2); this.x.graphics.exprs[1-1] = exprs; this.x.model.rpar = sblock; } else { diff --git a/js/Misc/DSUPER.pickle b/js/Misc/DSUPER.pickle index e20a96c0..24d918fc 100644 --- a/js/Misc/DSUPER.pickle +++ b/js/Misc/DSUPER.pickle @@ -15,70 +15,64 @@ S'bitems' p1 S'string' p2 -sS'arg1' +sS'arg1.model' p3 S'object' p4 -sS'scicos_context' +sS'x.graphics.exprs[1-1]' p5 -NsS'x.model' +S'double' p6 -g4 sS'x.model.rpar' p7 -NsS'arg1.model.rpar.props' +NsS'ss' p8 -g4 -sS'tt' +g6 +sS'arg1' p9 -g2 -sS'btitre' +g4 +sS'exprs0' p10 -S'double' +g6 +sS'btitre' p11 -sS'[PREVAR_scicos_context,ierr]' -p12 -g11 +g6 sS'sblock' +p12 +NsS'scicos_context' p13 -NsS'graphics' +NsS'exprs' p14 -g4 -sS'typ' +g6 +sS'x.model' p15 -S'list' +g4 +sS'PREVAR_scicos_context' p16 -sS'arg1.model' +NsS'context' p17 -g4 -sS'x.graphics.exprs[1-1]' +S'vector' p18 -g11 -sS'ss' +sS'graphics' p19 -g11 -sS'exprs0' +g4 +sS'y' p20 -g11 -sS'exprs' +g6 +sS'x' p21 -g11 -sS'[sblock,%w,needcompile2,this.ok]' +g4 +sS'arg1.model.rpar.props' p22 -g11 -sS'PREVAR_scicos_context' +g4 +sS'typ' p23 -NsS'context' +S'list' p24 -S'vector' +sS'tt' p25 -sS'y' -p26 -g11 -sS'x' -p27 -g4 +g2 sS'arg1.model.rpar' -p28 +p26 g4 s.
\ No newline at end of file diff --git a/js/Misc/EDGETRIGGER.js b/js/Misc/EDGETRIGGER.js index 54bc5ecf..f694714f 100644 --- a/js/Misc/EDGETRIGGER.js +++ b/js/Misc/EDGETRIGGER.js @@ -11,8 +11,8 @@ function EDGETRIGGER() { this.model.ipar = new ScilabDouble([sign(this.edge)]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [string(this.edge)]; - gr_i = []; + var exprs = [string(this.edge)]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -28,8 +28,8 @@ function EDGETRIGGER() { EDGETRIGGER.prototype.set = function EDGETRIGGER() { this.edge = parseFloat(arguments[0]["edge"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.edge,exprs] = scicos_getvalue("Set edge trigger block parameters",["rising (1), falling (-1), both (0)"],list("vec",1),exprs); diff --git a/js/Misc/EDGE_TRIGGER.js b/js/Misc/EDGE_TRIGGER.js index 63163874..4349ce08 100644 --- a/js/Misc/EDGE_TRIGGER.js +++ b/js/Misc/EDGE_TRIGGER.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/EDGE_TRIGGER.sci" */ function EDGE_TRIGGER() { EDGE_TRIGGER.prototype.define = function EDGE_TRIGGER() { - scs_m_1 = scicos_diagram(); + var scs_m_1 = scicos_diagram(); scs_m_1.objs[1-1] = EDGETRIGGER("define"); scs_m_1.objs[2-1] = IFTHEL_f("define"); scs_m_1.objs[3-1] = IN_f("define"); @@ -9,8 +9,8 @@ function EDGE_TRIGGER() { 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; + var blk = scs_m_1.objs[1-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [60,0]; graphics.sz = [60,40]; @@ -21,8 +21,8 @@ function EDGE_TRIGGER() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[1-1] = blk; - blk = scs_m_1.objs[2-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[2-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [160,0]; graphics.sz = [60,40]; @@ -35,8 +35,8 @@ function EDGE_TRIGGER() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[2-1] = blk; - blk = scs_m_1.objs[3-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[3-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; @@ -46,8 +46,8 @@ function EDGE_TRIGGER() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[3-1] = blk; - blk = scs_m_1.objs[4-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[4-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [170,-60]; graphics.sz = [20,20]; @@ -57,15 +57,15 @@ function EDGE_TRIGGER() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[4-1] = blk; - lnk = scs_m_1.objs[5-1]; + var 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]; + var 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]; + var lnk = scs_m_1.objs[7-1]; lnk.ct = [5,-1]; lnk.from = [2,1,0]; lnk.to = [4,1,1]; @@ -77,7 +77,7 @@ function EDGE_TRIGGER() { this.model.in1 = new ScilabDouble([1]); this.model.evtout = new ScilabDouble([1]); this.model.rpar = scs_m_1; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } @@ -91,72 +91,72 @@ function EDGE_TRIGGER() { } 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]; + var o = arg1.model.rpar.objs[i-1]; if (typeof(o)=="Block"&&o.gui=="EDGETRIGGER") { - ppath = list(i); + var ppath = list(i); break; } } - newpar = list(); - y = 0; + var newpar = list(); + var y = 0; for (path in ppath) { - np = size(path,"*"); - spath = list(); + var np = size(path,"*"); + var 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]; } - xx = arg1[spath-1]; + var xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (diffobjs(this.xxn,xx)) { this.model = xx.model; - model_n = this.xxn.model; + var model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); + var modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.label,model_n.label); if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)) { - needcompile = 1; + var needcompile = 1; } if (or(this.model.firing!=model_n.firing)) { - needcompile = 2; + var needcompile = 2; } if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))) { - needcompile = 4; + var needcompile = 4; } if (this.model.sim=="input"||this.model.sim=="output") { if (this.model.ipar!=model_n.ipar) { - needcompile = 4; + var needcompile = 4; } } if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { - needcompile = 4; + var needcompile = 4; } if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { - needcompile = 4; + var needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { if (this.model.sim[1-1]!=model_n.sim[1-1]) { - needcompile = 4; + var needcompile = 4; } } } } else { - modified = or(model_n!=this.model); - eq = this.model.equations; - eqn = model_n.equations; + var modified = or(model_n!=this.model); + var eq = this.model.equations; + var eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { - needcompile = 4; + var needcompile = 4; } } arg1[spath-1] = this.xxn; newpar[size(newpar)+1-1] = path; - y = max(y,needcompile); + var y = max(y,needcompile); } } this.x = arg1; - typ = newpar; + var typ = newpar; return new BasicBlock(this.x); } } diff --git a/js/Misc/ENDBLK.js b/js/Misc/ENDBLK.js index 9393fdd7..3a854c31 100644 --- a/js/Misc/ENDBLK.js +++ b/js/Misc/ENDBLK.js @@ -1,11 +1,11 @@ /* 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())); + var 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]); this.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 = []; + var gr_i = []; this.x = standard_define([2,2],this.model,[],gr_i); return new BasicBlock(this.x); } @@ -19,72 +19,72 @@ function ENDBLK() { } ENDBLK.prototype.set = function ENDBLK() { for (i=1;i<=length(arg1.model.rpar.objs);i+=1) { - o = arg1.model.rpar.objs[i-1]; + var o = arg1.model.rpar.objs[i-1]; if (typeof(o)=="Block"&&o.gui=="END_c") { - ppath = list(i); + var ppath = list(i); break; } } - newpar = list(); - y = 0; + var newpar = list(); + var y = 0; for (path in ppath) { - np = size(path,"*"); - spath = list(); + var np = size(path,"*"); + var 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]; } - xx = arg1[spath-1]; + var xx = arg1[spath-1]; execstr("xxn="+xx.gui+"(\'set\',xx)"); if (!isequalbitwise(this.xxn,xx)) { this.model = xx.model; - model_n = this.xxn.model; + var model_n = this.xxn.model; if (!is_modelica_block(xx)) { - modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); + var modified = or(this.model.sim!=model_n.sim)||!isequal(this.model.state,model_n.state)||!isequal(this.model.dstate,model_n.dstate)||!isequal(this.model.odstate,model_n.odstate)||!isequal(this.model.rpar,model_n.rpar)||!isequal(this.model.ipar,model_n.ipar)||!isequal(this.model.opar,model_n.opar)||!isequal(this.model.label,model_n.label); if (or(this.model.in1!=model_n.in1)||or(this.model.out!=model_n.out)||or(this.model.in2!=model_n.in2)||or(this.model.out2!=model_n.out2)||or(this.model.outtyp!=model_n.outtyp)||or(this.model.intyp!=model_n.intyp)) { - needcompile = 1; + var needcompile = 1; } if (or(this.model.firing!=model_n.firing)) { - needcompile = 2; + var needcompile = 2; } if ((size(this.model.in1,"*")!=size(model_n.in1,"*"))||(size(this.model.out,"*")!=size(model_n.out,"*"))||(size(this.model.evtin,"*")!=size(model_n.evtin,"*"))) { - needcompile = 4; + var needcompile = 4; } if (this.model.sim=="input"||this.model.sim=="output") { if (this.model.ipar!=model_n.ipar) { - needcompile = 4; + var needcompile = 4; } } if (or(this.model.blocktype!=model_n.blocktype)||or(this.model.dep_ut!=model_n.dep_ut)) { - needcompile = 4; + var needcompile = 4; } if ((this.model.nzcross!=model_n.nzcross)||(this.model.nmode!=model_n.nmode)) { - needcompile = 4; + var needcompile = 4; } if (prod(size(model_n.sim))>1) { if (model_n.sim[2-1]>1000) { if (this.model.sim[1-1]!=model_n.sim[1-1]) { - needcompile = 4; + var needcompile = 4; } } } } else { - modified = or(model_n!=this.model); - eq = this.model.equations; - eqn = model_n.equations; + var modified = or(model_n!=this.model); + var eq = this.model.equations; + var eqn = model_n.equations; if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) { - needcompile = 4; + var needcompile = 4; } } arg1[spath-1] = this.xxn; newpar[size(newpar)+1-1] = path; - y = max(y,needcompile); + var y = max(y,needcompile); } } this.x = arg1; - typ = newpar; + var typ = newpar; return new BasicBlock(this.x); } } diff --git a/js/Misc/EXPRESSION.pickle b/js/Misc/EXPRESSION.pickle index 621cebb9..1ea1772c 100644 --- a/js/Misc/EXPRESSION.pickle +++ b/js/Misc/EXPRESSION.pickle @@ -55,9 +55,9 @@ sS'model.in1' p14 S'matrix' p15 -sS'[ok,%ok1,ipar,rpar,%nz]' +sS'x.graphics' p16 -g10 +g2 sS'%mm' p17 g10 @@ -71,59 +71,50 @@ sS'%ok1' p20 S'boolean' p21 -sS'[%ok1,ipar,rpar,nz]' -p22 -g10 sS'model.sim' -p23 +p22 S'list' -p24 -sS'[this.model,graphics,ok]' -p25 -g24 +p23 sS'in1' -p26 +p24 g15 sS'model.rpar' -p27 +p25 NsS'model.nmode' -p28 +p26 NsS'graphics.exprs' -p29 +p27 NsS'model.ipar' -p30 +p28 NsS'model.nzcross' -p31 +p29 NsS'%nz' -p32 +p30 g7 sS'ok' -p33 +p31 g21 -sS'x.graphics' -p34 -g2 sS'model.dep_ut' -p35 +p32 g7 sS'exprs' -p36 +p33 g15 sS'gr_i' -p37 +p34 g7 sS'PREVAR_scicos_context' -p38 +p35 NsS'ipar' -p39 +p36 g7 sS'y' -p40 +p37 g7 sS'x' -p41 +p38 g10 sS'model' -p42 +p39 g2 s.
\ No newline at end of file diff --git a/js/Misc/Extract_Activation.js b/js/Misc/Extract_Activation.js index d8fcaa48..1497b6a1 100644 --- a/js/Misc/Extract_Activation.js +++ b/js/Misc/Extract_Activation.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/Extract_Activation.sci" */ function Extract_Activation() { Extract_Activation.prototype.define = function Extract_Activation() { - scs_m_1 = scicos_diagram(); + var 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"); @@ -10,8 +10,8 @@ function Extract_Activation() { 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; + var blk = scs_m_1.objs[1-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [80,0]; graphics.sz = [60,40]; @@ -24,8 +24,8 @@ function Extract_Activation() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[1-1] = blk; - blk = scs_m_1.objs[2-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[2-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [80,-80]; graphics.sz = [80,40]; @@ -34,8 +34,8 @@ function Extract_Activation() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[2-1] = blk; - blk = scs_m_1.objs[3-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[3-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [0,10]; graphics.sz = [20,20]; @@ -45,8 +45,8 @@ function Extract_Activation() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[3-1] = blk; - blk = scs_m_1.objs[4-1]; - graphics = blk.graphics; + var blk = scs_m_1.objs[4-1]; + var graphics = blk.graphics; this.model = blk.model; graphics.orig = [110,-140]; graphics.sz = [20,20]; @@ -56,21 +56,21 @@ function Extract_Activation() { blk.graphics = graphics; blk.model = this.model; scs_m_1.objs[4-1] = blk; - lnk = scs_m_1.objs[5-1]; + var 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]; + var 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]; + var 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]; + var lnk = scs_m_1.objs[8-1]; lnk.ct = [5,-1]; lnk.from = [2,1,0]; lnk.to = [4,1,1]; @@ -82,7 +82,7 @@ function Extract_Activation() { this.model.in1 = new ScilabDouble([1]); this.model.evtout = new ScilabDouble([1]); this.model.rpar = scs_m_1; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,[],gr_i); return new BasicBlock(this.x); } diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js index 9e5509cf..3146e712 100644 --- a/js/Misc/HYSTHERESIS.js +++ b/js/Misc/HYSTHERESIS.js @@ -1,10 +1,10 @@ /* autogenerated from "macros/Misc/HYSTHERESIS.sci" */ function HYSTHERESIS() { HYSTHERESIS.prototype.define = function HYSTHERESIS() { - in1 = 1; - ipar = [0]; + var in1 = 1; + var ipar = [0]; this.nzz = 2; - rpar = [[1],[0],[1],[0]]; + var rpar = [[1],[0],[1],[0]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["hystheresis"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([in1]); @@ -14,8 +14,8 @@ function HYSTHERESIS() { this.model.nmode = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string(rpar)],[string(sign(this.nzz))]]; - gr_i = []; + var exprs = [[string(rpar)],[string(sign(this.nzz))]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -39,8 +39,8 @@ function HYSTHERESIS() { this.out_low = arguments[0]["out_low"] this.nzz = parseFloat(arguments[0]["nzz"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.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); diff --git a/js/Misc/IMPSPLIT_f.js b/js/Misc/IMPSPLIT_f.js index f9c8121b..6abfab60 100644 --- a/js/Misc/IMPSPLIT_f.js +++ b/js/Misc/IMPSPLIT_f.js @@ -3,7 +3,7 @@ function IMPSPLIT_f() { IMPSPLIT_f.prototype.define = function IMPSPLIT_f() { this.model = scicos_model(); this.model.sim = new ScilabString(["limpsplit"]); - mo = modelica(); + var mo = modelica(); mo.model = "limpsplit"; mo.inputs = "n"; mo.outputs = [["n"],["n"]]; diff --git a/js/Misc/LOGICAL_OP.js b/js/Misc/LOGICAL_OP.js index 73feb47a..83de46aa 100644 --- a/js/Misc/LOGICAL_OP.js +++ b/js/Misc/LOGICAL_OP.js @@ -1,8 +1,8 @@ /* autogenerated from "macros/Misc/LOGICAL_OP.sci" */ function LOGICAL_OP() { LOGICAL_OP.prototype.define = function LOGICAL_OP() { - in1 = [[-1],[-1]]; - ipar = [0]; + var in1 = [[-1],[-1]]; + var ipar = [0]; this.nin = 2; this.model = scicos_model(); this.model.sim = list(new ScilabString(["logicalop"]), new ScilabDouble([4])); @@ -11,8 +11,8 @@ function LOGICAL_OP() { this.model.ipar = ipar; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string(this.nin)],[string(ipar)]]; - gr_i = []; + var exprs = [[string(this.nin)],[string(ipar)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,11 +34,11 @@ function LOGICAL_OP() { this.Datatype = arguments[0]["Datatype"] this.tp = parseFloat(arguments[0]["tp"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,1)==2) { - exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]]; + var exprs = [[exprs],[sci2exp(1)],[sci2exp(0)]]; } while (true) { [ok,this.nin,this.rule,this.Datatype,this.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); @@ -50,16 +50,16 @@ function LOGICAL_OP() { this.tp = int(this.tp); if (this.nin<1) { message("Number of inputs must be >=1 "); - ok = false; + var ok = false; } else if ((this.rule<0)||(this.rule>5)) { message("Incorrect operator "+string(this.rule)+" ; must be 0 to 5."); - ok = false; + var ok = false; } else if ((this.rule==5)&&(this.nin>1)) { message("Only one input allowed for NOT operation"); this.nin = 1; } else if (((this.Datatype==1)&&(this.tp!=0))) { message("Bitwise Rule is only activated when Data type is integer"); - ok = false; + var ok = false; } if (ok) { if ((this.tp!=0)) { @@ -83,35 +83,41 @@ function LOGICAL_OP() { this.model.sim = list(new ScilabString(["logicalop_ui8"]), new ScilabDouble([4])); } else { message("Datatype is not supported"); - ok = false; + var ok = false; } this.model.ipar = new ScilabDouble([this.rule],[this.tp]); } if (ok) { - it = this.Datatype*ones(this.nin,1); - ot = this.Datatype; - in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; + var it = this.Datatype*ones(this.nin,1); + var ot = this.Datatype; + var in1 = [-ones(this.nin,1),-2*ones(this.nin,1)]; if ((this.rule!=5)&&(this.nin==1)) { - out = [1,1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var out = [1,1]; + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } else { - out = [-1,-2]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var out = [-1,-2]; + var tmpvar1 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; } } if (ok) { if (this.rule==0) { - label = "AND"; + var label = "AND"; } else if (this.rule==1) { - label = "OR"; + var label = "OR"; } else if (this.rule==2) { - label = "NAND"; + var label = "NAND"; } else if (this.rule==3) { - label = "NOR"; + var label = "NOR"; } else if (this.rule==4) { - label = "XOR"; + var label = "XOR"; } else if (this.rule==5) { - label = "NOT"; + var label = "NOT"; } graphics.exprs = exprs; graphics.style = ["blockWithLabel;displayedLabel="+label]; diff --git a/js/Misc/LOGICAL_OP.pickle b/js/Misc/LOGICAL_OP.pickle index 51f0a704..5537fa7c 100644 --- a/js/Misc/LOGICAL_OP.pickle +++ b/js/Misc/LOGICAL_OP.pickle @@ -64,49 +64,46 @@ p19 sS'nin' p20 g10 -sS'[this.model,graphics,ok]' -p21 -g10 sS'in1' -p22 +p21 g14 sS'graphics.exprs' -p23 +p22 g14 sS'model.ipar' -p24 +p23 g8 sS'typ' -p25 +p24 g8 sS'ok' -p26 +p25 S'boolean' -p27 +p26 sS'model.blocktype' -p28 +p27 g5 sS'rule' -p29 +p28 g10 sS'exprs' -p30 +p29 g14 sS'gr_i' -p31 +p30 g8 sS'ipar' -p32 +p31 g8 sS'y' -p33 +p32 g8 sS'x' -p34 +p33 g10 sS'model' -p35 +p34 g2 sS'ot' -p36 +p35 Ns.
\ No newline at end of file diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index c1aaa528..dde93d71 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -5,11 +5,11 @@ function MBLOCK() { this.intype = ["I"]; this.out = [["y1"],["y2"]]; this.outtype = [["I"],["E"]]; - param = [["R"],["L"]]; - paramv = list(0.1,.0001); + var param = [["R"],["L"]]; + var paramv = list(0.1,.0001); this.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(this.pprop.slice()),nameF,[]); + var nameF = "generic"; + var 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(this.pprop.slice()),nameF,[]); this.model = scicos_model(); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [false,true]; @@ -17,7 +17,7 @@ function MBLOCK() { for (i=1;i<=lstsize(paramv);i+=1) { this.model.rpar = new ScilabDouble([this.model.rpar],[paramv[i-1].slice()]); } - mo = modelica(); + var mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); this.model.sim = list(new ScilabString([mo.model]), new ScilabDouble([30004])); @@ -26,7 +26,7 @@ function MBLOCK() { this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"r"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"r"),1)]); this.model.equations = mo; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; @@ -58,35 +58,35 @@ function MBLOCK() { this.lab_1 = arguments[0]["lab_1"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (this.type[exprs-1]==15) { - paramv = list(); + var paramv = list(); this.pprop = []; for (i=1;i<=size(this.model.rpar,"*");i+=1) { paramv[$+1-1] = string(this.model.rpar[i-1]); this.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(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]); + var 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(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]); } this.lab_1 = list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF); - lab_2 = exprs.paramv; + var lab_2 = exprs.paramv; while (true) { [ok,this.Tin,this.Tintype,this.Tout,this.Touttype,this.Tparam,this.pprop,this.Tfunam,this.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),this.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"); + var 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; + var ok = false; } if (ok) { for (i=1;i<=size(this.in1,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(in(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(in(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -96,10 +96,10 @@ function MBLOCK() { } if (ok) { for (i=1;i<=size(this.out,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(out(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(out(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -108,12 +108,12 @@ function MBLOCK() { } } if (ok) { - param = param.slice(); + var param = param.slice(); for (i=1;i<=size(param,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(param(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(param(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -125,7 +125,7 @@ function MBLOCK() { for (i=1;i<=size(this.intype,"*");i+=1) { if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") { messagebox("Input type should be \'E\' or \'I\'!","modal","error"); - ok = false; + var ok = false; break; } } @@ -134,7 +134,7 @@ function MBLOCK() { for (i=1;i<=size(this.outtype,"*");i+=1) { if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") { messagebox("Output type should be \'E\' or \'I\'!","modal","error"); - ok = false; + var ok = false; break; } } @@ -142,110 +142,118 @@ function MBLOCK() { if (ok) { if (or(size(this.intype)!=size(this.in1))) { messagebox("Input variables are not well defined!","modal","error"); - ok = false; + var ok = false; } } if (ok) { if (or(size(this.outtype)!=size(this.out))) { messagebox("Output variables are not well defined!","modal","error"); - ok = false; + var ok = false; } } if (ok) { this.pprop = this.pprop.slice(); if ((size(param,"*")!=size(this.pprop,"*"))) { messagebox([["There is differences in"],["size of param and size "],["of param properties."]],"modal","error"); - ok = false; + var ok = false; } } if (ok) { if (max(this.pprop)>2||min(this.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; + var ok = false; } } if (ok) { if (this.funam=="") { messagebox("The filename is not defined!","modal","error"); - ok = false; + var ok = false; } } if (ok) { - [dirF,nameF,extF] = fileparts(this.funam); + var tmpvar0 = fileparts(this.funam) + var dirF = tmpvar0[0] + var nameF = tmpvar0[1] + var extF = tmpvar0[2]; if ((extF!=""&&extF!=".mo")||(dirF!=""&&extF!=".mo")) { messagebox("Filename extention should be \'.mo \' !","modal","error"); - ok = false; + var ok = false; } } if (ok) { - intypex = find(this.intype=="I"); - outtypex = find(this.outtype=="I"); - [this.model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + var intypex = find(this.intype=="I"); + var outtypex = find(this.outtype=="I"); + var tmpvar1 = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; } if (ok) { - Tparam_lab = evstr(this.Tparam); - Tparam_sz = size(Tparam_lab,"*"); + var Tparam_lab = evstr(this.Tparam); + var 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"; } } else if (Tparam_sz<lstsize(lab_2)) { - lab_2_tmp = list(); + var 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 = lab_2_tmp; + var lab_2 = lab_2_tmp; } if (Tparam_sz!=0) { - lhs_txt = ""; - lab_txt = ""; - rhs_txt = ""; + var lhs_txt = ""; + var lab_txt = ""; + var rhs_txt = ""; for (i=1;i<=Tparam_sz;i+=1) { - lhs_txt = lhs_txt+"%v"+string(i)+","; + var lhs_txt = lhs_txt+"%v"+string(i)+","; if (this.pprop[i-1]==0) { - lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';"; + var lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';"; } else if (this.pprop[i-1]==1) { - lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';"; + var lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';"; } else if (this.pprop[i-1]==2) { - lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';"; + var lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';"; } - rhs_txt = rhs_txt+"\'vec\',-1,"; + var 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)"; + var lhs_txt = part(lhs_txt,1,length(lhs_txt)-1); + var lab_txt = part(lab_txt,1,length(lab_txt)-1); + var rhs_txt = part(rhs_txt,1,length(rhs_txt)-1); + var 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; + var lab_2 = exprs.paramv; } } } if (ok) { - paramv = list(); + var 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); + var tt = mgetl(this.funam); } else { - tt = exprs.funtxt; - mo = this.model.equations; + var tt = exprs.funtxt; + var mo = this.model.equations; if (mo.model!=nameF) { - tt = []; + var tt = []; } } - [ok,tt] = MODCOM(this.funam,tt,this.in1,this.out,param,paramv,this.pprop); + var tmpvar2 = MODCOM(this.funam,tt,this.in1,this.out,param,paramv,this.pprop) + var ok = tmpvar2[0] + var tt = tmpvar2[1]; if (!ok) { break; } } if (ok) { - mo = modelica(); + var mo = modelica(); mo.model = nameF; mo.inputs = this.in1; mo.outputs = this.out; diff --git a/js/Misc/MBLOCK.pickle b/js/Misc/MBLOCK.pickle index 639839ac..b85e0353 100644 --- a/js/Misc/MBLOCK.pickle +++ b/js/Misc/MBLOCK.pickle @@ -41,210 +41,201 @@ S'rhs_txt' p1 S'string' p2 -sS'graphics.out_implicit' +sS'model.sim' p3 -NsS'model.sim' -p4 S'list' -p5 +p4 sS'arg1' -p6 +p5 S'object' -p7 +p6 sS'graphics.gr_i[1-1][1-1]' -p8 +p7 g2 sS'graphics.exprs' -p9 -g7 +p8 +g6 sS'outtypex' -p10 +p9 S'double' -p11 +p10 sS'mo.model' -p12 +p11 g2 sS'ierr' -p13 -g11 +p12 +g10 sS'exprs.paramv[i-1]' -p14 -g11 +p13 +g10 sS'lab_2_tmp' -p15 -g5 +p14 +g4 sS'x.model' -p16 -g7 +p15 +g6 sS'exprs.outtype' -p17 -g11 +p16 +g10 sS'exprs.intype' -p18 -g11 +p17 +g10 sS'exprs.nameF' -p19 -g11 +p18 +g10 sS'exprs.funtxt' -p20 +p19 S'vector' +p20 +sS'graphics.out_implicit' p21 -sS'[dirF,nameF,extF]' +NsS'out' p22 -g11 -sS'out' -p23 S'matrix' -p24 +p23 sS'nameF' -p25 +p24 g2 sS'lab_2_tmp[i-1]' -p26 -g11 +p25 +g10 sS'exprs.pprop' -p27 -g11 +p26 +g10 sS'Tparam_lab' -p28 -g11 +p27 +g10 sS'exprs.out' -p29 -g11 +p28 +g10 sS'graphics.in_implicit' -p30 +p29 NsS'typ' -p31 -g21 +p30 +g20 sS'getvalue_txt' -p32 +p31 g2 sS'mo.inputs' -p33 -g21 +p32 +g20 sS'param' -p34 -g24 +p33 +g23 sS'paramv' -p35 -g5 +p34 +g4 sS'gr_i' -p36 -g21 +p35 +g20 sS'x.graphics.in_implicit' +p36 +g20 +sS'model.sim[1]' p37 -g21 -sS'[ok,tt]' +NsS'mo.parameters' p38 -g11 -sS'model.sim[1]' +g4 +sS'Tparam_sz' p39 -NsS'mo.parameters' +g10 +sS'pprop' p40 -g5 -sS'Tparam_sz' +g23 +sS'model.out' p41 -g11 -sS'mo.outputs' +g10 +sS'exprs.in1' p42 -g24 -sS'pprop' +g10 +sS'model.equations' p43 -g24 -sS'model.out' +g6 +sS'mo.outputs' p44 -g11 -sS'exprs.in1' -p45 -g11 -sS'model.equations' -p46 -g7 -sS'[this.model,graphics,ok]' -p47 -g11 +g23 sS'intype' -p48 -g21 +p45 +g20 sS'x.graphics.out_implicit' -p49 -g24 +p46 +g23 sS'in1' -p50 -g21 +p47 +g20 sS'model.rpar' -p51 -g24 +p48 +g23 sS'model.in1' -p52 -g11 +p49 +g10 sS'lhs_txt' -p53 +p50 g2 sS'outtype' -p54 -g24 +p51 +g23 sS'graphics' -p55 -g7 +p52 +g6 sS'intypex' -p56 -g11 +p53 +g10 sS'lab_1' -p57 -g5 +p54 +g4 sS'lab_2' -p58 +p55 NsS'paramv[$+1-1]' -p59 +p56 g2 sS'ok' -p60 +p57 S'boolean' -p61 +p58 sS'model.blocktype' -p62 +p59 g2 sS'exprs.param' -p63 -g11 +p60 +g10 sS'mo' -p64 -g7 +p61 +g6 sS'x.graphics' -p65 -g7 +p62 +g6 sS'pprop[$+1-1]' -p66 -g11 +p63 +g10 sS'model.dep_ut' -p67 -g21 +p64 +g20 sS'exprs.paramv' -p68 -g5 +p65 +g4 sS'exprs' -p69 -g11 +p66 +g10 sS'lab_2[$+1-1]' -p70 +p67 g2 sS'r' -p71 -g61 +p68 +g58 sS'lab_txt' -p72 +p69 g2 sS'y' -p73 -g21 +p70 +g20 sS'x' -p74 -g11 +p71 +g10 sS'model' -p75 -g7 +p72 +g6 sS'tt' -p76 -g21 +p73 +g20 s.
\ No newline at end of file diff --git a/js/Misc/MEMORY_f.js b/js/Misc/MEMORY_f.js index c410b3c2..d975cc56 100644 --- a/js/Misc/MEMORY_f.js +++ b/js/Misc/MEMORY_f.js @@ -1,9 +1,9 @@ /* 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)]]; + var z = 0; + var in1 = 1; + var exprs = [[string(z)],[string(1)]]; this.model = scicos_model(); this.model.sim = new ScilabString(["memo"]); this.model.in1 = new ScilabDouble([in1]); @@ -13,7 +13,7 @@ function MEMORY_f() { this.model.rpar = new ScilabDouble([z]); this.model.blocktype = new ScilabString(["m"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,8 +31,8 @@ function MEMORY_f() { this.a = arguments[0]["a"] this.inh = parseFloat(arguments[0]["inh"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.a,this.inh,exprs] = scicos_getvalue("Set memory block parameters",["initial condition","Inherit (1: no, 0: yes)"],list("vec",-1,"vec",1),exprs); @@ -44,13 +44,16 @@ function MEMORY_f() { } else { this.inh = 1; } - [this.model,graphics,ok] = check_io(this.model,graphics,-1,-1,this.inh,[]); - out = size(this.a,"*"); + var tmpvar0 = check_io(this.model,graphics,-1,-1,this.inh,[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; + var out = size(this.a,"*"); if (out==0) { - ok = false; + var ok = false; messagebox("Initial condition empty","modal","error"); } - in1 = out; + var in1 = out; if (ok) { graphics.exprs = exprs; this.model.rpar = new ScilabDouble([this.a]); diff --git a/js/Misc/MEMORY_f.pickle b/js/Misc/MEMORY_f.pickle index c40ec1e8..e262d11d 100644 --- a/js/Misc/MEMORY_f.pickle +++ b/js/Misc/MEMORY_f.pickle @@ -48,49 +48,45 @@ sS'model.sim' p13 S'string' p14 -sS'[this.model,graphics,ok]' -p15 -S'list' -p16 sS'in1' -p17 +p15 g2 sS'model.rpar' -p18 +p16 g2 sS'graphics.exprs' -p19 +p17 NsS'typ' -p20 +p18 S'vector' -p21 +p19 sS'ok' -p22 +p20 S'boolean' -p23 +p21 sS'model.blocktype' -p24 +p22 g14 sS'model.dep_ut' -p25 -g21 +p23 +g19 sS'exprs' -p26 +p24 S'matrix' -p27 +p25 sS'gr_i' -p28 -g21 +p26 +g19 sS'y' -p29 -g21 +p27 +g19 sS'x' -p30 +p28 g2 sS'model' -p31 +p29 g4 sS'z' -p32 +p30 g2 s.
\ No newline at end of file diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 29fb583e..0c2ce112 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -5,11 +5,11 @@ function MPBLOCK() { 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,[]); + var param = []; + var paramv = list(); + var pprop = []; + var nameF = "myModel"; + var 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,[]); this.model = scicos_model(); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,true]; @@ -17,7 +17,7 @@ function MPBLOCK() { for (i=1;i<=lstsize(paramv);i+=1) { this.model.rpar = new ScilabDouble([this.model.rpar],[paramv[i-1].slice()]); } - mo = modelica(); + var mo = modelica(); mo.model = nameF; mo.parameters = list(param,paramv); this.model.sim = list(new ScilabString([mo.model]), new ScilabDouble([10004])); @@ -26,7 +26,7 @@ function MPBLOCK() { this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"r"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"r"),1)]); this.model.equations = mo; - gr_i = []; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; @@ -43,35 +43,44 @@ function MPBLOCK() { MPBLOCK.prototype.set = function MPBLOCK() { this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (this.type[exprs-1]==15) { - paramv = list(); - pprop = []; + var paramv = list(); + var pprop = []; for (i=1;i<=size(this.model.rpar,"*");i+=1) { paramv[$+1-1] = string(this.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]); + var 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; + var lab_1 = list(exprs.in1,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF); + var 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); + var tmpvar0 = 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) + var ok = tmpvar0[0] + var Tin = tmpvar0[1] + var Tintype = tmpvar0[2] + var Tout = tmpvar0[3] + var Touttype = tmpvar0[4] + var Tparam = tmpvar0[5] + var pprop = tmpvar0[6] + var Tfunam = tmpvar0[7] + var lab_1 = tmpvar0[8]; 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"); + var 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; + var ok = false; } if (ok) { for (i=1;i<=size(this.in1,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(in(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(in(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -81,10 +90,10 @@ function MPBLOCK() { } if (ok) { for (i=1;i<=size(this.out,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(out(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(out(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -93,12 +102,12 @@ function MPBLOCK() { } } if (ok) { - param = param.slice(); + var param = param.slice(); for (i=1;i<=size(param,"*");i+=1) { - r = false; - ierr = execstr("r=validvar(param(i))","errcatch"); + var r = false; + var ierr = execstr("r=validvar(param(i))","errcatch"); if (!r) { - ok = false; + var ok = false; break; } } @@ -110,7 +119,7 @@ function MPBLOCK() { for (i=1;i<=size(this.intype,"*");i+=1) { if (this.intype[i-1]!="E"&&this.intype[i-1]!="I") { x_message("Input type should be \'E\' or \'I\'!"); - ok = false; + var ok = false; break; } } @@ -119,7 +128,7 @@ function MPBLOCK() { for (i=1;i<=size(this.outtype,"*");i+=1) { if (this.outtype[i-1]!="E"&&this.outtype[i-1]!="I") { x_message("Output type should be \'E\' or \'I\'!"); - ok = false; + var ok = false; break; } } @@ -127,100 +136,106 @@ function MPBLOCK() { if (ok) { if (or(size(this.intype)!=size(this.in1))) { x_message("Input variables are not well defined!"); - ok = false; + var ok = false; } } if (ok) { if (or(size(this.outtype)!=size(this.out))) { x_message("Output variables are not well defined!"); - ok = false; + var ok = false; } } if (ok) { - pprop = pprop.slice(); + var pprop = pprop.slice(); if ((size(param,"*")!=size(pprop,"*"))) { x_message([["There is differences in"],["size of param and size "],["of param properties."]]); - ok = false; + var ok = false; } } 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; + var ok = false; } } if (ok) { if (this.funam=="") { x_message("The model name is not defined!"); - ok = false; + var ok = false; } } if (ok) { - [dirF,nameF,extF] = fileparts(this.funam); + var tmpvar1 = fileparts(this.funam) + var dirF = tmpvar1[0] + var nameF = tmpvar1[1] + var extF = tmpvar1[2]; if ((extF!="")||(dirF!="")) { x_message("Invalid model name!"); - ok = false; + var ok = false; } } if (ok) { - intypex = find(this.intype=="I"); - outtypex = find(this.outtype=="I"); - [this.model,graphics,ok] = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + var intypex = find(this.intype=="I"); + var outtypex = find(this.outtype=="I"); + var tmpvar2 = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex) + this.model = tmpvar2[0] + var graphics = tmpvar2[1] + var ok = tmpvar2[2]; } if (ok) { - Tparam_lab = evstr(Tparam); - Tparam_sz = size(Tparam_lab,"*"); + var Tparam_lab = evstr(Tparam); + var 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"; } } else if (Tparam_sz<lstsize(lab_2)) { - lab_2_tmp = list(); + var lab_2_tmp = list(); if (Tparam_sz!=0) { for (i=1;i<=Tparam_sz;i+=1) { - ee = evstr(exprs.param); + var 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]; } } } - lab_2 = lab_2_tmp; + var lab_2 = lab_2_tmp; } } if (Tparam_sz!=0) { - lhs_txt = ""; - lab_txt = ""; - rhs_txt = ""; + var lhs_txt = ""; + var lab_txt = ""; + var rhs_txt = ""; for (i=1;i<=Tparam_sz;i+=1) { - lhs_txt = lhs_txt+"%v"+string(i)+","; + var lhs_txt = lhs_txt+"%v"+string(i)+","; if (pprop[i-1]==0) { - lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';"; + var lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+"\';"; } else if (pprop[i-1]==1) { - lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (state) \';"; + var 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) \';"; + var lab_txt = lab_txt+"\'"+Tparam_lab[i-1]+" (fixed state) \';"; } - rhs_txt = rhs_txt+"\'vec\',-1,"; + var 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)"; + var lhs_txt = part(lhs_txt,1,length(lhs_txt)-1); + var lab_txt = part(lab_txt,1,length(lab_txt)-1); + var rhs_txt = part(rhs_txt,1,length(rhs_txt)-1); + var 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; + var lab_2 = exprs.paramv; } } } if (ok) { - paramv = list(); + var paramv = list(); for (i=1;i<=Tparam_sz;i+=1) { execstr("paramv("+string(i)+")=%v"+string(i)); } } if (ok) { - mo = modelica(); + var mo = modelica(); mo.model = nameF; mo.inputs = this.in1; mo.outputs = this.out; diff --git a/js/Misc/MPBLOCK.pickle b/js/Misc/MPBLOCK.pickle index 2bb44bab..f46d2426 100644 --- a/js/Misc/MPBLOCK.pickle +++ b/js/Misc/MPBLOCK.pickle @@ -25,210 +25,201 @@ S'rhs_txt' p1 S'string' p2 -sS'graphics.out_implicit' +sS'model.sim' p3 -NsS'model.sim' -p4 S'list' -p5 +p4 sS'ee' -p6 +p5 S'double' -p7 +p6 sS'arg1' -p8 +p7 S'object' -p9 +p8 sS'graphics.gr_i[1-1][1-1]' -p10 +p9 g2 sS'graphics.exprs' -p11 -g9 +p10 +g8 sS'outtypex' -p12 -g7 +p11 +g6 sS'mo.model' -p13 +p12 g2 sS'ierr' -p14 -g7 +p13 +g6 sS'exprs.paramv[i-1]' -p15 -g7 +p14 +g6 sS'lab_2_tmp' +p15 +g4 +sS'x.model' p16 -g5 -sS'[ok,Tin,Tintype,Tout,Touttype,Tparam,pprop,Tfunam,lab_1]' -p17 -g7 +g8 sS'exprs.outtype' -p18 -g7 +p17 +g6 sS'exprs.intype' -p19 -g7 +p18 +g6 sS'exprs.nameF' +p19 +g6 +sS'graphics.out_implicit' p20 -g7 -sS'[dirF,nameF,extF]' +NsS'out' p21 -g7 -sS'out' -p22 S'matrix' -p23 +p22 sS'nameF' -p24 +p23 g2 sS'lab_2_tmp[i-1]' -p25 -g7 +p24 +g6 sS'exprs.pprop' -p26 -g7 +p25 +g6 sS'Tparam_lab' -p27 -g7 +p26 +g6 sS'exprs.out' -p28 -g7 +p27 +g6 sS'graphics.in_implicit' -p29 +p28 NsS'typ' -p30 +p29 S'vector' -p31 +p30 sS'getvalue_txt' -p32 +p31 g2 sS'mo.inputs' -p33 -g31 +p32 +g30 sS'param' -p34 -g31 +p33 +g30 sS'paramv' -p35 -g5 +p34 +g4 sS'gr_i' -p36 -g31 +p35 +g30 sS'x.graphics.in_implicit' +p36 +g30 +sS'model.sim[1]' p37 -g31 -sS'x.model' +NsS'mo.parameters' p38 -g9 -sS'model.sim[1]' +g4 +sS'Tparam_sz' p39 -NsS'mo.parameters' +g6 +sS'pprop' p40 -g5 -sS'Tparam_sz' +g30 +sS'model.out' p41 -g7 -sS'mo.outputs' +g6 +sS'exprs.in1' p42 -g23 -sS'pprop' +g6 +sS'model.equations' p43 -g31 -sS'model.out' +g8 +sS'mo.outputs' p44 -g7 -sS'exprs.in1' -p45 -g7 -sS'model.equations' -p46 -g9 -sS'[this.model,graphics,ok]' -p47 -g7 +g22 sS'intype' -p48 -g31 +p45 +g30 sS'x.graphics.out_implicit' -p49 -g23 +p46 +g22 sS'in1' -p50 -g31 +p47 +g30 sS'model.rpar' -p51 -g23 +p48 +g22 sS'model.in1' -p52 -g7 +p49 +g6 sS'lhs_txt' -p53 +p50 g2 sS'outtype' -p54 -g23 +p51 +g22 sS'graphics' -p55 -g9 +p52 +g8 sS'intypex' -p56 -g7 +p53 +g6 sS'lab_1' -p57 -g5 +p54 +g4 sS'lab_2' -p58 +p55 NsS'paramv[$+1-1]' -p59 +p56 g2 sS'ok' -p60 +p57 S'boolean' -p61 +p58 sS'model.blocktype' -p62 +p59 g2 sS'exprs.param' -p63 -g7 +p60 +g6 sS'mo' -p64 -g9 +p61 +g8 sS'x.graphics' -p65 -g9 +p62 +g8 sS'pprop[$+1-1]' -p66 -g7 +p63 +g6 sS'model.dep_ut' -p67 -g31 +p64 +g30 sS'exprs.funtxt' -p68 +p65 g2 sS'exprs' -p69 -g7 +p66 +g6 sS'lab_2[$+1-1]' -p70 +p67 g2 sS'r' -p71 -g61 +p68 +g58 sS'lab_txt' -p72 +p69 g2 sS'y' -p73 -g31 +p70 +g30 sS'x' -p74 -g7 +p71 +g6 sS'model' -p75 -g9 +p72 +g8 sS'exprs.paramv' -p76 -g5 +p73 +g4 s.
\ No newline at end of file diff --git a/js/Misc/PAL_f.js b/js/Misc/PAL_f.js index c06c86e8..7b64b6c3 100644 --- a/js/Misc/PAL_f.js +++ b/js/Misc/PAL_f.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/PAL_f.sci" */ function PAL_f() { PAL_f.prototype.define = function PAL_f() { - scs = scicos_diagram(); + var scs = scicos_diagram(); scs.props.title = "Palette"; this.model = scicos_model(); this.model.sim = new ScilabString(["palette"]); @@ -10,7 +10,7 @@ function PAL_f() { this.model.rpar = new ScilabDouble([scs]); this.model.blocktype = new ScilabString(["h"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,[],gr_i); this.x.graphics.id = scs.props.title[1-1]; return new BasicBlock(this.x); @@ -24,12 +24,16 @@ function PAL_f() { return options; } PAL_f.prototype.set = function PAL_f() { - [this.x,newparameters,needcompile,edited] = scicos(arg1.model.rpar); + var tmpvar0 = scicos(arg1.model.rpar) + this.x = tmpvar0[0] + var newparameters = tmpvar0[1] + var needcompile = tmpvar0[2] + var edited = tmpvar0[3]; arg1.graphics.id = this.x.props.title[1-1]; arg1.model.rpar = this.x; this.x = arg1; - y = []; - typ = []; + var y = []; + var typ = []; %exit = resume(false) return new BasicBlock(this.x); } diff --git a/js/Misc/PAL_f.pickle b/js/Misc/PAL_f.pickle index 3c09443d..1851d7a7 100644 --- a/js/Misc/PAL_f.pickle +++ b/js/Misc/PAL_f.pickle @@ -24,56 +24,53 @@ sS'model.dep_ut' p6 S'vector' p7 -sS'[this.x,newparameters,needcompile,edited]' +sS'arg1' p8 -S'double' -p9 +g4 sS'scs.props' -p10 +p9 g4 sS'model.in1' -p11 +p10 g7 sS'scs.props.title' -p12 +p11 g2 sS'x.props' -p13 +p12 g4 sS'model.out' -p14 +p13 g7 sS'gr_i' -p15 +p14 g7 sS'model.rpar' +p15 +S'double' p16 -g9 sS'scs' p17 g4 -sS'arg1' -p18 -g4 sS'y' -p19 +p18 g7 sS'x' -p20 -g9 +p19 +g16 sS'model' -p21 +p20 g4 sS'x.graphics.id' -p22 -g9 +p21 +g16 sS'typ' -p23 +p22 g7 sS'arg1.model.rpar' -p24 +p23 g4 sS'arg1.graphics.id' -p25 -g9 +p24 +g16 s.
\ No newline at end of file diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js index cc56163e..bf3d386a 100644 --- a/js/Misc/PENDULUM_ANIM.js +++ b/js/Misc/PENDULUM_ANIM.js @@ -16,8 +16,8 @@ function PENDULUM_ANIM() { this.model.rpar = new ScilabDouble([this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]); this.model.blocktype = new ScilabString(["d"]); this.model.dep_ut = [false,false]; - exprs = string(this.model.rpar); - gr_i = []; + var exprs = string(this.model.rpar); + var gr_i = []; this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -45,32 +45,32 @@ function PENDULUM_ANIM() { this.ymin = parseFloat(arguments[0]["ymin"]) this.ymax = parseFloat(arguments[0]["ymax"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; - dstate = this.model.dstate; + var dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.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 = []; + var mess = []; if (this.plen<=0||this.csiz<=0) { - mess = [[mess],["Pendulum length and cart size must be positive."],[" "]]; - ok = false; + var mess = [[mess],["Pendulum length and cart size must be positive."],[" "]]; + var ok = false; } if (this.ymin>=this.ymax) { - mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; - ok = false; + var mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; + var ok = false; } if (this.xmin>=this.xmax) { - mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; - ok = false; + var mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; + var ok = false; } if (!ok) { message(mess); } else { - rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + var rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; this.model.rpar = new ScilabDouble(rpar); graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Misc/RATELIMITER.js b/js/Misc/RATELIMITER.js index c3af489f..aa206268 100644 --- a/js/Misc/RATELIMITER.js +++ b/js/Misc/RATELIMITER.js @@ -3,7 +3,7 @@ function RATELIMITER() { RATELIMITER.prototype.define = function RATELIMITER() { this.minp = -1; this.maxp = 1; - rpar = [[this.maxp],[this.minp]]; + var rpar = [[this.maxp],[this.minp]]; this.model = scicos_model(); this.model.sim = list(new ScilabString(["ratelimiter"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -11,8 +11,8 @@ function RATELIMITER() { this.model.rpar = new ScilabDouble(rpar); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string(this.maxp)],[string(this.minp)]]; - gr_i = []; + var exprs = [[string(this.maxp)],[string(this.minp)]]; + var gr_i = []; this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -30,8 +30,8 @@ function RATELIMITER() { this.maxp = parseFloat(arguments[0]["maxp"]) this.minp = parseFloat(arguments[0]["minp"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.maxp,this.minp,exprs] = scicos_getvalue("Set rate limiter parameters",["max slope","min slope"],list("vec",1,"vec",1),exprs); @@ -41,7 +41,7 @@ function RATELIMITER() { if (this.maxp<=this.minp||this.maxp<=0||this.minp>=0) { message("We must have max_slope> 0 > min_slope."); } else { - rpar = [[this.maxp],[this.minp]]; + var rpar = [[this.maxp],[this.minp]]; this.model.rpar = new ScilabDouble(rpar); graphics.exprs = exprs; this.x.graphics = graphics; diff --git a/js/Misc/RELATIONALOP.js b/js/Misc/RELATIONALOP.js index c1f3fcb9..34d9bb78 100644 --- a/js/Misc/RELATIONALOP.js +++ b/js/Misc/RELATIONALOP.js @@ -1,8 +1,8 @@ /* autogenerated from "macros/Misc/RELATIONALOP.sci" */ function RELATIONALOP() { RELATIONALOP.prototype.define = function RELATIONALOP() { - ipar = [2]; - label = "<"; + var ipar = [2]; + var label = "<"; this.model = scicos_model(); this.model.sim = list(new ScilabString(["relationalop"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1],[1]); @@ -10,8 +10,8 @@ function RELATIONALOP() { this.model.ipar = ipar; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[string(ipar)],[string(0)]]; - gr_i = []; + var exprs = [[string(ipar)],[string(0)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); this.x.graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; return new BasicBlock(this.x); @@ -32,11 +32,11 @@ function RELATIONALOP() { this.zcr = parseFloat(arguments[0]["zcr"]) this.Datatype = arguments[0]["Datatype"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,1)==2) { - exprs = [[exprs],[sci2exp(1)]]; + var exprs = [[exprs],[sci2exp(1)]]; } while (true) { [ok,this.rule,this.zcr,this.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); @@ -49,7 +49,7 @@ function RELATIONALOP() { } if ((this.rule<0)||(this.rule>5)) { message("Incorrect operator "+string(this.rule)+" ; must be 0 to 5."); - ok = false; + var ok = false; } if ((this.Datatype==1)) { this.model.sim = list(new ScilabString(["relational_op"]), new ScilabDouble([4])); @@ -67,28 +67,31 @@ function RELATIONALOP() { this.model.sim = list(new ScilabString(["relational_op_ui8"]), new ScilabDouble([4])); } else { message("Datatype is not supported"); - ok = false; + var ok = false; } if (ok) { - it = this.Datatype*ones(1,2); - ot = this.Datatype; - in1 = [[-1,-2],[-1,-2]]; - out = [-1,-2]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var it = this.Datatype*ones(1,2); + var ot = this.Datatype; + var in1 = [[-1,-2],[-1,-2]]; + var out = [-1,-2]; + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.rule==0) { - label = "=="; + var label = "=="; } else if (this.rule==1) { - label = "~="; + var label = "~="; } else if (this.rule==2) { - label = "<"; + var label = "<"; } else if (this.rule==3) { - label = "≤"; + var label = "≤"; } else if (this.rule==4) { - label = ">"; + var label = ">"; } else if (this.rule==5) { - label = "≥"; + var label = "≥"; } graphics.exprs = exprs; graphics.style = ["fontSize=13;fontStyle=1;displayedLabel="+label]; diff --git a/js/Misc/RELATIONALOP.pickle b/js/Misc/RELATIONALOP.pickle index 708c065e..3d35c336 100644 --- a/js/Misc/RELATIONALOP.pickle +++ b/js/Misc/RELATIONALOP.pickle @@ -62,55 +62,52 @@ sS'model.sim' p19 S'list' p20 -sS'[this.model,graphics,ok]' -p21 -g10 sS'model.nmode' -p22 +p21 g10 sS'in1' -p23 +p22 g15 sS'graphics.exprs' -p24 +p23 g15 sS'x.graphics.style' -p25 +p24 g8 sS'model.ipar' -p26 +p25 g8 sS'model.nzcross' -p27 +p26 g10 sS'ok' -p28 +p27 S'boolean' -p29 +p28 sS'model.blocktype' -p30 +p29 g5 sS'rule' -p31 +p30 g10 sS'exprs' -p32 +p31 g15 sS'gr_i' -p33 +p32 g8 sS'ipar' -p34 +p33 g8 sS'y' -p35 +p34 g8 sS'x' -p36 +p35 g10 sS'model' -p37 +p36 g2 sS'ot' -p38 +p37 Ns.
\ No newline at end of file diff --git a/js/Misc/SUPER_f.js b/js/Misc/SUPER_f.js index 2064ceb8..5cf0195b 100644 --- a/js/Misc/SUPER_f.js +++ b/js/Misc/SUPER_f.js @@ -1,12 +1,12 @@ /* autogenerated from "macros/Misc/SUPER_f.sci" */ function SUPER_f() { SUPER_f.prototype.define = function SUPER_f() { - scs = scicos_diagram(); + var scs = scicos_diagram(); scs.props.title = "Super Block"; - in1 = IN_f("define"); + var in1 = IN_f("define"); in1.graphics.orig = [40,40]; in1.graphics.sz = [20,20]; - out = OUT_f("define"); + var out = OUT_f("define"); out.graphics.orig = [240,40]; out.graphics.sz = [20,20]; scs.objs[1-1] = in1; @@ -18,7 +18,7 @@ function SUPER_f() { this.model.rpar = new ScilabDouble([scs]); this.model.blocktype = new ScilabString(["h"]); this.model.dep_ut = [false,false]; - gr_i = []; + var gr_i = []; this.x = standard_define([2,2],this.model,[],gr_i); return new SuperBlock(this.x); } diff --git a/js/Misc/TEXT_f.js b/js/Misc/TEXT_f.js index c6e3131f..f3b95620 100644 --- a/js/Misc/TEXT_f.js +++ b/js/Misc/TEXT_f.js @@ -7,8 +7,8 @@ function TEXT_f() { this.model.sim = new ScilabString(["text"]); this.model.rpar = new ScilabString(["Text"]); this.model.ipar = new ScilabDouble([this.font],[this.siz]); - exprs = [["Text"],[string(this.font)],[string(this.siz)]]; - graphics = scicos_graphics(); + var exprs = [["Text"],[string(this.font)],[string(this.siz)]]; + var graphics = scicos_graphics(); graphics.orig = [0,0]; graphics.sz = [2,1]; graphics.exprs = exprs; @@ -31,12 +31,12 @@ function TEXT_f() { this.font = parseFloat(arguments[0]["font"]) this.siz = parseFloat(arguments[0]["siz"]) this.x = arg1; - graphics = arg1.graphics; - orig = graphics.orig; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var orig = graphics.orig; + var exprs = graphics.exprs; this.model = arg1.model; if (size(exprs,"*")==1) { - exprs = [[exprs],["3"],["1"]]; + var exprs = [[exprs],["3"],["1"]]; } while (true) { [ok,this.txt,this.font,this.siz,exprs] = scicos_getvalue("Set Text block parameters",["Text","Font number","Font size"],list("str",-1,"vec",1,"vec",1),exprs); @@ -45,28 +45,28 @@ function TEXT_f() { } if (this.font<=0||this.font>6) { message("Font number must be greater than 0 and less than 7"); - ok = false; + var ok = false; } if (this.siz<0) { message("Font size must be positive"); - ok = false; + var 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; + var gh_winpal = gca(); + var default_font_style = gh_winpal.font_style; + var default_font_size = gh_winpal.font_size; + var default_font_color = gh_winpal.font_color; gh_winpal.font_style = this.font; gh_winpal.font_size = this.siz; - r = xstringl(0,0,exprs[1-1],evstr(exprs[2-1]),evstr(exprs[3-1])); + var 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); + var sz = r.slice(3-1,4); graphics.sz = sz; this.x.graphics = graphics; - ipar = [[this.font],[this.siz]]; + var ipar = [[this.font],[this.siz]]; this.model.rpar = new ScilabDouble([this.txt]); this.model.ipar = new ScilabDouble(ipar); this.x.model = this.model; diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js index f84d26d0..1499b7e8 100644 --- a/js/Misc/c_block.js +++ b/js/Misc/c_block.js @@ -1,14 +1,14 @@ /* 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 = []; + var in1 = 1; + var out = 1; + var clkin = []; + var clkout = []; + var x0 = []; + var z0 = []; + var typ = "c"; + var auto = []; this.rpar = []; this.funam = "toto"; this.model = scicos_model(); @@ -24,8 +24,8 @@ function c_block() { this.model.blocktype = new ScilabString([typ]); this.model.firing = auto; this.model.dep_ut = [true,false]; - label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(this.rpar))],[this.funam]],list([])); - gr_i = []; + var label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(this.rpar))],[this.funam]],list([])); + var gr_i = []; this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -49,8 +49,8 @@ function c_block() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; while (true) { [ok,this.i,this.o,this.rpar,this.funam,this.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) { @@ -62,18 +62,23 @@ function c_block() { label[1-1] = this.lab; this.rpar = this.rpar.slice(); this.i = int(this.i.slice()); - ni = size(this.i,1); + var ni = size(this.i,1); this.o = int(this.o.slice()); - no = size(this.o,1); - tt = label[2-1]; + var no = size(this.o,1); + var tt = label[2-1]; if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { - tt = []; + var tt = []; } - [ok,tt] = CFORTR(this.funam,tt,this.i,this.o); + var tmpvar0 = CFORTR(this.funam,tt,this.i,this.o) + var ok = tmpvar0[0] + var tt = tmpvar0[1]; if (!ok) { break; } - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); + var tmpvar1 = check_io(this.model,graphics,this.i,this.o,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { this.model.sim[1] = new ScilabString([this.funam]); this.model.rpar = this.rpar; diff --git a/js/Misc/c_block.pickle b/js/Misc/c_block.pickle index 84c7c67e..26a3af97 100644 --- a/js/Misc/c_block.pickle +++ b/js/Misc/c_block.pickle @@ -74,77 +74,71 @@ sS'label' p21 S'list' p22 -sS'[ok,tt]' -p23 -g9 sS'model.evtin' -p24 +p23 g3 sS'model.sim[1]' +p24 +NsS'model.firing' p25 -NsS'label[2-1]' -p26 -g3 -sS'model.firing' -p27 g3 sS'model.sim' -p28 +p26 g22 sS'model.evtout' -p29 +p27 g3 sS'clkout' -p30 +p28 g3 sS'auto' -p31 +p29 +g3 +sS'label[2-1]' +p30 g3 -sS'[this.model,graphics,ok]' -p32 -g22 sS'in1' -p33 +p31 g9 sS'model.rpar' -p34 +p32 g3 sS'model.state' -p35 +p33 g3 sS'graphics.exprs' -p36 +p34 NsS'x0' -p37 +p35 g3 sS'model.ipar' -p38 +p36 g9 sS'typ' -p39 +p37 g13 sS'model.blocktype' -p40 +p38 g13 sS'i' -p41 +p39 g9 sS'no' -p42 +p40 g9 sS'o' -p43 +p41 g9 sS'gr_i' -p44 +p42 g3 sS'y' -p45 +p43 g3 sS'x' -p46 +p44 g9 sS'model' -p47 +p45 g5 s.
\ No newline at end of file diff --git a/js/Misc/fortran_block.js b/js/Misc/fortran_block.js index 5e0f951a..bd4d11c7 100644 --- a/js/Misc/fortran_block.js +++ b/js/Misc/fortran_block.js @@ -15,8 +15,8 @@ function fortran_block() { this.model.firing = []; this.model.dep_ut = [true,false]; this.funam = "forty"; - label = list([[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([])); - gr_i = []; + var label = list([[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[strcat(sci2exp(this.model.rpar))],[this.funam]],list([])); + var gr_i = []; this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -40,8 +40,8 @@ function fortran_block() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; while (true) { [ok,this.i,this.o,this.rpar,this.funam,this.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) { @@ -53,18 +53,23 @@ function fortran_block() { label[1-1] = this.lab; this.rpar = this.rpar.slice(); this.i = int(this.i.slice()); - ni = size(this.i,1); + var ni = size(this.i,1); this.o = int(this.o.slice()); - no = size(this.o,1); - tt = label[2-1]; + var no = size(this.o,1); + var tt = label[2-1]; if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { - tt = []; + var tt = []; } - [ok,tt] = FORTR(this.funam,tt,this.i,this.o); + var tmpvar0 = FORTR(this.funam,tt,this.i,this.o) + var ok = tmpvar0[0] + var tt = tmpvar0[1]; if (!ok) { break; } - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); + var tmpvar1 = check_io(this.model,graphics,this.i,this.o,[],[]) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { this.model.sim[1] = new ScilabString([this.funam]); this.model.rpar = this.rpar; diff --git a/js/Misc/fortran_block.pickle b/js/Misc/fortran_block.pickle index 9a7877f6..d1773d92 100644 --- a/js/Misc/fortran_block.pickle +++ b/js/Misc/fortran_block.pickle @@ -65,65 +65,59 @@ sS'label' p18 S'list' p19 -sS'[ok,tt]' -p20 -g13 sS'model.evtin' -p21 +p20 g3 sS'model.sim[1]' +p21 +NsS'model.firing' p22 -NsS'label[2-1]' -p23 -g3 -sS'model.firing' -p24 g3 sS'model.sim' -p25 +p23 g19 sS'model.evtout' -p26 +p24 +g3 +sS'label[2-1]' +p25 g3 -sS'[this.model,graphics,ok]' -p27 -g19 sS'model.rpar' -p28 +p26 g3 sS'model.state' -p29 +p27 g3 sS'graphics.exprs' -p30 +p28 NsS'model.ipar' -p31 +p29 g13 sS'typ' -p32 +p30 g3 sS'model.blocktype' -p33 +p31 g9 sS'i' -p34 +p32 g13 sS'no' -p35 +p33 g13 sS'o' -p36 +p34 g13 sS'gr_i' -p37 +p35 g3 sS'y' -p38 +p36 g3 sS'x' -p39 +p37 g13 sS'model' -p40 +p38 g5 s.
\ No newline at end of file diff --git a/js/Misc/func_block.js b/js/Misc/func_block.js index 52a8a30a..2579f2c7 100644 --- a/js/Misc/func_block.js +++ b/js/Misc/func_block.js @@ -7,8 +7,8 @@ function func_block() { this.model.out = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = "v=sin(u);y=u*v"; - gr_i = []; + var exprs = "v=sin(u);y=u*v"; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -22,11 +22,14 @@ function func_block() { } func_block.prototype.set = function func_block() { this.model = arg1.model; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.x = arg1; this.model = this.x.model; - [ok,mac,exprs] = this.genfunc[exprs-1]; + var tmpvar0 = genfunc(exprs) + var ok = tmpvar0[0] + var mac = tmpvar0[1] + var exprs = tmpvar0[2]; if (ok) { this.model.sim = new ScilabDouble([mac]); graphics.exprs = exprs; diff --git a/js/Misc/func_block.pickle b/js/Misc/func_block.pickle index a9ca4a5b..ea703ec1 100644 --- a/js/Misc/func_block.pickle +++ b/js/Misc/func_block.pickle @@ -6,10 +6,8 @@ S'x' p2 aS'model' p3 -aS'genfunc' -p4 -atp5 -Rp6 +atp4 +Rp5 .(dp0 S'model.sim' p1 @@ -19,49 +17,46 @@ sS'model.in1' p3 S'double' p4 -sS'[ok,mac,exprs]' -p5 -g4 sS'model.blocktype' -p6 +p5 g2 sS'x.graphics' -p7 +p6 S'object' -p8 +p7 sS'arg1' -p9 -g8 +p8 +g7 sS'graphics.exprs' -p10 +p9 NsS'model.out' -p11 +p10 g4 sS'exprs' -p12 +p11 g2 sS'x.model' -p13 +p12 NsS'gr_i' -p14 +p13 S'vector' -p15 +p14 sS'model.dep_ut' -p16 -g15 +p15 +g14 sS'graphics' -p17 -g8 +p16 +g7 sS'y' -p18 -g15 +p17 +g14 sS'x' -p19 +p18 g4 sS'model' -p20 -g8 +p19 +g7 sS'typ' -p21 -g15 +p20 +g14 s.
\ No newline at end of file diff --git a/js/Misc/generic_block.js b/js/Misc/generic_block.js index 702943ca..93cefd86 100644 --- a/js/Misc/generic_block.js +++ b/js/Misc/generic_block.js @@ -16,8 +16,8 @@ function generic_block() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.firing)],["y"],["n"]]; - gr_i = []; + var label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.firing)],["y"],["n"]]; + var gr_i = []; this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -59,8 +59,8 @@ function generic_block() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } @@ -69,7 +69,7 @@ function generic_block() { if (!ok) { break; } - label = this.lab; + var label = this.lab; this.function_name = stripblanks(this.function_name); this.xx = this.xx.slice(); this.z = this.z.slice(); @@ -82,12 +82,12 @@ function generic_block() { this.funtyp = int(this.funtyp); if (this.funtyp<0) { message("function type cannot be negative"); - ok = false; + var ok = false; } if ([[this.ci],[this.co]]!=[]) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); - ok = false; + var ok = false; } } this.depu = stripblanks(this.depu); @@ -102,13 +102,16 @@ function generic_block() { } else { this.dept = false; } - dep_ut = [this.depu,this.dept]; + var dep_ut = [this.depu,this.dept]; if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); + var tmpvar0 = check_io(this.model,graphics,this.i,this.o,this.ci,this.co) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.funtyp==3) { - needcompile = 4; + var needcompile = 4; } this.model.sim = list(new ScilabDouble([this.function_name]), new ScilabDouble([this.funtyp])); this.model.state = this.xx; diff --git a/js/Misc/generic_block.pickle b/js/Misc/generic_block.pickle index d1f4eab6..f90f00f7 100644 --- a/js/Misc/generic_block.pickle +++ b/js/Misc/generic_block.pickle @@ -96,70 +96,67 @@ g8 sS'arg1.graphics' p24 g5 -sS'[this.model,graphics,ok]' -p25 -g22 sS'model.rpar' -p26 +p25 g8 sS'model.state' -p27 +p26 g8 sS'graphics' -p28 +p27 g5 sS'model.ipar' -p29 +p28 g8 sS'typ' -p30 +p29 g8 sS'needcompile' -p31 +p30 g2 sS'arg1.model' -p32 +p31 NsS'label[9-1]' -p33 +p32 g8 sS'ok' -p34 +p33 S'boolean' -p35 +p34 sS'model.blocktype' -p36 +p35 g20 sS'i' -p37 +p36 g2 sS'o' -p38 +p37 g2 sS'depu' -p39 -g35 +p38 +g34 sS'dept' -p40 -g35 +p39 +g34 sS'gr_i' -p41 +p40 g8 sS'ipar' -p42 +p41 g2 sS'y' -p43 +p42 g8 sS'x' -p44 +p43 g2 sS'model' -p45 +p44 g5 sS'z' -p46 +p45 g8 sS'dep_ut' -p47 +p46 g8 s.
\ No newline at end of file diff --git a/js/Misc/generic_block2.js b/js/Misc/generic_block2.js index aa827d03..d276b49a 100644 --- a/js/Misc/generic_block2.js +++ b/js/Misc/generic_block2.js @@ -16,8 +16,8 @@ function generic_block2() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; - gr_i = []; + var label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp(this.model.in1)],[sci2exp(this.model.out)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; + var gr_i = []; this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -63,8 +63,8 @@ function generic_block2() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } @@ -73,7 +73,7 @@ function generic_block2() { if (!ok) { break; } - label = this.lab; + var label = this.lab; this.function_name = stripblanks(this.function_name); this.xx = this.xx.slice(); this.z = this.z.slice(); @@ -86,12 +86,12 @@ function generic_block2() { this.funtyp = int(this.funtyp); if (this.funtyp<0) { message("function type cannot be negative"); - ok = false; + var ok = false; } if ([[this.ci],[this.co]]!=[]) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); - ok = false; + var ok = false; } } this.depu = stripblanks(this.depu); @@ -106,13 +106,16 @@ function generic_block2() { } else { this.dept = false; } - dep_ut = [this.depu,this.dept]; + var dep_ut = [this.depu,this.dept]; if (ok) { - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); + var tmpvar0 = check_io(this.model,graphics,this.i,this.o,this.ci,this.co) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.funtyp==3) { - needcompile = 4; + var needcompile = 4; } this.model.sim = list(new ScilabDouble([this.function_name]), new ScilabDouble([this.funtyp])); this.model.state = this.xx; diff --git a/js/Misc/generic_block2.pickle b/js/Misc/generic_block2.pickle index 3acdefcd..4d36465d 100644 --- a/js/Misc/generic_block2.pickle +++ b/js/Misc/generic_block2.pickle @@ -102,72 +102,69 @@ g8 sS'arg1.graphics' p25 g5 -sS'[this.model,graphics,ok]' -p26 -g23 sS'model.nmode' -p27 +p26 NsS'model.rpar' -p28 +p27 g8 sS'model.state' -p29 +p28 g8 sS'graphics' -p30 +p29 g5 sS'model.ipar' -p31 +p30 g8 sS'typ' -p32 +p31 g8 sS'needcompile' -p33 +p32 g2 sS'arg1.model' -p34 +p33 NsS'label[9-1]' -p35 +p34 g8 sS'ok' -p36 +p35 S'boolean' -p37 +p36 sS'model.blocktype' -p38 +p37 g21 sS'i' -p39 +p38 g2 sS'o' -p40 +p39 g2 sS'depu' -p41 -g37 +p40 +g36 sS'dept' -p42 -g37 +p41 +g36 sS'gr_i' -p43 +p42 g8 sS'ipar' -p44 +p43 g2 sS'y' -p45 +p44 g8 sS'x' -p46 +p45 g2 sS'model' -p47 +p46 g5 sS'z' -p48 +p47 g8 sS'dep_ut' -p49 +p48 g8 s.
\ No newline at end of file diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js index a185a2a2..e5bb8697 100644 --- a/js/Misc/generic_block3.js +++ b/js/Misc/generic_block3.js @@ -12,8 +12,8 @@ function generic_block3() { this.model.out2 = new ScilabDouble([1]); this.model.outtyp = new ScilabDouble([1]); this.model.dep_ut = [true,false]; - label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; - gr_i = []; + var label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]]; + var gr_i = []; this.x = standard_define([4,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -67,8 +67,8 @@ function generic_block3() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } @@ -77,7 +77,7 @@ function generic_block3() { if (!ok) { break; } - label = this.lab; + var label = this.lab; this.function_name = stripblanks(this.function_name); this.xx = this.xx.slice(); this.z = this.z.slice(); @@ -88,21 +88,21 @@ function generic_block3() { this.funtyp = this.funtyp; if (this.funtyp<0) { message("function type cannot be negative"); - ok = false; + var ok = false; } if ([[this.ci],[this.co]]!=[]) { if (max([[this.ci],[this.co]])>1) { message("vector event links not supported"); - ok = false; + var ok = false; } } if (this.type[this.opar-1]!=15) { message("object parameter must be a list"); - ok = false; + var ok = false; } if (this.type[this.oz-1]!=15) { message("discrete object state must be a list"); - ok = false; + var ok = false; } this.depu = stripblanks(this.depu); if (part(this.depu,1)=="y") { @@ -116,13 +116,16 @@ function generic_block3() { } else { this.dept = false; } - dep_ut = [this.depu,this.dept]; + var dep_ut = [this.depu,this.dept]; if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co); + var tmpvar0 = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { if (this.funtyp==3) { - needcompile = 4; + var needcompile = 4; } this.model.sim = list(new ScilabDouble([this.function_name]), new ScilabDouble([this.funtyp])); this.model.state = this.xx; diff --git a/js/Misc/generic_block3.pickle b/js/Misc/generic_block3.pickle index a7a2fa07..c9d9390b 100644 --- a/js/Misc/generic_block3.pickle +++ b/js/Misc/generic_block3.pickle @@ -110,74 +110,71 @@ p24 sS'arg1.graphics' p25 g6 -sS'[this.model,graphics,ok]' -p26 -g3 sS'model.out2' -p27 +p26 g3 sS'model.nmode' -p28 +p27 NsS'model.rpar' -p29 +p28 g9 sS'model.outtyp' -p30 +p29 g3 sS'model.state' -p31 +p30 g9 sS'graphics' -p32 +p31 g6 sS'model.ipar' -p33 +p32 g3 sS'typ' -p34 +p33 g9 sS'model.opar' -p35 +p34 NsS'needcompile' -p36 +p35 g3 sS'arg1.model' -p37 +p36 NsS'label[9-1]' -p38 +p37 g9 sS'ok' -p39 +p38 S'boolean' -p40 +p39 sS'model.dep_ut' -p41 +p40 g9 sS'depu' -p42 -g40 +p41 +g39 sS'dept' -p43 -g40 +p42 +g39 sS'gr_i' -p44 +p43 g9 sS'ipar' -p45 +p44 g3 sS'y' -p46 +p45 g9 sS'x' -p47 +p46 g3 sS'model' -p48 +p47 g6 sS'z' -p49 +p48 g9 sS'dep_ut' -p50 +p49 g9 s.
\ No newline at end of file diff --git a/js/Misc/scifunc_block.js b/js/Misc/scifunc_block.js index 83c45670..80f6abb0 100644 --- a/js/Misc/scifunc_block.js +++ b/js/Misc/scifunc_block.js @@ -1,14 +1,14 @@ /* 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 = []; + var in1 = 1; + var out = 1; + var clkin = []; + var clkout = []; + var x0 = []; + var z0 = []; + var typ = "c"; + var auto = []; this.rpar = []; this.model = scicos_model(); this.model.sim = list(new ScilabString(["scifunc"]), new ScilabDouble([3])); @@ -24,8 +24,8 @@ function scifunc_block() { this.model.blocktype = new ScilabString([typ]); this.model.firing = auto; this.model.dep_ut = [true,false]; - exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); - gr_i = []; + var exprs = list([[sci2exp(in1)],[sci2exp(out)],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -57,11 +57,11 @@ function scifunc_block() { this.auto0 = arguments[0]["auto0"] this.deptime = arguments[0]["deptime"] this.lab = arguments[0]["lab"] - needcompile = 0; + var needcompile = 0; this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; if (size(exprs[1-1],"*")==8) { exprs[1-1][9-1] = "0"; } @@ -74,23 +74,29 @@ function scifunc_block() { this.xx = this.xx.slice(); this.z = this.z.slice(); this.rpar = this.rpar.slice(); - nrp = prod(size(this.rpar)); + var nrp = prod(size(this.rpar)); this.i = int(this.i.slice()); - ni = size(this.i,1); + var ni = size(this.i,1); this.o = int(this.o.slice()); - no = size(this.o,1); + var no = size(this.o,1); this.ci = int(this.ci.slice()); - nci = size(this.ci,1); + var nci = size(this.ci,1); this.co = int(this.co.slice()); - nco = size(this.co,1); - [ok,tt,dep_ut] = genfunc1(exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c"); + var nco = size(this.co,1); + var tmpvar0 = genfunc1(exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c") + var ok = tmpvar0[0] + var tt = tmpvar0[1] + var dep_ut = tmpvar0[2]; dep_ut[2-1] = (1==this.deptime); if (!ok) { break; } - [this.model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,this.ci,this.co); + var tmpvar1 = check_io(this.model,graphics,this.i,this.o,this.ci,this.co) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { - auto = this.auto0; + var auto = this.auto0; this.model.state = this.xx; this.model.dstate = this.z; this.model.rpar = this.rpar; @@ -99,7 +105,7 @@ function scifunc_block() { this.model.ipar = new ScilabDouble([0]); } if (or(this.model.opar!=tt)) { - needcompile = 4; + var needcompile = 4; } this.model.opar = new ScilabDouble([tt]); this.model.firing = new ScilabDouble([auto]); diff --git a/js/Misc/scifunc_block.pickle b/js/Misc/scifunc_block.pickle index 8aa4565d..d55b8523 100644 --- a/js/Misc/scifunc_block.pickle +++ b/js/Misc/scifunc_block.pickle @@ -86,9 +86,9 @@ g3 sS'z0' p22 g9 -sS'[ok,tt,dep_ut]' +sS'auto' p23 -g3 +g9 sS'model.evtin' p24 g9 @@ -111,75 +111,69 @@ sS'exprs[1-1][9-1]' p31 S'string' p32 -sS'[this.model,graphics,ok]' -p33 -g28 sS'in1' -p34 +p33 g3 sS'model.rpar' -p35 +p34 g9 sS'nci' -p36 +p35 g3 sS'model.state' -p37 +p36 g9 sS'nco' -p38 +p37 g3 sS'x0' -p39 +p38 g9 sS'nrp' -p40 +p39 g3 sS'typ' -p41 +p40 g32 sS'model.opar' -p42 +p41 g28 sS'needcompile' -p43 +p42 g3 sS'model.blocktype' -p44 +p43 g32 -sS'auto' -p45 -g9 sS'i' -p46 +p44 g3 sS'x.graphics' -p47 +p45 g6 sS'x.model' -p48 +p46 g6 sS'o' -p49 +p47 g3 sS'exprs' -p50 +p48 g28 sS'gr_i' -p51 +p49 g9 sS'graphics.exprs' -p52 +p50 NsS'y' -p53 +p51 g9 sS'x' -p54 +p52 g3 sS'model' -p55 +p53 g6 sS'z' -p56 +p54 g9 s.
\ No newline at end of file diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index e96e9bdb..494f6450 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -1,16 +1,16 @@ /* 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 = []; + var in1 = 1; + var out = 1; + var clkin = []; + var clkout = []; + var x0 = []; + var z0 = []; + var typ = "c"; + var auto = []; this.rpar = []; - it = 1; + var it = 1; this.model = scicos_model(); this.model.sim = list(new ScilabString(["scifunc"]), new ScilabDouble([3])); this.model.in1 = new ScilabDouble([in1]); @@ -29,8 +29,8 @@ function scifunc_block_m() { this.model.blocktype = new ScilabString([typ]); this.model.firing = auto; this.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(this.rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); - gr_i = []; + var exprs = list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -62,11 +62,11 @@ function scifunc_block_m() { this.auto0 = arguments[0]["auto0"] this.deptime = arguments[0]["deptime"] this.lab = arguments[0]["lab"] - needcompile = 0; + var needcompile = 0; this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; while (true) { [ok,this.i,this.o,this.ci,this.co,this.xx,this.z,this.rpar,this.auto0,this.deptime,this.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) { @@ -76,23 +76,29 @@ function scifunc_block_m() { this.xx = this.xx.slice(); this.z = this.z.slice(); this.rpar = this.rpar.slice(); - it = ones(1,size(this.i,1)); - ot = ones(1,size(this.o,1)); - nrp = prod(size(this.rpar)); - ni = size(this.i,1); - no = size(this.o,1); + var it = ones(1,size(this.i,1)); + var ot = ones(1,size(this.o,1)); + var nrp = prod(size(this.rpar)); + var ni = size(this.i,1); + var no = size(this.o,1); this.ci = int(this.ci.slice()); - nci = size(this.ci,1); + var nci = size(this.ci,1); this.co = int(this.co.slice()); - nco = size(this.co,1); - [ok,tt,dep_ut] = genfunc2(exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c"); + var nco = size(this.co,1); + var tmpvar0 = genfunc2(exprs[2-1],this.i,this.o,nci,nco,size(this.xx,1),size(this.z,1),nrp,"c") + var ok = tmpvar0[0] + var tt = tmpvar0[1] + var dep_ut = tmpvar0[2]; dep_ut[2-1] = (1==this.deptime); if (!ok) { break; } - [this.model,graphics,ok] = set_io(this.model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); + var tmpvar1 = set_io(this.model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co) + this.model = tmpvar1[0] + var graphics = tmpvar1[1] + var ok = tmpvar1[2]; if (ok) { - auto = this.auto0; + var auto = this.auto0; this.model.state = this.xx; this.model.dstate = this.z; this.model.rpar = this.rpar; @@ -101,7 +107,7 @@ function scifunc_block_m() { this.model.ipar = new ScilabDouble([0]); } if (or(this.model.opar!=tt)) { - needcompile = 4; + var needcompile = 4; } this.model.opar = new ScilabDouble([tt]); this.model.firing = new ScilabDouble([auto]); diff --git a/js/Misc/scifunc_block_m.pickle b/js/Misc/scifunc_block_m.pickle index 58448010..e943163b 100644 --- a/js/Misc/scifunc_block_m.pickle +++ b/js/Misc/scifunc_block_m.pickle @@ -89,106 +89,100 @@ g3 sS'z0' p23 g10 -sS'[ok,tt,dep_ut]' -p24 -g3 sS'model.evtin' -p25 +p24 g10 sS'exprs[2-1]' -p26 +p25 NsS'model.firing' -p27 +p26 g10 sS'model.sim' -p28 +p27 S'list' -p29 +p28 sS'model.evtout' -p30 +p29 g10 sS'clkout' -p31 +p30 g10 sS'model.in2' -p32 +p31 g3 sS'auto' -p33 +p32 g10 -sS'[this.model,graphics,ok]' -p34 -g3 sS'model.out2' -p35 +p33 g3 sS'in1' -p36 +p34 g3 sS'model.rpar' -p37 +p35 g10 sS'nci' -p38 +p36 g3 sS'model.state' -p39 +p37 g10 sS'nco' -p40 +p38 g3 sS'model.outtyp' -p41 +p39 g3 sS'x0' -p42 +p40 g10 sS'nrp' -p43 +p41 g3 sS'typ' -p44 +p42 S'string' -p45 +p43 sS'model.opar' -p46 -g29 +p44 +g28 sS'needcompile' -p47 +p45 g3 sS'z' -p48 +p46 g10 sS'model.blocktype' -p49 -g45 +p47 +g43 sS'x.graphics' -p50 +p48 g6 sS'x.model' -p51 +p49 g6 sS'model.dep_ut' -p52 +p50 g10 sS'exprs' -p53 -g29 +p51 +g28 sS'gr_i' -p54 +p52 g10 sS'graphics.exprs' -p55 +p53 NsS'y' -p56 +p54 g10 sS'x' -p57 +p55 g3 sS'model' -p58 +p56 g6 sS'ot' -p59 +p57 g3 s.
\ No newline at end of file |