summaryrefslogtreecommitdiff
path: root/js/Linear/GAINBLK.js
diff options
context:
space:
mode:
authorSunil Shetye2018-07-12 23:16:08 +0530
committerSunil Shetye2018-07-13 10:21:08 +0530
commit214ade87a6cef2bf55f9b9f2848ffafc02f37f18 (patch)
tree50fdfe7b1e8850622825e362ca865be3f0911009 /js/Linear/GAINBLK.js
parenta2bfd6050ab2b5b6bbede92393b1f61d4ecc25aa (diff)
downloadsci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.gz
sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.bz2
sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.zip
add more global variables
Diffstat (limited to 'js/Linear/GAINBLK.js')
-rw-r--r--js/Linear/GAINBLK.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/js/Linear/GAINBLK.js b/js/Linear/GAINBLK.js
index fa1b00c6..a74d673f 100644
--- a/js/Linear/GAINBLK.js
+++ b/js/Linear/GAINBLK.js
@@ -15,9 +15,9 @@ function GAINBLK() {
this.model.rpar = new ScilabDouble([this.gain]);
this.model.blocktype = new ScilabString(["c"]);
this.model.dep_ut = new ScilabDouble([true,false]);
- var exprs = [strcat(sci2exp(this.gain))];
- var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GAINBLK\",sz(1),sz(2));"]);
- this.x = standard_define([2,2],this.model,exprs,gr_i);
+ this.exprs = [strcat(sci2exp(this.gain))];
+ this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GAINBLK\",sz(1),sz(2));"]);
+ this.x = standard_define([2,2],this.model,this.exprs,this.gr_i);
return new BasicBlock(this.x);
}
GAINBLK.prototype.details = function GAINBLK() {
@@ -33,15 +33,16 @@ function GAINBLK() {
GAINBLK.prototype.set = function GAINBLK() {
this.gain = parseFloat(arguments[0]["gain"])
this.over = arguments[0]["over"]
+ this.exprs = inverse(arguments[0]["exprs"])
this.x = arg1;
this.graphics = arg1.graphics;
- var exprs = this.graphics.exprs;
+ this.exprs = this.graphics.exprs;
this.model = arg1.model;
- if (size(exprs,"*")==1) {
- var exprs = [[exprs],[sci2exp(0)]];
+ if (size(this.exprs,"*")==1) {
+ this.exprs = [[this.exprs],[sci2exp(0)]];
}
while (true) {
- [ok,this.gain,this.over,exprs] = scicos_getvalue("Set gain block parameters",["Gain","Do On Overflow(0=Nothing 1=Saturate 2=Error)"],list("mat",[-1,-1],"vec",1),exprs);
+ [ok,this.gain,this.over,this.exprs] = scicos_getvalue("Set gain block parameters",["Gain","Do On Overflow(0=Nothing 1=Saturate 2=Error)"],list("mat",[-1,-1],"vec",1),this.exprs);
if (!ok) {
break;
}
@@ -153,7 +154,7 @@ function GAINBLK() {
}
}
if (ok) {
- this.graphics.exprs = new ScilabDouble(exprs);
+ this.graphics.exprs = new ScilabDouble(this.exprs);
this.x.graphics = this.graphics;
this.x.model = this.model;
break;