summaryrefslogtreecommitdiff
path: root/js/IntegerOp
diff options
context:
space:
mode:
Diffstat (limited to 'js/IntegerOp')
-rw-r--r--js/IntegerOp/BITCLEAR.js42
-rw-r--r--js/IntegerOp/BITCLEAR.pickle10
-rw-r--r--js/IntegerOp/BITSET.js42
-rw-r--r--js/IntegerOp/BITSET.pickle10
-rw-r--r--js/IntegerOp/CONVERT.js326
-rw-r--r--js/IntegerOp/CONVERT.pickle12
-rw-r--r--js/IntegerOp/EXTRACTBITS.js94
-rw-r--r--js/IntegerOp/EXTRACTBITS.pickle14
-rw-r--r--js/IntegerOp/INTMUL.js48
-rw-r--r--js/IntegerOp/INTMUL.pickle10
-rw-r--r--js/IntegerOp/JKFLIPFLOP.js16
-rw-r--r--js/IntegerOp/JKFLIPFLOP.pickle8
-rw-r--r--js/IntegerOp/LOGIC.js26
-rw-r--r--js/IntegerOp/LOGIC.pickle8
-rw-r--r--js/IntegerOp/SHIFT.js50
-rw-r--r--js/IntegerOp/SHIFT.pickle12
-rw-r--r--js/IntegerOp/SRFLIPFLOP.js16
-rw-r--r--js/IntegerOp/SRFLIPFLOP.pickle8
18 files changed, 398 insertions, 354 deletions
diff --git a/js/IntegerOp/BITCLEAR.js b/js/IntegerOp/BITCLEAR.js
index 4cb78029..df27bd42 100644
--- a/js/IntegerOp/BITCLEAR.js
+++ b/js/IntegerOp/BITCLEAR.js
@@ -28,51 +28,51 @@ function BITCLEAR() {
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,Datatype,bit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"BITCLEAR")],[" "],[gettext("Clear a bit")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Index of Bit (0 is least significant)")]],list("vec",1,"vec",1),exprs);
+ [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"BITCLEAR")],[" "],[gettext("Clear a bit")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Index of Bit (0 is least significant)")]],list("vec",1,"vec",1),exprs);
if (!ok) {
break;
}
in1 = [model.in1,model.in2];
- if (floor(bit)!=bit) {
- block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter: %5.1f."),gettext("Index of Bit"),bit),gettext("Must be integer."));
+ if (floor(this.bit)!=this.bit) {
+ block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter: %5.1f."),gettext("Index of Bit"),this.bit),gettext("Must be integer."));
ok = false;
- } else if ((Datatype==3)||(Datatype==6)) {
- if (bit>31||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 31]"));
+ } else if ((this.Datatype==3)||(this.Datatype==6)) {
+ if (this.bit>31||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 31]"));
ok = false;
} else {
- bit = uint32(bit);
- n = (2^32-1)-2^bit;
+ this.bit = uint32(this.bit);
+ n = (2^32-1)-2^this.bit;
n = uint32(n);
model.sim = list("bit_clear_32",4);
}
- } else if ((Datatype==4)||(Datatype==7)) {
- if (bit>15||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 15]"));
+ } else if ((this.Datatype==4)||(this.Datatype==7)) {
+ if (this.bit>15||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 15]"));
ok = false;
} else {
- bit = uint16(bit);
- n = (2^16-1)-2^bit;
+ this.bit = uint16(this.bit);
+ n = (2^16-1)-2^this.bit;
n = uint16(n);
model.sim = list("bit_clear_16",4);
}
- } else if ((Datatype==5)||(Datatype==8)) {
- if (bit>7||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 7]"));
+ } else if ((this.Datatype==5)||(this.Datatype==8)) {
+ if (this.bit>7||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 7]"));
ok = false;
} else {
- bit = uint8(bit);
- n = (2^8-1)-2^bit;
+ this.bit = uint8(this.bit);
+ n = (2^8-1)-2^this.bit;
n = uint8(n);
model.sim = list("bit_clear_8",4);
}
} else {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),this.Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
ok = false;
}
if (ok) {
- it = Datatype;
- ot = Datatype;
+ it = this.Datatype;
+ ot = this.Datatype;
out = [1,1];
[model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
diff --git a/js/IntegerOp/BITCLEAR.pickle b/js/IntegerOp/BITCLEAR.pickle
index 0d1dde24..37de0b23 100644
--- a/js/IntegerOp/BITCLEAR.pickle
+++ b/js/IntegerOp/BITCLEAR.pickle
@@ -2,8 +2,12 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'Datatype'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'bit'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js
index 21e6d076..51786a6b 100644
--- a/js/IntegerOp/BITSET.js
+++ b/js/IntegerOp/BITSET.js
@@ -28,49 +28,49 @@ function BITSET() {
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,Datatype,bit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"BITSET")],[" "],[gettext("Set a bit")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Index of Bit (0 is least significant)")]],list("vec",1,"vec",1),exprs);
+ [ok,this.Datatype,this.bit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"BITSET")],[" "],[gettext("Set a bit")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Index of Bit (0 is least significant)")]],list("vec",1,"vec",1),exprs);
if (!ok) {
break;
}
in1 = [model.in1,model.in2];
- if (floor(bit)!=bit) {
- block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter: %5.1f."),gettext("Index of Bit"),bit),gettext("Must be integer."));
+ if (floor(this.bit)!=this.bit) {
+ block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter: %5.1f."),gettext("Index of Bit"),this.bit),gettext("Must be integer."));
ok = false;
}
- if ((Datatype==3)||(Datatype==6)) {
- if (bit>31||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 31]"));
+ if ((this.Datatype==3)||(this.Datatype==6)) {
+ if (this.bit>31||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 31]"));
ok = false;
}
- bit = uint32(bit);
- n = 2^bit;
+ this.bit = uint32(this.bit);
+ n = 2^this.bit;
n = uint32(n);
model.sim = list("bit_set_32",4);
- } else if ((Datatype==4)||(Datatype==7)) {
- if (bit>15||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 15]"));
+ } else if ((this.Datatype==4)||(this.Datatype==7)) {
+ if (this.bit>15||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 15]"));
ok = false;
}
- bit = uint16(bit);
- n = 2^bit;
+ this.bit = uint16(this.bit);
+ n = 2^this.bit;
n = uint16(n);
model.sim = list("bit_set_16",4);
- } else if ((Datatype==5)||(Datatype==8)) {
- if (bit>7||bit<0) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),bit),msprintf(gettext("Must be in the interval %s."),"[0, 7]"));
+ } else if ((this.Datatype==5)||(this.Datatype==8)) {
+ if (this.bit>7||this.bit<0) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Index of Bit"),this.bit),msprintf(gettext("Must be in the interval %s."),"[0, 7]"));
ok = false;
}
- bit = uint8(bit);
- n = 2^bit;
+ this.bit = uint8(this.bit);
+ n = 2^this.bit;
n = uint8(n);
model.sim = list("bit_set_8",4);
} else {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),this.Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
ok = false;
}
if (ok) {
- it = Datatype;
- ot = Datatype;
+ it = this.Datatype;
+ ot = this.Datatype;
out = [1,1];
[model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
diff --git a/js/IntegerOp/BITSET.pickle b/js/IntegerOp/BITSET.pickle
index 0d1dde24..37de0b23 100644
--- a/js/IntegerOp/BITSET.pickle
+++ b/js/IntegerOp/BITSET.pickle
@@ -2,8 +2,12 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'Datatype'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'bit'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js
index cf2d120b..721337bb 100644
--- a/js/IntegerOp/CONVERT.js
+++ b/js/IntegerOp/CONVERT.js
@@ -30,327 +30,327 @@ function CONVERT() {
model = arg1.model;
exprs = graphics.exprs;
while (true) {
- [ok,it,ot,np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CONVERT")],[" "],[gettext("Type conversion")],[" "]],[[gettext("Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)")],[gettext("Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)")],[gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")]],list("vec",1,"vec",1,"vec",1),exprs);
+ [ok,this.it,this.ot,this.np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CONVERT")],[" "],[gettext("Type conversion")],[" "]],[[gettext("Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)")],[gettext("Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)")],[gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")]],list("vec",1,"vec",1,"vec",1),exprs);
if (!ok) {
break;
}
- if (it==2) {
- it = 1;
+ if (this.it==2) {
+ this.it = 1;
}
- if (ot==2) {
- ot = 1;
+ if (this.ot==2) {
+ this.ot = 1;
}
- if ((np!=0&&np!=1&&np!=2)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),np),msprintf(gettext("Must be in the interval %s."),"[0, 2]"));
+ if ((this.np!=0&&this.np!=1&&this.np!=2)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),this.np),msprintf(gettext("Must be in the interval %s."),"[0, 2]"));
ok = false;
- } else if ((it>8||it<1)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Input Type"),it),msprintf(gettext("Must be in the interval %s."),"[1, 8]"));
+ } else if ((this.it>8||this.it<1)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Input Type"),this.it),msprintf(gettext("Must be in the interval %s."),"[1, 8]"));
ok = false;
- } else if ((ot>8||ot<1)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Output Type"),ot),msprintf(gettext("Must be in the interval %s."),"[1, 8]"));
+ } else if ((this.ot>8||this.ot<1)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Output Type"),this.ot),msprintf(gettext("Must be in the interval %s."),"[1, 8]"));
ok = false;
}
model.sim = list("convert",4);
- if ((it==ot)) {
+ if ((this.it==this.ot)) {
model.ipar = 1;
} else {
- if ((np==0)) {
- if ((it==1)) {
- if ((ot==3)) {
+ if ((this.np==0)) {
+ if ((this.it==1)) {
+ if ((this.ot==3)) {
model.ipar = 2;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 3;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 4;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 5;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 6;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 7;
}
- } else if ((it==3)) {
- if ((ot==1)) {
+ } else if ((this.it==3)) {
+ if ((this.ot==1)) {
model.ipar = 8;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 9;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 10;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 1;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 11;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 12;
}
- } else if ((it==4)) {
- if ((ot==1)) {
+ } else if ((this.it==4)) {
+ if ((this.ot==1)) {
model.ipar = 13;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 14;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 15;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 16;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 1;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 17;
}
- } else if ((it==5)) {
- if ((ot==1)) {
+ } else if ((this.it==5)) {
+ if ((this.ot==1)) {
model.ipar = 18;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 19;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 20;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 21;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 22;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 1;
}
- } else if ((it==6)) {
- if ((ot==1)) {
+ } else if ((this.it==6)) {
+ if ((this.ot==1)) {
model.ipar = 23;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 1;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 24;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 25;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 26;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 27;
}
- } else if ((it==7)) {
- if ((ot==1)) {
+ } else if ((this.it==7)) {
+ if ((this.ot==1)) {
model.ipar = 28;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 29;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 1;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 30;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 31;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 32;
}
- } else if ((it==8)) {
- if ((ot==1)) {
+ } else if ((this.it==8)) {
+ if ((this.ot==1)) {
model.ipar = 33;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 34;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 35;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 1;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 36;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 37;
}
}
- } else if ((np==1)) {
- if ((it==1)) {
- if ((ot==3)) {
+ } else if ((this.np==1)) {
+ if ((this.it==1)) {
+ if ((this.ot==3)) {
model.ipar = 38;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 39;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 40;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 41;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 42;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 43;
}
- } else if ((it==3)) {
- if ((ot==1)) {
+ } else if ((this.it==3)) {
+ if ((this.ot==1)) {
model.ipar = 8;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 44;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 45;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 46;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 47;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 48;
}
- } else if ((it==4)) {
- if ((ot==1)) {
+ } else if ((this.it==4)) {
+ if ((this.ot==1)) {
model.ipar = 13;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 14;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 49;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 50;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 51;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 52;
}
- } else if ((it==5)) {
- if ((ot==1)) {
+ } else if ((this.it==5)) {
+ if ((this.ot==1)) {
model.ipar = 18;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 19;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 20;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 53;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 54;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 55;
}
- } else if ((it==6)) {
- if ((ot==1)) {
+ } else if ((this.it==6)) {
+ if ((this.ot==1)) {
model.ipar = 23;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 56;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 57;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 58;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 59;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 60;
}
- } else if ((it==7)) {
- if ((ot==1)) {
+ } else if ((this.it==7)) {
+ if ((this.ot==1)) {
model.ipar = 28;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 29;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 61;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 62;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 31;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 63;
}
- } else if ((it==8)) {
- if ((ot==1)) {
+ } else if ((this.it==8)) {
+ if ((this.ot==1)) {
model.ipar = 33;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 34;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 35;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 64;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 36;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 37;
}
}
- } else if ((np==2)) {
- if ((it==1)) {
- if ((ot==3)) {
+ } else if ((this.np==2)) {
+ if ((this.it==1)) {
+ if ((this.ot==3)) {
model.ipar = 65;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 66;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 67;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 68;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 69;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 70;
}
- } else if ((it==3)) {
- if ((ot==1)) {
+ } else if ((this.it==3)) {
+ if ((this.ot==1)) {
model.ipar = 8;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 71;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 72;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 73;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 74;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 75;
}
- } else if ((it==4)) {
- if ((ot==1)) {
+ } else if ((this.it==4)) {
+ if ((this.ot==1)) {
model.ipar = 13;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 14;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 76;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 77;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 78;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 79;
}
- } else if ((it==5)) {
- if ((ot==1)) {
+ } else if ((this.it==5)) {
+ if ((this.ot==1)) {
model.ipar = 18;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 19;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 20;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 80;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 81;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 82;
}
- } else if ((it==6)) {
- if ((ot==1)) {
+ } else if ((this.it==6)) {
+ if ((this.ot==1)) {
model.ipar = 23;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 83;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 84;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 85;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 86;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 87;
}
- } else if ((it==7)) {
- if ((ot==1)) {
+ } else if ((this.it==7)) {
+ if ((this.ot==1)) {
model.ipar = 28;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 29;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 88;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 89;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 31;
- } else if ((ot==8)) {
+ } else if ((this.ot==8)) {
model.ipar = 90;
}
- } else if ((it==8)) {
- if ((ot==1)) {
+ } else if ((this.it==8)) {
+ if ((this.ot==1)) {
model.ipar = 33;
- } else if ((ot==3)) {
+ } else if ((this.ot==3)) {
model.ipar = 34;
- } else if ((ot==4)) {
+ } else if ((this.ot==4)) {
model.ipar = 35;
- } else if ((ot==5)) {
+ } else if ((this.ot==5)) {
model.ipar = 91;
- } else if ((ot==6)) {
+ } else if ((this.ot==6)) {
model.ipar = 36;
- } else if ((ot==7)) {
+ } else if ((this.ot==7)) {
model.ipar = 37;
}
}
@@ -359,7 +359,7 @@ function CONVERT() {
in1 = [model.in1,model.in2];
out = [model.out,model.out2];
if (ok) {
- [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+ [model,graphics,ok] = set_io(model,graphics,list(in1,this.it),list(out,this.ot),[],[]);
}
if (ok) {
graphics.exprs = exprs;
diff --git a/js/IntegerOp/CONVERT.pickle b/js/IntegerOp/CONVERT.pickle
index 0d1dde24..3b00c670 100644
--- a/js/IntegerOp/CONVERT.pickle
+++ b/js/IntegerOp/CONVERT.pickle
@@ -2,8 +2,14 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'np'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'ot'
+p4
+aS'it'
+p5
+atp6
+Rp7
. \ No newline at end of file
diff --git a/js/IntegerOp/EXTRACTBITS.js b/js/IntegerOp/EXTRACTBITS.js
index 8f376b2d..25db739c 100644
--- a/js/IntegerOp/EXTRACTBITS.js
+++ b/js/IntegerOp/EXTRACTBITS.js
@@ -29,56 +29,56 @@ function EXTRACTBITS() {
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,Datatype,rule,bit,scal,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"EXTRACTBITS")],[" "],[gettext("Bits Extraction")],[" "],[gettext("&nbsp;- Bits to Extract:")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;1 Upper Half")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;2 Lower Half")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;3 Range from MSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;4 Range to LSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;5 Range of Bits")],[gettext("&nbsp;- Number of Bits or Index of bit : Index 0 is LSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Bits to extract")],[gettext("Number of Bits or Index of Bit")],[gettext("Treat Bit Field as an Integer (0:No, 1:Yes)")]],list("vec",1,"vec",1,"vec",-1,"vec",1),exprs);
+ [ok,this.Datatype,this.rule,this.bit,this.scal,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"EXTRACTBITS")],[" "],[gettext("Bits Extraction")],[" "],[gettext("&nbsp;- Bits to Extract:")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;1 Upper Half")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;2 Lower Half")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;3 Range from MSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;4 Range to LSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;5 Range of Bits")],[gettext("&nbsp;- Number of Bits or Index of bit : Index 0 is LSB")],[gettext("&nbsp;&nbsp;&nbsp;&nbsp;If \'Bits to Extract\' is set to \'Range of bits\': [Start, End]")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Bits to extract")],[gettext("Number of Bits or Index of Bit")],[gettext("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(bit.slice())," ");
- if ((rule<1)||(rule>5)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Bits to Extract"),rule),msprintf(gettext("Must be in the interval %s."),"[1, 5]"));
+ bitstr = strcat(string(this.bit.slice())," ");
+ if ((this.rule<1)||(this.rule>5)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Bits to Extract"),this.rule),msprintf(gettext("Must be in the interval %s."),"[1, 5]"));
ok = false;
- } else if (scal<0||scal>1) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Treat Bit Field as an Integer"),scal),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
+ } else if (this.scal<0||this.scal>1) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Treat Bit Field as an Integer"),this.scal),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
ok = false;
} else {
in1 = [model.in1,model.in2];
- bit = int(bit);
- rule = int(rule);
- if ((rule==3)||(rule==4)) {
- if ((size(bit,"*")!=1)) {
+ 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(gettext("Wrong size for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),gettext("Must be a single value."));
ok = false;
} else {
- numb = bit;
+ numb = this.bit;
}
- } else if ((rule==5)) {
- if ((size(bit,"*")!=2)) {
+ } else if ((this.rule==5)) {
+ if ((size(this.bit,"*")!=2)) {
block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),gettext("Must have this form: [Start, End]."));
ok = false;
- } else if (bit[1-1]>bit[2-1]) {
+ } else if (this.bit[1-1]>this.bit[2-1]) {
block_parameter_error(msprintf(gettext("Wrong values for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),msprintf(gettext("\'Start\' must be less than \'End\'.")));
ok = false;
} else {
- numb = bit[2-1]-bit[1-1];
+ numb = this.bit[2-1]-this.bit[1-1];
}
} else {
- bit = 0;
+ this.bit = 0;
numb = [];
}
}
if (ok) {
- if ((Datatype==3||Datatype==6)) {
- if (or(bit.slice()>31)||or(bit.slice()<0)) {
+ if ((this.Datatype==3||this.Datatype==6)) {
+ if (or(this.bit.slice()>31)||or(this.bit.slice()<0)) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),msprintf(gettext("Indexes must be in the interval %s."),"[0, 31]"));
ok = false;
}
- switch (rule) {
+ switch (this.rule) {
case 1:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_32_UH0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 3:
model.sim = list("extract_bit_32_UH1",4);
case 6:
@@ -88,11 +88,11 @@ function EXTRACTBITS() {
case 2:
model.sim = list("extract_bit_32_LH",4);
case 3:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_32_MSB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 3:
model.sim = list("extract_bit_32_MSB1",4);
case 6:
@@ -102,11 +102,11 @@ function EXTRACTBITS() {
case 4:
model.sim = list("extract_bit_32_LSB",4);
case 5:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_32_RB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 3:
model.sim = list("extract_bit_32_RB1",4);
case 6:
@@ -114,18 +114,18 @@ function EXTRACTBITS() {
}
}
}
- } else if ((Datatype==4||Datatype==7)) {
- if (or(bit.slice()>15)||or(bit.slice()<0)) {
+ } else if ((this.Datatype==4||this.Datatype==7)) {
+ if (or(this.bit.slice()>15)||or(this.bit.slice()<0)) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),msprintf(gettext("Indexes must be in the interval %s."),"[0, 15]"));
ok = false;
}
- switch (rule) {
+ switch (this.rule) {
case 1:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_16_UH0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 4:
model.sim = list("extract_bit_16_UH1",4);
case 7:
@@ -135,11 +135,11 @@ function EXTRACTBITS() {
case 2:
model.sim = list("extract_bit_16_LH",4);
case 3:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_16_MSB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 4:
model.sim = list("extract_bit_16_MSB1",4);
case 7:
@@ -149,11 +149,11 @@ function EXTRACTBITS() {
case 4:
model.sim = list("extract_bit_16_LSB",4);
case 5:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_16_RB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 4:
model.sim = list("extract_bit_16_RB1",4);
case 7:
@@ -161,18 +161,18 @@ function EXTRACTBITS() {
}
}
}
- } else if ((Datatype==5||Datatype==8)) {
- if (or(bit.slice()>7)||or(bit.slice()<0)) {
+ } else if ((this.Datatype==5||this.Datatype==8)) {
+ if (or(this.bit.slice()>7)||or(this.bit.slice()<0)) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Number of Bits or Index of Bit"),bitstr),msprintf(gettext("Indexes must be in the interval %s."),"[0, 7]"));
ok = false;
}
- switch (rule) {
+ switch (this.rule) {
case 1:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_8_UH0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 5:
model.sim = list("extract_bit_8_UH1",4);
case 8:
@@ -182,11 +182,11 @@ function EXTRACTBITS() {
case 2:
model.sim = list("extract_bit_8_LH",4);
case 3:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_8_MSB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 5:
model.sim = list("extract_bit_8_MSB1",4);
case 8:
@@ -196,11 +196,11 @@ function EXTRACTBITS() {
case 4:
model.sim = list("extract_bit_8_LSB",4);
case 5:
- switch (scal) {
+ switch (this.scal) {
case 0:
model.sim = list("extract_bit_8_RB0",4);
case 1:
- switch (Datatype) {
+ switch (this.Datatype) {
case 5:
model.sim = list("extract_bit_8_RB1",4);
case 8:
@@ -209,19 +209,19 @@ function EXTRACTBITS() {
}
}
} else {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),this.Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
ok = false;
}
}
if (ok) {
- it = Datatype;
- ot = Datatype;
+ it = this.Datatype;
+ ot = this.Datatype;
out = [1,1];
[model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
if (ok) {
graphics.exprs = exprs;
- model.ipar = [[int(bit.slice())],[int(numb.slice())]];
+ model.ipar = [[int(this.bit.slice())],[int(numb.slice())]];
this.x.graphics = graphics;
this.x.model = model;
break;
diff --git a/js/IntegerOp/EXTRACTBITS.pickle b/js/IntegerOp/EXTRACTBITS.pickle
index 0d1dde24..38656d03 100644
--- a/js/IntegerOp/EXTRACTBITS.pickle
+++ b/js/IntegerOp/EXTRACTBITS.pickle
@@ -2,8 +2,16 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'Datatype'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'bit'
+p4
+aS'scal'
+p5
+aS'rule'
+p6
+atp7
+Rp8
. \ No newline at end of file
diff --git a/js/IntegerOp/INTMUL.js b/js/IntegerOp/INTMUL.js
index c67e5c5e..9ce9fb1b 100644
--- a/js/IntegerOp/INTMUL.js
+++ b/js/IntegerOp/INTMUL.js
@@ -30,59 +30,59 @@ function INTMUL() {
model = arg1.model;
exprs = graphics.exprs;
while (true) {
- [ok,Datatype,np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"INTMUL")],[" "],[gettext("Integer matrix multiplication")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")]],list("vec",1,"vec",1),exprs);
+ [ok,this.Datatype,this.np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"INTMUL")],[" "],[gettext("Integer matrix multiplication")],[" "]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Do on Overflow (0:Nothing, 1:Saturate, 2:Error)")]],list("vec",1,"vec",1),exprs);
if (!ok) {
break;
}
- it = Datatype*ones(1,2);
- ot = Datatype;
- if ((np!=0&&np!=1&&np!=2)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),np),msprintf(gettext("Must be in the interval %s."),"[0, 2]"));
+ it = this.Datatype*ones(1,2);
+ ot = this.Datatype;
+ if ((this.np!=0&&this.np!=1&&this.np!=2)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Do on Overflow"),this.np),msprintf(gettext("Must be in the interval %s."),"[0, 2]"));
ok = false;
- } else if (Datatype==3) {
- if (np==0) {
+ } else if (this.Datatype==3) {
+ if (this.np==0) {
model.sim = list("matmul_i32n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_i32s",4);
} else {
model.sim = list("matmul_i32e",4);
}
- } else if (Datatype==4) {
- if (np==0) {
+ } else if (this.Datatype==4) {
+ if (this.np==0) {
model.sim = list("matmul_i16n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_i16s",4);
} else {
model.sim = list("matmul_i16e",4);
}
- } else if (Datatype==5) {
- if (np==0) {
+ } else if (this.Datatype==5) {
+ if (this.np==0) {
model.sim = list("matmul_i8n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_i8s",4);
} else {
model.sim = list("matmul_i8e",4);
}
- } else if (Datatype==6) {
- if (np==0) {
+ } else if (this.Datatype==6) {
+ if (this.np==0) {
model.sim = list("matmul_ui32n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_ui32s",4);
} else {
model.sim = list("matmul_ui32e",4);
}
- } else if (Datatype==7) {
- if (np==0) {
+ } else if (this.Datatype==7) {
+ if (this.np==0) {
model.sim = list("matmul_ui16n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_ui16s",4);
} else {
model.sim = list("matmul_ui16e",4);
}
- } else if (Datatype==8) {
- if (np==0) {
+ } else if (this.Datatype==8) {
+ if (this.np==0) {
model.sim = list("matmul_ui8n",4);
- } else if (np==1) {
+ } else if (this.np==1) {
model.sim = list("matmul_ui8s",4);
} else {
model.sim = list("matmul_ui8e",4);
@@ -97,7 +97,7 @@ function INTMUL() {
[model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
}
if (ok) {
- model.ipar = np;
+ model.ipar = this.np;
graphics.exprs = exprs;
this.x.graphics = graphics;
this.x.model = model;
diff --git a/js/IntegerOp/INTMUL.pickle b/js/IntegerOp/INTMUL.pickle
index 0d1dde24..a107a003 100644
--- a/js/IntegerOp/INTMUL.pickle
+++ b/js/IntegerOp/INTMUL.pickle
@@ -2,8 +2,12 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'Datatype'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'np'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/IntegerOp/JKFLIPFLOP.js b/js/IntegerOp/JKFLIPFLOP.js
index 17aa3c0d..fcada59b 100644
--- a/js/IntegerOp/JKFLIPFLOP.js
+++ b/js/IntegerOp/JKFLIPFLOP.js
@@ -67,25 +67,25 @@ function JKFLIPFLOP() {
model = xx.model;
init_old = model.odstate[1-1];
while (true) {
- [ok,init,exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"JKFLIPFLOP")],[" "],[gettext("JK flip-flop")],[" "],[gettext("The \'Initial Value\' must be 0 or 1 of type int8")],[gettext("&nbsp;- Negative values are considered as int8(0)")],[gettext("&nbsp;- Positive values are considered as int8(1)")],[" "]],gettext("Initial Value"),list("vec",1),exprs);
+ [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"JKFLIPFLOP")],[" "],[gettext("JK flip-flop")],[" "],[gettext("The \'Initial Value\' must be 0 or 1 of type int8")],[gettext("&nbsp;- Negative values are considered as int8(0)")],[gettext("&nbsp;- Positive values are considered as int8(1)")],[" "]],gettext("Initial Value"),list("vec",1),exprs);
if (!ok) {
break;
}
- if (init<=0) {
- init = int8(0);
- } else if (init>0) {
- init = int8(1);
+ if (this.init<=0) {
+ this.init = int8(0);
+ } else if (this.init>0) {
+ this.init = int8(1);
}
if (ok) {
- xx.graphics.exprs[1-1] = exprs0;
- model.odstate[1-1] = init;
+ xx.graphics.exprs[1-1] = this.exprs0;
+ model.odstate[1-1] = this.init;
xx.model = model;
arg1.model.rpar.objs[path-1] = xx;
break;
}
}
needcompile = 0;
- if (init_old!=init) {
+ if (init_old!=this.init) {
newpar[size(newpar)+1-1] = 1;
needcompile = 2;
}
diff --git a/js/IntegerOp/JKFLIPFLOP.pickle b/js/IntegerOp/JKFLIPFLOP.pickle
index 0d1dde24..61b3190c 100644
--- a/js/IntegerOp/JKFLIPFLOP.pickle
+++ b/js/IntegerOp/JKFLIPFLOP.pickle
@@ -4,6 +4,10 @@ p0
((lp1
S'x'
p2
-atp3
-Rp4
+aS'init'
+p3
+aS'exprs0'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js
index 3a4dceef..dc3d15e3 100644
--- a/js/IntegerOp/LOGIC.js
+++ b/js/IntegerOp/LOGIC.js
@@ -1,7 +1,7 @@
/* autogenerated from "macros/IntegerOp/LOGIC.sci" */
function LOGIC() {
LOGIC.prototype.define = function LOGIC() {
- mat = [[0],[0],[0],[1]];
+ this.mat = [[0],[0],[0],[1]];
model = scicos_model();
model.sim = list("logic",4);
model.in1 = [[1],[1]];
@@ -11,11 +11,11 @@ function LOGIC() {
model.evtin = 1;
model.intyp = [5,5];
model.outtyp = 5;
- model.opar = list(int8(mat));
+ model.opar = list(int8(this.mat));
model.blocktype = "c";
model.firing = false;
model.dep_ut = [true,false];
- exprs = [[sci2exp(mat)],[sci2exp(0)]];
+ exprs = [[sci2exp(this.mat)],[sci2exp(0)]];
gr_i = [];
this.x = standard_define([2,2],model,exprs,gr_i);
return new BasicBlock(this.x);
@@ -31,21 +31,21 @@ function LOGIC() {
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,mat,herit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"LOGIC")],[" "],[gettext("Combinatorial logic")],[" "],[gettext("&nbsp; Rows of the matrix are the output values")],[gettext("&nbsp; Number of rows must be a power of two.")],[gettext("&nbsp; Number of columns gives the number of outputs.")],[" "]],[[gettext("Truth Table (matrix of outputs)")],[gettext("Accepts Inherited Events (0:No, 1:Yes)")]],list("mat",[-1,-2],"vec",1),exprs);
+ [ok,this.mat,this.herit,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"LOGIC")],[" "],[gettext("Combinatorial logic")],[" "],[gettext("&nbsp; Rows of the matrix are the output values")],[gettext("&nbsp; Number of rows must be a power of two.")],[gettext("&nbsp; Number of columns gives the number of outputs.")],[" "]],[[gettext("Truth Table (matrix of outputs)")],[gettext("Accepts Inherited Events (0:No, 1:Yes)")]],list("mat",[-1,-2],"vec",1),exprs);
if (!ok) {
break;
}
- nout = size(mat,2);
- nin = (log(size(mat,1))/log(2));
+ nout = size(this.mat,2);
+ nin = (log(size(this.mat,1))/log(2));
u1 = floor(nin);
if ((u1!=nin)) {
- block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter: %d."),gettext("Truth Table"),size(mat,1)),gettext("Number of rows must be a power of two."));
+ block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter: %d."),gettext("Truth Table"),size(this.mat,1)),gettext("Number of rows must be a power of two."));
ok = false;
- } else if ((find(mat.slice()!=0&&mat.slice()!=1)!=[])) {
+ } else if ((find(this.mat.slice()!=0&&this.mat.slice()!=1)!=[])) {
block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Truth Table")),msprintf(gettext("Elements must be in the interval %s."),"[0, 1]"));
ok = false;
- } else if (herit<0||herit>1) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Accepts Inherited Events"),herit),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
+ } else if (this.herit<0||this.herit>1) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Accepts Inherited Events"),this.herit),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
ok = false;
}
if (ok) {
@@ -53,12 +53,12 @@ function LOGIC() {
out = [ones(nout,1),ones(nout,1)];
it = 5*ones(1,nin);
ot = 5*ones(1,nout);
- [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-herit,1),[]);
+ [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),ones(1-this.herit,1),[]);
}
if (ok) {
graphics.exprs = exprs;
- mat = int8(mat);
- model.opar = list(mat);
+ this.mat = int8(this.mat);
+ model.opar = list(this.mat);
this.x.graphics = graphics;
this.x.model = model;
break;
diff --git a/js/IntegerOp/LOGIC.pickle b/js/IntegerOp/LOGIC.pickle
index 0d1dde24..f96c5749 100644
--- a/js/IntegerOp/LOGIC.pickle
+++ b/js/IntegerOp/LOGIC.pickle
@@ -4,6 +4,10 @@ p0
((lp1
S'x'
p2
-atp3
-Rp4
+aS'herit'
+p3
+aS'mat'
+p4
+atp5
+Rp6
. \ No newline at end of file
diff --git a/js/IntegerOp/SHIFT.js b/js/IntegerOp/SHIFT.js
index d1360f21..21e5e04e 100644
--- a/js/IntegerOp/SHIFT.js
+++ b/js/IntegerOp/SHIFT.js
@@ -31,28 +31,28 @@ function SHIFT() {
model = arg1.model;
exprs = graphics.exprs;
while (true) {
- [ok,Datatype,nb,np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"SHIFT")],[" "],[gettext("Shift/Rotates bits")]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Number of Bits to Shift Left (Negative number to shift right)")],[gettext("Shift Type (0:Arithmetic, 1:Circular)")]],list("vec",1,"vec",1,"vec",1),exprs);
+ [ok,this.Datatype,this.nb,this.np,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"SHIFT")],[" "],[gettext("Shift/Rotates bits")]],[[msprintf(gettext("Data Type %s"),"(3:int32, 4:int16, 5:int8, ...)")],[gettext("Number of Bits to Shift Left (Negative number to shift right)")],[gettext("Shift Type (0:Arithmetic, 1:Circular)")]],list("vec",1,"vec",1,"vec",1),exprs);
if (!ok) {
break;
}
- if ((np!=0&&np!=1)) {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Shift Type"),np),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
+ if ((this.np!=0&&this.np!=1)) {
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Shift Type"),this.np),msprintf(gettext("Must be in the interval %s."),"[0, 1]"));
ok = false;
}
- it = Datatype;
- ot = Datatype;
- if ((Datatype==3||Datatype==6)) {
- if (nb>0) {
- switch (np) {
+ it = this.Datatype;
+ ot = this.Datatype;
+ if ((this.Datatype==3||this.Datatype==6)) {
+ if (this.nb>0) {
+ switch (this.np) {
case 0:
model.sim = list("shift_32_LA",4);
case 1:
model.sim = list("shift_32_LC",4);
}
- } else if (nb<0) {
- switch (np) {
+ } else if (this.nb<0) {
+ switch (this.np) {
case 0:
- switch (Datatype) {
+ switch (this.Datatype) {
case 3:
model.sim = list("shift_32_RA",4);
case 6:
@@ -62,18 +62,18 @@ function SHIFT() {
model.sim = list("shift_32_RC",4);
}
}
- } else if ((Datatype==4||Datatype==7)) {
- if (nb>0) {
- switch (np) {
+ } else if ((this.Datatype==4||this.Datatype==7)) {
+ if (this.nb>0) {
+ switch (this.np) {
case 0:
model.sim = list("shift_16_LA",4);
case 1:
model.sim = list("shift_16_LC",4);
}
- } else if (nb<0) {
- switch (np) {
+ } else if (this.nb<0) {
+ switch (this.np) {
case 0:
- switch (Datatype) {
+ switch (this.Datatype) {
case 4:
model.sim = list("shift_16_RA",4);
case 7:
@@ -83,18 +83,18 @@ function SHIFT() {
model.sim = list("shift_16_RC",4);
}
}
- } else if ((Datatype==5||Datatype==8)) {
- if (nb>0) {
- switch (np) {
+ } else if ((this.Datatype==5||this.Datatype==8)) {
+ if (this.nb>0) {
+ switch (this.np) {
case 0:
model.sim = list("shift_8_LA",4);
case 1:
model.sim = list("shift_8_LC",4);
}
- } else if (nb<0) {
- switch (np) {
+ } else if (this.nb<0) {
+ switch (this.np) {
case 0:
- switch (Datatype) {
+ switch (this.Datatype) {
case 5:
model.sim = list("shift_8_RA",4);
case 8:
@@ -105,14 +105,14 @@ function SHIFT() {
}
}
} else {
- block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
+ block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Data Type"),this.Datatype),msprintf(gettext("Must be in the interval %s."),"[3, 8]"));
ok = false;
}
if (ok) {
[model,graphics,ok] = set_io(model,graphics,list([-1,-2],it),list([-1,-2],ot),[],[]);
}
if (ok) {
- model.ipar = nb;
+ model.ipar = this.nb;
graphics.exprs = exprs;
this.x.graphics = graphics;
this.x.model = model;
diff --git a/js/IntegerOp/SHIFT.pickle b/js/IntegerOp/SHIFT.pickle
index 0d1dde24..9529207d 100644
--- a/js/IntegerOp/SHIFT.pickle
+++ b/js/IntegerOp/SHIFT.pickle
@@ -2,8 +2,14 @@ c__builtin__
set
p0
((lp1
-S'x'
+S'Datatype'
p2
-atp3
-Rp4
+aS'x'
+p3
+aS'nb'
+p4
+aS'np'
+p5
+atp6
+Rp7
. \ No newline at end of file
diff --git a/js/IntegerOp/SRFLIPFLOP.js b/js/IntegerOp/SRFLIPFLOP.js
index eb57ffe8..3ae36928 100644
--- a/js/IntegerOp/SRFLIPFLOP.js
+++ b/js/IntegerOp/SRFLIPFLOP.js
@@ -51,25 +51,25 @@ function SRFLIPFLOP() {
model = xx.model;
init_old = model.odstate[1-1];
while (true) {
- [ok,init,exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"SRFLIPFLOP")],[" "],[gettext("SR flip-flop")],[" "],[gettext("The \'Initial Value\' must be 0 or 1 of type int8")],[gettext("&nbsp;- Negative values are considered as int8(0)")],[gettext("&nbsp;- Positive values are considered as int8(1)")],[" "]],gettext("Initial Value"),list("vec",1),exprs);
+ [ok,this.init,this.exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"SRFLIPFLOP")],[" "],[gettext("SR flip-flop")],[" "],[gettext("The \'Initial Value\' must be 0 or 1 of type int8")],[gettext("&nbsp;- Negative values are considered as int8(0)")],[gettext("&nbsp;- Positive values are considered as int8(1)")],[" "]],gettext("Initial Value"),list("vec",1),exprs);
if (!ok) {
break;
}
- if (init<=0) {
- init = int8(0);
- } else if (init>0) {
- init = int8(1);
+ if (this.init<=0) {
+ this.init = int8(0);
+ } else if (this.init>0) {
+ this.init = int8(1);
}
if (ok) {
- xx.graphics.exprs[1-1] = exprs0;
- model.odstate[1-1] = init;
+ xx.graphics.exprs[1-1] = this.exprs0;
+ model.odstate[1-1] = this.init;
xx.model = model;
arg1.model.rpar.objs[path-1] = xx;
break;
}
}
needcompile = 0;
- if (init_old!=init) {
+ if (init_old!=this.init) {
newpar[size(newpar)+1-1] = path;
needcompile = 2;
}
diff --git a/js/IntegerOp/SRFLIPFLOP.pickle b/js/IntegerOp/SRFLIPFLOP.pickle
index 0d1dde24..61b3190c 100644
--- a/js/IntegerOp/SRFLIPFLOP.pickle
+++ b/js/IntegerOp/SRFLIPFLOP.pickle
@@ -4,6 +4,10 @@ p0
((lp1
S'x'
p2
-atp3
-Rp4
+aS'init'
+p3
+aS'exprs0'
+p4
+atp5
+Rp6
. \ No newline at end of file