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/PRODUCT.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/PRODUCT.js')
-rw-r--r-- | js/NonLinear/PRODUCT.js | 32 |
1 files changed, 16 insertions, 16 deletions
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); } } |