summaryrefslogtreecommitdiff
path: root/js/Threshold
diff options
context:
space:
mode:
Diffstat (limited to 'js/Threshold')
-rw-r--r--js/Threshold/GENERAL_f.js88
-rw-r--r--js/Threshold/NEGTOPOS_f.js26
-rw-r--r--js/Threshold/POSTONEG_f.js28
-rw-r--r--js/Threshold/ZCROSS_f.js66
4 files changed, 104 insertions, 104 deletions
diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js
index 3e451bd1..6ad0a076 100644
--- a/js/Threshold/GENERAL_f.js
+++ b/js/Threshold/GENERAL_f.js
@@ -1,57 +1,57 @@
/* autogenerated from "macros/Threshold/GENERAL_f.sci" */
function GENERAL_f() {
GENERAL_f.prototype.define = function GENERAL_f() {
-rpar=[[0],[0],[0],[0]];
-in1=1;
-out=1;
-model=scicos_model();
-model.sim=list("zcross",1);
-model.nzcross=in1;
-model.in1=in1;
-model.evtout=ones(out,1);
-model.rpar=[[0],[0],[0],[0]];
-model.blocktype="z";
-model.firing=-ones(out,1);
-model.dep_ut=[true,false];
-exprs=[[strcat(sci2exp(in1))],[strcat(sci2exp(out))]];
-gr_i=[];
-x=standard_define([3,2],model,exprs,gr_i);
+ rpar = [[0],[0],[0],[0]];
+ in1 = 1;
+ out = 1;
+ model = scicos_model();
+ model.sim = list("zcross",1);
+ model.nzcross = in1;
+ model.in1 = in1;
+ model.evtout = ones(out,1);
+ model.rpar = [[0],[0],[0],[0]];
+ model.blocktype = "z";
+ model.firing = -ones(out,1);
+ model.dep_ut = [true,false];
+ exprs = [[strcat(sci2exp(in1))],[strcat(sci2exp(out))]];
+ gr_i = [];
+ x = standard_define([3,2],model,exprs,gr_i);
}
GENERAL_f.prototype.details = function GENERAL_f() {
}
GENERAL_f.prototype.get = function GENERAL_f() {
}
GENERAL_f.prototype.set = function GENERAL_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-rpar=model.rpar;
-in1=model.in1;
-out=model.evtout;
-nin=sum(in1);
-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));
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ rpar = model.rpar;
+ in1 = model.in1;
+ out = model.evtout;
+ nin = sum(in1);
+ 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;
+ 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;
}
}
}
diff --git a/js/Threshold/NEGTOPOS_f.js b/js/Threshold/NEGTOPOS_f.js
index ae16877b..82fe5548 100644
--- a/js/Threshold/NEGTOPOS_f.js
+++ b/js/Threshold/NEGTOPOS_f.js
@@ -1,24 +1,24 @@
/* autogenerated from "macros/Threshold/NEGTOPOS_f.sci" */
function NEGTOPOS_f() {
NEGTOPOS_f.prototype.define = function NEGTOPOS_f() {
-model=scicos_model();
-model.sim=list("zcross",1);
-model.nzcross=1;
-model.in1=1;
-model.evtout=1;
-model.rpar=[[-1],[-1],[0],[-1]];
-model.blocktype="z";
-model.firing=-1;
-model.dep_ut=[true,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ model = scicos_model();
+ model.sim = list("zcross",1);
+ model.nzcross = 1;
+ model.in1 = 1;
+ model.evtout = 1;
+ model.rpar = [[-1],[-1],[0],[-1]];
+ model.blocktype = "z";
+ model.firing = -1;
+ model.dep_ut = [true,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
NEGTOPOS_f.prototype.details = function NEGTOPOS_f() {
}
NEGTOPOS_f.prototype.get = function NEGTOPOS_f() {
}
NEGTOPOS_f.prototype.set = function NEGTOPOS_f() {
-x=arg1;
-x.model.firing=-1;
+ x = arg1;
+ x.model.firing = -1;
}
}
diff --git a/js/Threshold/POSTONEG_f.js b/js/Threshold/POSTONEG_f.js
index 18649a50..5a59bb94 100644
--- a/js/Threshold/POSTONEG_f.js
+++ b/js/Threshold/POSTONEG_f.js
@@ -1,25 +1,25 @@
/* autogenerated from "macros/Threshold/POSTONEG_f.sci" */
function POSTONEG_f() {
POSTONEG_f.prototype.define = function POSTONEG_f() {
-rpar=[[-1],[-1],[-1],[0]];
-model=scicos_model();
-model.sim=list("zcross",1);
-model.nzcross=1;
-model.in1=1;
-model.evtout=1;
-model.rpar=[[-1],[-1],[-1],[0]];
-model.blocktype="z";
-model.dep_ut=[true,false];
-model.firing=[-1];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ rpar = [[-1],[-1],[-1],[0]];
+ model = scicos_model();
+ model.sim = list("zcross",1);
+ model.nzcross = 1;
+ model.in1 = 1;
+ model.evtout = 1;
+ model.rpar = [[-1],[-1],[-1],[0]];
+ model.blocktype = "z";
+ model.dep_ut = [true,false];
+ model.firing = [-1];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
POSTONEG_f.prototype.details = function POSTONEG_f() {
}
POSTONEG_f.prototype.get = function POSTONEG_f() {
}
POSTONEG_f.prototype.set = function POSTONEG_f() {
-x=arg1;
-x.model.firing=[-1];
+ x = arg1;
+ x.model.firing = [-1];
}
}
diff --git a/js/Threshold/ZCROSS_f.js b/js/Threshold/ZCROSS_f.js
index 3d77edcc..cd20e7a7 100644
--- a/js/Threshold/ZCROSS_f.js
+++ b/js/Threshold/ZCROSS_f.js
@@ -1,50 +1,50 @@
/* autogenerated from "macros/Threshold/ZCROSS_f.sci" */
function ZCROSS_f() {
ZCROSS_f.prototype.define = function ZCROSS_f() {
-rpar=[[-1],[-1],[0],[0]];
-in1=1;
-model=scicos_model();
-model.sim=list("zcross",1);
-model.in1=in1;
-model.nzcross=in1;
-model.evtout=1;
-model.rpar=[[-1],[-1],[0],[0]];
-model.blocktype="z";
-model.firing=-1;
-model.dep_ut=[true,false];
-exprs=strcat(sci2exp(in1));
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ rpar = [[-1],[-1],[0],[0]];
+ in1 = 1;
+ model = scicos_model();
+ model.sim = list("zcross",1);
+ model.in1 = in1;
+ model.nzcross = in1;
+ model.evtout = 1;
+ model.rpar = [[-1],[-1],[0],[0]];
+ model.blocktype = "z";
+ model.firing = -1;
+ model.dep_ut = [true,false];
+ exprs = strcat(sci2exp(in1));
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
ZCROSS_f.prototype.details = function ZCROSS_f() {
}
ZCROSS_f.prototype.get = function ZCROSS_f() {
}
ZCROSS_f.prototype.set = function ZCROSS_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-while (true) {
-[ok,in1,exprs]=scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),exprs);
-if (!ok) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ while (true) {
+ [ok,in1,exprs] = scicos_getvalue([["Set Zero-Crossing parameters"],["All surfaces must cross together"]],"Input size",list("vec",1),exprs);
+ if (!ok) {
break;
}
-in1=int(in1);
-if (in1<=0) {
+ in1 = int(in1);
+ if (in1<=0) {
message("Block must have at least one input");
-} else {
-kk=0;
+ } else {
+ kk = 0;
for (jj=1;jj<=in1;jj+=1) {
-kk=kk+2^(in1+jj-1);
+ kk = kk+2^(in1+jj-1);
}
-model.rpar=[[-ones(kk,1)],[zeros(2^(2*in1)-kk,1)]];
-graphics.exprs=exprs;
-model.in1=in1;
-model.nzcross=in1;
-model.firing=-1;
-x.graphics=graphics;
-x.model=model;
+ model.rpar = [[-ones(kk,1)],[zeros(2^(2*in1)-kk,1)]];
+ graphics.exprs = exprs;
+ model.in1 = in1;
+ model.nzcross = in1;
+ model.firing = -1;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}