diff options
Diffstat (limited to 'js/Misc/scifunc_block_m.js')
-rw-r--r-- | js/Misc/scifunc_block_m.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/js/Misc/scifunc_block_m.js b/js/Misc/scifunc_block_m.js index f53b1d5d..869b6256 100644 --- a/js/Misc/scifunc_block_m.js +++ b/js/Misc/scifunc_block_m.js @@ -11,27 +11,27 @@ function scifunc_block_m() { auto = []; this.rpar = []; it = 1; - model = scicos_model(); - model.sim = list("scifunc",3); - model.in1 = in1; - model.in2 = in1; - model.intyp = it; - model.out = out; - model.out2 = out; - model.outtyp = it; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.opar = list(); - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list("scifunc",3); + this.model.in1 = new ScilabDouble(in1); + this.model.in2 = new ScilabDouble(in1); + this.model.intyp = new ScilabDouble(it); + this.model.out = new ScilabDouble(out); + this.model.out2 = new ScilabDouble(out); + this.model.outtyp = new ScilabDouble(it); + this.model.evtin = clkin; + this.model.evtout = clkout; + this.model.state = x0; + this.model.dstate = z0; + this.model.rpar = this.rpar; + this.model.ipar = new ScilabDouble(0); + this.model.opar = list(); + this.model.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; exprs = list([[sci2exp([in1,in1])],[sci2exp([out,out])],[sci2exp(clkin)],[sci2exp(clkout)],[strcat(sci2exp(x0))],[strcat(sci2exp(z0))],[strcat(sci2exp(this.rpar))],[sci2exp(auto)],[sci2exp(0)]],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," ")); gr_i = []; - this.x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } scifunc_block_m.prototype.details = function scifunc_block_m() { @@ -64,7 +64,7 @@ function scifunc_block_m() { this.lab = arguments[0]["lab"] needcompile = 0; this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; exprs = graphics.exprs; while (true) { @@ -90,23 +90,23 @@ function scifunc_block_m() { if (!ok) { break; } - [model,graphics,ok] = set_io(model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); + [model,graphics,ok] = set_io(this.model,graphics,list(this.i,it),list(this.o,ot),this.ci,this.co); if (ok) { auto = this.auto0; - model.state = this.xx; - model.dstate = this.z; - model.rpar = this.rpar; - if (model.ipar!=0) { - model.opar = model.ipar; - model.ipar = 0; + this.model.state = this.xx; + this.model.dstate = this.z; + this.model.rpar = this.rpar; + if (this.model.ipar!=0) { + this.model.opar = new ScilabDouble(this.model.ipar); + this.model.ipar = new ScilabDouble(0); } - if (or(model.opar!=tt)) { + if (or(this.model.opar!=tt)) { needcompile = 4; } - model.opar = tt; - model.firing = auto; - model.dep_ut = dep_ut; - this.x.model = model; + this.model.opar = new ScilabDouble(tt); + this.model.firing = new ScilabDouble(auto); + this.model.dep_ut = new ScilabDouble(dep_ut); + this.x.model = this.model; exprs[2-1] = tt; graphics.exprs = exprs; this.x.graphics = graphics; |