summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--combined.js61
-rw-r--r--js/Threshold/GENERAL_f.js60
-rwxr-xr-xsci2jsyacc.py6
3 files changed, 124 insertions, 3 deletions
diff --git a/combined.js b/combined.js
index 319dca8f..2c1ef7ed 100644
--- a/combined.js
+++ b/combined.js
@@ -10595,6 +10595,65 @@ x=arg1;
x.model.firing=[-1];
}
}
+/* 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);
+}
+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));
+}
+n=size(rp,2)/2;
+result=x_mdialog("routing matrix",string.slice(1-1,nout1),string.slice(1-1,2^(2*nin1)),string[rp.slice().slice()-1]);
+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;
+}
+}
+}
+}
+}
/* autogenerated from "macros/Electrical/PotentialSensor.sci" */
function PotentialSensor() {
PotentialSensor.prototype.define = function PotentialSensor() {
@@ -17147,4 +17206,4 @@ x=arg1;
}
}
-/* made from 260/274 files */
+/* made from 261/274 files */
diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js
index 1161a6ce..9cb344fd 100644
--- a/js/Threshold/GENERAL_f.js
+++ b/js/Threshold/GENERAL_f.js
@@ -1,3 +1,59 @@
-Syntax error in input LexToken(COMMA,',',1,1919)
/* autogenerated from "macros/Threshold/GENERAL_f.sci" */
-None
+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);
+}
+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));
+}
+n=size(rp,2)/2;
+result=x_mdialog("routing matrix",string.slice(1-1,nout1),string.slice(1-1,2^(2*nin1)),string[rp.slice().slice()-1]);
+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/sci2jsyacc.py b/sci2jsyacc.py
index 754451c8..a1b59c66 100755
--- a/sci2jsyacc.py
+++ b/sci2jsyacc.py
@@ -450,6 +450,12 @@ def p_lterm_ltermfunc_index(p):
addtoarray(p[1])
p[0] = '%s[%s-1]' % (p[1], p[3])
+# B(2:$-1,1:n)
+def p_lterm_ltermfunc_slice_slice(p):
+ 'lterm : ltermvar OPENBRACKET expression COLON expression COMMA expression COLON expression CLOSEBRACKET'
+ addtoarray(p[1])
+ p[0] = '%s.slice(%s-1,%s).slice(%s-1,%s)' % (p[1], p[3], p[5], p[7], p[9])
+
# B($-2)(3)
def p_lterm_ltermfunc_index_index(p):
'lterm : ltermvar OPENBRACKET expression CLOSEOPENBRACKET expression CLOSEBRACKET'