From 62b1d7dd9183ed75733b44104890586b03818214 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Mon, 9 Jul 2018 11:43:39 +0530 Subject: support ScilabBoolean, ScilabDouble, ScilabString --- js/Sources/RAMP.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'js/Sources/RAMP.js') diff --git a/js/Sources/RAMP.js b/js/Sources/RAMP.js index f34a816a..e3ad460e 100644 --- a/js/Sources/RAMP.js +++ b/js/Sources/RAMP.js @@ -5,18 +5,18 @@ function RAMP() { this.iout = 0; this.stt = 0; rpar = [[this.slope],[this.stt],[this.iout]]; - model = scicos_model(); - model.sim = list("ramp",4); - model.in1 = []; - model.out = 1; - model.rpar = rpar; - model.blocktype = "c"; - model.nmode = 1; - model.nzcross = 1; - model.dep_ut = [false,true]; + this.model = scicos_model(); + this.model.sim = list("ramp",4); + this.model.in1 = []; + this.model.out = new ScilabDouble(1); + this.model.rpar = rpar; + this.model.blocktype = new ScilabString("c"); + this.model.nmode = new ScilabDouble(1); + this.model.nzcross = new ScilabDouble(1); + this.model.dep_ut = [false,true]; exprs = [string(rpar)]; gr_i = []; - this.x = standard_define([2,2],model,exprs,gr_i); + this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } RAMP.prototype.details = function RAMP() { @@ -37,7 +37,7 @@ function RAMP() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.slope,this.stt,this.iout,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","RAMP")],[" "],["Ramp function"],[" "]],["Slope","Start Time","Initial Value"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -46,10 +46,10 @@ function RAMP() { if (this.stt<0) { block_parameter_error(msprintf("Wrong value for \'Start Time\' parameter: %e.",this.stt),"Null or positive integer expected."); } else { - model.rpar = [[this.slope],[this.stt],[this.iout]]; + this.model.rpar = [[this.slope],[this.stt],[this.iout]]; graphics.exprs = exprs; this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } -- cgit