diff options
author | Sunil Shetye | 2018-09-18 17:38:01 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-10-08 11:24:12 +0530 |
commit | f6d537573102a160601aa5c070f63455204d5f9d (patch) | |
tree | 7d61bbc8303725a3f9b0ab4e9662ab1ce962565d /js/Misc/MBLOCK.js | |
parent | f389f174481df676c841ebcc87a7b8b313921bbc (diff) | |
download | sci2js-master.tar.gz sci2js-master.tar.bz2 sci2js-master.zip |
Diffstat (limited to 'js/Misc/MBLOCK.js')
-rw-r--r-- | js/Misc/MBLOCK.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js index a5bec067..a9a5eed3 100644 --- a/js/Misc/MBLOCK.js +++ b/js/Misc/MBLOCK.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/Misc/MBLOCK.sci" */ function MBLOCK() { MBLOCK.prototype.define = function MBLOCK() { - this.in1 = ["u1"]; + this.in = ["u1"]; this.intype = ["I"]; this.out = [["y1"],["y2"]]; this.outtype = [["I"],["E"]]; @@ -9,7 +9,7 @@ function MBLOCK() { var paramv = list(0.1,.0001); this.pprop = [[0],[0]]; var nameF = "generic"; - var exprs = tlist(["MBLOCK","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(this.pprop.slice()),nameF,[]); + var exprs = tlist(["MBLOCK","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(this.pprop.slice()),nameF,[]); this.model = scicos_model(); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabBoolean([false,true]); @@ -21,7 +21,7 @@ function MBLOCK() { mo.model = nameF; mo.parameters = list(param,paramv); this.model.sim = list(new ScilabString([mo.model]), new ScilabDouble([30004])); - 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)]); @@ -92,7 +92,7 @@ function MBLOCK() { 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) { @@ -101,7 +101,7 @@ function MBLOCK() { } } if (!ok) { - messagebox([["Invalid variable name for the input "+string(i)+"."],["\""+this.in1[i-1]+"\""],["Please choose another variable name."]],"modal","error"); + messagebox([["Invalid variable name for the input "+string(i)+"."],["\""+this.in[i-1]+"\""],["Please choose another variable name."]],"modal","error"); } } if (ok) { @@ -150,7 +150,7 @@ function MBLOCK() { } } if (ok) { - if (or(size(this.intype)!=size(this.in1))) { + if (or(size(this.intype)!=size(this.in))) { messagebox("Input variables are not well defined!","modal","error"); var ok = false; } @@ -193,7 +193,7 @@ function MBLOCK() { if (ok) { var intypex = find(this.intype=="I"); var outtypex = find(this.outtype=="I"); - var tmpvar1 = 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 tmpvar1 = 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 = tmpvar1[0]; this.graphics = tmpvar1[1]; var ok = tmpvar1[2]; @@ -255,7 +255,7 @@ function MBLOCK() { var tt = []; } } - var tmpvar2 = MODCOM(this.funam,tt,this.in1,this.out,param,paramv,this.pprop); + var tmpvar2 = MODCOM(this.funam,tt,this.in,this.out,param,paramv,this.pprop); var ok = tmpvar2[0]; var tt = tmpvar2[1]; if (!ok) { @@ -265,7 +265,7 @@ function MBLOCK() { if (ok) { var mo = modelica(); mo.model = nameF; - mo.inputs = this.in1; + mo.inputs = this.in; mo.outputs = this.out; if (max(this.pprop)>0) { mo.parameters = list(transpose(param),paramv,transpose(this.pprop)); |