diff options
Diffstat (limited to 'js/Linear/TIME_DELAY.js')
-rw-r--r-- | js/Linear/TIME_DELAY.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/Linear/TIME_DELAY.js b/js/Linear/TIME_DELAY.js index d90a39e1..47984ef6 100644 --- a/js/Linear/TIME_DELAY.js +++ b/js/Linear/TIME_DELAY.js @@ -2,18 +2,18 @@ function TIME_DELAY() { TIME_DELAY.prototype.define = function TIME_DELAY() { nin = 1; - T = 1; - init = 0; - N = 1024; + 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 = [T,init]; - model.ipar = N; + model.rpar = [this.T,this.init]; + model.ipar = this.N; model.blocktype = "x"; model.dep_ut = [false,true]; - exprs = [[string(T)],[string(init)],[string(N)]]; + exprs = [[string(this.T)],[string(this.init)],[string(this.N)]]; gr_i = []; this.x = standard_define([3.5,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -30,15 +30,15 @@ function TIME_DELAY() { model = arg1.model; nin = model.in1[1-1]; while (true) { - [ok,T,init,N,exprs] = scicos_getvalue("Set delay parameters",[["Delay"],["initial input"],["Buffer size"]],list("vec",1,"vec",1,"vec",1),exprs); + [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) { break; } - if (N<2) { + if (this.N<2) { message("Buffer must be larger than 2"); ok = false; } - if (T<=0) { + if (this.T<=0) { message("Delay must be positive"); ok = false; } @@ -47,8 +47,8 @@ function TIME_DELAY() { } if (ok) { graphics.exprs = exprs; - model.rpar = [[T],[init]]; - model.ipar = N; + model.rpar = [[this.T],[this.init]]; + model.ipar = this.N; model.dep_ut = [false,true]; this.x.graphics = graphics; this.x.model = model; |