diff options
author | Sunil Shetye | 2018-06-26 14:59:47 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-26 14:59:47 +0530 |
commit | eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00 (patch) | |
tree | 6378935263fe5cafd389b6893ac3b37a1dd4b1a7 /js/NonLinear/LOOKUP2D.js | |
parent | afed64f1a0eab0b2d742088186d7bc340a2c895b (diff) | |
download | sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.gz sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.bz2 sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.zip |
add return value from scicos_getvalue to global vars
Diffstat (limited to 'js/NonLinear/LOOKUP2D.js')
-rw-r--r-- | js/NonLinear/LOOKUP2D.js | 46 |
1 files changed, 23 insertions, 23 deletions
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; |