summaryrefslogtreecommitdiff
path: root/js/Misc/generic_block3.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Misc/generic_block3.js')
-rw-r--r--js/Misc/generic_block3.js27
1 files changed, 15 insertions, 12 deletions
diff --git a/js/Misc/generic_block3.js b/js/Misc/generic_block3.js
index a185a2a2..e5bb8697 100644
--- a/js/Misc/generic_block3.js
+++ b/js/Misc/generic_block3.js
@@ -12,8 +12,8 @@ function generic_block3() {
this.model.out2 = new ScilabDouble([1]);
this.model.outtyp = new ScilabDouble([1]);
this.model.dep_ut = [true,false];
- label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]];
- gr_i = [];
+ var label = [[this.function_name],[sci2exp(this.funtyp)],[sci2exp([this.model.in1,this.model.in2])],[sci2exp(this.model.intyp)],[sci2exp([this.model.out,this.model.out2]),sci2exp(this.model.outtyp)],[sci2exp(this.model.evtin)],[sci2exp(this.model.evtout)],[sci2exp(this.model.state)],[sci2exp(this.model.dstate)],[sci2exp(this.model.odstate)],[sci2exp(this.model.rpar)],[sci2exp(this.model.ipar)],[sci2exp(this.model.opar)],[sci2exp(this.model.nmode)],[sci2exp(this.model.nzcross)],[sci2exp(this.model.firing)],["y"],["n"]];
+ var gr_i = [];
this.x = standard_define([4,2],this.model,label,gr_i);
return new BasicBlock(this.x);
}
@@ -67,8 +67,8 @@ function generic_block3() {
this.lab = arguments[0]["lab"]
this.x = arg1;
this.model = arg1.model;
- graphics = arg1.graphics;
- label = graphics.exprs;
+ var graphics = arg1.graphics;
+ var label = graphics.exprs;
if (size(label,"*")==14) {
label[9-1] = [];
}
@@ -77,7 +77,7 @@ function generic_block3() {
if (!ok) {
break;
}
- label = this.lab;
+ var label = this.lab;
this.function_name = stripblanks(this.function_name);
this.xx = this.xx.slice();
this.z = this.z.slice();
@@ -88,21 +88,21 @@ function generic_block3() {
this.funtyp = this.funtyp;
if (this.funtyp<0) {
message("function type cannot be negative");
- ok = false;
+ var ok = false;
}
if ([[this.ci],[this.co]]!=[]) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
- ok = false;
+ var ok = false;
}
}
if (this.type[this.opar-1]!=15) {
message("object parameter must be a list");
- ok = false;
+ var ok = false;
}
if (this.type[this.oz-1]!=15) {
message("discrete object state must be a list");
- ok = false;
+ var ok = false;
}
this.depu = stripblanks(this.depu);
if (part(this.depu,1)=="y") {
@@ -116,13 +116,16 @@ function generic_block3() {
} else {
this.dept = false;
}
- dep_ut = [this.depu,this.dept];
+ var dep_ut = [this.depu,this.dept];
if (ok) {
- [this.model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co);
+ var tmpvar0 = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co)
+ this.model = tmpvar0[0]
+ var graphics = tmpvar0[1]
+ var ok = tmpvar0[2];
}
if (ok) {
if (this.funtyp==3) {
- needcompile = 4;
+ var needcompile = 4;
}
this.model.sim = list(new ScilabDouble([this.function_name]), new ScilabDouble([this.funtyp]));
this.model.state = this.xx;