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/Linear/TIME_DELAY.js | |
parent | 5c011853630a1b466ef4789d5b600dd530d0a3ec (diff) | |
download | sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2 sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip |
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Linear/TIME_DELAY.js')
-rw-r--r-- | js/Linear/TIME_DELAY.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/js/Linear/TIME_DELAY.js b/js/Linear/TIME_DELAY.js index fc9aa70e..ce36dfc9 100644 --- a/js/Linear/TIME_DELAY.js +++ b/js/Linear/TIME_DELAY.js @@ -5,17 +5,17 @@ function TIME_DELAY() { this.T = 1; this.init = 0; this.N = 1024; - model = scicos_model(); - model.sim = list("time_delay",4); - model.in1 = [nin]; - model.out = nin; - model.rpar = [this.T,this.init]; - model.ipar = this.N; - model.blocktype = "x"; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("time_delay",4); + this.model.in1 = [nin]; + this.model.out = new ScilabDouble(nin); + this.model.rpar = [this.T,this.init]; + this.model.ipar = new ScilabDouble(this.N); + this.model.blocktype = new ScilabString("x"); + this.model.dep_ut = [false,true]; exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; - this.x = standard_define([3.5,2],model,exprs,gr_i); + this.x = standard_define([3.5,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } TIME_DELAY.prototype.details = function TIME_DELAY() { @@ -36,8 +36,8 @@ function TIME_DELAY() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - nin = model.in1[1-1]; + this.model = arg1.model; + nin = this.model.in1[1-1]; while (true) { [ok,this.T,this.init,this.N,exprs] = scicos_getvalue("Set delay parameters",["Delay","initial input","Buffer size"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -52,15 +52,15 @@ function TIME_DELAY() { ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[-1],-1,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,[-1],-1,[],[]); } if (ok) { graphics.exprs = exprs; - model.rpar = [[this.T],[this.init]]; - model.ipar = this.N; - model.dep_ut = [false,true]; + this.model.rpar = [[this.T],[this.init]]; + this.model.ipar = new ScilabDouble(this.N); + this.model.dep_ut = [false,true]; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } |