summaryrefslogtreecommitdiff
path: root/js/Sources/CLOCK_f.js
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/Sources/CLOCK_f.js
parent7c70459c10aed0d74ee03896abaf47fefdbf7c8f (diff)
downloadsci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.gz
sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.bz2
sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.zip
add spacing to end of block also
Diffstat (limited to 'js/Sources/CLOCK_f.js')
-rw-r--r--js/Sources/CLOCK_f.js83
1 files changed, 42 insertions, 41 deletions
diff --git a/js/Sources/CLOCK_f.js b/js/Sources/CLOCK_f.js
index 2ddee5fe..ddfcd81b 100644
--- a/js/Sources/CLOCK_f.js
+++ b/js/Sources/CLOCK_f.js
@@ -29,30 +29,31 @@ function CLOCK_f() {
diagram.objs[4-1] = split;
diagram.objs[5-1] = scicos_link(xx=[[380.71],[399]],yy=[[172],[172]],ct=[5,-1],from=[4,1],to=[1,1]);
diagram.objs[6-1] = scicos_link(xx=[[380.71],[380.71],[340],[340]],yy=[[172],[302],[302],[277.71]],ct=[5,-1],from=[4,2],to=[2,1]);
- x = scicos_block();
- x.gui = "CLOCK_f";
- x.graphics.sz = [2,2];
- x.graphics.gr_i = gr_i;
- x.graphics.peout = 0;
- x.model.sim = "csuper";
- 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 = "CLOCK_f";
+ this.x.graphics.sz = [2,2];
+ this.x.graphics.gr_i = gr_i;
+ this.x.graphics.peout = 0;
+ this.x.model.sim = "csuper";
+ 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;
}
CLOCK_f.prototype.details = function CLOCK_f() {
+ return this.x;
}
CLOCK_f.prototype.get = function CLOCK_f() {
}
CLOCK_f.prototype.set = function CLOCK_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=="EVTDLY_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=="EVTDLY_f") {
+ path = i;
+ break;
+ }
+ }
newpar = list();
xx = arg1.model.rpar.objs[path-1];
exprs = xx.graphics.exprs;
@@ -61,32 +62,32 @@ break;
dt_old = model.rpar;
model_n = model;
while (true) {
- [ok,dt,t0,exprs0] = scicos_getvalue("Set Clock block parameters",[["Period"],["Init time"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (dt<=0) {
-message("period must be positive");
- ok = false;
-}
- if (ok) {
- xx.graphics.exprs = exprs0;
- model.rpar = dt;
- model.firing = t0;
- xx.model = model;
- arg1.model.rpar.objs[path-1] = xx;
-break;
-}
-}
+ [ok,dt,t0,exprs0] = scicos_getvalue("Set Clock block parameters",[["Period"],["Init time"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (dt<=0) {
+ message("period must be positive");
+ ok = false;
+ }
+ if (ok) {
+ xx.graphics.exprs = exprs0;
+ model.rpar = dt;
+ model.firing = t0;
+ xx.model = model;
+ arg1.model.rpar.objs[path-1] = xx;
+ break;
+ }
+ }
if (!and([t0_old,dt_old]==[t0,dt])||!and(exprs0==exprs)) {
- newpar[size(newpar)+1-1] = path;
-}
+ newpar[size(newpar)+1-1] = path;
+ }
if (t0_old!=t0) {
- needcompile = 2;
+ needcompile = 2;
} else {
- needcompile = 0;
-}
- x = arg1;
+ needcompile = 0;
+ }
+ this.x = arg1;
y = needcompile;
typ = newpar;
}