/* autogenerated from "macros/Misc/PENDULUM_ANIM.sci" */ function PENDULUM_ANIM() { PENDULUM_ANIM.prototype.define = function PENDULUM_ANIM() { this.plen = 2; this.csiz = 2; this.phi = 0; this.xmin = -5; this.xmax = 5; this.ymin = -5; this.ymax = 5; this.model = scicos_model(); this.model.sim = list(new ScilabString(["anim_pen"]), new ScilabDouble([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],this.model,exprs,gr_i); return new BasicBlock(this.x); } PENDULUM_ANIM.prototype.details = function PENDULUM_ANIM() { return this.x; } PENDULUM_ANIM.prototype.get = function PENDULUM_ANIM() { var options = { plen:["pendulum length",this.plen], csiz:["cart size (square side)",this.csiz], phi:["slope",this.phi], xmin:["Xmin",this.xmin], xmax:["Xmax",this.xmax], ymin:["Ymin",this.ymin], ymax:["Ymax",this.ymax], } return options; } PENDULUM_ANIM.prototype.set = function PENDULUM_ANIM() { this.plen = parseFloat(arguments[0]["plen"]) this.csiz = parseFloat(arguments[0]["csiz"]) this.phi = parseFloat(arguments[0]["phi"]) this.xmin = parseFloat(arguments[0]["xmin"]) this.xmax = parseFloat(arguments[0]["xmax"]) this.ymin = parseFloat(arguments[0]["ymin"]) this.ymax = parseFloat(arguments[0]["ymax"]) this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; 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) { break; } mess = []; if (this.plen<=0||this.csiz<=0) { mess = [[mess],["Pendulum length and cart size must be positive."],[" "]]; ok = false; } if (this.ymin>=this.ymax) { mess = [[mess],["Ymax must be greater than Ymin"],[" "]]; ok = false; } if (this.xmin>=this.xmax) { mess = [[mess],["Xmax must be greater than Xmin"],[" "]]; ok = false; } if (!ok) { message(mess); } else { rpar = [[this.plen],[this.csiz],[this.phi],[this.xmin],[this.xmax],[this.ymin],[this.ymax]]; this.model.rpar = rpar; graphics.exprs = exprs; this.x.graphics = graphics; this.x.model = this.model; break; } } return new BasicBlock(this.x); } }