diff options
author | Sunil Shetye | 2018-07-12 23:16:08 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-13 10:21:08 +0530 |
commit | 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 (patch) | |
tree | 50fdfe7b1e8850622825e362ca865be3f0911009 /js/Linear/SUMMATION.js | |
parent | a2bfd6050ab2b5b6bbede92393b1f61d4ecc25aa (diff) | |
download | sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.gz sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.bz2 sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.zip |
add more global variables
Diffstat (limited to 'js/Linear/SUMMATION.js')
-rw-r--r-- | js/Linear/SUMMATION.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/js/Linear/SUMMATION.js b/js/Linear/SUMMATION.js index f0d68daf..afad8077 100644 --- a/js/Linear/SUMMATION.js +++ b/js/Linear/SUMMATION.js @@ -11,9 +11,9 @@ function SUMMATION() { this.model.ipar = new ScilabDouble(this.sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = sci2exp(this.sgn); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SUMMATION\",sz(1),sz(2));"]); - this.x = standard_define([2,3],this.model,exprs,gr_i); + this.exprs = sci2exp(this.sgn); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SUMMATION\",sz(1),sz(2));"]); + this.x = standard_define([2,3],this.model,this.exprs,this.gr_i); return new Summation(this.x); } SUMMATION.prototype.details = function SUMMATION() { @@ -31,17 +31,18 @@ function SUMMATION() { this.Datatype = arguments[0]["Datatype"] this.sgn = inverse(arguments[0]["sgn"]) this.satur = arguments[0]["satur"] + this.exprs = inverse(arguments[0]["exprs"]) this.x = arg1; this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = this.graphics.exprs; - if (size(exprs,1)==1) { - var exprs = [[sci2exp(1)],[exprs],[sci2exp(0)]]; - } else if (size(exprs,1)==2) { - var exprs = [[exprs],[sci2exp(0)]]; + this.exprs = this.graphics.exprs; + if (size(this.exprs,1)==1) { + this.exprs = [[sci2exp(1)],[this.exprs],[sci2exp(0)]]; + } else if (size(this.exprs,1)==2) { + this.exprs = [[this.exprs],[sci2exp(0)]]; } while (true) { - [ok,this.Datatype,this.sgn,this.satur,exprs] = scicos_getvalue("Set sum block parameters",["Datatype (1=real double 2=complex 3=int32 ...)","Number of inputs or sign vector (of +1, -1)","Do on Overflow(0=Nothing 1=Saturate 2=Error)"],list("vec",1,"vec",-1,"vec",1),exprs); + [ok,this.Datatype,this.sgn,this.satur,this.exprs] = scicos_getvalue("Set sum block parameters",["Datatype (1=real double 2=complex 3=int32 ...)","Number of inputs or sign vector (of +1, -1)","Do on Overflow(0=Nothing 1=Saturate 2=Error)"],list("vec",1,"vec",-1,"vec",1),this.exprs); if (!ok) { break; } @@ -141,7 +142,7 @@ function SUMMATION() { if (ok) { this.model.rpar = new ScilabDouble([this.satur]); this.model.ipar = new ScilabDouble([this.sgn]); - this.graphics.exprs = new ScilabDouble(exprs); + this.graphics.exprs = new ScilabDouble(this.exprs); this.x.graphics = this.graphics; this.x.model = this.model; break; |