diff options
author | Sunil Shetye | 2018-07-09 11:43:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-09 12:16:25 +0530 |
commit | 62b1d7dd9183ed75733b44104890586b03818214 (patch) | |
tree | 9859e9ca295df98df945bd5fcccc3a264e8bede1 /js/Misc/PENDULUM_ANIM.js | |
parent | 5c011853630a1b466ef4789d5b600dd530d0a3ec (diff) | |
download | sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.gz sci2js-62b1d7dd9183ed75733b44104890586b03818214.tar.bz2 sci2js-62b1d7dd9183ed75733b44104890586b03818214.zip |
support ScilabBoolean, ScilabDouble, ScilabString
Diffstat (limited to 'js/Misc/PENDULUM_ANIM.js')
-rw-r--r-- | js/Misc/PENDULUM_ANIM.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/js/Misc/PENDULUM_ANIM.js b/js/Misc/PENDULUM_ANIM.js index 968e7ba2..375b3739 100644 --- a/js/Misc/PENDULUM_ANIM.js +++ b/js/Misc/PENDULUM_ANIM.js @@ -8,17 +8,17 @@ function PENDULUM_ANIM() { this.xmax = 5; this.ymin = -5; this.ymax = 5; - model = scicos_model(); - model.sim = list("anim_pen",5); - model.in1 = [[1],[1]]; - model.evtin = 1; - model.dstate = 0; - model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.blocktype = "d"; - model.dep_ut = [false,false]; - exprs = string(model.rpar); + this.model = scicos_model(); + this.model.sim = list("anim_pen",5); + this.model.in1 = [[1],[1]]; + this.model.evtin = new ScilabDouble(1); + this.model.dstate = new ScilabDouble(0); + this.model.rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; + this.model.blocktype = new ScilabString("d"); + this.model.dep_ut = [false,false]; + exprs = string(this.model.rpar); gr_i = []; - this.x = standard_define([3,3],model,exprs,gr_i); + this.x = standard_define([3,3],this.model,exprs,gr_i); return new BasicBlock(this.x); } PENDULUM_ANIM.prototype.details = function PENDULUM_ANIM() { @@ -47,8 +47,8 @@ function PENDULUM_ANIM() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; - dstate = model.dstate; + this.model = arg1.model; + dstate = this.model.dstate; while (true) { [ok,this.plen,this.csiz,this.phi,this.xmin,this.xmax,this.ymin,this.ymax,exprs] = scicos_getvalue("Set Scope parameters",["pendulum length","cart size (square side)","slope","Xmin","Xmax","Ymin","Ymax"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -71,10 +71,10 @@ function PENDULUM_ANIM() { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; - model.rpar = rpar; + this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } |