diff options
Diffstat (limited to 'js/Misc/MPBLOCK.js')
-rw-r--r-- | js/Misc/MPBLOCK.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 50121a28..e7c3a0ce 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/MPBLOCK.sci" */ function MPBLOCK() { MPBLOCK.prototype.define = function MPBLOCK() { - this.in1 = ["u"]; + this.in = ["u"]; this.intype = ["I"]; this.out = [["y1"],["y2"]]; this.outtype = [["I"],["I"]]; @@ -9,7 +9,7 @@ function MPBLOCK() { var paramv = list(); var pprop = []; var nameF = "myModel"; - var exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in1.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]); + var exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],sci2exp(this.in.slice()),sci2exp(this.intype.slice()),sci2exp(this.out.slice()),sci2exp(this.outtype.slice()),sci2exp(param.slice()),list(string(0.1),string(.0001)),sci2exp(pprop.slice()),nameF,[]); this.model = scicos_model(); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabBoolean([true,true]); @@ -21,7 +21,7 @@ function MPBLOCK() { mo.model = nameF; mo.parameters = list(param,paramv); this.model.sim = list(new ScilabString([mo.model]), new ScilabDouble([10004])); - mo.inputs = this.in1; + mo.inputs = this.in; mo.outputs = this.out; this.model.in = new ScilabDouble([ones(size(mo.inputs,"r"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"r"),1)]); @@ -71,7 +71,7 @@ function MPBLOCK() { var ok = false; } if (ok) { - for (i=1;i<=size(this.in1,"*");i+=1) { + for (i=1;i<=size(this.in,"*");i+=1) { var r = false; var ierr = execstr("r=validvar(in(i))","errcatch"); if (!r) { @@ -80,7 +80,7 @@ function MPBLOCK() { } } if (!ok) { - x_message([["Invalid variable name for the input "+string(i)+"."],["\""+this.in1[i-1]+"\""],["Please choose another variable name."]]); + x_message([["Invalid variable name for the input "+string(i)+"."],["\""+this.in[i-1]+"\""],["Please choose another variable name."]]); } } if (ok) { @@ -129,7 +129,7 @@ function MPBLOCK() { } } if (ok) { - if (or(size(this.intype)!=size(this.in1))) { + if (or(size(this.intype)!=size(this.in))) { x_message("Input variables are not well defined!"); var ok = false; } @@ -172,7 +172,7 @@ function MPBLOCK() { if (ok) { var intypex = find(this.intype=="I"); var outtypex = find(this.outtype=="I"); - var tmpvar2 = set_io(this.model,this.graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); + var tmpvar2 = set_io(this.model,this.graphics,list([ones(this.in),ones(this.in)],ones(this.in)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex); this.model = tmpvar2[0]; this.graphics = tmpvar2[1]; var ok = tmpvar2[2]; @@ -232,7 +232,7 @@ function MPBLOCK() { if (ok) { var mo = modelica(); mo.model = nameF; - mo.inputs = this.in1; + mo.inputs = this.in; mo.outputs = this.out; if (pprop.length!=0) { if (max(pprop)>0) { |