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/Misc/HYSTHERESIS.js | |
parent | a2bfd6050ab2b5b6bbede92393b1f61d4ecc25aa (diff) | |
download | sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.gz sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.bz2 sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.zip |
add more global variables
Diffstat (limited to 'js/Misc/HYSTHERESIS.js')
-rw-r--r-- | js/Misc/HYSTHERESIS.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/Misc/HYSTHERESIS.js b/js/Misc/HYSTHERESIS.js index 1df3ee97..a4ef4c44 100644 --- a/js/Misc/HYSTHERESIS.js +++ b/js/Misc/HYSTHERESIS.js @@ -14,9 +14,9 @@ function HYSTHERESIS() { this.model.nmode = new ScilabDouble([1]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[string(rpar)],[string(sign(this.nzz))]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HYSTHERESIS\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[string(rpar)],[string(sign(this.nzz))]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HYSTHERESIS\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } HYSTHERESIS.prototype.details = function HYSTHERESIS() { @@ -38,19 +38,20 @@ function HYSTHERESIS() { this.out_high = arguments[0]["out_high"] this.out_low = arguments[0]["out_low"] this.nzz = parseFloat(arguments[0]["nzz"]) + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; while (true) { - [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,exprs] = scicos_getvalue("Set parameters",["switch on at","switch off at","output when on","output when off","use zero crossing: yes (1), no (0)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.high_lim,this.low_lim,this.out_high,this.out_low,this.nzz,this.exprs] = scicos_getvalue("Set parameters",["switch on at","switch off at","output when on","output when off","use zero crossing: yes (1), no (0)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } if (this.low_lim>this.high_lim) { message("switch on value must be larger than switch off value"); } else { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.model.rpar = new ScilabDouble(transpose([this.high_lim,this.low_lim,this.out_high,this.out_low])); if (this.nzz>0) { this.nzz = 2; |