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/MUX.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/MUX.js')
-rw-r--r-- | js/Branching/MUX.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/js/Branching/MUX.js b/js/Branching/MUX.js index c0cdd611..cd23e5d7 100644 --- a/js/Branching/MUX.js +++ b/js/Branching/MUX.js @@ -1,15 +1,15 @@ /* autogenerated from "macros/Branching/MUX.sci" */ function MUX() { MUX.prototype.define = function MUX() { - in1 = 2; + this.in1 = 2; model = scicos_model(); model.sim = list("multiplex",4); - model.in1 = -transpose([1:in1]); + model.in1 = -transpose([1:this.in1]); model.out = 0; - model.ipar = in1; + model.ipar = this.in1; model.blocktype = "c"; model.dep_ut = [true,false]; - exprs = string(in1); + exprs = string(this.in1); gr_i = []; this.x = standard_define([.5,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -25,36 +25,36 @@ function MUX() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); + [ok,this.in1,exprs] = scicos_getvalue("Set MUX block parameters","number of input ports or vector of sizes",list("intvec",-1),exprs); if (!ok) { break; } - if (size(in1,"*")==1) { - if (in1<2||in1>31) { + if (size(this.in1,"*")==1) { + if (this.in1<2||this.in1>31) { message("Block must have at least two input ports and at most 31"); ok = false; } else { - [model,graphics,ok] = check_io(model,graphics,-transpose([1:in1]),0,[],[]); + [model,graphics,ok] = check_io(model,graphics,-transpose([1:this.in1]),0,[],[]); } } else { - if (size(in1,"*")<2||or(in1==0)||size(in1,"*")>31) { + if (size(this.in1,"*")<2||or(this.in1==0)||size(this.in1,"*")>31) { message([["Block must have at least two input ports"],["and at most 31. Size 0 is not allowed. "]]); ok = false; } else { - if (min(in1)<0) { + if (min(this.in1)<0) { nout = 0; } else { - nout = sum(in1); + nout = sum(this.in1); } - [model,graphics,ok] = check_io(model,graphics,in1.slice(),nout,[],[]); + [model,graphics,ok] = check_io(model,graphics,this.in1.slice(),nout,[],[]); if (ok) { - in1 = size(in1,"*"); + this.in1 = size(this.in1,"*"); } } } if (ok) { graphics.exprs = exprs; - model.ipar = in1; + model.ipar = this.in1; this.x.graphics = graphics; this.x.model = model; break; |