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 | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/IntegerOp')
-rw-r--r-- | js/IntegerOp/BITCLEAR.js | 43 | ||||
-rw-r--r-- | js/IntegerOp/BITCLEAR.pickle | 43 | ||||
-rw-r--r-- | js/IntegerOp/BITSET.js | 43 | ||||
-rw-r--r-- | js/IntegerOp/BITSET.pickle | 43 | ||||
-rw-r--r-- | js/IntegerOp/CONVERT.js | 25 | ||||
-rw-r--r-- | js/IntegerOp/CONVERT.pickle | 41 | ||||
-rw-r--r-- | js/IntegerOp/DFLIPFLOP.js | 10 | ||||
-rw-r--r-- | js/IntegerOp/DLATCH.js | 4 | ||||
-rw-r--r-- | js/IntegerOp/EXTRACTBITS.js | 49 | ||||
-rw-r--r-- | js/IntegerOp/EXTRACTBITS.pickle | 45 | ||||
-rw-r--r-- | js/IntegerOp/INTMUL.js | 27 | ||||
-rw-r--r-- | js/IntegerOp/INTMUL.pickle | 37 | ||||
-rw-r--r-- | js/IntegerOp/JKFLIPFLOP.js | 26 | ||||
-rw-r--r-- | js/IntegerOp/LOGIC.js | 33 | ||||
-rw-r--r-- | js/IntegerOp/LOGIC.pickle | 37 | ||||
-rw-r--r-- | js/IntegerOp/SHIFT.js | 25 | ||||
-rw-r--r-- | js/IntegerOp/SHIFT.pickle | 49 | ||||
-rw-r--r-- | js/IntegerOp/SRFLIPFLOP.js | 24 |
18 files changed, 302 insertions, 302 deletions
diff --git a/js/IntegerOp/BITCLEAR.js b/js/IntegerOp/BITCLEAR.js index 4d9758ec..9230f85e 100644 --- a/js/IntegerOp/BITCLEAR.js +++ b/js/IntegerOp/BITCLEAR.js @@ -12,8 +12,8 @@ function BITCLEAR() { this.model.opar = list(new ScilabDouble([int32(0)])); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(3)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(3)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,57 +31,60 @@ function BITCLEAR() { this.Datatype = arguments[0]["Datatype"] this.bit = parseFloat(arguments[0]["bit"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITCLEAR")],[" "],["Clear a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [this.model.in1,this.model.in2]; + var in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); - ok = false; + var ok = false; } else if ((this.Datatype==3)||(this.Datatype==6)) { if (this.bit>31||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 31]")); - ok = false; + var ok = false; } else { this.bit = uint32(this.bit); - n = (2^32-1)-2^this.bit; - n = uint32(n); + var n = (2^32-1)-2^this.bit; + var n = uint32(n); this.model.sim = list(new ScilabString(["bit_clear_32"]), new ScilabDouble([4])); } } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 15]")); - ok = false; + var ok = false; } else { this.bit = uint16(this.bit); - n = (2^16-1)-2^this.bit; - n = uint16(n); + var n = (2^16-1)-2^this.bit; + var n = uint16(n); this.model.sim = list(new ScilabString(["bit_clear_16"]), new ScilabDouble([4])); } } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 7]")); - ok = false; + var ok = false; } else { this.bit = uint8(this.bit); - n = (2^8-1)-2^this.bit; - n = uint8(n); + var n = (2^8-1)-2^this.bit; + var n = uint8(n); this.model.sim = list(new ScilabString(["bit_clear_8"]), new ScilabDouble([4])); } } 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) { - it = this.Datatype; - ot = this.Datatype; - out = [1,1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var it = this.Datatype; + var ot = this.Datatype; + var out = [1,1]; + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/IntegerOp/BITCLEAR.pickle b/js/IntegerOp/BITCLEAR.pickle index f0b09f39..fc60b980 100644 --- a/js/IntegerOp/BITCLEAR.pickle +++ b/js/IntegerOp/BITCLEAR.pickle @@ -49,59 +49,56 @@ sS'model.sim' p14 S'list' p15 -sS'[this.model,graphics,ok]' -p16 -g7 sS'model.out2' -p17 +p16 g7 sS'in1' -p18 +p17 g10 sS'model.outtyp' -p19 +p18 g7 sS'graphics.exprs' -p20 +p19 NsS'bit' -p21 +p20 g7 sS'typ' -p22 +p21 g10 sS'model.opar' -p23 +p22 g15 sS'ok' -p24 +p23 S'boolean' -p25 +p24 sS'model.blocktype' -p26 +p25 S'string' -p27 +p26 sS'model.dep_ut' -p28 +p27 g10 sS'n' -p29 +p28 g7 sS'exprs' -p30 +p29 S'matrix' -p31 +p30 sS'gr_i' -p32 +p31 g10 sS'y' -p33 +p32 g10 sS'x' -p34 +p33 g7 sS'model' -p35 +p34 g2 sS'ot' -p36 +p35 Ns.
\ No newline at end of file diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js index f20d0619..6a0582fe 100644 --- a/js/IntegerOp/BITSET.js +++ b/js/IntegerOp/BITSET.js @@ -12,8 +12,8 @@ function BITSET() { this.model.opar = list(new ScilabDouble([uint32(0)])); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(3)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(3)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -31,55 +31,58 @@ function BITSET() { this.Datatype = arguments[0]["Datatype"] this.bit = parseFloat(arguments[0]["bit"]) this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","BITSET")],[" "],["Set a bit"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Index of Bit (0 is least significant)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - in1 = [this.model.in1,this.model.in2]; + var in1 = [this.model.in1,this.model.in2]; if (floor(this.bit)!=this.bit) { block_parameter_error(msprintf("Wrong type for \'%s\' parameter: %5.1f.","Index of Bit",this.bit),"Must be integer."); - ok = false; + var ok = false; } if ((this.Datatype==3)||(this.Datatype==6)) { if (this.bit>31||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 31]")); - ok = false; + var ok = false; } this.bit = uint32(this.bit); - n = 2^this.bit; - n = uint32(n); + var n = 2^this.bit; + var n = uint32(n); this.model.sim = list(new ScilabString(["bit_set_32"]), new ScilabDouble([4])); } else if ((this.Datatype==4)||(this.Datatype==7)) { if (this.bit>15||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 15]")); - ok = false; + var ok = false; } this.bit = uint16(this.bit); - n = 2^this.bit; - n = uint16(n); + var n = 2^this.bit; + var n = uint16(n); this.model.sim = list(new ScilabString(["bit_set_16"]), new ScilabDouble([4])); } else if ((this.Datatype==5)||(this.Datatype==8)) { if (this.bit>7||this.bit<0) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Index of Bit",this.bit),msprintf("Must be in the interval %s.","[0, 7]")); - ok = false; + var ok = false; } this.bit = uint8(this.bit); - n = 2^this.bit; - n = uint8(n); + var n = 2^this.bit; + var n = uint8(n); this.model.sim = list(new ScilabString(["bit_set_8"]), new ScilabDouble([4])); } 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) { - it = this.Datatype; - ot = this.Datatype; - out = [1,1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var it = this.Datatype; + var ot = this.Datatype; + var out = [1,1]; + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/IntegerOp/BITSET.pickle b/js/IntegerOp/BITSET.pickle index f0b09f39..fc60b980 100644 --- a/js/IntegerOp/BITSET.pickle +++ b/js/IntegerOp/BITSET.pickle @@ -49,59 +49,56 @@ sS'model.sim' p14 S'list' p15 -sS'[this.model,graphics,ok]' -p16 -g7 sS'model.out2' -p17 +p16 g7 sS'in1' -p18 +p17 g10 sS'model.outtyp' -p19 +p18 g7 sS'graphics.exprs' -p20 +p19 NsS'bit' -p21 +p20 g7 sS'typ' -p22 +p21 g10 sS'model.opar' -p23 +p22 g15 sS'ok' -p24 +p23 S'boolean' -p25 +p24 sS'model.blocktype' -p26 +p25 S'string' -p27 +p26 sS'model.dep_ut' -p28 +p27 g10 sS'n' -p29 +p28 g7 sS'exprs' -p30 +p29 S'matrix' -p31 +p30 sS'gr_i' -p32 +p31 g10 sS'y' -p33 +p32 g10 sS'x' -p34 +p33 g7 sS'model' -p35 +p34 g2 sS'ot' -p36 +p35 Ns.
\ No newline at end of file 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; diff --git a/js/IntegerOp/CONVERT.pickle b/js/IntegerOp/CONVERT.pickle index b52bf187..b4be3cad 100644 --- a/js/IntegerOp/CONVERT.pickle +++ b/js/IntegerOp/CONVERT.pickle @@ -55,57 +55,54 @@ sS'model.sim' p15 S'list' p16 -sS'[this.model,graphics,ok]' -p17 -g5 sS'model.out2' -p18 +p17 g5 sS'in1' -p19 +p18 g11 sS'model.rpar' -p20 +p19 g11 sS'model.outtyp' -p21 +p20 g5 sS'graphics.exprs' -p22 +p21 NsS'model.ipar' -p23 +p22 g5 sS'typ' -p24 +p23 g11 sS'ok' -p25 +p24 S'boolean' -p26 +p25 sS'model.blocktype' -p27 +p26 S'string' -p28 +p27 sS'model.dep_ut' -p29 +p28 g11 sS'exprs' -p30 +p29 S'matrix' -p31 +p30 sS'gr_i' -p32 +p31 g11 sS'y' -p33 +p32 g11 sS'x' -p34 +p33 g5 sS'model' -p35 +p34 g2 sS'ot' -p36 +p35 g5 s.
\ No newline at end of file diff --git a/js/IntegerOp/DFLIPFLOP.js b/js/IntegerOp/DFLIPFLOP.js index e07adda8..79215c3e 100644 --- a/js/IntegerOp/DFLIPFLOP.js +++ b/js/IntegerOp/DFLIPFLOP.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/DFLIPFLOP.sci" */ function DFLIPFLOP() { DFLIPFLOP.prototype.define = function DFLIPFLOP() { - scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["DFLIPFLOP"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["DFLIPFLOP"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m.objs[1-1] = scicos_block(gui="CONST_m",graphics=scicos_graphics(orig=[109.62561,263.44465],sz=[[20],[20]],flip=true,theta=0,exprs="int8(0)",pin=[],pout=6,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim=list("cstblk4_m",4),in1=[],in2=[],intyp=1,out=1,out2=1,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(int8(0)),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[2-1] = scicos_block(gui="IFTHEL_f",graphics=scicos_graphics(orig=[239.98293,378.2166],sz=[60,60],flip=true,theta=0,exprs=[["1"],["1"]],pin=29,pout=[],pein=22,peout=[[16],[44]],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim=list("ifthel",-1),in1=1,in2=1,intyp=-1,out=[],out2=[],outtyp=1,evtin=1,evtout=[[1],[1]],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="l",firing=[-1,-1],dep_ut=[true,false],label="",nzcross=1,nmode=1,equations=list()),doc=list()); scs_m.objs[3-1] = scicos_block(gui="LOGICAL_OP",graphics=scicos_graphics(orig=[152.88902,260.24498],sz=[60,40],flip=true,theta=0,exprs=[["2"],["1"],["5"],["0"]],pin=[[11],[39]],pout=5,pein=[],peout=[],gr_i=[],id="",in_implicit=[["E"],["E"]],out_implicit="E"),model=scicos_model(sim=list("logicalop_i8",4),in1=[[-1],[-1]],in2=[[-2],[-2]],intyp=[[5],[5]],out=-1,out2=-2,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[[1],[0]],opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); @@ -16,7 +16,7 @@ function DFLIPFLOP() { scs_m.objs[12-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[457.40928,320.20131],sz=[20,20],flip=true,theta=0,exprs="2",pin=13,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=2,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[13-1] = scicos_link(xx=[[441.81249],[457.40928]],yy=[[329.46812],[330.20131]],id="drawlink",thick=[0,0],ct=[1,1],from=[7,1,0],to=[12,1,1]); scs_m.objs[14-1] = scicos_block(gui="OUT_f",graphics=scicos_graphics(orig=[376.4669,270.83282],sz=[20,20],flip=true,theta=0,exprs="1",pin=37,pout=[],pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="output",in1=-1,in2=[],intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); - scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title="Untitled",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=[],void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title="Untitled",tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=[],void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m_1.objs[1-1] = scicos_block(gui="ANDLOG_f",graphics=scicos_graphics(orig=[194,133],sz=[60,60],flip=true,theta=0,exprs=[],pin=[],pout=9,pein=[[4],[11]],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim="andlog",in1=[],in2=[],intyp=1,out=1,out2=[],outtyp=1,evtin=[[1],[1]],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_block(gui="CLKIN_f",graphics=scicos_graphics(orig=[149,287],sz=[20,20],flip=true,theta=0,exprs="1",pin=[],pout=[],pein=[],peout=4,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="input",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="d",firing=-1,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[3-1] = scicos_block(gui="CLKOUT_f",graphics=scicos_graphics(orig=[450,83],sz=[20,20],flip=true,theta=0,exprs="1",pin=[],pout=[],pein=8,peout=[],gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="output",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=1,evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); @@ -32,7 +32,7 @@ function DFLIPFLOP() { scs_m.objs[15-1] = scicos_block(gui="ANDBLK",graphics=scicos_graphics(orig=[233.73039,318.74407],sz=[40,40],flip=true,theta=0,exprs=[],pin=[],pout=[],pein=[[19],[16]],peout=17,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="csuper",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[[1],[1]],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=false,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[16-1] = scicos_link(xx=[[259.98293],[260.39705]],yy=[[372.50232],[364.45835]],id="drawlink",thick=[0,0],ct=[5,-1],from=[2,1,0],to=[15,2,1]); scs_m.objs[17-1] = scicos_link(xx=[[253.73039],[253.72572]],yy=[[313.02978],[309.29537]],id="drawlink",thick=[0,0],ct=[5,-1],from=[15,1,0],to=[41,1,1]); - scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["EDGE_TRIGGER","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["EDGE_TRIGGER","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m_1.objs[1-1] = scicos_block(gui="EDGETRIGGER",graphics=scicos_graphics(orig=[288.58631,257.1131],sz=[60,40],flip=true,theta=0,exprs="1",pin=5,pout=3,pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("edgetrig",4),in1=1,in2=[],intyp=1,out=1,out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=0,odstate=list(),rpar=[],ipar=1,opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=1,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_block(gui="IFTHEL_f",graphics=scicos_graphics(orig=[388.28869,247.1131],sz=[60,60],flip=true,theta=0,exprs=[["0"],["0"]],pin=3,pout=[],pein=[],peout=[[7],[0]],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim=list("ifthel",-1),in1=1,in2=[],intyp=1,out=[],out2=1,outtyp=[],evtin=[],evtout=[[1],[1]],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="l",firing=[-1,-1],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[3-1] = scicos_link(xx=[[357.15774],[362.99107],[379.71726]],yy=[[277.1131],[277.1131],[277.1131]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[2,1,1]); @@ -43,7 +43,7 @@ function DFLIPFLOP() { scs_m.objs[18-1] = scicos_block(gui="EDGE_TRIGGER",graphics=scicos_graphics(orig=[133.90637,385.342],sz=[60,40],flip=true,theta=0,exprs=[],pin=26,pout=[],pein=[],peout=19,gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim="csuper",in1=-1,in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=1,state=[],dstate=[],odstate=list(),rpar=scs_m_1,ipar=[],opar=list(),blocktype="h",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[19-1] = scicos_link(xx=[[163.90637],[163.90637],[247.06372]],yy=[[379.62771],[364.45835],[364.45835]],id="drawlink",thick=[0,0],ct=[5,-1],from=[18,1,0],to=[15,1,1]); scs_m.objs[20-1] = scicos_block(gui="IN_f",graphics=scicos_graphics(orig=[79.594811,395.47647],sz=[20,20],flip=true,theta=0,exprs="2",pin=[],pout=23,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim="input",in1=[],in2=[],intyp=1,out=-1,out2=[],outtyp=-1,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=2,opar=list(),blocktype="c",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); - scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["Extract_Activation","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["Extract_Activation","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m_1.objs[1-1] = scicos_block(gui="IFTHEL_f",graphics=scicos_graphics(orig=[150.65045,143.82208],sz=[60,60],flip=true,theta=0,exprs=[["0"],["0"]],pin=6,pout=[],pein=[],peout=[[3],[4]],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim=list("ifthel",-1),in1=1,in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[],evtout=[[1],[1]],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="l",firing=[-1,-1],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_block(gui="CLKSOMV_f",graphics=scicos_graphics(orig=[169.82143,96.146231],sz=[16.666667,16.666667],flip=true,theta=0,exprs=[],pin=[],pout=[],pein=[[3],[4],[0]],peout=8,gr_i=[],id="",in_implicit=[],out_implicit=[]),model=scicos_model(sim="sum",in1=[],in2=[],intyp=1,out=[],out2=[],outtyp=1,evtin=[[1],[1],[1]],evtout=1,state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="d",firing=-1,dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[3-1] = scicos_link(xx=[[170.65045],[170.65045],[150.04302],[150.04302],[169.82143]],yy=[[138.10779],[128.235],[128.235],[104.47956],[104.47956]],id="drawlink",thick=[0,0],ct=[5,-1],from=[1,1,0],to=[2,1,1]); @@ -88,7 +88,7 @@ function DFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [true,false]; this.model.rpar = new ScilabDouble([scs_m]); - gr_i = []; + var gr_i = []; this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } diff --git a/js/IntegerOp/DLATCH.js b/js/IntegerOp/DLATCH.js index ac4afc92..2b08ce0f 100644 --- a/js/IntegerOp/DLATCH.js +++ b/js/IntegerOp/DLATCH.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/DLATCH.sci" */ function DLATCH() { DLATCH.prototype.define = function DLATCH() { - scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["DLATCH"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["DLATCH"],tol=[0.0001,0.000001,1.000e-10,100001,0,0],tf=100000,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m.objs[1-1] = scicos_block(gui="CONST_m",graphics=scicos_graphics(orig=[109.62561,263.44465],sz=[[20],[20]],flip=true,theta=0,exprs="int8(0)",pin=[],pout=7,pein=[],peout=[],gr_i=[],id="",in_implicit=[],out_implicit="E"),model=scicos_model(sim=list("cstblk4_m",4),in1=[],in2=[],intyp=1,out=1,out2=1,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(int8(0)),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[2-1] = scicos_block(gui="IFTHEL_f",graphics=scicos_graphics(orig=[233.37693,320.30536],sz=[60,60],flip=true,theta=0,exprs=[["0"],["1"]],pin=13,pout=[],pein=[],peout=[[6],[0]],gr_i=list([["txt=[\'If in>0\';\' \';\' then else\'];"],["xstringb(orig(1),orig(2),txt,sz(1),sz(2),\'fill\');"]],8),id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim=list("ifthel",-1),in1=1,in2=1,intyp=-1,out=[],out2=[],outtyp=1,evtin=[],evtout=[[1],[1]],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="l",firing=[-1,-1],dep_ut=[true,false],label="",nzcross=1,nmode=1,equations=list()),doc=list()); scs_m.objs[3-1] = scicos_block(gui="LOGICAL_OP",graphics=scicos_graphics(orig=[152.88902,260.24498],sz=[60,40],flip=true,theta=0,exprs=[["2"],["1"],["5"],["0"]],pin=[[15],[7]],pout=5,pein=[],peout=[],gr_i=list("xstringb(orig(1),orig(2),[\'Logical Op \';OPER],sz(1),sz(2),\'fill\');",8),id="",in_implicit=[["E"],["E"]],out_implicit="E"),model=scicos_model(sim=list("logicalop_i8",4),in1=[[-1],[-1]],in2=[[-2],[-2]],intyp=[[5],[5]],out=-1,out2=-2,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[[1],[0]],opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); @@ -33,7 +33,7 @@ function DLATCH() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [true,false]; this.model.rpar = new ScilabDouble([scs_m]); - gr_i = []; + var gr_i = []; this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } diff --git a/js/IntegerOp/EXTRACTBITS.js b/js/IntegerOp/EXTRACTBITS.js index 65367a6f..5525a5f5 100644 --- a/js/IntegerOp/EXTRACTBITS.js +++ b/js/IntegerOp/EXTRACTBITS.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/EXTRACTBITS.sci" */ function EXTRACTBITS() { EXTRACTBITS.prototype.define = function EXTRACTBITS() { - numb = []; + var numb = []; this.model = scicos_model(); this.model.sim = list(new ScilabString(["extract_bit_32_UH0"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([1]); @@ -13,8 +13,8 @@ function EXTRACTBITS() { this.model.ipar = [0,numb]; this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(3)],[sci2exp(1)],[sci2exp(0)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([4,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -36,52 +36,52 @@ function EXTRACTBITS() { this.bit = parseFloat(arguments[0]["bit"]) this.scal = arguments[0]["scal"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.Datatype,this.rule,this.bit,this.scal,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","EXTRACTBITS")],[" "],["Bits Extraction"],[" "],[" - Bits to Extract:"],[" 1 Upper Half"],[" 2 Lower Half"],[" 3 Range from MSB"],[" 4 Range to LSB"],[" 5 Range of Bits"],[" - Number of Bits or Index of bit : Index 0 is LSB"],[" If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Bits to extract","Number of Bits or Index of Bit","Treat Bit Field as an Integer (0:No, 1:Yes)"],list("vec",1,"vec",1,"vec",-1,"vec",1),exprs); if (!ok) { break; } - bitstr = strcat(string(this.bit.slice())," "); + var bitstr = strcat(string(this.bit.slice())," "); if ((this.rule<1)||(this.rule>5)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Bits to Extract",this.rule),msprintf("Must be in the interval %s.","[1, 5]")); - ok = false; + var ok = false; } else if (this.scal<0||this.scal>1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Treat Bit Field as an Integer",this.scal),msprintf("Must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } else { - in1 = [this.model.in1,this.model.in2]; + var in1 = [this.model.in1,this.model.in2]; this.bit = int(this.bit); this.rule = int(this.rule); if ((this.rule==3)||(this.rule==4)) { if ((size(this.bit,"*")!=1)) { block_parameter_error(msprintf("Wrong size for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),"Must be a single value."); - ok = false; + var ok = false; } else { - numb = this.bit; + var numb = this.bit; } } else if ((this.rule==5)) { if ((size(this.bit,"*")!=2)) { block_parameter_error(msprintf("Wrong size for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),"Must have this form: [Start, End]."); - ok = false; + var ok = false; } else if (this.bit[1-1]>this.bit[2-1]) { block_parameter_error(msprintf("Wrong values for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),msprintf("\'Start\' must be less than \'End\'.")); - ok = false; + var ok = false; } else { - numb = this.bit[2-1]-this.bit[1-1]; + var numb = this.bit[2-1]-this.bit[1-1]; } } else { this.bit = 0; - numb = []; + var numb = []; } } if (ok) { if ((this.Datatype==3||this.Datatype==6)) { if (or(this.bit.slice()>31)||or(this.bit.slice()<0)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),msprintf("Indexes must be in the interval %s.","[0, 31]")); - ok = false; + var ok = false; } switch (this.rule) { case 1: @@ -128,7 +128,7 @@ function EXTRACTBITS() { } else if ((this.Datatype==4||this.Datatype==7)) { if (or(this.bit.slice()>15)||or(this.bit.slice()<0)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),msprintf("Indexes must be in the interval %s.","[0, 15]")); - ok = false; + var ok = false; } switch (this.rule) { case 1: @@ -175,7 +175,7 @@ function EXTRACTBITS() { } else if ((this.Datatype==5||this.Datatype==8)) { if (or(this.bit.slice()>7)||or(this.bit.slice()<0)) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Number of Bits or Index of Bit",bitstr),msprintf("Indexes must be in the interval %s.","[0, 7]")); - ok = false; + var ok = false; } switch (this.rule) { case 1: @@ -221,14 +221,17 @@ function EXTRACTBITS() { } } 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) { - it = this.Datatype; - ot = this.Datatype; - out = [1,1]; - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var it = this.Datatype; + var ot = this.Datatype; + var out = [1,1]; + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/IntegerOp/EXTRACTBITS.pickle b/js/IntegerOp/EXTRACTBITS.pickle index e5bdf3b7..08b5b345 100644 --- a/js/IntegerOp/EXTRACTBITS.pickle +++ b/js/IntegerOp/EXTRACTBITS.pickle @@ -56,62 +56,59 @@ sS'model.sim' p15 S'list' p16 -sS'[this.model,graphics,ok]' -p17 -g7 sS'model.out2' -p18 +p17 g7 sS'in1' -p19 +p18 g9 sS'model.outtyp' -p20 +p19 g7 sS'numb' -p21 +p20 g9 sS'graphics.exprs' -p22 +p21 NsS'bit' -p23 +p22 g7 sS'model.ipar' -p24 +p23 g9 sS'typ' -p25 +p24 g9 sS'bitstr' -p26 +p25 g7 sS'ok' -p27 +p26 S'boolean' -p28 +p27 sS'model.blocktype' -p29 +p28 S'string' -p30 +p29 sS'rule' -p31 +p30 g7 sS'exprs' -p32 +p31 S'matrix' -p33 +p32 sS'gr_i' -p34 +p33 g9 sS'y' -p35 +p34 g9 sS'x' -p36 +p35 g7 sS'model' -p37 +p36 g2 sS'ot' -p38 +p37 Ns.
\ No newline at end of file diff --git a/js/IntegerOp/INTMUL.js b/js/IntegerOp/INTMUL.js index 375723a6..14df9421 100644 --- a/js/IntegerOp/INTMUL.js +++ b/js/IntegerOp/INTMUL.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/INTMUL.sci" */ function INTMUL() { INTMUL.prototype.define = function INTMUL() { - sgn = 0; + var sgn = 0; this.model = scicos_model(); this.model.sim = list(new ScilabString(["matmul_i32"]), new ScilabDouble([4])); this.model.in1 = new ScilabDouble([-1],[-2]); @@ -14,8 +14,8 @@ function INTMUL() { this.model.ipar = new ScilabDouble([sgn]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(3)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(3)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -33,19 +33,19 @@ function INTMUL() { this.Datatype = arguments[0]["Datatype"] 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.np,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","INTMUL")],[" "],["Integer matrix multiplication"],[" "]],[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),"Do on Overflow (0:Nothing, 1:Saturate, 2:Error)"],list("vec",1,"vec",1),exprs); if (!ok) { break; } - it = this.Datatype*ones(1,2); - ot = this.Datatype; + var it = this.Datatype*ones(1,2); + var ot = this.Datatype; 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.Datatype==3) { if (this.np==0) { this.model.sim = list(new ScilabString(["matmul_i32n"]), new ScilabDouble([4])); @@ -96,12 +96,15 @@ function INTMUL() { } } else { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Data Type",ot),msprintf("Must be in the interval %s.","[3, 8]")); - ok = false; + var ok = false; } - 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,it),list(out,ot),[],[]); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { this.model.ipar = new ScilabDouble([this.np]); diff --git a/js/IntegerOp/INTMUL.pickle b/js/IntegerOp/INTMUL.pickle index ab66f1de..2a3298b8 100644 --- a/js/IntegerOp/INTMUL.pickle +++ b/js/IntegerOp/INTMUL.pickle @@ -55,54 +55,51 @@ sS'model.sim' p17 S'list' p18 -sS'[this.model,graphics,ok]' -p19 -g10 sS'model.out2' -p20 +p19 g10 sS'in1' -p21 +p20 g8 sS'model.rpar' -p22 +p21 g8 sS'model.outtyp' -p23 +p22 g10 sS'graphics.exprs' -p24 +p23 NsS'model.ipar' -p25 +p24 g10 sS'typ' -p26 +p25 g8 sS'ok' -p27 +p26 S'boolean' -p28 +p27 sS'model.blocktype' -p29 +p28 g5 sS'model.dep_ut' -p30 +p29 g8 sS'exprs' -p31 +p30 g14 sS'gr_i' -p32 +p31 g8 sS'y' -p33 +p32 g8 sS'x' -p34 +p33 g10 sS'model' -p35 +p34 g2 sS'ot' -p36 +p35 Ns.
\ No newline at end of file diff --git a/js/IntegerOp/JKFLIPFLOP.js b/js/IntegerOp/JKFLIPFLOP.js index 6fbf4a6a..79853489 100644 --- a/js/IntegerOp/JKFLIPFLOP.js +++ b/js/IntegerOp/JKFLIPFLOP.js @@ -1,9 +1,9 @@ /* autogenerated from "macros/IntegerOp/JKFLIPFLOP.sci" */ function JKFLIPFLOP() { JKFLIPFLOP.prototype.define = function JKFLIPFLOP() { - scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["JKFLIPFLOP"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=60,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["JKFLIPFLOP"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=60,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m.objs[1-1] = scicos_block(gui="DOLLAR_m",graphics=scicos_graphics(orig=[299.96961,261.584],sz=[40,40],flip=false,theta=0,exprs=[["int8(0)"],["1"]],pin=7,pout=5,pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("dollar4_m",4),in1=1,in2=1,intyp=5,out=1,out2=1,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(int8(0)),rpar=[],ipar=[],opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); - scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["EDGE_TRIGGER","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m_1 = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["EDGE_TRIGGER","./"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=30,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m_1.objs[1-1] = scicos_block(gui="EDGETRIGGER",graphics=scicos_graphics(orig=[288.58631,257.1131],sz=[60,40],flip=true,theta=0,exprs="-1",pin=5,pout=3,pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("edgetrig",4),in1=1,in2=[],intyp=1,out=1,out2=[],outtyp=1,evtin=[],evtout=[],state=[],dstate=0,odstate=list(),rpar=[],ipar=-1,opar=list(),blocktype="c",firing=[],dep_ut=[true,false],label="",nzcross=1,nmode=0,equations=list()),doc=list()); scs_m_1.objs[2-1] = scicos_block(gui="IFTHEL_f",graphics=scicos_graphics(orig=[388.28869,247.1131],sz=[60,60],flip=true,theta=0,exprs=[["0"],["0"]],pin=3,pout=[],pein=[],peout=[[7],[0]],gr_i=[],id="",in_implicit="E",out_implicit=[]),model=scicos_model(sim=list("ifthel",-1),in1=1,in2=[],intyp=1,out=[],out2=1,outtyp=[],evtin=[],evtout=[[1],[1]],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(),blocktype="l",firing=[-1,-1],dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m_1.objs[3-1] = scicos_link(xx=[[357.15774],[362.99107],[379.71726]],yy=[[277.1131],[277.1131],[277.1131]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[2,1,1]); @@ -44,7 +44,7 @@ function JKFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [true,false]; this.model.rpar = new ScilabDouble([scs_m]); - gr_i = []; + var gr_i = []; this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } @@ -60,17 +60,17 @@ function JKFLIPFLOP() { this.init = parseFloat(arguments[0]["init"]) this.exprs0 = arguments[0]["exprs0"] for (i=1;i<=length(arg1.model.rpar.objs);i+=1) { - o = arg1.model.rpar.objs[i-1]; + var o = arg1.model.rpar.objs[i-1]; if (typeof(o)=="Block"&&o.gui=="DOLLAR_m") { - path = i; + var path = i; break; } } - newpar = list(); - xx = arg1.model.rpar.objs[path-1]; - exprs = xx.graphics.exprs[1-1]; + var newpar = list(); + var xx = arg1.model.rpar.objs[path-1]; + var exprs = xx.graphics.exprs[1-1]; this.model = xx.model; - init_old = this.model.odstate[1-1]; + var init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","JKFLIPFLOP")],[" "],["JK flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -89,14 +89,14 @@ function JKFLIPFLOP() { break; } } - needcompile = 0; + var needcompile = 0; if (init_old!=this.init) { newpar[size(newpar)+1-1] = 1; - needcompile = 2; + var needcompile = 2; } this.x = arg1; - y = needcompile; - typ = newpar; + var y = needcompile; + var typ = newpar; return new BasicBlock(this.x); } } diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js index 98689ead..5a517eb8 100644 --- a/js/IntegerOp/LOGIC.js +++ b/js/IntegerOp/LOGIC.js @@ -15,8 +15,8 @@ function LOGIC() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [true,false]; - exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; - gr_i = []; + var exprs = [[sci2exp(this.mat)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,exprs,gr_i); return new BasicBlock(this.x); } @@ -34,33 +34,36 @@ function LOGIC() { this.mat = inverse(arguments[0]["mat"]) this.herit = arguments[0]["herit"] this.x = arg1; - graphics = arg1.graphics; - exprs = graphics.exprs; + var graphics = arg1.graphics; + var exprs = graphics.exprs; this.model = arg1.model; while (true) { [ok,this.mat,this.herit,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","LOGIC")],[" "],["Combinatorial logic"],[" "],[" Rows of the matrix are the output values"],[" Number of rows must be a power of two."],[" Number of columns gives the number of outputs."],[" "]],["Truth Table (matrix of outputs)","Accepts Inherited Events (0:No, 1:Yes)"],list("mat",[-1,-2],"vec",1),exprs); if (!ok) { break; } - nout = size(this.mat,2); - nin = (log(size(this.mat,1))/log(2)); - u1 = floor(nin); + var nout = size(this.mat,2); + var nin = (log(size(this.mat,1))/log(2)); + var u1 = floor(nin); if ((u1!=nin)) { block_parameter_error(msprintf("Wrong size for \'%s\' parameter: %d.","Truth Table",size(this.mat,1)),"Number of rows must be a power of two."); - ok = false; + var ok = false; } else if ((find(this.mat.slice()!=0&&this.mat.slice()!=1)!=[])) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Truth Table"),msprintf("Elements must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } else if (this.herit<0||this.herit>1) { block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Accepts Inherited Events",this.herit),msprintf("Must be in the interval %s.","[0, 1]")); - ok = false; + var ok = false; } if (ok) { - in1 = [ones(nin,1),ones(nin,1)]; - out = [ones(nout,1),ones(nout,1)]; - it = 5*ones(1,nin); - ot = 5*ones(1,nout); - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]); + var in1 = [ones(nin,1),ones(nin,1)]; + var out = [ones(nout,1),ones(nout,1)]; + var it = 5*ones(1,nin); + var ot = 5*ones(1,nout); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { graphics.exprs = exprs; diff --git a/js/IntegerOp/LOGIC.pickle b/js/IntegerOp/LOGIC.pickle index a09fede5..383d01ee 100644 --- a/js/IntegerOp/LOGIC.pickle +++ b/js/IntegerOp/LOGIC.pickle @@ -66,55 +66,52 @@ g5 sS'mat' p22 g12 -sS'[this.model,graphics,ok]' -p23 -g5 sS'model.out2' -p24 +p23 g5 sS'in1' -p25 +p24 g8 sS'model.outtyp' -p26 +p25 g5 sS'graphics.exprs' -p27 +p26 NsS'typ' -p28 +p27 g8 sS'model.opar' -p29 +p28 g20 sS'ok' -p30 +p29 g18 sS'model.blocktype' -p31 +p30 S'string' -p32 +p31 sS'model.dep_ut' -p33 +p32 g8 sS'exprs' -p34 +p33 g12 sS'gr_i' -p35 +p34 g8 sS'y' -p36 +p35 g8 sS'x' -p37 +p36 g5 sS'model' -p38 +p37 g2 sS'ot' -p39 +p38 g5 sS'nout' -p40 +p39 g5 s.
\ No newline at end of file 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]); diff --git a/js/IntegerOp/SHIFT.pickle b/js/IntegerOp/SHIFT.pickle index fe2093d6..0f8af58b 100644 --- a/js/IntegerOp/SHIFT.pickle +++ b/js/IntegerOp/SHIFT.pickle @@ -50,56 +50,53 @@ sS'model.sim' p14 S'list' p15 -sS'[this.model,graphics,ok]' -p16 -g2 sS'model.out2' -p17 +p16 g2 sS'model.intyp' -p18 +p17 g2 sS'model.rpar' -p19 +p18 S'vector' -p20 +p19 sS'model.outtyp' -p21 +p20 g2 sS'graphics.exprs' -p22 +p21 NsS'model.ipar' -p23 +p22 g9 sS'typ' -p24 -g20 +p23 +g19 sS'ok' -p25 +p24 S'boolean' -p26 +p25 sS'model.blocktype' -p27 +p26 S'string' -p28 +p27 sS'model.dep_ut' -p29 -g20 +p28 +g19 sS'exprs' -p30 +p29 g9 sS'gr_i' -p31 -g20 +p30 +g19 sS'y' -p32 -g20 +p31 +g19 sS'x' -p33 +p32 g2 sS'model' -p34 +p33 g4 sS'ot' -p35 +p34 Ns.
\ No newline at end of file diff --git a/js/IntegerOp/SRFLIPFLOP.js b/js/IntegerOp/SRFLIPFLOP.js index 603bf152..3ed06b83 100644 --- a/js/IntegerOp/SRFLIPFLOP.js +++ b/js/IntegerOp/SRFLIPFLOP.js @@ -1,7 +1,7 @@ /* autogenerated from "macros/IntegerOp/SRFLIPFLOP.sci" */ function SRFLIPFLOP() { SRFLIPFLOP.prototype.define = function SRFLIPFLOP() { - scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["SRFLIPFLOP"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=60,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); + var scs_m = scicos_diagram(version="scicos4.2",props=scicos_params(wpar=[600,450,0,0,600,450],Title=["SRFLIPFLOP"],tol=[[0.0001],[0.000001],[1.000e-10],[100001],[0],[0],[0]],tf=60,context=" ",void1=[],options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(true,33),[8,1],[1,5],list([5,1],[4,1]),[0.8,0.8,0.8]),void2=[],void3=[],doc=list())); scs_m.objs[1-1] = scicos_block(gui="LOGIC",graphics=scicos_graphics(orig=[298.504,201.45067],sz=[40,40],flip=true,theta=0,exprs=[["[0 1;1 0;1 0;1 0;0 1;0 1;0 0;0 0]"],["1"]],pin=[[4],[10],[12]],pout=[[3],[8]],pein=[],peout=[],gr_i=[],id="",in_implicit=[["E"],["E"],["E"]],out_implicit=[["E"],["E"]]),model=scicos_model(sim=list("logic",4),in1=[[1],[1],[1]],in2=[[1],[1],[1]],intyp=[[5],[5],[5]],out=[[1],[1]],out2=[[1],[1]],outtyp=[[5],[5]],evtin=[],evtout=[],state=[],dstate=[],odstate=list(),rpar=[],ipar=[],opar=list(int8([[0,1],[1,0],[1,0],[1,0],[0,1],[0,1],[0,0],[0,0]])),blocktype="c",firing=false,dep_ut=[true,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[2-1] = scicos_block(gui="DOLLAR_m",graphics=scicos_graphics(orig=[299.23733,254.25067],sz=[40,40],flip=false,theta=0,exprs=[["int8(0)"],["1"]],pin=6,pout=4,pein=[],peout=[],gr_i=[],id="",in_implicit="E",out_implicit="E"),model=scicos_model(sim=list("dollar4_m",4),in1=1,in2=1,intyp=5,out=1,out2=1,outtyp=5,evtin=[],evtout=[],state=[],dstate=[],odstate=list(int8(0)),rpar=[],ipar=[],opar=list(),blocktype="d",firing=[],dep_ut=[false,false],label="",nzcross=0,nmode=0,equations=list()),doc=list()); scs_m.objs[3-1] = scicos_link(xx=[[347.07543],[363.03733],[363.03733]],yy=[[228.11733],[228.11733],[248.584]],id="drawlink",thick=[0,0],ct=[1,1],from=[1,1,0],to=[5,1,1]); @@ -28,7 +28,7 @@ function SRFLIPFLOP() { this.model.firing = new ScilabBoolean([false]); this.model.dep_ut = [true,false]; this.model.rpar = new ScilabDouble([scs_m]); - gr_i = []; + var gr_i = []; this.x = standard_define([2,3],this.model,[],gr_i); return new BasicBlock(this.x); } @@ -44,17 +44,17 @@ function SRFLIPFLOP() { this.init = parseFloat(arguments[0]["init"]) this.exprs0 = arguments[0]["exprs0"] for (i=1;i<=length(arg1.model.rpar.objs);i+=1) { - o = arg1.model.rpar.objs[i-1]; + var o = arg1.model.rpar.objs[i-1]; if (typeof(o)=="Block"&&o.gui=="DOLLAR_m") { - path = i; + var path = i; break; } } - newpar = list(); - xx = arg1.model.rpar.objs[path-1]; - exprs = xx.graphics.exprs[1-1]; + var newpar = list(); + var xx = arg1.model.rpar.objs[path-1]; + var exprs = xx.graphics.exprs[1-1]; this.model = xx.model; - init_old = this.model.odstate[1-1]; + var init_old = this.model.odstate[1-1]; while (true) { [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","SRFLIPFLOP")],[" "],["SR flip-flop"],[" "],["The \'Initial Value\' must be 0 or 1 of type int8"],[" - Negative values are considered as int8(0)"],[" - Positive values are considered as int8(1)"],[" "]],"Initial Value",list("vec",1),exprs); if (!ok) { @@ -73,14 +73,14 @@ function SRFLIPFLOP() { break; } } - needcompile = 0; + var needcompile = 0; if (init_old!=this.init) { newpar[size(newpar)+1-1] = path; - needcompile = 2; + var needcompile = 2; } this.x = arg1; - y = needcompile; - typ = newpar; + var y = needcompile; + var typ = newpar; return new BasicBlock(this.x); } } |