diff options
Diffstat (limited to 'js/NonLinear')
33 files changed, 275 insertions, 195 deletions
diff --git a/js/NonLinear/ABS_VALUE.js b/js/NonLinear/ABS_VALUE.js index 06525a67..cb2a098b 100644 --- a/js/NonLinear/ABS_VALUE.js +++ b/js/NonLinear/ABS_VALUE.js @@ -26,13 +26,13 @@ function ABS_VALUE() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); + [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; if (ok) { - if (zcr!=0) { + if (this.zcr!=0) { model.nmode = -1; model.nzcross = -1; } else { diff --git a/js/NonLinear/ABS_VALUE.pickle b/js/NonLinear/ABS_VALUE.pickle index 0d1dde24..4709e48c 100644 --- a/js/NonLinear/ABS_VALUE.pickle +++ b/js/NonLinear/ABS_VALUE.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'zcr' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/DLRADAPT_f.js b/js/NonLinear/DLRADAPT_f.js index a93eee91..ef454e12 100644 --- a/js/NonLinear/DLRADAPT_f.js +++ b/js/NonLinear/DLRADAPT_f.js @@ -1,24 +1,24 @@ /* autogenerated from "macros/NonLinear/DLRADAPT_f.sci" */ function DLRADAPT_f() { DLRADAPT_f.prototype.define = function DLRADAPT_f() { - p = [[0],[1]]; - rn = []; - rd = [[math.complex(0.2,0.8),math.complex(0.2,-0.8)],[math.complex(0.3,0.7),math.complex(0.3,-0.7)]]; - g = [[1],[1]]; - last_u = []; - last_y = [[0],[0]]; + this.p = [[0],[1]]; + this.rn = []; + this.rd = [[math.complex(0.2,0.8),math.complex(0.2,-0.8)],[math.complex(0.3,0.7),math.complex(0.3,-0.7)]]; + this.g = [[1],[1]]; + this.last_u = []; + this.last_y = [[0],[0]]; model = scicos_model(); model.sim = "dlradp"; model.in1 = [[1],[1]]; model.out = 1; model.evtin = 1; - model.dstate = [[last_u],[last_y]]; - model.rpar = [[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]]; + model.dstate = [[this.last_u],[this.last_y]]; + model.rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; model.ipar = [[0],[2],[2]]; model.blocktype = "d"; model.firing = []; model.dep_ut = [true,false]; - exprs = [[sci2exp(p)],[sci2exp(rn)],[sci2exp(rd,0)],[sci2exp(g)],[sci2exp(last_u)],[sci2exp(last_y)]]; + exprs = [[sci2exp(this.p)],[sci2exp(this.rn)],[sci2exp(this.rd,0)],[sci2exp(this.g)],[sci2exp(this.last_u)],[sci2exp(this.last_y)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -34,20 +34,20 @@ function DLRADAPT_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,p,rn,rd,g,last_u,last_y,exprs] = scicos_getvalue("Set block parameters",[["Vector of p mesh points"],["Numerator roots (one line for each mesh)"],["Denominator roots (one line for each mesh)"],["Vector of gain at mesh points"],["past inputs (Num degree values)"],["past outputs (Den degree values)"]],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs); + [ok,this.p,this.rn,this.rd,this.g,this.last_u,this.last_y,exprs] = scicos_getvalue("Set block parameters",[["Vector of p mesh points"],["Numerator roots (one line for each mesh)"],["Denominator roots (one line for each mesh)"],["Vector of gain at mesh points"],["past inputs (Num degree values)"],["past outputs (Den degree values)"]],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs); if (!ok) { break; } - m = size(rn,2); - [npt,n] = size(rd); + m = size(this.rn,2); + [npt,n] = size(this.rd); if (m>=n) { message("Transfer must be strictly proper"); - } else if (size(rn,1)!=0&&size(rn,1)!=size(p,"*")) { + } else if (size(this.rn,1)!=0&&size(this.rn,1)!=size(this.p,"*")) { message("Numerator roots matrix row size\'s is incorrect"); } else { - rpar = [[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]]; + rpar = [[this.p.slice()],[real(this.rn.slice())],[imag(this.rn.slice())],[real(this.rd.slice())],[imag(this.rd.slice())],[this.g.slice()]]; ipar = [[m],[n],[npt]]; - model.dstate = [[last_u.slice()],[last_y.slice()]]; + model.dstate = [[this.last_u.slice()],[this.last_y.slice()]]; model.rpar = rpar; model.ipar = ipar; graphics.exprs = exprs; diff --git a/js/NonLinear/DLRADAPT_f.pickle b/js/NonLinear/DLRADAPT_f.pickle index 0d1dde24..971b5bc0 100644 --- a/js/NonLinear/DLRADAPT_f.pickle +++ b/js/NonLinear/DLRADAPT_f.pickle @@ -2,8 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'last_y' p2 -atp3 -Rp4 +aS'g' +p3 +aS'last_u' +p4 +aS'rd' +p5 +aS'p' +p6 +aS'x' +p7 +aS'rn' +p8 +atp9 +Rp10 .
\ No newline at end of file diff --git a/js/NonLinear/EXPBLK_f.js b/js/NonLinear/EXPBLK_f.js index 8dbfaf1f..ec4262b2 100644 --- a/js/NonLinear/EXPBLK_f.js +++ b/js/NonLinear/EXPBLK_f.js @@ -2,12 +2,12 @@ function EXPBLK_f() { EXPBLK_f.prototype.define = function EXPBLK_f() { in1 = 1; - a = math.E; + this.a = math.E; model = scicos_model(); model.sim = "expblk"; model.in1 = -1; model.out = -1; - model.rpar = a; + model.rpar = this.a; model.blocktype = "c"; model.dep_ut = [true,false]; exprs = ["%e"]; @@ -29,15 +29,15 @@ function EXPBLK_f() { exprs = exprs[2-1]; } while (true) { - [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs); + [ok,this.a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs); if (!ok) { break; } - if (or(a<=0)) { + if (or(this.a<=0)) { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = a; + model.rpar = this.a; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/EXPBLK_f.pickle b/js/NonLinear/EXPBLK_f.pickle index 0d1dde24..792ba43a 100644 --- a/js/NonLinear/EXPBLK_f.pickle +++ b/js/NonLinear/EXPBLK_f.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/EXPBLK_m.js b/js/NonLinear/EXPBLK_m.js index 275d3563..177a00ef 100644 --- a/js/NonLinear/EXPBLK_m.js +++ b/js/NonLinear/EXPBLK_m.js @@ -2,7 +2,7 @@ function EXPBLK_m() { EXPBLK_m.prototype.define = function EXPBLK_m() { in1 = 1; - a = math.E; + this.a = math.E; model = scicos_model(); model.sim = list("expblk_m",4); model.in1 = -1; @@ -11,7 +11,7 @@ function EXPBLK_m() { model.out2 = -2; model.intyp = 1; model.outtyp = 1; - model.rpar = a; + model.rpar = this.a; model.blocktype = "c"; model.dep_ut = [true,false]; exprs = ["%e"]; @@ -33,15 +33,15 @@ function EXPBLK_m() { exprs = exprs[2-1]; } while (true) { - [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs); + [ok,this.a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs); if (!ok) { break; } - if (or(a<=0)) { + if (or(this.a<=0)) { message("a^u : a must be positive"); } else { graphics.exprs = exprs; - model.rpar = a; + model.rpar = this.a; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/EXPBLK_m.pickle b/js/NonLinear/EXPBLK_m.pickle index 0d1dde24..792ba43a 100644 --- a/js/NonLinear/EXPBLK_m.pickle +++ b/js/NonLinear/EXPBLK_m.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/INTRP2BLK_f.js b/js/NonLinear/INTRP2BLK_f.js index 6d1b5bf2..fb245e44 100644 --- a/js/NonLinear/INTRP2BLK_f.js +++ b/js/NonLinear/INTRP2BLK_f.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/NonLinear/INTRP2BLK_f.sci" */ function INTRP2BLK_f() { INTRP2BLK_f.prototype.define = function INTRP2BLK_f() { - a = [[0],[1]]; - b = [[0],[1]]; - c = [[0,1],[1,2]]; + this.a = [[0],[1]]; + this.b = [[0],[1]]; + this.c = [[0,1],[1,2]]; model = scicos_model(); model.sim = list("intrp2",1); model.in1 = [[1],[1]]; model.out = 1; - model.rpar = [[a],[b],[c.slice()]]; + model.rpar = [[this.a],[this.b],[this.c.slice()]]; model.ipar = [[2],[2]]; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[strcat(sci2exp(a))],[strcat(sci2exp(b))],[strcat(sci2exp(c,0))]]; + exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))],[strcat(sci2exp(this.c,0))]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -28,19 +28,19 @@ function INTRP2BLK_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,a,b,c,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."],["Z values"]],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs); + [ok,this.a,this.b,this.c,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."],["Z values"]],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs); if (!ok) { break; } - if (size(a,"*")!=size(c,"c")||size(b,"*")!=size(c,"r")) { + if (size(this.a,"*")!=size(this.c,"c")||size(this.b,"*")!=size(this.c,"r")) { message("incompatible dimension"); - } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0||min(b.slice(2-1,$)-b.slice(1-1,$-1))<=0) { + } else if (min(this.a.slice(2-1,$)-this.a.slice(1-1,$-1))<=0||min(this.b.slice(2-1,$)-this.b.slice(1-1,$-1))<=0) { message("X and Y must be strictly increasing"); } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[a.slice()],[b.slice()],[c.slice()]]; - model.ipar = [[size(a,"*")],[size(b,"*")]]; + model.rpar = [[this.a.slice()],[this.b.slice()],[this.c.slice()]]; + model.ipar = [[size(this.a,"*")],[size(this.b,"*")]]; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/INTRP2BLK_f.pickle b/js/NonLinear/INTRP2BLK_f.pickle index 0d1dde24..3ee9dce1 100644 --- a/js/NonLinear/INTRP2BLK_f.pickle +++ b/js/NonLinear/INTRP2BLK_f.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +aS'c' +p4 +aS'b' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/NonLinear/INTRPLBLK_f.js b/js/NonLinear/INTRPLBLK_f.js index 28ce39b3..978d3aa1 100644 --- a/js/NonLinear/INTRPLBLK_f.js +++ b/js/NonLinear/INTRPLBLK_f.js @@ -1,16 +1,16 @@ /* autogenerated from "macros/NonLinear/INTRPLBLK_f.sci" */ function INTRPLBLK_f() { INTRPLBLK_f.prototype.define = function INTRPLBLK_f() { - a = [[0],[1]]; - b = [[0],[1]]; + this.a = [[0],[1]]; + this.b = [[0],[1]]; model = scicos_model(); model.sim = "intrpl"; model.in1 = 1; model.out = 1; - model.rpar = [[a],[b]]; + model.rpar = [[this.a],[this.b]]; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[strcat(sci2exp(a))],[strcat(sci2exp(b))]]; + exprs = [[strcat(sci2exp(this.a))],[strcat(sci2exp(this.b))]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -26,18 +26,18 @@ function INTRPLBLK_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,a,b,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."]],list("vec",-1,"vec",-1),exprs); + [ok,this.a,this.b,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."]],list("vec",-1,"vec",-1),exprs); if (!ok) { break; } - if (size(a,"*")!=size(b,"*")) { + if (size(this.a,"*")!=size(this.b,"*")) { message("X and Y must have the same size"); - } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0) { + } else if (min(this.a.slice(2-1,$)-this.a.slice(1-1,$-1))<=0) { message("X must be strictly increasing"); } else { if (ok) { graphics.exprs = exprs; - model.rpar = [[a.slice()],[b.slice()]]; + model.rpar = [[this.a.slice()],[this.b.slice()]]; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/INTRPLBLK_f.pickle b/js/NonLinear/INTRPLBLK_f.pickle index 0d1dde24..8f2166a5 100644 --- a/js/NonLinear/INTRPLBLK_f.pickle +++ b/js/NonLinear/INTRPLBLK_f.pickle @@ -2,8 +2,12 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +aS'b' +p4 +atp5 +Rp6 .
\ No newline at end of file diff --git a/js/NonLinear/LOGBLK_f.js b/js/NonLinear/LOGBLK_f.js index 3cd0de2f..359068b9 100644 --- a/js/NonLinear/LOGBLK_f.js +++ b/js/NonLinear/LOGBLK_f.js @@ -2,12 +2,12 @@ function LOGBLK_f() { LOGBLK_f.prototype.define = function LOGBLK_f() { in1 = 1; - a = math.E; + this.a = math.E; model = scicos_model(); model.sim = "logblk"; model.in1 = -1; model.out = -1; - model.rpar = a; + model.rpar = this.a; model.blocktype = "c"; model.dep_ut = [true,false]; exprs = "%e"; @@ -29,16 +29,16 @@ function LOGBLK_f() { exprs = exprs[2-1]; } while (true) { - [ok,a,exprs] = scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs); + [ok,this.a,exprs] = scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs); if (!ok) { break; } - if (a<=1) { + if (this.a<=1) { message("Basis must be larger than 1"); } else { if (ok) { graphics.exprs = exprs; - model.rpar = a; + model.rpar = this.a; this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/LOGBLK_f.pickle b/js/NonLinear/LOGBLK_f.pickle index 0d1dde24..792ba43a 100644 --- a/js/NonLinear/LOGBLK_f.pickle +++ b/js/NonLinear/LOGBLK_f.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/LOOKUP2D.js b/js/NonLinear/LOOKUP2D.js index 9a741929..ba2f77ca 100644 --- a/js/NonLinear/LOOKUP2D.js +++ b/js/NonLinear/LOOKUP2D.js @@ -2,21 +2,21 @@ function LOOKUP2D() { LOOKUP2D.prototype.define = function LOOKUP2D() { model = scicos_model(); - xx = [1:4]; - yy = [1:3]; - zz = [[4,5,6],[16,19,20],[10,18,23],[6,3,-1]]; - Method = 1; + this.xx = [1:4]; + this.yy = [1:3]; + this.zz = [[4,5,6],[16,19,20],[10,18,23],[6,3,-1]]; + this.Method = 1; Graf = "n"; - Nx = length(xx); - Ny = length(yy); + Nx = length(this.xx); + Ny = length(this.yy); model.sim = list("lookup2d",4); model.in1 = [[1],[1]]; model.out = 1; - model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]]; - model.ipar = [[Nx],[Ny],[Method]]; + model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; + model.ipar = [[Nx],[Ny],[this.Method]]; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = list(strcat(sci2exp(xx)),strcat(sci2exp(yy)),strcat(sci2exp(zz)),sci2exp(Method),Graf); + exprs = list(strcat(sci2exp(this.xx)),strcat(sci2exp(this.yy)),strcat(sci2exp(this.zz)),sci2exp(this.Method),Graf); gr_i = []; this.x = standard_define([2.5,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -35,29 +35,29 @@ function LOOKUP2D() { SaveExit = false; while (true) { Ask_again = false; - [ok,xx,yy,zz,Method,graf,exprs] = scicos_getvalue("2D Lookup table parameters",[["Row index input values"],["Column index input values"],["Table data"],["Lookup method(1..5)"],["Launch graphic window(y/n)?"]],list("vec",-1,"vec",-1,"mat",[-1,-1],"vec",1,"str",1),exprs); + [ok,this.xx,this.yy,this.zz,this.Method,this.graf,exprs] = scicos_getvalue("2D Lookup table parameters",[["Row index input values"],["Column index input values"],["Table data"],["Lookup method(1..5)"],["Launch graphic window(y/n)?"]],list("vec",-1,"vec",-1,"mat",[-1,-1],"vec",1,"str",1),exprs); if (!ok) { break; } - mtd = int(Method); + mtd = int(this.Method); if (mtd<1) { mtd = 1; } if (mtd>6) { mtd = 6; } - if (graf!="y"&&graf!="Y") { - graf = "n"; + if (this.graf!="y"&&this.graf!="Y") { + this.graf = "n"; } exprs[5-1] = "n"; exprs[4-1] = sci2exp(mtd); METHOD = getmethod(mtd); if (!Ask_again) { - xx = xx.slice(); - yy = yy.slice(); - [nx,mx] = size(xx); - [ny,my] = size(yy); - [nz,mz] = size(zz); + this.xx = this.xx.slice(); + this.yy = this.yy.slice(); + [nx,mx] = size(this.xx); + [ny,my] = size(this.yy); + [nz,mz] = size(this.zz); if (((nx<=1)||(ny<=1))) { x_message("input row/column data size should be greater than one"); Ask_again = true; @@ -66,29 +66,29 @@ function LOOKUP2D() { x_message("incompatible size of x and y"); Ask_again = true; } - [ok] = test_increasing(xx); + [ok] = test_increasing(this.xx); if ((!ok)) { x_message("Row input values must be monotonically increasing"); Ask_again = true; } - [ok] = test_increasing(yy); + [ok] = test_increasing(this.yy); if ((!ok)) { x_message("Column input values must be monotonically increasing"); Ask_again = true; } } if (!Ask_again) { - if ((graf=="Y"||graf=="y")) { + if ((this.graf=="Y"||this.graf=="y")) { gh = gcf(); curwin = gh.figure_id; save_curwin = curwin; gh2 = scf(); curwin = max(winsid())+1; - plot3d(xx,yy,zz,35,45,"X@Y@Z",[5,2,4]); + plot3d(this.xx,this.yy,this.zz,35,45,"X@Y@Z",[5,2,4]); curwin = save_curwin; gh.figure_id = curwin; } - model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]]; + model.rpar = [[this.xx.slice()],[this.yy.slice()],[this.zz.slice()]]; model.ipar = [[nx],[ny],[mtd]]; graphics.exprs = exprs; this.x.model = model; diff --git a/js/NonLinear/LOOKUP2D.pickle b/js/NonLinear/LOOKUP2D.pickle index a808c055..8518b72f 100644 --- a/js/NonLinear/LOOKUP2D.pickle +++ b/js/NonLinear/LOOKUP2D.pickle @@ -2,10 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'order' p2 -aS'order' +aS'yy' p3 -atp4 -Rp5 +aS'xx' +p4 +aS'zz' +p5 +aS'x' +p6 +aS'Method' +p7 +aS'graf' +p8 +atp9 +Rp10 .
\ No newline at end of file diff --git a/js/NonLinear/LOOKUP_c.pickle b/js/NonLinear/LOOKUP_c.pickle index b1c7cff9..a645b625 100644 --- a/js/NonLinear/LOOKUP_c.pickle +++ b/js/NonLinear/LOOKUP_c.pickle @@ -4,18 +4,28 @@ p0 ((lp1 S'rparin' p2 -aS'ixy' +aS'extrapo' p3 -aS'iparin' +aS'yy' p4 -aS'argn' +aS'xx' p5 -aS'xy' +aS'ixy' p6 -aS'x' +aS'iparin' p7 -aS'curwin' +aS'argn' p8 -atp9 -Rp10 +aS'xy' +p9 +aS'x' +p10 +aS'curwin' +p11 +aS'Method' +p12 +aS'graf' +p13 +atp14 +Rp15 .
\ No newline at end of file diff --git a/js/NonLinear/MAXMIN.js b/js/NonLinear/MAXMIN.js index b2121ccd..91bda897 100644 --- a/js/NonLinear/MAXMIN.js +++ b/js/NonLinear/MAXMIN.js @@ -25,36 +25,36 @@ function MAXMIN() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,mm,nin,zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",[["Min (1) or Max (2) "],["Number of input vectors (1 or 2)"],["zero-crossing (1: yes, 0;no)"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.mm,this.nin,this.zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",[["Min (1) or Max (2) "],["Number of input vectors (1 or 2)"],["zero-crossing (1: yes, 0;no)"]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - if (zcr!=0) { - zcr = -1; + if (this.zcr!=0) { + this.zcr = -1; } - if (mm!=1) { - mm = 2; + if (this.mm!=1) { + this.mm = 2; } - if (nin!=1&&nin!=2) { + if (this.nin!=1&&this.nin!=2) { message("Wrong number of inputs, only 1 and 2 allowed"); ok = false; } if (ok) { - if (nin==1) { + if (this.nin==1) { [model,graphics,ok] = check_io(model,graphics,-1,1,[],[]); } else { [model,graphics,ok] = check_io(model,graphics,[-1,-1],-1,[],[]); } } if (ok) { - model.nzcross = zcr; - if (nin==1) { - model.nmode = abs(zcr); + model.nzcross = this.zcr; + if (this.nin==1) { + model.nmode = abs(this.zcr); } else { - model.nmode = zcr; + model.nmode = this.zcr; } - model.ipar = mm; - if (mm==1) { + model.ipar = this.mm; + if (this.mm==1) { label = "MIN"; } else { label = "MAX"; diff --git a/js/NonLinear/MAXMIN.pickle b/js/NonLinear/MAXMIN.pickle index 0d1dde24..f031a479 100644 --- a/js/NonLinear/MAXMIN.pickle +++ b/js/NonLinear/MAXMIN.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'mm' p2 -atp3 -Rp4 +aS'x' +p3 +aS'nin' +p4 +aS'zcr' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/NonLinear/POWBLK_f.js b/js/NonLinear/POWBLK_f.js index 3b06a6e8..302238de 100644 --- a/js/NonLinear/POWBLK_f.js +++ b/js/NonLinear/POWBLK_f.js @@ -2,15 +2,15 @@ function POWBLK_f() { POWBLK_f.prototype.define = function POWBLK_f() { in1 = 1; - a = 1.5; + this.a = 1.5; model = scicos_model(); model.sim = "powblk"; model.in1 = -1; model.out = -1; - model.rpar = a; + model.rpar = this.a; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = string(a); + exprs = string(this.a); gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -29,16 +29,16 @@ function POWBLK_f() { exprs = exprs[2-1]; } while (true) { - [ok,a,exprs] = scicos_getvalue("Set u^a block parameters","to the power of",list("vec",1),exprs); + [ok,this.a,exprs] = scicos_getvalue("Set u^a block parameters","to the power of",list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; - if (a==int(a)) { - model.ipar = a; + if (this.a==int(this.a)) { + model.ipar = this.a; model.rpar = []; } else { - model.rpar = a; + model.rpar = this.a; model.ipar = []; } model.firing = []; diff --git a/js/NonLinear/POWBLK_f.pickle b/js/NonLinear/POWBLK_f.pickle index 0d1dde24..792ba43a 100644 --- a/js/NonLinear/POWBLK_f.pickle +++ b/js/NonLinear/POWBLK_f.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'x' +S'a' p2 -atp3 -Rp4 +aS'x' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/PRODUCT.js b/js/NonLinear/PRODUCT.js index 6236adad..a16b0380 100644 --- a/js/NonLinear/PRODUCT.js +++ b/js/NonLinear/PRODUCT.js @@ -1,18 +1,18 @@ /* autogenerated from "macros/NonLinear/PRODUCT.sci" */ function PRODUCT() { PRODUCT.prototype.define = function PRODUCT() { - sgn = [[1],[-1]]; + this.sgn = [[1],[-1]]; model = scicos_model(); model.sim = list("product",4); model.in1 = [[-1],[-1]]; model.out = -1; - model.ipar = sgn; + model.ipar = this.sgn; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = sci2exp(sgn); + exprs = sci2exp(this.sgn); gr_i = []; this.x = standard_define([2,3],model,exprs,gr_i); - return new BasicBlock(this.x); + return new Product(this.x); } PRODUCT.prototype.details = function PRODUCT() { return this.x; @@ -25,30 +25,30 @@ function PRODUCT() { model = arg1.model; exprs = graphics.exprs; while (true) { - [ok,sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs); + [ok,this.sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs); if (!ok) { break; } - sgn = sgn.slice(); - if (size(sgn,1)==1) { - if (sgn<1) { + this.sgn = this.sgn.slice(); + if (size(this.sgn,1)==1) { + if (this.sgn<1) { message("Number of inputs must be > 0"); ok = false; - } else if (sgn==1) { + } else if (this.sgn==1) { in1 = -1; - sgn = []; + this.sgn = []; nout = 1; } else { - in1 = -ones(sgn,1); - sgn = ones(sgn,1); + in1 = -ones(this.sgn,1); + this.sgn = ones(this.sgn,1); nout = -1; } } else { - if (!and(abs(sgn)==1)) { + if (!and(abs(this.sgn)==1)) { message("Signs can only be +1 or -1"); ok = false; } else { - in1 = -ones(size(sgn,1),1); + in1 = -ones(size(this.sgn,1),1); nout = -1; } } @@ -56,13 +56,13 @@ function PRODUCT() { [model,graphics,ok] = check_io(model,graphics,in1,nout,[],[]); } if (ok) { - model.ipar = sgn; + model.ipar = this.sgn; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = model; break; } } - return new BasicBlock(this.x); + return new Product(this.x); } } diff --git a/js/NonLinear/PRODUCT.pickle b/js/NonLinear/PRODUCT.pickle index 0d1dde24..1f88411a 100644 --- a/js/NonLinear/PRODUCT.pickle +++ b/js/NonLinear/PRODUCT.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'sgn' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/QUANT_f.js b/js/NonLinear/QUANT_f.js index b22f4cc2..d236e32a 100644 --- a/js/NonLinear/QUANT_f.js +++ b/js/NonLinear/QUANT_f.js @@ -1,17 +1,17 @@ /* autogenerated from "macros/NonLinear/QUANT_f.sci" */ function QUANT_f() { QUANT_f.prototype.define = function QUANT_f() { - pas = 0.1; - meth = 1; + this.pas = 0.1; + this.meth = 1; model = scicos_model(); model.sim = "qzrnd"; model.in1 = -1; model.out = -1; - model.rpar = pas; - model.ipar = meth; + model.rpar = this.pas; + model.ipar = this.meth; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[string(pas)],[string(meth)]]; + exprs = [[string(this.pas)],[string(this.meth)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -27,17 +27,17 @@ function QUANT_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,pas,meth,exprs] = scicos_getvalue("Set parameters",[["Step"],["Quantization Type (1-4)"]],list("vec",1,"vec",1),exprs); + [ok,this.pas,this.meth,exprs] = scicos_getvalue("Set parameters",[["Step"],["Quantization Type (1-4)"]],list("vec",1,"vec",1),exprs); if (!ok) { break; } - if (meth<1||meth>4) { + if (this.meth<1||this.meth>4) { message("Quantization Type must be from 1 to 4"); } else { - rpar = pas; + rpar = this.pas; model.rpar = rpar; - model.ipar = meth; - switch (meth) { + model.ipar = this.meth; + switch (this.meth) { case 1: model.sim = "qzrnd"; case 2: diff --git a/js/NonLinear/QUANT_f.pickle b/js/NonLinear/QUANT_f.pickle index 0d1dde24..23575aa8 100644 --- a/js/NonLinear/QUANT_f.pickle +++ b/js/NonLinear/QUANT_f.pickle @@ -4,6 +4,10 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'meth' +p3 +aS'pas' +p4 +atp5 +Rp6 .
\ No newline at end of file diff --git a/js/NonLinear/SATURATION.js b/js/NonLinear/SATURATION.js index e760e47d..108584e1 100644 --- a/js/NonLinear/SATURATION.js +++ b/js/NonLinear/SATURATION.js @@ -1,9 +1,9 @@ /* autogenerated from "macros/NonLinear/SATURATION.sci" */ function SATURATION() { SATURATION.prototype.define = function SATURATION() { - minp = -1; - maxp = 1; - rpar = [[maxp],[minp]]; + this.minp = -1; + this.maxp = 1; + rpar = [[this.maxp],[this.minp]]; model = scicos_model(); model.sim = list("satur",4); model.in1 = 1; @@ -13,7 +13,7 @@ function SATURATION() { model.rpar = rpar; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[string(maxp)],[string(minp)],[string(model.nmode)]]; + exprs = [[string(this.maxp)],[string(this.minp)],[string(model.nmode)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -29,16 +29,16 @@ function SATURATION() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,maxp,minp,zeroc,exprs] = scicos_getvalue("Set Saturation parameters",[["Upper limit"],["Lower limit"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.maxp,this.minp,this.zeroc,exprs] = scicos_getvalue("Set Saturation parameters",[["Upper limit"],["Lower limit"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - if (maxp<=minp) { + if (this.maxp<=this.minp) { message("Upper limit must be > Lower limit"); } else { - rpar = [[maxp],[minp]]; + rpar = [[this.maxp],[this.minp]]; model.rpar = rpar; - if (zeroc!=0) { + if (this.zeroc!=0) { model.nzcross = 2; model.nmode = 1; } else { diff --git a/js/NonLinear/SATURATION.pickle b/js/NonLinear/SATURATION.pickle index 0d1dde24..00d3a947 100644 --- a/js/NonLinear/SATURATION.pickle +++ b/js/NonLinear/SATURATION.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'minp' p2 -atp3 -Rp4 +aS'x' +p3 +aS'maxp' +p4 +aS'zeroc' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/NonLinear/SAT_f.js b/js/NonLinear/SAT_f.js index 8b87bf2b..f422fef7 100644 --- a/js/NonLinear/SAT_f.js +++ b/js/NonLinear/SAT_f.js @@ -1,19 +1,19 @@ /* autogenerated from "macros/NonLinear/SAT_f.sci" */ function SAT_f() { SAT_f.prototype.define = function SAT_f() { - minp = -1; - maxp = 1; + this.minp = -1; + this.maxp = 1; slope = 1; - rpar = [[minp],[maxp],[slope]]; + rpar = [[this.minp],[this.maxp],[slope]]; model = scicos_model(); model.sim = list("lusat",1); model.in1 = 1; model.nzcross = 2; model.out = 1; - model.rpar = [[minp],[maxp],[slope]]; + model.rpar = [[this.minp],[this.maxp],[slope]]; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[string(minp)],[string(maxp)],[string(slope)]]; + exprs = [[string(this.minp)],[string(this.maxp)],[string(slope)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -29,16 +29,16 @@ function SAT_f() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,minp,maxp,pente,exprs] = scicos_getvalue("Set Saturation parameters",[["Min"],["Max"],["Slope"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.minp,this.maxp,this.pente,exprs] = scicos_getvalue("Set Saturation parameters",[["Min"],["Max"],["Slope"]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - if (maxp<=0) { + if (this.maxp<=0) { message("Max must be strictly positive"); - } else if (pente<=0) { + } else if (this.pente<=0) { message("Slope must be strictly positive"); } else { - rpar = [[minp/pente],[maxp/pente],[pente]]; + rpar = [[this.minp/this.pente],[this.maxp/this.pente],[this.pente]]; model.rpar = rpar; model.firing = []; graphics.exprs = exprs; diff --git a/js/NonLinear/SAT_f.pickle b/js/NonLinear/SAT_f.pickle index 0d1dde24..64c36d44 100644 --- a/js/NonLinear/SAT_f.pickle +++ b/js/NonLinear/SAT_f.pickle @@ -2,8 +2,14 @@ c__builtin__ set p0 ((lp1 -S'x' +S'minp' p2 -atp3 -Rp4 +aS'x' +p3 +aS'maxp' +p4 +aS'pente' +p5 +atp6 +Rp7 .
\ No newline at end of file diff --git a/js/NonLinear/SIGNUM.js b/js/NonLinear/SIGNUM.js index cf4dbfa7..2f5e5033 100644 --- a/js/NonLinear/SIGNUM.js +++ b/js/NonLinear/SIGNUM.js @@ -26,13 +26,13 @@ function SIGNUM() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); + [ok,this.zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs); if (!ok) { break; } graphics.exprs = exprs; if (ok) { - if (zcr!=0) { + if (this.zcr!=0) { model.nmode = -1; model.nzcross = -1; } else { diff --git a/js/NonLinear/SIGNUM.pickle b/js/NonLinear/SIGNUM.pickle index 0d1dde24..4709e48c 100644 --- a/js/NonLinear/SIGNUM.pickle +++ b/js/NonLinear/SIGNUM.pickle @@ -4,6 +4,8 @@ p0 ((lp1 S'x' p2 -atp3 -Rp4 +aS'zcr' +p3 +atp4 +Rp5 .
\ No newline at end of file diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js index e7a622a0..fbc3d85f 100644 --- a/js/NonLinear/TrigFun.js +++ b/js/NonLinear/TrigFun.js @@ -25,15 +25,15 @@ function TrigFun() { PREVAR_FF = [["sin"],["cos"],["tan"],["asin"],["acos"],["atan"],["sinh"],["cosh"],["tanh"],["asinh"],["acosh"],["atanh"]]; PREVAR_GG = [["Choose among "+strcat(PREVAR_FF.slice(1-1,4),", ")],[strcat(PREVAR_FF.slice(5-1,$),", ")]]; while (true) { - [ok,fun,exprs] = scicos_getvalue(PREVAR_GG,"Function",list("str",1),exprs); + [ok,this.fun,exprs] = scicos_getvalue(PREVAR_GG,"Function",list("str",1),exprs); if (!ok) { break; } - if (find(PREVAR_FF==fun)==[]) { - message("Sorry but "+fun+" is not in the list!"); + if (find(PREVAR_FF==this.fun)==[]) { + message("Sorry but "+this.fun+" is not in the list!"); } else { graphics.exprs = exprs; - execstr("model.sim=list(\'"+fun+"_blk\',4)"); + execstr("model.sim=list(\'"+this.fun+"_blk\',4)"); this.x.graphics = graphics; this.x.model = model; break; diff --git a/js/NonLinear/TrigFun.pickle b/js/NonLinear/TrigFun.pickle index 0d1dde24..b2a190a2 100644 --- a/js/NonLinear/TrigFun.pickle +++ b/js/NonLinear/TrigFun.pickle @@ -2,8 +2,10 @@ c__builtin__ set p0 ((lp1 -S'x' +S'fun' p2 -atp3 -Rp4 +aS'x' +p3 +atp4 +Rp5 .
\ No newline at end of file |