summaryrefslogtreecommitdiff
path: root/js/Threshold
diff options
context:
space:
mode:
Diffstat (limited to 'js/Threshold')
-rw-r--r--js/Threshold/GENERAL_f.js30
-rw-r--r--js/Threshold/GENERAL_f.pickle70
-rw-r--r--js/Threshold/ZCROSS_f.js30
-rw-r--r--js/Threshold/ZCROSS_f.pickle64
4 files changed, 96 insertions, 98 deletions
diff --git a/js/Threshold/GENERAL_f.js b/js/Threshold/GENERAL_f.js
index ef70faba..a63700e8 100644
--- a/js/Threshold/GENERAL_f.js
+++ b/js/Threshold/GENERAL_f.js
@@ -2,18 +2,18 @@
function GENERAL_f() {
GENERAL_f.prototype.define = function GENERAL_f() {
var rpar = [[0],[0],[0],[0]];
- this.in1 = 1;
+ this.in = 1;
this.out = 1;
this.model = scicos_model();
this.model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1]));
- this.model.nzcross = new ScilabDouble([this.in1]);
- this.model.in = new ScilabDouble([this.in1]);
+ this.model.nzcross = new ScilabDouble([this.in]);
+ this.model.in = new ScilabDouble([this.in]);
this.model.evtout = new ScilabDouble([ones(this.out,1)]);
this.model.rpar = new ScilabDouble([0],[0],[0],[0]);
this.model.blocktype = new ScilabString(["z"]);
this.model.firing = new ScilabDouble([-ones(this.out,1)]);
this.model.dep_ut = new ScilabBoolean([true,false]);
- var exprs = [[strcat(sci2exp(this.in1))],[strcat(sci2exp(this.out))]];
+ var exprs = [[strcat(sci2exp(this.in))],[strcat(sci2exp(this.out))]];
var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GENERAL_f\",sz(1),sz(2));"]);
this.x = new standard_define(new ScilabDouble([3,2]),this.model,new ScilabDouble(exprs),gr_i);
return new BasicBlock(this.x);
@@ -24,13 +24,13 @@ function GENERAL_f() {
GENERAL_f.prototype.get = function GENERAL_f() {
var exprs = this.graphics.exprs;
var rpar = this.model.rpar;
- this.in1 = this.model.in;
+ this.in = this.model.in;
this.out = this.model.evtout;
- var nin = sum(this.in1);
+ var nin = sum(this.in);
var nout = sum(this.out);
this.set_param_popup_title = "Set General Zero-Crossing parameters";
var options = {
- in1:["Input size",this.in1],
+ in:["Input size",this.in],
out:["Number of event output",this.out],
}
return options;
@@ -38,22 +38,22 @@ function GENERAL_f() {
GENERAL_f.prototype.set = function GENERAL_f() {
var exprs = this.graphics.exprs;
var rpar = this.model.rpar;
- this.in1 = this.model.in;
+ this.in = this.model.in;
this.out = this.model.evtout;
- var nin = sum(this.in1);
+ var nin = sum(this.in);
var nout = sum(this.out);
var ok = true;
- this.in1 = parseFloat(arguments[0]["in1"]);
+ this.in = arguments[0]["in"];
this.out = parseFloat(arguments[0]["out"]);
- var exprs = [arguments[0]["in1"], arguments[0]["out"]];
+ var exprs = [arguments[0]["in"], arguments[0]["out"]];
if (ok) {
- var tmpvar0 = check_io(this.model,this.graphics,this.in1,[],[],ones(this.out,1));
+ var tmpvar0 = check_io(this.model,this.graphics,this.in,[],[],ones(this.out,1));
this.model = tmpvar0[0];
this.graphics = tmpvar0[1];
var ok = tmpvar0[2];
if (ok) {
var nout1 = this.out;
- var nin1 = this.in1;
+ var nin1 = this.in;
if (nout==nout1&&nin==nin1) {
var rp = matrix(rpar,nout,2^(2*nin));
} else {
@@ -63,7 +63,7 @@ function GENERAL_f() {
var result = x_mdialog("routing matrix",string(1,nout1),string(1,2^(2*nin1)),string(rp.slice().slice()));
if (result.length!=0) {
rp.slice(1-1,nout1).slice(1-1,2*n) = evstr(result);
- this.model.nzcross = new ScilabDouble([this.in1]);
+ this.model.nzcross = new ScilabDouble([this.in]);
this.model.rpar = new ScilabDouble(rp.slice());
this.model.firing = new ScilabDouble([-ones(this.out,1)]);
this.graphics.exprs = new ScilabDouble([exprs]);
@@ -80,7 +80,7 @@ function GENERAL_f() {
GENERAL_f.prototype.importset = function GENERAL_f() {
var graphics = this.x.graphics;
var ary = getData(graphics.exprs);
- this.in1 = ary[0];
+ this.in = ary[0];
this.out = ary[1];
}
GENERAL_f.prototype.getContainer = function GENERAL_f() { return new BasicBlock(this.x); }
diff --git a/js/Threshold/GENERAL_f.pickle b/js/Threshold/GENERAL_f.pickle
index b652bc60..c400603c 100644
--- a/js/Threshold/GENERAL_f.pickle
+++ b/js/Threshold/GENERAL_f.pickle
@@ -30,80 +30,80 @@ sS'result'
p6
S'double'
p7
-sS'out'
+sS'in'
p8
g7
-sS'nin1'
+sS'out'
p9
-NsS'rp'
+g7
+sS'nin1'
p10
+NsS'rp'
+p11
g7
sS'x.graphics'
-p11
+p12
g2
sS'typ'
-p12
-S'vector'
p13
-sS'model.firing'
+S'vector'
p14
+sS'model.firing'
+p15
g7
sS'model.sim'
-p15
-S'list'
p16
-sS'model.evtout'
+S'list'
p17
-g7
-sS'nin'
+sS'model.evtout'
p18
g7
-sS'rp.slice(1-1,nout1).slice(1-1,2*n)'
+sS'nin'
p19
g7
-sS'in1'
+sS'rp.slice(1-1,nout1).slice(1-1,2*n)'
p20
g7
-sS'model.rpar'
+sS'in1'
p21
+NsS'model.rpar'
+p22
g4
sS'model.in'
-p22
-g7
-sS'graphics.exprs'
p23
-NsS'nout1'
+NsS'graphics.exprs'
p24
-NsS'model.nzcross'
+NsS'nout1'
p25
-g7
-sS'model.blocktype'
+NsS'model.nzcross'
p26
-S'string'
+NsS'model.blocktype'
p27
-sS'model.dep_ut'
+S'string'
p28
-S'vector_boolean'
+sS'model.dep_ut'
p29
-sS'n'
+S'vector_boolean'
p30
+sS'n'
+p31
g7
sS'exprs'
-p31
+p32
g4
sS'gr_i'
-p32
-g13
-sS'y'
p33
-g13
-sS'x'
+g14
+sS'y'
p34
-g13
-sS'model'
+g14
+sS'x'
p35
+g14
+sS'model'
+p36
g2
sS'nout'
-p36
+p37
g7
s. \ No newline at end of file
diff --git a/js/Threshold/ZCROSS_f.js b/js/Threshold/ZCROSS_f.js
index cae284ce..3a5c73bb 100644
--- a/js/Threshold/ZCROSS_f.js
+++ b/js/Threshold/ZCROSS_f.js
@@ -2,17 +2,17 @@
function ZCROSS_f() {
ZCROSS_f.prototype.define = function ZCROSS_f() {
var rpar = [[-1],[-1],[0],[0]];
- this.in1 = 1;
+ this.in = 1;
this.model = scicos_model();
this.model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1]));
- this.model.in = new ScilabDouble([this.in1]);
- this.model.nzcross = new ScilabDouble([this.in1]);
+ this.model.in = new ScilabDouble([this.in]);
+ this.model.nzcross = new ScilabDouble([this.in]);
this.model.evtout = new ScilabDouble([1]);
this.model.rpar = new ScilabDouble([-1],[-1],[0],[0]);
this.model.blocktype = new ScilabString(["z"]);
this.model.firing = new ScilabDouble([-1]);
this.model.dep_ut = new ScilabBoolean([true,false]);
- var exprs = strcat(sci2exp(this.in1));
+ var exprs = strcat(sci2exp(this.in));
var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ZCROSS_f\",sz(1),sz(2));"]);
this.x = new standard_define(new ScilabDouble([2,2]),this.model,new ScilabDouble([exprs]),gr_i);
return new BasicBlock(this.x);
@@ -24,7 +24,7 @@ function ZCROSS_f() {
var exprs = this.graphics.exprs;
this.set_param_popup_title = "Set Zero-Crossing parameters";
var options = {
- in1:["Input size",this.in1],
+ in:["Input size",this.in],
}
return options;
}
@@ -32,24 +32,24 @@ function ZCROSS_f() {
var exprs = this.graphics.exprs;
while (true) {
var ok = true;
- this.in1 = parseFloat(arguments[0]["in1"]);
- var exprs = [arguments[0]["in1"]];
+ this.in = parseFloat(arguments[0]["in"]);
+ var exprs = [arguments[0]["in"]];
if (!ok) {
break;
}
- this.in1 = int(this.in1);
- if (this.in1<=0) {
+ this.in = int(this.in);
+ if (this.in<=0) {
message("Block must have at least one input");
throw "user error";
} else {
var kk = 0;
- for (jj=1;jj<=this.in1;jj+=1) {
- var kk = kk+2^(this.in1+jj-1);
+ for (jj=1;jj<=this.in;jj+=1) {
+ var kk = kk+2^(this.in+jj-1);
}
- this.model.rpar = new ScilabDouble([-ones(kk,1)],[zeros(2^(2*this.in1)-kk,1)]);
+ this.model.rpar = new ScilabDouble([-ones(kk,1)],[zeros(2^(2*this.in)-kk,1)]);
this.graphics.exprs = new ScilabDouble([exprs]);
- this.model.in = new ScilabDouble([this.in1]);
- this.model.nzcross = new ScilabDouble([this.in1]);
+ this.model.in = new ScilabDouble([this.in]);
+ this.model.nzcross = new ScilabDouble([this.in]);
this.model.firing = new ScilabDouble([-1]);
this.x.graphics = this.graphics;
this.x.model = this.model;
@@ -64,7 +64,7 @@ function ZCROSS_f() {
ZCROSS_f.prototype.importset = function ZCROSS_f() {
var graphics = this.x.graphics;
var ary = getData(graphics.exprs);
- this.in1 = ary[0];
+ this.in = ary[0];
}
ZCROSS_f.prototype.getContainer = function ZCROSS_f() { return new BasicBlock(this.x); }
}
diff --git a/js/Threshold/ZCROSS_f.pickle b/js/Threshold/ZCROSS_f.pickle
index 2aac3c07..6b29920c 100644
--- a/js/Threshold/ZCROSS_f.pickle
+++ b/js/Threshold/ZCROSS_f.pickle
@@ -21,64 +21,62 @@ sS'model.evtout'
p3
S'double'
p4
-sS'model.blocktype'
+sS'model.in'
p5
-S'string'
+NsS'x.graphics'
p6
-sS'x.graphics'
-p7
S'object'
-p8
+p7
sS'kk'
+p8
+S'string'
p9
-g6
sS'model.nzcross'
p10
-g4
-sS'graphics.exprs'
+NsS'graphics'
p11
-NsS'in1'
-p12
-g4
+g7
sS'model.rpar'
-p13
+p12
S'matrix'
-p14
+p13
sS'rpar'
-p15
-g14
+p14
+g13
sS'exprs'
-p16
+p15
g4
sS'x.model'
-p17
+p16
NsS'gr_i'
-p18
+p17
S'vector'
-p19
+p18
sS'model.dep_ut'
-p20
+p19
S'vector_boolean'
+p20
+sS'graphics.exprs'
p21
-sS'model.in'
+NsS'in'
p22
g4
-sS'graphics'
-p23
-g8
sS'y'
-p24
-g19
+p23
+g18
sS'x'
-p25
-g19
+p24
+g18
sS'model'
-p26
-g8
+p25
+g7
sS'typ'
-p27
-g19
+p26
+g18
sS'model.firing'
-p28
+p27
g4
+sS'model.blocktype'
+p28
+g9
s. \ No newline at end of file