summaryrefslogtreecommitdiff
path: root/js/Misc/MBLOCK.js
diff options
context:
space:
mode:
authorSunil Shetye2018-08-29 10:48:12 +0530
committerSunil Shetye2018-08-29 18:03:04 +0530
commit352623792d2b9400510599c487540b1e763a7d3c (patch)
tree7711522f3fcd42a9d5f22b9fa3328763452a6918 /js/Misc/MBLOCK.js
parent17a1beeeae647a6fbd0904a5d794ce7754df7eb2 (diff)
downloadsci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.gz
sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.bz2
sci2js-352623792d2b9400510599c487540b1e763a7d3c.zip
add the common code to get method also
type is a function get the popup title from the value set in the get method
Diffstat (limited to 'js/Misc/MBLOCK.js')
-rw-r--r--js/Misc/MBLOCK.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/js/Misc/MBLOCK.js b/js/Misc/MBLOCK.js
index 590d570e..8794da27 100644
--- a/js/Misc/MBLOCK.js
+++ b/js/Misc/MBLOCK.js
@@ -36,6 +36,19 @@ function MBLOCK() {
return this.x;
}
MBLOCK.prototype.get = function MBLOCK() {
+ var exprs = this.graphics.exprs;
+ if (type(exprs)==15) {
+ var paramv = list();
+ this.pprop = [];
+ for (i=1;i<=size(this.model.rpar,"*");i+=1) {
+ paramv[$+1-1] = string(this.model.rpar[i-1]);
+ this.pprop[$+1-1] = 0;
+ }
+ var exprs = tlist(["MBLOCK","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(this.pprop.slice()),exprs[1-1][7-1],exprs[2-1]);
+ }
+ var lab_1 = list(exprs.in,exprs.intype,exprs.out,exprs.outtype,exprs.param,exprs.pprop,exprs.nameF);
+ var lab_2 = exprs.paramv;
+ this.set_param_popup_title = "Set Modelica generic block parameters";
var options = {
Tin:["Input variables: ",this.Tin],
Tintype:["Input variables types: ",this.Tintype],
@@ -49,7 +62,7 @@ function MBLOCK() {
}
MBLOCK.prototype.set = function MBLOCK() {
var exprs = this.graphics.exprs;
- if (this.type[exprs-1]==15) {
+ if (type(exprs)==15) {
var paramv = list();
this.pprop = [];
for (i=1;i<=size(this.model.rpar,"*");i+=1) {
@@ -272,7 +285,7 @@ function MBLOCK() {
exprs.param = lab_1[5-1];
exprs.paramv = list();
if (Tparam_sz!=0) {
- if (this.type[lab_2-1]==15) {
+ if (type(lab_2)==15) {
for (i=1;i<=lstsize(lab_2);i+=1) {
exprs.paramv[i-1] = lab_2[i-1];
}
@@ -297,7 +310,6 @@ function MBLOCK() {
return new BasicBlock(this.x);
}
MBLOCK.prototype.get_popup_title = function MBLOCK() {
- var set_param_popup_title = "Set Modelica generic block parameters";
- return set_param_popup_title;
+ return this.set_param_popup_title;
}
}