diff options
author | Sunil Shetye | 2018-07-11 13:05:13 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-11 15:21:08 +0530 |
commit | 079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch) | |
tree | 785ed59b5b238203a9e91f3e323da59d1083d86e /js/IntegerOp/CONVERT.js | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/IntegerOp/CONVERT.js')
-rw-r--r-- | js/IntegerOp/CONVERT.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js index 32a89506..ddd77a7c 100644 --- a/js/IntegerOp/CONVERT.js +++ b/js/IntegerOp/CONVERT.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/CONVERT.sci" */ function CONVERT() { CONVERT.prototype.define = function CONVERT() { - sgn = 2; + var sgn = 2; this.model = scicos_model(); this.model.sim = list(new ScilabString(["convert"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1]); @@ -14,8 +14,8 @@ function CONVERT() { this.model.ipar = new ScilabDouble([sgn]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(1)],[sci2exp(3)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -35,9 +35,9 @@ function CONVERT() { this.ot = parseFloat(arguments[0]["ot"]) this.np = arguments[0]["np"] this.x = arg1; - graphics = arg1.graphics; + var graphics = arg1.graphics; this.model = arg1.model; - exprs = graphics.exprs; + var exprs = 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); if (!ok) { @@ -51,13 +51,13 @@ function CONVERT() { } if ((this.np!=0&&this.np!=1&&this.np!=2)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Do on Overflow",this.np),msprintf("Must be in the interval %s.","[0, 2]")); - ok = false; + var ok = false; } else if ((this.it>8||this.it<1)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Input Type",this.it),msprintf("Must be in the interval %s.","[1, 8]")); - ok = false; + var ok = false; } else if ((this.ot>8||this.ot<1)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Output Type",this.ot),msprintf("Must be in the interval %s.","[1, 8]")); - ok = false; + var ok = false; } this.model.sim = list(new ScilabString(["convert"]), new ScilabDouble([4])); if ((this.it==this.ot)) { @@ -365,10 +365,13 @@ function CONVERT() { } } } - in1 = [this.model.in1,this.model.in2]; - out = [this.model.out,this.model.out2]; + var in1 = [this.model.in1,this.model.in2]; + var out = [this.model.out,this.model.out2]; if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,this.it),list(out,this.ot),[],[]); + var tmpvar0 = set_io(this.model,graphics,list(in1,this.it),list(out,this.ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; |