diff options
author | Sunil Shetye | 2018-06-25 12:08:56 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-25 12:45:27 +0530 |
commit | 7c70459c10aed0d74ee03896abaf47fefdbf7c8f (patch) | |
tree | 6f6acc6a5087295c6e59f0f94bfda5025049d5fa /js/Linear/DOLLAR.js | |
parent | 870479a2e4b932426a904b2ebae7e4ee72037326 (diff) | |
download | sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.gz sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.tar.bz2 sci2js-7c70459c10aed0d74ee03896abaf47fefdbf7c8f.zip |
separate out code for getvalue
Diffstat (limited to 'js/Linear/DOLLAR.js')
-rw-r--r-- | js/Linear/DOLLAR.js | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/js/Linear/DOLLAR.js b/js/Linear/DOLLAR.js index e404c6cc..5b736b28 100644 --- a/js/Linear/DOLLAR.js +++ b/js/Linear/DOLLAR.js @@ -1,88 +1,88 @@ /* autogenerated from "macros/Linear/DOLLAR.sci" */ function DOLLAR() { DOLLAR.prototype.define = function DOLLAR() { -z=0; -inh=0; -in1=1; -exprs=string([[z],[inh]]); -model=scicos_model(); -model.sim=list("dollar4",4); -model.in1=in1; -model.out=in1; -model.evtin=1-inh; -model.dstate=z; -model.blocktype="d"; -model.dep_ut=[false,false]; -gr_i=[]; -x=standard_define([2,2],model,exprs,gr_i); + z = 0; + inh = 0; + in1 = 1; + exprs = string([[z],[inh]]); + model = scicos_model(); + model.sim = list("dollar4",4); + model.in1 = in1; + model.out = in1; + model.evtin = 1-inh; + model.dstate = z; + model.blocktype = "d"; + model.dep_ut = [false,false]; + gr_i = []; + x = standard_define([2,2],model,exprs,gr_i); } DOLLAR.prototype.details = function DOLLAR() { } DOLLAR.prototype.get = function DOLLAR() { } DOLLAR.prototype.set = function DOLLAR() { -x=arg1; -graphics=arg1.graphics; -exprs=graphics.exprs; -model=arg1.model; -if (size(exprs,"*")<2) { -exprs[2-1]="0"; + x = arg1; + graphics = arg1.graphics; + exprs = graphics.exprs; + model = arg1.model; + if (size(exprs,"*")<2) { + 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); -if (!ok) { + 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); + if (!ok) { break; } -out=[size(a,1),size(a,2)]; -if (out==0) { -out=[]; + out = [size(a,1),size(a,2)]; + if (out==0) { + out = []; } -in1=out; -model.sim=list("dollar4_m",4); -model.odstate=list(a); -model.dstate=[]; -if (this.type[(a)==1-1]) { -if (isreal(a)) { -it=1; -ot=1; -if ((size(a,1)==1||size(a,2)==1)) { -model.sim=list("dollar4",4); -model.dstate=a.slice(); -model.odstate=list(); + in1 = out; + model.sim = list("dollar4_m",4); + model.odstate = list(a); + model.dstate = []; + if (this.type[(a)==1-1]) { + if (isreal(a)) { + it = 1; + ot = 1; + if ((size(a,1)==1||size(a,2)==1)) { + model.sim = list("dollar4",4); + model.dstate = a.slice(); + model.odstate = list(); } -} else { -it=2; -ot=2; + } else { + it = 2; + ot = 2; } -} else if ((typeof(a)=="int32")) { -it=3; -ot=3; -} else if ((typeof(a)=="int16")) { -it=4; -ot=4; -} else if ((typeof(a)=="int8")) { -it=5; -ot=5; -} else if ((typeof(a)=="uint32")) { -it=6; -ot=6; -} else if ((typeof(a)=="uint16")) { -it=7; -ot=7; -} else if ((typeof(a)=="uint8")) { -it=8; -ot=8; -} else { + } else if ((typeof(a)=="int32")) { + it = 3; + ot = 3; + } else if ((typeof(a)=="int16")) { + it = 4; + ot = 4; + } else if ((typeof(a)=="int8")) { + it = 5; + ot = 5; + } else if ((typeof(a)=="uint32")) { + it = 6; + ot = 6; + } else if ((typeof(a)=="uint16")) { + it = 7; + ot = 7; + } else if ((typeof(a)=="uint8")) { + it = 8; + ot = 8; + } else { message("type is not recognized"); -ok=false; + ok = false; } -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]); + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-inh,1),[]); } -if (ok) { -graphics.exprs=exprs; -x.graphics=graphics; -x.model=model; + if (ok) { + graphics.exprs = exprs; + x.graphics = graphics; + x.model = model; break; } } |