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/Linear/GAIN_f.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'js/Linear/GAIN_f.js') diff --git a/js/Linear/GAIN_f.js b/js/Linear/GAIN_f.js index f0fd2265..a7ea5848 100644 --- a/js/Linear/GAIN_f.js +++ b/js/Linear/GAIN_f.js @@ -4,16 +4,16 @@ function GAIN_f() { this.gain = 1; in1 = 1; out = 1; - model = scicos_model(); - model.sim = "gain"; - model.in1 = 1; - model.out = 1; - model.rpar = this.gain; - model.blocktype = "c"; - model.dep_ut = [true,false]; + this.model = scicos_model(); + this.model.sim = new ScilabString("gain"); + this.model.in1 = new ScilabDouble(1); + this.model.out = new ScilabDouble(1); + this.model.rpar = new ScilabDouble(this.gain); + this.model.blocktype = new ScilabString("c"); + this.model.dep_ut = [true,false]; exprs = [[strcat(sci2exp(this.gain))],[strcat(sci2exp(in1))],[strcat(sci2exp(out))]]; 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); } GAIN_f.prototype.details = function GAIN_f() { @@ -30,7 +30,7 @@ function GAIN_f() { this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; - model = arg1.model; + this.model = arg1.model; while (true) { [ok,this.gain,exprs] = scicos_getvalue("Set gain block parameters",["Gain"],list("mat",[-1,-1]),exprs[1-1]); if (!ok) { @@ -40,12 +40,12 @@ function GAIN_f() { message("Gain must have at least one element"); } else { [out,in1] = size(this.gain); - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + [model,graphics,ok] = check_io(this.model,graphics,in1,out,[],[]); if (ok) { graphics.exprs = exprs; - model.rpar = this.gain.slice(); + this.model.rpar = this.gain.slice(); this.x.graphics = graphics; - this.x.model = model; + this.x.model = this.model; break; } } -- cgit