diff options
Diffstat (limited to 'js/IntegerOp/SHIFT.js')
-rw-r--r-- | js/IntegerOp/SHIFT.js | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/js/IntegerOp/SHIFT.js b/js/IntegerOp/SHIFT.js index 799bee21..ab0de403 100644 --- a/js/IntegerOp/SHIFT.js +++ b/js/IntegerOp/SHIFT.js @@ -1,8 +1,8 @@ /* autogenerated from "macros/IntegerOp/SHIFT.sci" */ function SHIFT() { SHIFT.prototype.define = function SHIFT() { - sgn = [[0],[0]]; - OPER = 0; + var sgn = [[0],[0]]; + var OPER = 0; this.model = scicos_model(); this.model.sim = list(new ScilabString(["shift_32_LA"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1]); @@ -15,8 +15,8 @@ function SHIFT() { this.model.ipar = new ScilabDouble(sgn); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(3)],[sci2exp(0)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -36,9 +36,9 @@ function SHIFT() { this.nb = arguments[0]["nb"] 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.Datatype,this.nb,this.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","SHIFT")],[" "],["Shift/Rotates bits"]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Number of Bits to Shift Left (Negative number to shift right)","Shift Type (0:Arithmetic, 1:Circular)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { @@ -46,10 +46,10 @@ function SHIFT() { } if ((this.np!=0&&this.np!=1)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Shift Type",this.np),msprintf("Must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } - it = this.Datatype; - ot = this.Datatype; + var it = this.Datatype; + var ot = this.Datatype; if ((this.Datatype==3||this.Datatype==6)) { if (this.nb>0) { switch (this.np) { @@ -115,10 +115,13 @@ function SHIFT() { } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",this.Datatype),msprintf("Must be in the interval %s.","[3, 8]")); - ok = false; + var ok = false; } if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]); + var tmpvar0 = set_io(this.model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { this.model.ipar = new ScilabDouble([this.nb]); |