diff options
author | Sunil Shetye | 2018-07-11 17:51:05 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-12 23:01:50 +0530 |
commit | 44a3807a94783e831070f0e003340af58dc64d16 (patch) | |
tree | cce50388afa463583d7a7aead34d40f5b02281f7 /js/Misc/MPBLOCK.js | |
parent | 0047c3bea1d86b12a08544f6f0833c63e77f6eac (diff) | |
download | sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.gz sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.bz2 sci2js-44a3807a94783e831070f0e003340af58dc64d16.zip |
change graphics to object
Diffstat (limited to 'js/Misc/MPBLOCK.js')
-rw-r--r-- | js/Misc/MPBLOCK.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/js/Misc/MPBLOCK.js b/js/Misc/MPBLOCK.js index 01cecbc4..a783ecfb 100644 --- a/js/Misc/MPBLOCK.js +++ b/js/Misc/MPBLOCK.js @@ -43,8 +43,8 @@ function MPBLOCK() { MPBLOCK.prototype.set = function MPBLOCK() { this.x = arg1; this.model = arg1.model; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; if (this.type[exprs-1]==15) { var paramv = list(); var pprop = []; @@ -57,15 +57,15 @@ function MPBLOCK() { var lab_1 = list(exprs.in1,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] - var Tin = tmpvar0[1] - var Tintype = tmpvar0[2] - var Tout = tmpvar0[3] - var Touttype = tmpvar0[4] - var Tparam = tmpvar0[5] - var pprop = tmpvar0[6] - var Tfunam = tmpvar0[7] + 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]; + var Tin = tmpvar0[1]; + var Tintype = tmpvar0[2]; + var Tout = tmpvar0[3]; + var Touttype = tmpvar0[4]; + var Tparam = tmpvar0[5]; + var pprop = tmpvar0[6]; + var Tfunam = tmpvar0[7]; var lab_1 = tmpvar0[8]; if (!ok) { break; @@ -165,9 +165,9 @@ function MPBLOCK() { } } if (ok) { - var tmpvar1 = fileparts(this.funam) - var dirF = tmpvar1[0] - var nameF = tmpvar1[1] + var tmpvar1 = fileparts(this.funam); + var dirF = tmpvar1[0]; + var nameF = tmpvar1[1]; var extF = tmpvar1[2]; if ((extF!="")||(dirF!="")) { x_message("Invalid model name!"); @@ -177,9 +177,9 @@ function MPBLOCK() { if (ok) { var intypex = find(this.intype=="I"); var outtypex = find(this.outtype=="I"); - var tmpvar2 = set_io(this.model,graphics,list([ones(this.in1),ones(this.in1)],ones(this.in1)),list([ones(this.out),ones(this.out)],ones(this.out)),[],[],intypex,outtypex) - this.model = tmpvar2[0] - var graphics = tmpvar2[1] + 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); + this.model = tmpvar2[0]; + this.graphics = tmpvar2[1]; var ok = tmpvar2[2]; } if (ok) { @@ -251,7 +251,7 @@ function MPBLOCK() { for (i=1;i<=lstsize(paramv);i+=1) { this.model.rpar = new ScilabDouble([this.model.rpar],[double(paramv[i-1].slice())]); } - this.model.sim[1] = new ScilabDouble([this.funam]); + this.model.sim[1-1] = new ScilabDouble([this.funam]); exprs.in1 = lab_1[1-1]; exprs.intype = lab_1[2-1]; exprs.out = lab_1[3-1]; @@ -273,11 +273,11 @@ function MPBLOCK() { exprs.nameF = lab_1[7-1]; exprs.funtxt = ""; this.x.model = this.model; - graphics.gr_i[1-1][1-1] = "txt=[\' "+nameF+" \'];"; - graphics.in_implicit = this.intype; - graphics.out_implicit = this.outtype; - graphics.exprs = exprs; - this.x.graphics = graphics; + this.graphics.gr_i[1-1][1-1] = new ScilabString(["txt=[\' "+nameF+" \'];"]); + this.graphics.in_implicit = new ScilabDouble(this.intype); + this.graphics.out_implicit = new ScilabDouble(this.outtype); + this.graphics.exprs = exprs; + this.x.graphics = this.graphics; break; } } |