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/DOLLAR.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/DOLLAR.js')
-rw-r--r-- | js/Linear/DOLLAR.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/js/Linear/DOLLAR.js b/js/Linear/DOLLAR.js index f5b2186c..950b9b02 100644 --- a/js/Linear/DOLLAR.js +++ b/js/Linear/DOLLAR.js @@ -2,14 +2,14 @@ function DOLLAR() { DOLLAR.prototype.define = function DOLLAR() { z = 0; - inh = 0; + this.inh = 0; in1 = 1; - exprs = string([[z],[inh]]); + exprs = string([[z],[this.inh]]); model = scicos_model(); model.sim = list("dollar4",4); model.in1 = in1; model.out = in1; - model.evtin = 1-inh; + model.evtin = 1-this.inh; model.dstate = z; model.blocktype = "d"; model.dep_ut = [false,false]; @@ -31,47 +31,47 @@ function DOLLAR() { exprs[2-1] = "0"; } while (true) { - [ok,a,inh,exprs] = scicos_getvalue("Set 1/z block parameters",[["initial condition"],["Inherit (no:0, yes:1)"]],list("mat",[-1,-2],"vec",-1),exprs); + [ok,this.a,this.inh,exprs] = scicos_getvalue("Set 1/z block parameters",[["initial condition"],["Inherit (no:0, yes:1)"]],list("mat",[-1,-2],"vec",-1),exprs); if (!ok) { break; } - out = [size(a,1),size(a,2)]; + out = [size(this.a,1),size(this.a,2)]; if (out==0) { out = []; } in1 = out; model.sim = list("dollar4_m",4); - model.odstate = list(a); + model.odstate = list(this.a); model.dstate = []; - if (this.type[(a)==1-1]) { - if (isreal(a)) { + if (this.type[(this.a)==1-1]) { + if (isreal(this.a)) { it = 1; ot = 1; - if ((size(a,1)==1||size(a,2)==1)) { + if ((size(this.a,1)==1||size(this.a,2)==1)) { model.sim = list("dollar4",4); - model.dstate = a.slice(); + model.dstate = this.a.slice(); model.odstate = list(); } } else { it = 2; ot = 2; } - } else if ((typeof(a)=="int32")) { + } else if ((typeof(this.a)=="int32")) { it = 3; ot = 3; - } else if ((typeof(a)=="int16")) { + } else if ((typeof(this.a)=="int16")) { it = 4; ot = 4; - } else if ((typeof(a)=="int8")) { + } else if ((typeof(this.a)=="int8")) { it = 5; ot = 5; - } else if ((typeof(a)=="uint32")) { + } else if ((typeof(this.a)=="uint32")) { it = 6; ot = 6; - } else if ((typeof(a)=="uint16")) { + } else if ((typeof(this.a)=="uint16")) { it = 7; ot = 7; - } else if ((typeof(a)=="uint8")) { + } else if ((typeof(this.a)=="uint8")) { it = 8; ot = 8; } else { @@ -79,7 +79,7 @@ function DOLLAR() { ok = false; } if (ok) { - [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]); + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.inh,1),[]); } if (ok) { graphics.exprs = exprs; |