From 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Thu, 12 Jul 2018 23:16:08 +0530 Subject: add more global variables --- js/IntegerOp/CONVERT.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'js/IntegerOp/CONVERT.js') diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js index dab0ab34..205bf88a 100644 --- a/js/IntegerOp/CONVERT.js +++ b/js/IntegerOp/CONVERT.js @@ -14,9 +14,9 @@ function CONVERT() { this.model.ipar = new ScilabDouble([sgn]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONVERT\",sz(1),sz(2));"]); - this.x = standard_define([3,2],this.model,exprs,gr_i); + this.exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONVERT\",sz(1),sz(2));"]); + this.x = standard_define([3,2],this.model,this.exprs,this.gr_i); return new BasicBlock(this.x); } CONVERT.prototype.details = function CONVERT() { @@ -34,12 +34,13 @@ function CONVERT() { this.it = parseFloat(arguments[0]["it"]) this.ot = parseFloat(arguments[0]["ot"]) this.np = arguments[0]["np"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; this.model = arg1.model; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; while (true) { - [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.it,this.ot,this.np,this.exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONVERT")],[" "],["Type conversion"],[" "]],["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)","Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } @@ -374,7 +375,7 @@ function CONVERT() { var ok = tmpvar0[2]; } if (ok) { - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; -- cgit