diff options
author | Sunil Shetye | 2018-07-09 11:43:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-09 12:16:25 +0530 |
commit | 62b1d7dd9183ed75733b44104890586b03818214 (patch) | |
tree | 9859e9ca295df98df945bd5fcccc3a264e8bede1 /js/Misc/c_block.js | |
parent | 5c011853630a1b466ef4789d5b600dd530d0a3ec (diff) | |
download | sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2 sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip |
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Misc/c_block.js')
-rw-r--r-- | js/Misc/c_block.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/js/Misc/c_block.js b/js/Misc/c_block.js index 51dc7208..3c1e294c 100644 --- a/js/Misc/c_block.js +++ b/js/Misc/c_block.js @@ -11,22 +11,22 @@ function c_block() { auto = []; this.rpar = []; this.funam = "toto"; - model = scicos_model(); - model.sim = list(" ",2001); - model.in1 = in1; - model.out = out; - model.evtin = clkin; - model.evtout = clkout; - model.state = x0; - model.dstate = z0; - model.rpar = this.rpar; - model.ipar = 0; - model.blocktype = typ; - model.firing = auto; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = list(" ",2001); + this.model.in1 = new ScilabDouble(in1); + this.model.out = new ScilabDouble(out); + 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.blocktype = new ScilabString(typ); + this.model.firing = auto; + this.model.dep_ut = [true,false]; label = list([[sci2exp(in1)],[sci2exp(out)],[strcat(sci2exp(this.rpar))],[this.funam]],list([])); gr_i = []; - this.x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } c_block.prototype.details = function c_block() { @@ -48,7 +48,7 @@ function c_block() { this.funam = arguments[0]["funam"] this.lab = arguments[0]["lab"] this.x = arg1; - model = arg1.model; + this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; while (true) { @@ -66,19 +66,19 @@ function c_block() { this.o = int(this.o.slice()); no = size(this.o,1); tt = label[2-1]; - if (model.sim[1-1]!=this.funam||size(model.in1,"*")!=size(this.i,"*")||size(model.out,"*")!=size(this.o,"*")) { + if (this.model.sim[1-1]!=this.funam||size(this.model.in1,"*")!=size(this.i,"*")||size(this.model.out,"*")!=size(this.o,"*")) { tt = []; } [ok,tt] = CFORTR(this.funam,tt,this.i,this.o); if (!ok) { break; } - [model,graphics,ok] = check_io(model,graphics,this.i,this.o,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,this.i,this.o,[],[]); if (ok) { - model.sim[1-1] = this.funam; - model.rpar = this.rpar; + this.model.sim[('1', 'double')] = new ScilabString(this.funam); + this.model.rpar = this.rpar; label[2-1] = tt; - this.x.model = model; + this.x.model = this.model; graphics.exprs = label; this.x.graphics = graphics; break; |