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/Branching/SWITCH2.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/Branching/SWITCH2.js')
-rw-r--r-- | js/Branching/SWITCH2.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/js/Branching/SWITCH2.js b/js/Branching/SWITCH2.js index 1c8a4fb8..f3b2b4c7 100644 --- a/js/Branching/SWITCH2.js +++ b/js/Branching/SWITCH2.js @@ -3,7 +3,7 @@ function SWITCH2() { SWITCH2.prototype.define = function SWITCH2() { in1 = [[-1],[1],[-1]]; ipar = [0]; - nzz = 1; + this.nzz = 1; rpar = 0; model = scicos_model(); model.sim = list("switch2",4); @@ -11,11 +11,11 @@ function SWITCH2() { model.out = -1; model.ipar = ipar; model.rpar = rpar; - model.nzcross = nzz; + model.nzcross = this.nzz; model.nmode = 1; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = [[string(ipar)],[string(rpar)],[string(nzz)]]; + exprs = [[string(ipar)],[string(rpar)],[string(this.nzz)]]; gr_i = []; this.x = standard_define([2,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -31,21 +31,21 @@ function SWITCH2() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,rule,thra,nzz,exprs] = scicos_getvalue("Set parameters",[["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.rule,this.thra,this.nzz,exprs] = scicos_getvalue("Set parameters",[["pass first input if: u2>=a (0), u2>a (1), u2~=a (2)"],["threshold a"],["use zero crossing: yes (1), no (0)"]],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } - rule = int(rule); - if ((rule<0)) { - rule = 0; + this.rule = int(this.rule); + if ((this.rule<0)) { + this.rule = 0; } - if ((rule>2)) { - rule = 2; + if ((this.rule>2)) { + this.rule = 2; } graphics.exprs = exprs; - model.ipar = rule; - model.rpar = thra; - if (nzz!=0) { + model.ipar = this.rule; + model.rpar = this.thra; + if (this.nzz!=0) { model.nmode = 1; model.nzcross = 1; } else { |