diff options
author | Sunil Shetye | 2018-08-24 11:46:02 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-08-27 16:43:40 +0530 |
commit | 3386d0d537a498adce65f313aacb7ca4a147a4d2 (patch) | |
tree | dc8b98c70c10cec2c9f3f37b5858e1afd6554698 /js/Misc/MPBLOCK.js | |
parent | 9fee9bd7e5e356e872c7a539d4a6cfa89cae593c (diff) | |
download | sci2js-3386d0d537a498adce65f313aacb7ca4a147a4d2.tar.gz sci2js-3386d0d537a498adce65f313aacb7ca4a147a4d2.tar.bz2 sci2js-3386d0d537a498adce65f313aacb7ca4a147a4d2.zip |
remove exprs and gr_i from default global list
Diffstat (limited to 'js/Misc/MPBLOCK.js')
-rw-r--r-- | js/Misc/MPBLOCK.js | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index f20e0135..1c5aed9b 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -9,7 +9,7 @@ function MPBLOCK() { var paramv = list(); var pprop = []; var nameF = "myModel"; - this.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.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,[]); this.model = scicos_model(); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabBoolean([true,true]); @@ -26,8 +26,8 @@ function MPBLOCK() { this.model.in = new ScilabDouble([ones(size(mo.inputs,"r"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"r"),1)]); this.model.equations = mo; - this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MPBLOCK\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([3,2]),this.model,new ScilabDouble([this.exprs]),this.gr_i); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MPBLOCK\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3,2]),this.model,new ScilabDouble([exprs]),gr_i); this.x.graphics.in_implicit = this.intype; this.x.graphics.out_implicit = this.outtype; return new BasicBlock(this.x); @@ -39,18 +39,18 @@ function MPBLOCK() { alert("parameters cannot be modified"); } MPBLOCK.prototype.set = function MPBLOCK() { - this.exprs = this.graphics.exprs; - if (this.type[this.exprs-1]==15) { + var exprs = this.graphics.exprs; + if (this.type[exprs-1]==15) { var paramv = list(); var pprop = []; for (i=1;i<=size(this.model.rpar,"*");i+=1) { paramv[$+1-1] = string(this.model.rpar[i-1]); pprop[$+1-1] = 0; } - this.exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],this.exprs[1-1][1-1],this.exprs[1-1][2-1],this.exprs[1-1][3-1],this.exprs[1-1][4-1],this.exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),this.exprs[1-1][7-1],this.exprs[2-1]); + var exprs = tlist(["MPBLOCK","in","intype","out","outtype","param","paramv","pprop","nameF","funtxt"],exprs[1-1][1-1],exprs[1-1][2-1],exprs[1-1][3-1],exprs[1-1][4-1],exprs[1-1][5-1],paramv,sci2exp(pprop.slice()),exprs[1-1][7-1],exprs[2-1]); } - var lab_1 = list(this.exprs.in,this.exprs.intype,this.exprs.out,this.exprs.outtype,this.exprs.param,this.exprs.pprop,this.exprs.nameF); - var lab_2 = this.exprs.paramv; + var lab_1 = list(exprs.in,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF); + var lab_2 = exprs.paramv; while (true) { var tmpvar0 = getvalue("Set Modelica generic block parameters",[["Input variables: "],["Input variables types: "],["Output variables: "],["Output variables types:"],["Parameters in Modelica:"],["Parameters properties: "],["Model name in packages:"]],list("str",-1,"str",-1,"str",-1,"str",-1,"str",-1,"vec",-1,"str",-1),lab_1); var ok = tmpvar0[0]; @@ -188,7 +188,7 @@ function MPBLOCK() { var lab_2_tmp = list(); if (Tparam_sz!=0) { for (i=1;i<=Tparam_sz;i+=1) { - var ee = evstr(this.exprs.param); + var ee = evstr(exprs.param); for (j=1;j<=size(ee,"r");j+=1) { if (ee[j-1]==Tparam_lab[i-1]) { lab_2_tmp[i-1] = lab_2[j-1]; @@ -219,7 +219,7 @@ function MPBLOCK() { var getvalue_txt = "[ok,"+lhs_txt+",lab_2]=scicos_getvalue(\'Set parameters values\',["+lab_txt+"],"+"list("+rhs_txt+"),lab_2)"; execstr(getvalue_txt); if (!ok) { - var lab_2 = this.exprs.paramv; + var lab_2 = exprs.paramv; } } } @@ -247,31 +247,31 @@ function MPBLOCK() { this.model.rpar = new ScilabDouble([this.model.rpar],[double(paramv[i-1].slice())]); } this.model.sim[1-1] = new ScilabDouble([this.funam]); - this.exprs.in = lab_1[1-1]; - this.exprs.intype = lab_1[2-1]; - this.exprs.out = lab_1[3-1]; - this.exprs.outtype = lab_1[4-1]; - this.exprs.param = lab_1[5-1]; - this.exprs.paramv = list(); + exprs.in = lab_1[1-1]; + exprs.intype = lab_1[2-1]; + exprs.out = lab_1[3-1]; + exprs.outtype = lab_1[4-1]; + exprs.param = lab_1[5-1]; + exprs.paramv = list(); if (Tparam_sz!=0) { if (this.type[lab_2-1]==15) { for (i=1;i<=lstsize(lab_2);i+=1) { - this.exprs.paramv[i-1] = lab_2[i-1]; + exprs.paramv[i-1] = lab_2[i-1]; } } else { for (i=1;i<=size(lab_2,"*");i+=1) { - this.exprs.paramv[i-1] = lab_2[i-1]; + exprs.paramv[i-1] = lab_2[i-1]; } } } - this.exprs.pprop = lab_1[6-1]; - this.exprs.nameF = lab_1[7-1]; - this.exprs.funtxt = ""; + exprs.pprop = lab_1[6-1]; + exprs.nameF = lab_1[7-1]; + exprs.funtxt = ""; this.x.model = this.model; this.graphics.gr_i[1-1][1-1] = new ScilabString(["txt=[\' "+nameF+" \'];"]); this.graphics.in_implicit = new ScilabString(this.intype); this.graphics.out_implicit = new ScilabDouble(this.outtype); - this.graphics.exprs = this.exprs; + this.graphics.exprs = exprs; this.x.graphics = this.graphics; break; } |