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/INTRP2BLK_f.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/INTRP2BLK_f.js')
-rw-r--r-- | js/NonLinear/INTRP2BLK_f.js | 20 |
1 files changed, 10 insertions, 10 deletions
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; |