diff options
author | Sunil Shetye | 2018-07-11 17:51:05 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-12 23:01:50 +0530 |
commit | 44a3807a94783e831070f0e003340af58dc64d16 (patch) | |
tree | cce50388afa463583d7a7aead34d40f5b02281f7 /js/Events | |
parent | 0047c3bea1d86b12a08544f6f0833c63e77f6eac (diff) | |
download | sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.gz sci2js-44a3807a94783e831070f0e003340af58dc64d16.tar.bz2 sci2js-44a3807a94783e831070f0e003340af58dc64d16.zip |
change graphics to object
Diffstat (limited to 'js/Events')
-rw-r--r-- | js/Events/END_c.js | 8 | ||||
-rw-r--r-- | js/Events/END_c.pickle | 6 | ||||
-rw-r--r-- | js/Events/EVTDLY_c.js | 8 | ||||
-rw-r--r-- | js/Events/EVTDLY_c.pickle | 6 | ||||
-rw-r--r-- | js/Events/EVTDLY_f.js | 8 | ||||
-rw-r--r-- | js/Events/EVTDLY_f.pickle | 6 | ||||
-rw-r--r-- | js/Events/EVTGEN_f.js | 8 | ||||
-rw-r--r-- | js/Events/EVTGEN_f.pickle | 6 | ||||
-rw-r--r-- | js/Events/EVTVARDLY.js | 8 | ||||
-rw-r--r-- | js/Events/EVTVARDLY.pickle | 6 | ||||
-rw-r--r-- | js/Events/HALT_f.js | 8 | ||||
-rw-r--r-- | js/Events/HALT_f.pickle | 6 | ||||
-rw-r--r-- | js/Events/IFTHEL_f.js | 16 | ||||
-rw-r--r-- | js/Events/IFTHEL_f.pickle | 14 | ||||
-rw-r--r-- | js/Events/MFCLCK_f.js | 8 | ||||
-rw-r--r-- | js/Events/MFCLCK_f.pickle | 6 | ||||
-rw-r--r-- | js/Events/M_freq.js | 36 | ||||
-rw-r--r-- | js/Events/M_freq.pickle | 12 | ||||
-rw-r--r-- | js/Events/freq_div.js | 74 | ||||
-rw-r--r-- | js/Events/freq_div.pickle | 6 |
20 files changed, 138 insertions, 118 deletions
diff --git a/js/Events/END_c.js b/js/Events/END_c.js index 24848fcb..4a6d30f3 100644 --- a/js/Events/END_c.js +++ b/js/Events/END_c.js @@ -26,8 +26,8 @@ function END_c() { END_c.prototype.set = function END_c() { this.tf = parseFloat(arguments[0]["tf"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.tf,exprs] = scicos_getvalue("Set final simulation time",["Final simulation time"],list("vec",1),exprs); @@ -35,9 +35,9 @@ function END_c() { break; } if (ok) { - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble([exprs]); this.model.firing = new ScilabDouble([this.tf]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/END_c.pickle b/js/Events/END_c.pickle index 2ea5b116..a4f46284 100644 --- a/js/Events/END_c.pickle +++ b/js/Events/END_c.pickle @@ -8,8 +8,10 @@ aS'x' p3 aS'model' p4 -atp5 -Rp6 +aS'graphics' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTDLY_c.js b/js/Events/EVTDLY_c.js index a4a6f941..2efd3fc3 100644 --- a/js/Events/EVTDLY_c.js +++ b/js/Events/EVTDLY_c.js @@ -30,8 +30,8 @@ function EVTDLY_c() { this.dt = parseFloat(arguments[0]["dt"]) this.ff = parseFloat(arguments[0]["ff"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.dt,this.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); @@ -43,10 +43,10 @@ function EVTDLY_c() { var ok = false; } if (ok) { - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble([exprs]); this.model.rpar = new ScilabDouble([this.dt],[this.ff]); this.model.firing = new ScilabDouble([this.ff]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/EVTDLY_c.pickle b/js/Events/EVTDLY_c.pickle index 47f20274..60b471e4 100644 --- a/js/Events/EVTDLY_c.pickle +++ b/js/Events/EVTDLY_c.pickle @@ -10,8 +10,10 @@ aS'dt' p4 aS'ff' p5 -atp6 -Rp7 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTDLY_f.js b/js/Events/EVTDLY_f.js index eb531d9c..dff6dabd 100644 --- a/js/Events/EVTDLY_f.js +++ b/js/Events/EVTDLY_f.js @@ -30,8 +30,8 @@ function EVTDLY_f() { this.dt = parseFloat(arguments[0]["dt"]) this.ff = parseFloat(arguments[0]["ff"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.dt,this.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); @@ -43,10 +43,10 @@ function EVTDLY_f() { var ok = false; } if (ok) { - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble([exprs]); this.model.rpar = new ScilabDouble([this.dt]); this.model.firing = new ScilabDouble([this.ff]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/EVTDLY_f.pickle b/js/Events/EVTDLY_f.pickle index 9668c749..55d2d19b 100644 --- a/js/Events/EVTDLY_f.pickle +++ b/js/Events/EVTDLY_f.pickle @@ -10,8 +10,10 @@ aS'dt' p4 aS'ff' p5 -atp6 -Rp7 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTGEN_f.js b/js/Events/EVTGEN_f.js index 6d387826..19c40114 100644 --- a/js/Events/EVTGEN_f.js +++ b/js/Events/EVTGEN_f.js @@ -25,19 +25,19 @@ function EVTGEN_f() { EVTGEN_f.prototype.set = function EVTGEN_f() { this.tt = parseFloat(arguments[0]["tt"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.tt,exprs] = scicos_getvalue("Set Event time",["Event Time"],list("vec",1),exprs); if (!ok) { break; } - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble([exprs]); if (this.model.firing!=this.tt) { this.model.firing = new ScilabDouble([this.tt]); } - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/EVTGEN_f.pickle b/js/Events/EVTGEN_f.pickle index b39db62c..50c53ccb 100644 --- a/js/Events/EVTGEN_f.pickle +++ b/js/Events/EVTGEN_f.pickle @@ -8,8 +8,10 @@ aS'model' p3 aS'tt' p4 -atp5 -Rp6 +aS'graphics' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/EVTVARDLY.js b/js/Events/EVTVARDLY.js index 2855497c..2116f270 100644 --- a/js/Events/EVTVARDLY.js +++ b/js/Events/EVTVARDLY.js @@ -26,17 +26,17 @@ function EVTVARDLY() { EVTVARDLY.prototype.set = function EVTVARDLY() { this.fir = arguments[0]["fir"] this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.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; + this.graphics.exprs = new ScilabDouble([exprs]); this.model.firing = new ScilabDouble([this.fir]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/EVTVARDLY.pickle b/js/Events/EVTVARDLY.pickle index 8c91c11d..9d2598f9 100644 --- a/js/Events/EVTVARDLY.pickle +++ b/js/Events/EVTVARDLY.pickle @@ -8,8 +8,10 @@ aS'x' p3 aS'model' p4 -atp5 -Rp6 +aS'graphics' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/HALT_f.js b/js/Events/HALT_f.js index f3796ca3..e891d796 100644 --- a/js/Events/HALT_f.js +++ b/js/Events/HALT_f.js @@ -26,8 +26,8 @@ function HALT_f() { HALT_f.prototype.set = function HALT_f() { this.n = parseFloat(arguments[0]["n"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; while (true) { [ok,this.n,exprs] = scicos_getvalue("Set Halt block parameters",["State on halt"],list("vec",1),exprs); @@ -35,9 +35,9 @@ function HALT_f() { break; } if (ok) { - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble([exprs]); this.model.ipar = new ScilabDouble([this.n]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/HALT_f.pickle b/js/Events/HALT_f.pickle index eea3c5a5..e639bd1c 100644 --- a/js/Events/HALT_f.pickle +++ b/js/Events/HALT_f.pickle @@ -8,8 +8,10 @@ aS'model' p3 aS'n' p4 -atp5 -Rp6 +aS'graphics' +p5 +atp6 +Rp7 .(dp0 S'model.sim' p1 diff --git a/js/Events/IFTHEL_f.js b/js/Events/IFTHEL_f.js index a43df50f..be1e07ee 100644 --- a/js/Events/IFTHEL_f.js +++ b/js/Events/IFTHEL_f.js @@ -32,8 +32,8 @@ function IFTHEL_f() { this.inh = inverse(arguments[0]["inh"]) this.nmod = parseFloat(arguments[0]["nmod"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; if (exprs==[]) { var exprs = string(1); @@ -53,17 +53,17 @@ function IFTHEL_f() { if (this.inh!=1) { this.inh = []; } - var tmpvar0 = check_io(this.model,graphics,1,[],this.inh,[[1],[1]]) - this.model = tmpvar0[0] - var graphics = tmpvar0[1] + var tmpvar0 = check_io(this.model,this.graphics,1,[],this.inh,[[1],[1]]); + this.model = tmpvar0[0]; + this.graphics = tmpvar0[1]; var ok = tmpvar0[2]; if (ok) { - graphics.exprs = exprs; + this.graphics.exprs = new ScilabString([exprs]); this.model.evtin = new ScilabDouble(this.inh); - this.model.sim[2] = new ScilabDouble([-1]); + this.model.sim[2-1] = new ScilabDouble([-1]); this.model.nmode = new ScilabDouble([this.nmod]); this.model.nzcross = new ScilabDouble([this.nmod]); - this.x.graphics = graphics; + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/IFTHEL_f.pickle b/js/Events/IFTHEL_f.pickle index 39f28732..d2685e9e 100644 --- a/js/Events/IFTHEL_f.pickle +++ b/js/Events/IFTHEL_f.pickle @@ -10,8 +10,10 @@ aS'inh' p4 aS'nmod' p5 -atp6 -Rp7 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 @@ -72,12 +74,12 @@ g16 sS'model.nzcross' p24 g6 -sS'model.sim[2]' -p25 -g6 sS'model.blocktype' -p26 +p25 g16 +sS'model.sim[2-1]' +p26 +g6 sS'model.dep_ut' p27 g8 diff --git a/js/Events/MFCLCK_f.js b/js/Events/MFCLCK_f.js index 65b4b868..333c096e 100644 --- a/js/Events/MFCLCK_f.js +++ b/js/Events/MFCLCK_f.js @@ -32,8 +32,8 @@ function MFCLCK_f() { this.dt = parseFloat(arguments[0]["dt"]) this.nn = parseFloat(arguments[0]["nn"]) this.x = arg1; - var graphics = arg1.graphics; - var exprs = graphics.exprs; + this.graphics = arg1.graphics; + var exprs = this.graphics.exprs; this.model = arg1.model; [ok,this.dt,this.nn,exprs] = scicos_getvalue("Set Multifrequency clock parameters",["basic period (1/f)","multiply by (n)"],list("vec",1,"vec",1),exprs); if (ok) { @@ -42,8 +42,8 @@ function MFCLCK_f() { var hh = this.model.firing; hh[2-1] = 0; this.model.firing = new ScilabDouble(hh); - graphics.exprs = exprs; - this.x.graphics = graphics; + this.graphics.exprs = new ScilabDouble([exprs]); + this.x.graphics = this.graphics; this.x.model = this.model; } return new BasicBlock(this.x); diff --git a/js/Events/MFCLCK_f.pickle b/js/Events/MFCLCK_f.pickle index ef1a472e..ecb4e072 100644 --- a/js/Events/MFCLCK_f.pickle +++ b/js/Events/MFCLCK_f.pickle @@ -10,8 +10,10 @@ aS'dt' p4 aS'nn' p5 -atp6 -Rp7 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.dstate' p1 diff --git a/js/Events/M_freq.js b/js/Events/M_freq.js index b76b3d94..1b969936 100644 --- a/js/Events/M_freq.js +++ b/js/Events/M_freq.js @@ -29,9 +29,9 @@ function M_freq() { this.frequ = inverse(arguments[0]["frequ"]) this.offset = inverse(arguments[0]["offset"]) this.x = arg1; - var graphics = arg1.graphics; + this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = graphics.exprs; + var exprs = this.graphics.exprs; while (true) { [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",-1,"vec",-1),exprs); if (!ok) { @@ -50,32 +50,32 @@ function M_freq() { var ok = false; } if (ok) { - var tmpvar0 = mfrequ_clk(this.frequ,this.offset) - var m = tmpvar0[0] - var den = tmpvar0[1] - var off = tmpvar0[2] - var count = tmpvar0[3] - var m1 = tmpvar0[4] - var fir = tmpvar0[5] - this.frequ = tmpvar0[6] - this.offset = tmpvar0[7] + var tmpvar0 = mfrequ_clk(this.frequ,this.offset); + var m = tmpvar0[0]; + var den = tmpvar0[1]; + var off = tmpvar0[2]; + var count = tmpvar0[3]; + var m1 = tmpvar0[4]; + var fir = tmpvar0[5]; + this.frequ = tmpvar0[6]; + this.offset = tmpvar0[7]; var ok = tmpvar0[8]; } if (ok) { this.model.opar = list(m, new ScilabDouble([double(den)]), new ScilabDouble([off]), new ScilabDouble([count])); var mn = (2^size(m1,"*"))-1; - var tmpvar1 = set_io(this.model,graphics,list(),list(),1,ones(mn,1)) - this.model = tmpvar1[0] - var graphics = tmpvar1[1] + var tmpvar1 = set_io(this.model,this.graphics,list(),list(),1,ones(mn,1)); + this.model = tmpvar1[0]; + this.graphics = tmpvar1[1]; var ok = tmpvar1[2]; if (mn>3) { - graphics.sz = [40+(mn-3)*10,40]; + this.graphics.sz = new ScilabDouble([40+(mn-3)*10,40]); } else { - graphics.sz = [50,40]; + this.graphics.sz = new ScilabDouble([50,40]); } this.model.firing = new ScilabDouble([fir]); - graphics.exprs = exprs; - this.x.graphics = graphics; + this.graphics.exprs = new ScilabDouble([exprs]); + this.x.graphics = this.graphics; this.x.model = this.model; break; } diff --git a/js/Events/M_freq.pickle b/js/Events/M_freq.pickle index 1b907d36..806b7dbd 100644 --- a/js/Events/M_freq.pickle +++ b/js/Events/M_freq.pickle @@ -8,14 +8,16 @@ aS'of' p3 aS'frequ' p4 -aS'offset' +aS'graphics' p5 -aS'x' +aS'offset' p6 -aS'model' +aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Events/freq_div.js b/js/Events/freq_div.js index 7c42fa2a..06413e1f 100644 --- a/js/Events/freq_div.js +++ b/js/Events/freq_div.js @@ -13,61 +13,61 @@ function freq_div() { scs_m_1.objs[9-1] = scicos_link(); scs_m_1.objs[10-1] = scicos_link(); var blk = scs_m_1.objs[1-1]; - var graphics = blk.graphics; + this.graphics = blk.graphics; this.model = blk.model; - graphics.orig = [0,-100]; - graphics.sz = [60,40]; - graphics.exprs = [["0"],["3"]]; + this.graphics.orig = new ScilabDouble([0,-100]); + this.graphics.sz = new ScilabDouble([60,40]); + this.graphics.exprs = new ScilabDouble(["0"],["3"]); this.model.dstate = new ScilabDouble([3]); this.model.ipar = new ScilabDouble([3]); - graphics.pout = 7; - graphics.pein = 10; - blk.graphics = graphics; + this.graphics.pout = new ScilabDouble([7]); + this.graphics.pein = new ScilabDouble([10]); + blk.graphics = this.graphics; blk.model = this.model; scs_m_1.objs[1-1] = blk; var blk = scs_m_1.objs[2-1]; - var graphics = blk.graphics; + this.graphics = blk.graphics; this.model = blk.model; - graphics.orig = [120,0]; - graphics.sz = [20,20]; - graphics.exprs = ["1"]; + this.graphics.orig = new ScilabDouble([120,0]); + this.graphics.sz = new ScilabDouble([20,20]); + this.graphics.exprs = new ScilabDouble(["1"]); this.model.ipar = new ScilabDouble([1]); - graphics.peout = 6; - blk.graphics = graphics; + this.graphics.peout = new ScilabDouble([6]); + blk.graphics = this.graphics; blk.model = this.model; scs_m_1.objs[2-1] = blk; var blk = scs_m_1.objs[3-1]; - var graphics = blk.graphics; + this.graphics = blk.graphics; this.model = blk.model; - graphics.orig = [130,-160]; - graphics.sz = [20,20]; - graphics.exprs = ["1"]; + this.graphics.orig = new ScilabDouble([130,-160]); + this.graphics.sz = new ScilabDouble([20,20]); + this.graphics.exprs = new ScilabDouble(["1"]); this.model.ipar = new ScilabDouble([1]); - graphics.pein = 8; - blk.graphics = graphics; + this.graphics.pein = new ScilabDouble([8]); + blk.graphics = this.graphics; blk.model = this.model; scs_m_1.objs[3-1] = blk; var blk = scs_m_1.objs[4-1]; - var graphics = blk.graphics; + this.graphics = blk.graphics; this.model = blk.model; - graphics.orig = [100,-100]; - graphics.sz = [60,40]; - graphics.exprs = [["1"],["0"]]; + this.graphics.orig = new ScilabDouble([100,-100]); + this.graphics.sz = new ScilabDouble([60,40]); + this.graphics.exprs = new ScilabDouble(["1"],["0"]); this.model.ipar = new ScilabDouble([1]); - graphics.pin = 7; - graphics.pein = 9; - graphics.peout = [[0],[8]]; - blk.graphics = graphics; + this.graphics.pin = new ScilabDouble([7]); + this.graphics.pein = new ScilabDouble([9]); + this.graphics.peout = new ScilabDouble([0],[8]); + blk.graphics = this.graphics; blk.model = this.model; scs_m_1.objs[4-1] = blk; var blk = scs_m_1.objs[5-1]; - var graphics = blk.graphics; + this.graphics = blk.graphics; this.model = blk.model; - graphics.orig = [127,-33]; - graphics.sz = [7,7]; - graphics.pein = 6; - graphics.peout = [[9],[10]]; - blk.graphics = graphics; + this.graphics.orig = new ScilabDouble([127,-33]); + this.graphics.sz = new ScilabDouble([7,7]); + this.graphics.pein = new ScilabDouble([6]); + this.graphics.peout = new ScilabDouble([9],[10]); + blk.graphics = this.graphics; blk.model = this.model; scs_m_1.objs[5-1] = blk; var lnk = scs_m_1.objs[6-1]; @@ -136,8 +136,8 @@ function freq_div() { spath[$+1-1] = path; var xx = arg1[spath-1]; var xxn = xx; - var graphics = xx.graphics; - var exprs = graphics.exprs; + this.graphics = xx.graphics; + var exprs = this.graphics.exprs; this.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); @@ -152,10 +152,10 @@ function freq_div() { if (%ph>%df-1) { %ph = %df-1; } - graphics.exprs = exprs; + this.graphics.exprs = new ScilabDouble(exprs); this.model.ipar = new ScilabDouble([%df]); this.model.dstate = new ScilabDouble([%ph]); - xxn.graphics = graphics; + xxn.graphics = this.graphics; xxn.model = this.model; break; } diff --git a/js/Events/freq_div.pickle b/js/Events/freq_div.pickle index ff28fc58..f58dd424 100644 --- a/js/Events/freq_div.pickle +++ b/js/Events/freq_div.pickle @@ -10,8 +10,10 @@ aS'%df' p4 aS'%ph' p5 -atp6 -Rp7 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'lnk.ct' p1 |