summaryrefslogtreecommitdiff
path: root/js/Branching/MUX.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Branching/MUX.js')
-rw-r--r--js/Branching/MUX.js34
1 files changed, 17 insertions, 17 deletions
diff --git a/js/Branching/MUX.js b/js/Branching/MUX.js
index c42892d9..9a601e8f 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() {
- this.in1 = 2;
+ this.in = 2;
this.model = scicos_model();
this.model.sim = list(new ScilabString(["multiplex"]), new ScilabDouble([4]));
- this.model.in = new ScilabDouble(-transpose([1:this.in1]));
+ this.model.in = new ScilabDouble(-transpose([1:this.in]));
this.model.out = new ScilabDouble([0]);
- this.model.ipar = new ScilabDouble([this.in1]);
+ this.model.ipar = new ScilabDouble([this.in]);
this.model.blocktype = new ScilabString(["c"]);
this.model.dep_ut = new ScilabBoolean([true,false]);
- var exprs = string(this.in1);
+ var exprs = string(this.in);
var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MUX\",sz(1),sz(2));"]);
this.x = new standard_define(new ScilabDouble([.5,2]),this.model,new ScilabString([exprs]),gr_i);
return new BasicBlock(this.x);
@@ -21,7 +21,7 @@ function MUX() {
var exprs = this.graphics.exprs;
this.set_param_popup_title = "Set MUX block parameters";
var options = {
- in1:["number of input ports or vector of sizes",this.in1],
+ in:["number of input ports or vector of sizes",this.in],
}
return options;
}
@@ -29,45 +29,45 @@ function MUX() {
var exprs = this.graphics.exprs;
while (true) {
var ok = true;
- this.in1 = parseFloat(arguments[0]["in1"]);
- var exprs = [arguments[0]["in1"]];
+ this.in = parseFloat(arguments[0]["in"]);
+ var exprs = [arguments[0]["in"]];
if (!ok) {
break;
}
- if (size(this.in1,"*")==1) {
- if (this.in1<2||this.in1>31) {
+ if (size(this.in,"*")==1) {
+ if (this.in<2||this.in>31) {
message("Block must have at least two input ports and at most 31");
throw "user error";
var ok = false;
} else {
- var tmpvar0 = check_io(this.model,this.graphics,-transpose([1:this.in1]),0,[],[]);
+ var tmpvar0 = check_io(this.model,this.graphics,-transpose([1:this.in]),0,[],[]);
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
}
} else {
- if (size(this.in1,"*")<2||or(this.in1==0)||size(this.in1,"*")>31) {
+ if (size(this.in,"*")<2||or(this.in==0)||size(this.in,"*")>31) {
message([["Block must have at least two input ports"],["and at most 31. Size 0 is not allowed. "]]);
throw "user error";
var ok = false;
} else {
- if (min(this.in1)<0) {
+ if (min(this.in)<0) {
var nout = 0;
} else {
- var nout = sum(this.in1);
+ var nout = sum(this.in);
}
- var tmpvar1 = check_io(this.model,this.graphics,this.in1.slice(),nout,[],[]);
+ var tmpvar1 = check_io(this.model,this.graphics,this.in.slice(),nout,[],[]);
this.model = tmpvar1[0];
this.graphics = tmpvar1[1];
var ok = tmpvar1[2];
if (ok) {
- this.in1 = size(this.in1,"*");
+ this.in = size(this.in,"*");
}
}
}
if (ok) {
this.graphics.exprs = new ScilabDouble([exprs]);
- this.model.ipar = new ScilabDouble([this.in1]);
+ this.model.ipar = new ScilabDouble([this.in]);
this.x.graphics = this.graphics;
this.x.model = this.model;
break;
@@ -81,7 +81,7 @@ function MUX() {
MUX.prototype.importset = function MUX() {
var graphics = this.x.graphics;
var ary = getData(graphics.exprs);
- this.in1 = ary[0];
+ this.in = ary[0];
}
MUX.prototype.getContainer = function MUX() { return new BasicBlock(this.x); }
}