summaryrefslogtreecommitdiff
path: root/js/Events
diff options
context:
space:
mode:
authorSunil Shetye2018-06-25 18:20:39 +0530
committerSunil Shetye2018-06-26 11:06:22 +0530
commit7465daea85285ba7f291b6bf6ddc45caa9e7ad65 (patch)
treee8e3e4dd60d469c290d55de15644ddbc1e013bc6 /js/Events
parent7c70459c10aed0d74ee03896abaf47fefdbf7c8f (diff)
downloadsci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.gz
sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.bz2
sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.zip
add spacing to end of block also
Diffstat (limited to 'js/Events')
-rw-r--r--js/Events/ANDBLK.js29
-rw-r--r--js/Events/ANDBLK.pickle6
-rw-r--r--js/Events/ANDLOG_f.js5
-rw-r--r--js/Events/ANDLOG_f.pickle6
-rw-r--r--js/Events/CLKSOMV_f.js5
-rw-r--r--js/Events/CLKSOMV_f.pickle6
-rw-r--r--js/Events/CLKSOM_f.js5
-rw-r--r--js/Events/CLKSOM_f.pickle6
-rw-r--r--js/Events/CLKSPLIT_f.js5
-rw-r--r--js/Events/CLKSPLIT_f.pickle6
-rw-r--r--js/Events/END_c.js29
-rw-r--r--js/Events/END_c.pickle6
-rw-r--r--js/Events/EVTDLY_c.js39
-rw-r--r--js/Events/EVTDLY_c.pickle6
-rw-r--r--js/Events/EVTDLY_f.js39
-rw-r--r--js/Events/EVTDLY_f.pickle6
-rw-r--r--js/Events/EVTGEN_f.js29
-rw-r--r--js/Events/EVTGEN_f.pickle6
-rw-r--r--js/Events/EVTVARDLY.js25
-rw-r--r--js/Events/EVTVARDLY.pickle6
-rw-r--r--js/Events/HALT_f.js29
-rw-r--r--js/Events/HALT_f.pickle6
-rw-r--r--js/Events/IFTHEL_f.js59
-rw-r--r--js/Events/IFTHEL_f.pickle6
-rw-r--r--js/Events/MCLOCK_f.js43
-rw-r--r--js/Events/MCLOCK_f.pickle8
-rw-r--r--js/Events/MFCLCK_f.js23
-rw-r--r--js/Events/MFCLCK_f.pickle6
-rw-r--r--js/Events/M_freq.js75
-rw-r--r--js/Events/M_freq.pickle8
-rw-r--r--js/Events/VirtualCLK0.js5
-rw-r--r--js/Events/VirtualCLK0.pickle6
-rw-r--r--js/Events/freq_div.js143
-rw-r--r--js/Events/freq_div.pickle6
34 files changed, 372 insertions, 321 deletions
diff --git a/js/Events/ANDBLK.js b/js/Events/ANDBLK.js
index 1c8b8aae..ef00fcfa 100644
--- a/js/Events/ANDBLK.js
+++ b/js/Events/ANDBLK.js
@@ -52,25 +52,26 @@ function ANDBLK() {
diagram.objs[10-1] = split;
diagram.objs[11-1] = scicos_link(xx=[[234],[234]],yy=[[275.78],[198.71]],ct=[5,-1],from=[10,1],to=[1,2]);
diagram.objs[12-1] = scicos_link(xx=[[234],[361],[361]],yy=[[275.78],[275.78],[202.71]],ct=[5,-1],from=[10,2],to=[7,1]);
- x = scicos_block();
- x.gui = "ANDBLK";
- x.graphics.sz = [2,2];
- x.graphics.gr_i = [];
- x.graphics.pein = [[0],[0]];
- x.graphics.peout = 0;
- x.model.sim = "csuper";
- x.model.evtin = [[1],[1]];
- x.model.evtout = 1;
- x.model.blocktype = "h";
- x.model.firing = false;
- x.model.dep_ut = [false,false];
- x.model.rpar = diagram;
+ this.x = scicos_block();
+ this.x.gui = "ANDBLK";
+ this.x.graphics.sz = [2,2];
+ this.x.graphics.gr_i = [];
+ this.x.graphics.pein = [[0],[0]];
+ this.x.graphics.peout = 0;
+ this.x.model.sim = "csuper";
+ this.x.model.evtin = [[1],[1]];
+ this.x.model.evtout = 1;
+ this.x.model.blocktype = "h";
+ this.x.model.firing = false;
+ this.x.model.dep_ut = [false,false];
+ this.x.model.rpar = diagram;
}
ANDBLK.prototype.details = function ANDBLK() {
+ return this.x;
}
ANDBLK.prototype.get = function ANDBLK() {
}
ANDBLK.prototype.set = function ANDBLK() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/ANDBLK.pickle b/js/Events/ANDBLK.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/ANDBLK.pickle
+++ b/js/Events/ANDBLK.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/ANDLOG_f.js b/js/Events/ANDLOG_f.js
index eec2ed6b..17acfade 100644
--- a/js/Events/ANDLOG_f.js
+++ b/js/Events/ANDLOG_f.js
@@ -9,13 +9,14 @@ function ANDLOG_f() {
model.firing = [];
model.dep_ut = [false,false];
gr_i = [];
- x = standard_define([3,3],model,[],gr_i);
+ this.x = standard_define([3,3],model,[],gr_i);
}
ANDLOG_f.prototype.details = function ANDLOG_f() {
+ return this.x;
}
ANDLOG_f.prototype.get = function ANDLOG_f() {
}
ANDLOG_f.prototype.set = function ANDLOG_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/ANDLOG_f.pickle b/js/Events/ANDLOG_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/ANDLOG_f.pickle
+++ b/js/Events/ANDLOG_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/CLKSOMV_f.js b/js/Events/CLKSOMV_f.js
index b7cb2c36..b9489ab8 100644
--- a/js/Events/CLKSOMV_f.js
+++ b/js/Events/CLKSOMV_f.js
@@ -9,13 +9,14 @@ function CLKSOMV_f() {
model.firing = -1;
model.dep_ut = [false,false];
gr_i = [];
- x = standard_define([2,2],model,[],gr_i);
+ this.x = standard_define([2,2],model,[],gr_i);
}
CLKSOMV_f.prototype.details = function CLKSOMV_f() {
+ return this.x;
}
CLKSOMV_f.prototype.get = function CLKSOMV_f() {
}
CLKSOMV_f.prototype.set = function CLKSOMV_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/CLKSOMV_f.pickle b/js/Events/CLKSOMV_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/CLKSOMV_f.pickle
+++ b/js/Events/CLKSOMV_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/CLKSOM_f.js b/js/Events/CLKSOM_f.js
index f1fad184..45f5aa6d 100644
--- a/js/Events/CLKSOM_f.js
+++ b/js/Events/CLKSOM_f.js
@@ -9,13 +9,14 @@ function CLKSOM_f() {
model.firing = -1;
model.dep_ut = [false,false];
gr_i = [];
- x = standard_define([1,1]/1.2,model,[],gr_i);
+ this.x = standard_define([1,1]/1.2,model,[],gr_i);
}
CLKSOM_f.prototype.details = function CLKSOM_f() {
+ return this.x;
}
CLKSOM_f.prototype.get = function CLKSOM_f() {
}
CLKSOM_f.prototype.set = function CLKSOM_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/CLKSOM_f.pickle b/js/Events/CLKSOM_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/CLKSOM_f.pickle
+++ b/js/Events/CLKSOM_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/CLKSPLIT_f.js b/js/Events/CLKSPLIT_f.js
index c24b13fb..c3792fc2 100644
--- a/js/Events/CLKSPLIT_f.js
+++ b/js/Events/CLKSPLIT_f.js
@@ -8,13 +8,14 @@ function CLKSPLIT_f() {
model.blocktype = "d";
model.firing = [false,false,false];
model.dep_ut = [false,false];
- x = standard_define([1,1]/3,model,[],[]);
+ this.x = standard_define([1,1]/3,model,[],[]);
}
CLKSPLIT_f.prototype.details = function CLKSPLIT_f() {
+ return this.x;
}
CLKSPLIT_f.prototype.get = function CLKSPLIT_f() {
}
CLKSPLIT_f.prototype.set = function CLKSPLIT_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/CLKSPLIT_f.pickle b/js/Events/CLKSPLIT_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/CLKSPLIT_f.pickle
+++ b/js/Events/CLKSPLIT_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/END_c.js b/js/Events/END_c.js
index be502525..c385c9aa 100644
--- a/js/Events/END_c.js
+++ b/js/Events/END_c.js
@@ -11,29 +11,30 @@ function END_c() {
model.dep_ut = [false,false];
exprs = string(tf);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
END_c.prototype.details = function END_c() {
+ return this.x;
}
END_c.prototype.get = function END_c() {
}
END_c.prototype.set = function END_c() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs);
- if (!ok) {
-break;
-}
- if (ok) {
- graphics.exprs = exprs;
- model.firing = tf;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (ok) {
+ graphics.exprs = exprs;
+ model.firing = tf;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/END_c.pickle b/js/Events/END_c.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/END_c.pickle
+++ b/js/Events/END_c.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/EVTDLY_c.js b/js/Events/EVTDLY_c.js
index d38dd3c7..2946d381 100644
--- a/js/Events/EVTDLY_c.js
+++ b/js/Events/EVTDLY_c.js
@@ -13,34 +13,35 @@ function EVTDLY_c() {
model.dep_ut = [false,false];
exprs = [[string(dt)],[sci2exp(ff)]];
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
EVTDLY_c.prototype.details = function EVTDLY_c() {
+ return this.x;
}
EVTDLY_c.prototype.get = function EVTDLY_c() {
}
EVTDLY_c.prototype.set = function EVTDLY_c() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,dt,ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" to disable any output event."]],[["Delay"],["Date of initial output event"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (dt<=0) {
-message("Delay must be positive");
- ok = false;
-}
- if (ok) {
- graphics.exprs = exprs;
- model.rpar = [[dt],[ff]];
- model.firing = ff;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,dt,ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" to disable any output event."]],[["Delay"],["Date of initial output event"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (dt<=0) {
+ message("Delay must be positive");
+ ok = false;
+ }
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = [[dt],[ff]];
+ model.firing = ff;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/EVTDLY_c.pickle b/js/Events/EVTDLY_c.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/EVTDLY_c.pickle
+++ b/js/Events/EVTDLY_c.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/EVTDLY_f.js b/js/Events/EVTDLY_f.js
index 4636bc98..48180c10 100644
--- a/js/Events/EVTDLY_f.js
+++ b/js/Events/EVTDLY_f.js
@@ -13,34 +13,35 @@ function EVTDLY_f() {
model.dep_ut = [false,false];
exprs = [[string(dt)],[sci2exp(ff)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
EVTDLY_f.prototype.details = function EVTDLY_f() {
+ return this.x;
}
EVTDLY_f.prototype.get = function EVTDLY_f() {
}
EVTDLY_f.prototype.set = function EVTDLY_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,dt,ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" if no initial event required"]],[["Delay"],["Date of initial output event"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (dt<=0) {
-message("Delay must be positive");
- ok = false;
-}
- if (ok) {
- graphics.exprs = exprs;
- model.rpar = dt;
- model.firing = ff;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,dt,ff,exprs] = scicos_getvalue([["Set Event Delay block parameters"],["Delay is the delay between an input event "],[" and the generated output event"],["Block may initially generate an output event before "],[" any input event. \"Date of initial output event\""],[" gives the date of this event. Set a negative value"],[" if no initial event required"]],[["Delay"],["Date of initial output event"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (dt<=0) {
+ message("Delay must be positive");
+ ok = false;
+ }
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = dt;
+ model.firing = ff;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/EVTDLY_f.pickle b/js/Events/EVTDLY_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/EVTDLY_f.pickle
+++ b/js/Events/EVTDLY_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/EVTGEN_f.js b/js/Events/EVTGEN_f.js
index 56b4be21..f2966e46 100644
--- a/js/Events/EVTGEN_f.js
+++ b/js/Events/EVTGEN_f.js
@@ -10,29 +10,30 @@ function EVTGEN_f() {
model.dep_ut = [false,false];
exprs = string(tt);
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
EVTGEN_f.prototype.details = function EVTGEN_f() {
+ return this.x;
}
EVTGEN_f.prototype.get = function EVTGEN_f() {
}
EVTGEN_f.prototype.set = function EVTGEN_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs);
- if (!ok) {
-break;
-}
- graphics.exprs = exprs;
- if (model.firing!=tt) {
- model.firing = tt;
-}
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ graphics.exprs = exprs;
+ if (model.firing!=tt) {
+ model.firing = tt;
+ }
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Events/EVTGEN_f.pickle b/js/Events/EVTGEN_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/EVTGEN_f.pickle
+++ b/js/Events/EVTGEN_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/EVTVARDLY.js b/js/Events/EVTVARDLY.js
index 866efa95..ac96bcd5 100644
--- a/js/Events/EVTVARDLY.js
+++ b/js/Events/EVTVARDLY.js
@@ -12,27 +12,28 @@ function EVTVARDLY() {
model.dep_ut = [true,false];
exprs = string(model.firing);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
EVTVARDLY.prototype.details = function EVTVARDLY() {
+ return this.x;
}
EVTVARDLY.prototype.get = function EVTVARDLY() {
}
EVTVARDLY.prototype.set = function EVTVARDLY() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,fir,exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- graphics.exprs = exprs;
- model.firing = fir;
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,fir,exprs] = scicos_getvalue("Set parameter of variable event delay","Initial event firing time (<0 if absent)",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ graphics.exprs = exprs;
+ model.firing = fir;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/Events/EVTVARDLY.pickle b/js/Events/EVTVARDLY.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/EVTVARDLY.pickle
+++ b/js/Events/EVTVARDLY.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/HALT_f.js b/js/Events/HALT_f.js
index 1f8c6bf8..897b61c0 100644
--- a/js/Events/HALT_f.js
+++ b/js/Events/HALT_f.js
@@ -11,29 +11,30 @@ function HALT_f() {
model.dep_ut = [false,false];
exprs = string(n);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
HALT_f.prototype.details = function HALT_f() {
+ return this.x;
}
HALT_f.prototype.get = function HALT_f() {
}
HALT_f.prototype.set = function HALT_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs);
- if (!ok) {
-break;
-}
- if (ok) {
- graphics.exprs = exprs;
- model.ipar = n;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (ok) {
+ graphics.exprs = exprs;
+ model.ipar = n;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/HALT_f.pickle b/js/Events/HALT_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/HALT_f.pickle
+++ b/js/Events/HALT_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/IFTHEL_f.js b/js/Events/IFTHEL_f.js
index 181ba139..a3ea4b20 100644
--- a/js/Events/IFTHEL_f.js
+++ b/js/Events/IFTHEL_f.js
@@ -15,46 +15,47 @@ function IFTHEL_f() {
model.nzcross = 1;
gr_i = [];
exprs = [[string(model.in1)],[string(model.nmode)]];
- x = standard_define([3,3],model,exprs,gr_i);
+ this.x = standard_define([3,3],model,exprs,gr_i);
}
IFTHEL_f.prototype.details = function IFTHEL_f() {
+ return this.x;
}
IFTHEL_f.prototype.get = function IFTHEL_f() {
}
IFTHEL_f.prototype.set = function IFTHEL_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (exprs==[]) {
- exprs = string(1);
-}
+ exprs = string(1);
+ }
if (size(exprs,"*")==1) {
- exprs[2-1] = string(1);
-}
+ exprs[2-1] = string(1);
+ }
while (true) {
- [ok,inh,nmod,exprs] = scicos_getvalue("Set parameters",[["Inherit (1: no, 0: yes)"],["zero-crossing (0: no, 1: yes)"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- model.dep_ut = [true,false];
- if (nmod!=0) {
- nmod = 1;
-}
- if (inh!=1) {
- inh = [];
-}
- [model,graphics,ok] = check_io(model,graphics,1,[],inh,[[1],[1]]);
- if (ok) {
- graphics.exprs = exprs;
- model.evtin = inh;
- model.sim[2-1] = -1;
- model.nmode = nmod;
- model.nzcross = nmod;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,inh,nmod,exprs] = scicos_getvalue("Set parameters",[["Inherit (1: no, 0: yes)"],["zero-crossing (0: no, 1: yes)"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ model.dep_ut = [true,false];
+ if (nmod!=0) {
+ nmod = 1;
+ }
+ if (inh!=1) {
+ inh = [];
+ }
+ [model,graphics,ok] = check_io(model,graphics,1,[],inh,[[1],[1]]);
+ if (ok) {
+ graphics.exprs = exprs;
+ model.evtin = inh;
+ model.sim[2-1] = -1;
+ model.nmode = nmod;
+ model.nzcross = nmod;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/IFTHEL_f.pickle b/js/Events/IFTHEL_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/IFTHEL_f.pickle
+++ b/js/Events/IFTHEL_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/MCLOCK_f.js b/js/Events/MCLOCK_f.js
index 8dce3105..e0beef45 100644
--- a/js/Events/MCLOCK_f.js
+++ b/js/Events/MCLOCK_f.js
@@ -58,37 +58,38 @@ function MCLOCK_f() {
diagram.objs[11-1] = split2;
diagram.objs[12-1] = scicos_link(xx=[[482.5],[489.6],[489.6],[354],[354]],yy=[[169.3],[169.3],[338.3],[338.3],[244.7]],ct=[10,-1],from=[11,1],to=[1,1]);
diagram.objs[13-1] = scicos_link(xx=[[482.4],[482.4],[509]],yy=[[169.3],[152],[152]],ct=[10,-1],from=[11,2],to=[7,1]);
- x = scicos_block();
- x.gui = "MCLOCK_f";
- x.graphics.sz = [3,2];
- x.graphics.gr_i = gr_i;
- x.model.sim = "csuper";
- x.model.evtout = [[1],[1]];
- x.model.blocktype = "h";
- x.model.rpar = diagram;
- x.graphics.peout = [[0],[0]];
+ this.x = scicos_block();
+ this.x.gui = "MCLOCK_f";
+ this.x.graphics.sz = [3,2];
+ this.x.graphics.gr_i = gr_i;
+ this.x.model.sim = "csuper";
+ this.x.model.evtout = [[1],[1]];
+ this.x.model.blocktype = "h";
+ this.x.model.rpar = diagram;
+ this.x.graphics.peout = [[0],[0]];
}
MCLOCK_f.prototype.details = function MCLOCK_f() {
+ return this.x;
}
MCLOCK_f.prototype.get = function MCLOCK_f() {
}
MCLOCK_f.prototype.set = function MCLOCK_f() {
-for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
- o = arg1.model.rpar.objs[i-1];
- if (typeof(o)=="Block"&&o.gui=="MFCLCK_f") {
- path = i;
-break;
-}
-}
+ for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
+ o = arg1.model.rpar.objs[i-1];
+ if (typeof(o)=="Block"&&o.gui=="MFCLCK_f") {
+ path = i;
+ break;
+ }
+ }
newpar = list();
spath = list("model","rpar","objs",path);
xx = arg1[spath-1];
-execstr("xxn="+xx.gui+"(\'set\',xx)");
+ execstr("xxn="+xx.gui+"(\'set\',xx)");
if (or(this.xxn!=xx)) {
- arg1[spath-1] = this.xxn;
- newpar[size(newpar)+1-1] = path;
-}
- x = arg1;
+ arg1[spath-1] = this.xxn;
+ newpar[size(newpar)+1-1] = path;
+ }
+ this.x = arg1;
y = 0;
typ = newpar;
}
diff --git a/js/Events/MCLOCK_f.pickle b/js/Events/MCLOCK_f.pickle
index 349c1dad..a010fd54 100644
--- a/js/Events/MCLOCK_f.pickle
+++ b/js/Events/MCLOCK_f.pickle
@@ -2,8 +2,10 @@ c__builtin__
set
p0
((lp1
-S'xxn'
+S'x'
p2
-atp3
-Rp4
+aS'xxn'
+p3
+atp4
+Rp5
. \ No newline at end of file
diff --git a/js/Events/MFCLCK_f.js b/js/Events/MFCLCK_f.js
index 9e5fa63f..1dbc294f 100644
--- a/js/Events/MFCLCK_f.js
+++ b/js/Events/MFCLCK_f.js
@@ -15,27 +15,28 @@ function MFCLCK_f() {
model.dep_ut = [false,false];
exprs = [[string(dt)],[string(nn)]];
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
MFCLCK_f.prototype.details = function MFCLCK_f() {
+ return this.x;
}
MFCLCK_f.prototype.get = function MFCLCK_f() {
}
MFCLCK_f.prototype.set = function MFCLCK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
[ok,dt,nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",[["basic period (1/f)"],["multiply by (n)"]],list("vec",1,"vec",1),exprs);
if (ok) {
- model.ipar = nn;
- model.rpar = dt;
- hh = model.firing;
- hh[2-1] = 0;
- model.firing = hh;
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-}
+ model.ipar = nn;
+ model.rpar = dt;
+ hh = model.firing;
+ hh[2-1] = 0;
+ model.firing = hh;
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ }
}
}
diff --git a/js/Events/MFCLCK_f.pickle b/js/Events/MFCLCK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/MFCLCK_f.pickle
+++ b/js/Events/MFCLCK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/M_freq.js b/js/Events/M_freq.js
index 68f13431..ac3d3246 100644
--- a/js/Events/M_freq.js
+++ b/js/Events/M_freq.js
@@ -12,52 +12,53 @@ function M_freq() {
model.dep_ut = [false,false];
exprs = [[sci2exp([[1],[2]])],[sci2exp([[0],[0]])]];
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
M_freq.prototype.details = function M_freq() {
+ return this.x;
}
M_freq.prototype.get = function M_freq() {
}
M_freq.prototype.set = function M_freq() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
model = arg1.model;
exprs = graphics.exprs;
while (true) {
- [ok,frequ,offset,exprs] = scicos_getvalue("Set block parameters",[["Sample time"],["Offset"]],list("vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- offset = offset.slice();
- frequ = frequ.slice();
- if ((size(frequ,"*"))!=(size(offset,"*"))) {
-message("offset and frequency must have the same size");
- ok = false;
- } else if (or(frequ<0)) {
-message("Frequency must be a positif number");
- ok = false;
- } else if (or(abs(offset)>frequ)) {
-message("The |Offset| must be less than the Frequency");
- ok = false;
-}
- if (ok) {
- [m,den,off,count,m1,fir,frequ,offset,ok] = mfrequ_clk(frequ,offset);
-}
- if (ok) {
- model.opar = list(m,double(den),off,count);
- mn = (2^size(m1,"*"))-1;
- [model,graphics,ok] = set_io(model,graphics,list(),list(),1,ones(mn,1));
- if (mn>3) {
- graphics.sz = [40+(mn-3)*10,40];
- } else {
- graphics.sz = [50,40];
-}
- model.firing = fir;
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,frequ,offset,exprs] = scicos_getvalue("Set block parameters",[["Sample time"],["Offset"]],list("vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ offset = offset.slice();
+ frequ = frequ.slice();
+ if ((size(frequ,"*"))!=(size(offset,"*"))) {
+ message("offset and frequency must have the same size");
+ ok = false;
+ } else if (or(frequ<0)) {
+ message("Frequency must be a positif number");
+ ok = false;
+ } else if (or(abs(offset)>frequ)) {
+ message("The |Offset| must be less than the Frequency");
+ ok = false;
+ }
+ if (ok) {
+ [m,den,off,count,m1,fir,frequ,offset,ok] = mfrequ_clk(frequ,offset);
+ }
+ if (ok) {
+ model.opar = list(m,double(den),off,count);
+ mn = (2^size(m1,"*"))-1;
+ [model,graphics,ok] = set_io(model,graphics,list(),list(),1,ones(mn,1));
+ if (mn>3) {
+ graphics.sz = [40+(mn-3)*10,40];
+ } else {
+ graphics.sz = [50,40];
+ }
+ model.firing = fir;
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/Events/M_freq.pickle b/js/Events/M_freq.pickle
index 7d80f6e5..0bdf24af 100644
--- a/js/Events/M_freq.pickle
+++ b/js/Events/M_freq.pickle
@@ -2,10 +2,12 @@ c__builtin__
set
p0
((lp1
-S'of'
+S'x'
p2
aS'fr'
p3
-atp4
-Rp5
+aS'of'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/Events/VirtualCLK0.js b/js/Events/VirtualCLK0.js
index 4cc02b10..f4cf1f54 100644
--- a/js/Events/VirtualCLK0.js
+++ b/js/Events/VirtualCLK0.js
@@ -10,13 +10,14 @@ function VirtualCLK0() {
model.firing = -1;
model.dep_ut = [false,false];
exprs = [];
- x = standard_define([2,2],model,exprs," ");
+ this.x = standard_define([2,2],model,exprs," ");
}
VirtualCLK0.prototype.details = function VirtualCLK0() {
+ return this.x;
}
VirtualCLK0.prototype.get = function VirtualCLK0() {
}
VirtualCLK0.prototype.set = function VirtualCLK0() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/Events/VirtualCLK0.pickle b/js/Events/VirtualCLK0.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/VirtualCLK0.pickle
+++ b/js/Events/VirtualCLK0.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/Events/freq_div.js b/js/Events/freq_div.js
index 8569364c..d3a993b4 100644
--- a/js/Events/freq_div.js
+++ b/js/Events/freq_div.js
@@ -96,28 +96,29 @@ function freq_div() {
lnk.from = [5,2,0];
lnk.to = [1,1,1];
scs_m_1.objs[10-1] = lnk;
-blk={};
-lnk={};
+ blk={};
+ lnk={};
model = scicos_model();
model.sim = "csuper";
model.evtin = 1;
model.evtout = 1;
model.rpar = scs_m_1;
gr_i = [];
- x = standard_define([3,2],model,[],gr_i);
+ this.x = standard_define([3,2],model,[],gr_i);
}
freq_div.prototype.details = function freq_div() {
+ return this.x;
}
freq_div.prototype.get = function freq_div() {
}
freq_div.prototype.set = function freq_div() {
-for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
- o = arg1.model.rpar.objs[i-1];
- if (typeof(o)=="Block"&&o.gui=="Modulo_Count") {
- path = i;
-break;
-}
-}
+ for (i=1;i<=length(arg1.model.rpar.objs);i+=1) {
+ o = arg1.model.rpar.objs[i-1];
+ if (typeof(o)=="Block"&&o.gui=="Modulo_Count") {
+ path = i;
+ break;
+ }
+ }
newpar = list();
y = 0;
spath = list();
@@ -131,68 +132,68 @@ break;
exprs = graphics.exprs;
model = xx.model;
while (true) {
- [ok,%ph,%df,exprs] = scicos_getvalue("Set frequency division block parameters",[["Phase (0 to division factor -1)"],["Division factor"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (ok) {
- if (%df<1) {
- %df = 1;
-}
- %ph = abs(%ph);
- if (%ph>%df-1) {
- %ph = %df-1;
-}
- graphics.exprs = exprs;
- model.ipar = %df;
- model.dstate = %ph;
- xxn.graphics = graphics;
- xxn.model = model;
-break;
-}
-}
+ [ok,%ph,%df,exprs] = scicos_getvalue("Set frequency division block parameters",[["Phase (0 to division factor -1)"],["Division factor"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (ok) {
+ if (%df<1) {
+ %df = 1;
+ }
+ %ph = abs(%ph);
+ if (%ph>%df-1) {
+ %ph = %df-1;
+ }
+ graphics.exprs = exprs;
+ model.ipar = %df;
+ model.dstate = %ph;
+ xxn.graphics = graphics;
+ xxn.model = model;
+ break;
+ }
+ }
if (diffobjs(xxn,xx)) {
- model = xx.model;
- model_n = xxn.model;
- if (!is_modelica_block(xx)) {
- modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label);
- if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) {
- needcompile = 1;
-}
- if (or(model.firing!=model_n.firing)) {
- needcompile = 2;
-}
- if (model.sim=="input"||model.sim=="output") {
- if (model.ipar!=model_n.ipar) {
- needcompile = 4;
-}
-}
- if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
- needcompile = 4;
-}
- if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
- needcompile = 4;
-}
- if (prod(size(model_n.sim))>1) {
- if (model_n.sim[2-1]>1000) {
- if (model.sim[1-1]!=model_n.sim[1-1]) {
- needcompile = 4;
-}
-}
-}
- } else {
- modified = or(model_n!=model);
- eq = model.equations;
- eqn = model_n.equations;
- if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
- needcompile = 4;
-}
-}
- arg1[spath-1] = xxn;
- newpar[size(newpar)+1-1] = 1;
- y = max(y,needcompile);
-}
- x = arg1;
+ model = xx.model;
+ model_n = xxn.model;
+ if (!is_modelica_block(xx)) {
+ modified = or(model.sim!=model_n.sim)||!isequal(model.state,model_n.state)||!isequal(model.dstate,model_n.dstate)||!isequal(model.rpar,model_n.rpar)||!isequal(model.ipar,model_n.ipar)||!isequal(model.label,model_n.label);
+ if (or(model.in1!=model_n.in1)||or(model.out!=model_n.out)) {
+ needcompile = 1;
+ }
+ if (or(model.firing!=model_n.firing)) {
+ needcompile = 2;
+ }
+ if (model.sim=="input"||model.sim=="output") {
+ if (model.ipar!=model_n.ipar) {
+ needcompile = 4;
+ }
+ }
+ if (or(model.blocktype!=model_n.blocktype)||or(model.dep_ut!=model_n.dep_ut)) {
+ needcompile = 4;
+ }
+ if ((model.nzcross!=model_n.nzcross)||(model.nmode!=model_n.nmode)) {
+ needcompile = 4;
+ }
+ if (prod(size(model_n.sim))>1) {
+ if (model_n.sim[2-1]>1000) {
+ if (model.sim[1-1]!=model_n.sim[1-1]) {
+ needcompile = 4;
+ }
+ }
+ }
+ } else {
+ modified = or(model_n!=model);
+ eq = model.equations;
+ eqn = model_n.equations;
+ if (or(eq.model!=eqn.model)||or(eq.inputs!=eqn.inputs)||or(eq.outputs!=eqn.outputs)) {
+ needcompile = 4;
+ }
+ }
+ arg1[spath-1] = xxn;
+ newpar[size(newpar)+1-1] = 1;
+ y = max(y,needcompile);
+ }
+ this.x = arg1;
typ = newpar;
}
}
diff --git a/js/Events/freq_div.pickle b/js/Events/freq_div.pickle
index 154645d8..0d1dde24 100644
--- a/js/Events/freq_div.pickle
+++ b/js/Events/freq_div.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file