summaryrefslogtreecommitdiff
path: root/js/Misc/CBLOCK4.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/Misc/CBLOCK4.js')
-rw-r--r--js/Misc/CBLOCK4.js42
1 files changed, 24 insertions, 18 deletions
diff --git a/js/Misc/CBLOCK4.js b/js/Misc/CBLOCK4.js
index c99b5d9d..15889859 100644
--- a/js/Misc/CBLOCK4.js
+++ b/js/Misc/CBLOCK4.js
@@ -1,7 +1,7 @@
/* autogenerated from "macros/Misc/CBLOCK4.sci" */
function CBLOCK4() {
CBLOCK4.prototype.define = function CBLOCK4() {
- funam = "toto";
+ var funam = "toto";
this.model = scicos_model();
this.model.sim = list(new ScilabString([" "]), new ScilabDouble([2004]));
this.model.in1 = new ScilabDouble([1]);
@@ -11,8 +11,8 @@ function CBLOCK4() {
this.model.out2 = new ScilabDouble([1]);
this.model.outtyp = new ScilabDouble([1]);
this.model.dep_ut = [true,false];
- label = list([[funam],["n"],[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 = list([[funam],["n"],[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);
}
@@ -66,34 +66,34 @@ function CBLOCK4() {
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;
while (true) {
[ok,this.function_name,this.impli,this.in1,this.it,this.out,this.ot,this.ci,this.co,this.xx,this.z,this.oz,this.rpar,this.ipar,this.opar,this.nmode,this.nzcr,this.auto0,this.depu,this.dept,this.lab] = scicos_getvalue("Set C-Block4 block parameters",["Simulation function","Is block implicit? (y,n)","Input ports sizes","Input ports type","Output port sizes","Output ports type","Input event ports sizes","Output events ports sizes","Initial continuous state","Initial discrete state","Initial object state","Real parameters vector","Integer parameters vector","Object parameters list","Number of modes","Number of zero crossings","Initial firing vector (<0 for no firing)","Direct feedthrough (y or n)","Time dependence (y or n)"],list("str",1,"str",1,"mat",[-1,2],"vec",-1,"mat",[-1,2],"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"lis",-1,"vec",-1,"vec",-1,"lis",-1,"vec",1,"vec",1,"vec","sum(%8)","str",1,"str",1),label[1-1]);
if (!ok) {
break;
}
label[1-1] = this.lab;
- funam = stripblanks(this.function_name);
+ var funam = stripblanks(this.function_name);
this.xx = this.xx.slice();
this.z = this.z.slice();
this.rpar = this.rpar.slice();
this.ipar = int(this.ipar.slice());
- nx = size(this.xx,1);
- nz = size(this.z,1);
+ var nx = size(this.xx,1);
+ var nz = size(this.z,1);
this.ci = int(this.ci.slice());
- nevin = size(this.ci,1);
+ var nevin = size(this.ci,1);
this.co = int(this.co.slice());
- nevout = size(this.co,1);
+ var nevout = size(this.co,1);
if (part(this.impli,1)=="y") {
- funtyp = 12004;
+ var funtyp = 12004;
} else {
- funtyp = 2004;
+ var funtyp = 2004;
}
if ([[this.ci],[this.co]]!=[]) {
if (max([[this.ci],[this.co]])>1) {
message("vector event links not supported");
- ok = false;
+ var ok = false;
}
}
if (ok) {
@@ -109,19 +109,25 @@ function CBLOCK4() {
} else {
this.dept = false;
}
- dep_ut = [this.depu,this.dept];
+ var dep_ut = [this.depu,this.dept];
if (funam==" ") {
break;
}
if (this.model.sim[1-1]!=funam||sign(size(this.model.state,"*"))!=sign(nx)||sign(size(this.model.dstate,"*"))!=sign(nz)||this.model.nzcross!=this.nzcr||sign(size(this.model.evtout,"*"))!=sign(nevout)) {
- tt = [];
+ var tt = [];
}
- tt = label[2-1];
- [this.model,graphics,ok] = set_io(this.model,graphics,list(this.in1,this.it),list(this.out,this.ot),this.ci,this.co);
+ var tt = label[2-1];
+ 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) {
while (true) {
- [ok,tt,cancel] = this.CC4[funam-1][tt-1];
+ var tmpvar1 = CC4(funam,tt)
+ var ok = tmpvar1[0]
+ var tt = tmpvar1[1]
+ var cancel = tmpvar1[2];
if (!ok) {
if (cancel) {
break;