diff options
Diffstat (limited to 'js/Threshold/GENERAL_f.js')
-rw-r--r-- | js/Threshold/GENERAL_f.js | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js index 6ad0a076..7a98c8ef 100644 --- a/js/Threshold/GENERAL_f.js +++ b/js/Threshold/GENERAL_f.js @@ -15,14 +15,15 @@ function GENERAL_f() { model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; gr_i = []; - x = standard_define([3,2],model,exprs,gr_i); + this.x = standard_define([3,2],model,exprs,gr_i); } GENERAL_f.prototype.details = function GENERAL_f() { + return this.x; } GENERAL_f.prototype.get = function GENERAL_f() { } GENERAL_f.prototype.set = function GENERAL_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; @@ -33,27 +34,27 @@ function GENERAL_f() { nout = sum(out); [ok,in1,out,exprs] = scicos_getvalue("Set General Zero-Crossing parameters",[["Input size"],["Number of event output"]],list("vec",1,"vec",1),exprs); if (ok) { - [model,graphics,ok] = check_io(model,graphics,in1,[],[],ones(out,1)); - if (ok) { - nout1 = out; - nin1 = in1; - if (nout==nout1&&nin==nin1) { - rp = matrix(rpar,nout,2^(2*nin)); - } else { - rp = -1*ones(nout1,2^(2*nin1)); -} - n = size(rp,2)/2; - result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice())); - if (result!=[]) { - rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result); - model.nzcross = in1; - model.rpar = rp.slice(); - model.firing = -ones(out,1); - graphics.exprs = exprs; - x.graphics = graphics; - x.model = model; -} -} -} + [model,graphics,ok] = check_io(model,graphics,in1,[],[],ones(out,1)); + if (ok) { + nout1 = out; + nin1 = in1; + if (nout==nout1&&nin==nin1) { + rp = matrix(rpar,nout,2^(2*nin)); + } else { + rp = -1*ones(nout1,2^(2*nin1)); + } + n = size(rp,2)/2; + result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice())); + if (result!=[]) { + rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result); + model.nzcross = in1; + model.rpar = rp.slice(); + model.firing = -ones(out,1); + graphics.exprs = exprs; + this.x.graphics = graphics; + this.x.model = model; + } + } + } } } |