diff options
author | Sunil Shetye | 2018-06-26 14:59:47 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-26 14:59:47 +0530 |
commit | eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00 (patch) | |
tree | 6378935263fe5cafd389b6893ac3b37a1dd4b1a7 /js/Linear/DELAYV_f.js | |
parent | afed64f1a0eab0b2d742088186d7bc340a2c895b (diff) | |
download | sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.gz sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.tar.bz2 sci2js-eb7c8e0cd42d4afe02be3adda2e94b6b0dfdaa00.zip |
add return value from scicos_getvalue to global vars
Diffstat (limited to 'js/Linear/DELAYV_f.js')
-rw-r--r-- | js/Linear/DELAYV_f.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/js/Linear/DELAYV_f.js b/js/Linear/DELAYV_f.js index 622d60b2..4f04acee 100644 --- a/js/Linear/DELAYV_f.js +++ b/js/Linear/DELAYV_f.js @@ -1,22 +1,22 @@ /* autogenerated from "macros/Linear/DELAYV_f.sci" */ function DELAYV_f() { DELAYV_f.prototype.define = function DELAYV_f() { - nin = 1; + this.nin = 1; z0 = zeros(11,1); - zz0 = z0.slice(1-1,$-1); - T = 1; + this.zz0 = z0.slice(1-1,$-1); + this.T = 1; model = scicos_model(); model.sim = list("delayv",1); - model.in1 = [[nin],[1]]; - model.out = nin; + model.in1 = [[this.nin],[1]]; + model.out = this.nin; model.evtin = 1; model.evtout = [[1],[1]]; model.dstate = z0; - model.rpar = T/(size(zz0,"*")); + model.rpar = this.T/(size(this.zz0,"*")); model.blocktype = "d"; model.firing = [0,-1]; model.dep_ut = [true,false]; - exprs = [[string(nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(T)]]; + exprs = [[string(this.nin)],[strcat(string(z0.slice(1-1,$-1)),";")],[string(this.T)]]; gr_i = []; this.x = standard_define([3,2],model,exprs,gr_i); return new BasicBlock(this.x); @@ -31,30 +31,30 @@ function DELAYV_f() { graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; - nin = model.in1[1-1]; + this.nin = model.in1[1-1]; z0 = model.dstate; - zz0 = z0.slice(1-1,$-1); + this.zz0 = z0.slice(1-1,$-1); told = z0[$-1]; while (true) { - [ok,nin,zz0,T,exprs] = scicos_getvalue("Set delay parameters",[["Number of inputs"],["Register initial condition"],["Max delay"]],list("vec",1,"vec",-1,"vec",1),exprs); + [ok,this.nin,this.zz0,this.T,exprs] = scicos_getvalue("Set delay parameters",[["Number of inputs"],["Register initial condition"],["Max delay"]],list("vec",1,"vec",-1,"vec",1),exprs); if (!ok) { break; } - if (size(zz0,"*")<2) { + if (size(this.zz0,"*")<2) { message("Register length must be at least 2"); ok = false; } - if (T<=0) { + if (this.T<=0) { message("Delay must be positive"); ok = false; } if (ok) { - [model,graphics,ok] = check_io(model,graphics,[[nin],[1]],nin,1,[[1],[1]]); + [model,graphics,ok] = check_io(model,graphics,[[this.nin],[1]],this.nin,1,[[1],[1]]); } if (ok) { graphics.exprs = exprs; - model.dstate = [[zz0.slice()],[told]]; - model.rpar = T/(size(zz0,"*")); + model.dstate = [[this.zz0.slice()],[told]]; + model.rpar = this.T/(size(this.zz0,"*")); this.x.graphics = graphics; this.x.model = model; break; |