diff options
author | Adhitya Kamakshidasan | 2016-07-11 16:23:37 +0530 |
---|---|---|
committer | GitHub | 2016-07-11 16:23:37 +0530 |
commit | 3c55efcb3ce622ea006b0126460bc6d1536f9753 (patch) | |
tree | 3e91efd3fa580bd61e3175200e67f6e6a95473b8 /data_structures_correct/CLOCK_c.js | |
parent | 2b8ff4319806419bf796a2b40ade9df6676cde18 (diff) | |
parent | 479d6c2a826b6c470731260860fe3e3a5906db7c (diff) | |
download | xcos-on-web-3c55efcb3ce622ea006b0126460bc6d1536f9753.tar.gz xcos-on-web-3c55efcb3ce622ea006b0126460bc6d1536f9753.tar.bz2 xcos-on-web-3c55efcb3ce622ea006b0126460bc6d1536f9753.zip |
Merge pull request #161 from ASP1234/master
Implement SET,GET of CLOCK_c Block
Diffstat (limited to 'data_structures_correct/CLOCK_c.js')
-rw-r--r-- | data_structures_correct/CLOCK_c.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/data_structures_correct/CLOCK_c.js b/data_structures_correct/CLOCK_c.js index 1284626..b6910b2 100644 --- a/data_structures_correct/CLOCK_c.js +++ b/data_structures_correct/CLOCK_c.js @@ -1,4 +1,20 @@ function CLOCK_c() { + + CLOCK_c.prototype.get = function CLOCK_c() { + var options = { + dt: ["Period", getData(this.x.model.rpar.objs[1].model.rpar)[0]], + t0: ["Initialisation Time", getData(this.x.model.rpar.objs[1].model.firing)], + }; + return options; + } + + CLOCK_c.prototype.set = function CLOCK_c() { + this.x.model.rpar.objs[1].model.firing = new ScilabDouble([arguments[0]["t0"]]); + this.x.model.rpar.objs[1].model.rpar = new ScilabDouble([arguments[0]["dt"]], [arguments[0]["t0"]]); + this.x.model.rpar.objs[1].graphics.exprs = new ScilabString([arguments[0]["dt"]], [arguments[0]["t0"]]) + return new BasicBlock(this.x); + } + CLOCK_c.prototype.define = function CLOCK_c() { var evtdly = new EVTDLY_c().internal(); evtdly.graphics.orig = new ScilabDouble([320, 232]); |