diff options
author | Sunil Shetye | 2018-08-29 10:48:12 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-08-29 18:03:04 +0530 |
commit | 352623792d2b9400510599c487540b1e763a7d3c (patch) | |
tree | 7711522f3fcd42a9d5f22b9fa3328763452a6918 /js/IntegerOp | |
parent | 17a1beeeae647a6fbd0904a5d794ce7754df7eb2 (diff) | |
download | sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.gz sci2js-352623792d2b9400510599c487540b1e763a7d3c.tar.bz2 sci2js-352623792d2b9400510599c487540b1e763a7d3c.zip |
add the common code to get method also
type is a function
get the popup title from the value set in the get method
Diffstat (limited to 'js/IntegerOp')
-rw-r--r-- | js/IntegerOp/BITCLEAR.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/BITSET.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/CONVERT.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/DFLIPFLOP.js | 3 | ||||
-rw-r--r-- | js/IntegerOp/DLATCH.js | 3 | ||||
-rw-r--r-- | js/IntegerOp/EXTRACTBITS.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/INTMUL.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/JKFLIPFLOP.js | 13 | ||||
-rw-r--r-- | js/IntegerOp/LOGIC.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/SHIFT.js | 5 | ||||
-rw-r--r-- | js/IntegerOp/SRFLIPFLOP.js | 13 |
11 files changed, 45 insertions, 22 deletions
diff --git a/js/IntegerOp/BITCLEAR.js b/js/IntegerOp/BITCLEAR.js index 8fda742f..a22a133c 100644 --- a/js/IntegerOp/BITCLEAR.js +++ b/js/IntegerOp/BITCLEAR.js @@ -21,6 +21,8 @@ function BITCLEAR() { return this.x; } BITCLEAR.prototype.get = function BITCLEAR() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","BITCLEAR"); var options = { Datatype:[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),this.Datatype], bit:["Index of Bit (0 is least significant)",this.bit], @@ -95,7 +97,6 @@ function BITCLEAR() { return new BasicBlock(this.x); } BITCLEAR.prototype.get_popup_title = function BITCLEAR() { - var set_param_popup_title = msprintf("Set %s block parameters","BITCLEAR"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/BITSET.js b/js/IntegerOp/BITSET.js index 28274e36..46a5273b 100644 --- a/js/IntegerOp/BITSET.js +++ b/js/IntegerOp/BITSET.js @@ -21,6 +21,8 @@ function BITSET() { return this.x; } BITSET.prototype.get = function BITSET() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","BITSET"); var options = { Datatype:[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),this.Datatype], bit:["Index of Bit (0 is least significant)",this.bit], @@ -93,7 +95,6 @@ function BITSET() { return new BasicBlock(this.x); } BITSET.prototype.get_popup_title = function BITSET() { - var set_param_popup_title = msprintf("Set %s block parameters","BITSET"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/CONVERT.js b/js/IntegerOp/CONVERT.js index 7fc0d844..be253a0c 100644 --- a/js/IntegerOp/CONVERT.js +++ b/js/IntegerOp/CONVERT.js @@ -23,6 +23,8 @@ function CONVERT() { return this.x; } CONVERT.prototype.get = function CONVERT() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","CONVERT"); var options = { it:["Input Type (1:double, 3:int32, 4:int16, 5:int8, ...)",this.it], ot:["Output Type (1:double, 3:int32, 4:int16, 5:int8, ...)",this.ot], @@ -381,7 +383,6 @@ function CONVERT() { return new BasicBlock(this.x); } CONVERT.prototype.get_popup_title = function CONVERT() { - var set_param_popup_title = msprintf("Set %s block parameters","CONVERT"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/DFLIPFLOP.js b/js/IntegerOp/DFLIPFLOP.js index 1c17a98f..e73cbdff 100644 --- a/js/IntegerOp/DFLIPFLOP.js +++ b/js/IntegerOp/DFLIPFLOP.js @@ -102,7 +102,6 @@ function DFLIPFLOP() { return new BasicBlock(this.x); } DFLIPFLOP.prototype.get_popup_title = function DFLIPFLOP() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/IntegerOp/DLATCH.js b/js/IntegerOp/DLATCH.js index 10a1b68a..3db5ca98 100644 --- a/js/IntegerOp/DLATCH.js +++ b/js/IntegerOp/DLATCH.js @@ -47,7 +47,6 @@ function DLATCH() { return new BasicBlock(this.x); } DLATCH.prototype.get_popup_title = function DLATCH() { - var set_param_popup_title = "Set parameters"; - return set_param_popup_title; + return; } } diff --git a/js/IntegerOp/EXTRACTBITS.js b/js/IntegerOp/EXTRACTBITS.js index c9733c28..805f0e68 100644 --- a/js/IntegerOp/EXTRACTBITS.js +++ b/js/IntegerOp/EXTRACTBITS.js @@ -22,6 +22,8 @@ function EXTRACTBITS() { return this.x; } EXTRACTBITS.prototype.get = function EXTRACTBITS() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","EXTRACTBITS"); var options = { Datatype:[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),this.Datatype], rule:["Bits to extract",this.rule], @@ -242,7 +244,6 @@ function EXTRACTBITS() { return new BasicBlock(this.x); } EXTRACTBITS.prototype.get_popup_title = function EXTRACTBITS() { - var set_param_popup_title = msprintf("Set %s block parameters","EXTRACTBITS"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/INTMUL.js b/js/IntegerOp/INTMUL.js index f525e597..ed5a179e 100644 --- a/js/IntegerOp/INTMUL.js +++ b/js/IntegerOp/INTMUL.js @@ -23,6 +23,8 @@ function INTMUL() { return this.x; } INTMUL.prototype.get = function INTMUL() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","INTMUL"); var options = { Datatype:[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),this.Datatype], np:["Do on Overflow (0:Nothing, 1:Saturate, 2:Error)",this.np], @@ -115,7 +117,6 @@ function INTMUL() { return new BasicBlock(this.x); } INTMUL.prototype.get_popup_title = function INTMUL() { - var set_param_popup_title = msprintf("Set %s block parameters","INTMUL"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/JKFLIPFLOP.js b/js/IntegerOp/JKFLIPFLOP.js index e171bcad..bdeef0a4 100644 --- a/js/IntegerOp/JKFLIPFLOP.js +++ b/js/IntegerOp/JKFLIPFLOP.js @@ -52,6 +52,16 @@ function JKFLIPFLOP() { return this.x; } JKFLIPFLOP.prototype.get = function JKFLIPFLOP() { + if (typeof(o)=="Block"&&o.gui=="DOLLAR_m") { + var path = i; + break; + } + } + var newpar = list(); + var exprs = xx.graphics.exprs[1-1]; + this.model = xx.model; + var init_old = this.model.odstate[1-1]; + this.set_param_popup_title = msprintf("Set %s block parameters","JKFLIPFLOP"); var options = { init:["Initial Value",this.init], } @@ -96,7 +106,6 @@ function JKFLIPFLOP() { return new BasicBlock(this.x); } JKFLIPFLOP.prototype.get_popup_title = function JKFLIPFLOP() { - var set_param_popup_title = msprintf("Set %s block parameters","JKFLIPFLOP"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/LOGIC.js b/js/IntegerOp/LOGIC.js index 6c4b8ac3..8575f03d 100644 --- a/js/IntegerOp/LOGIC.js +++ b/js/IntegerOp/LOGIC.js @@ -24,6 +24,8 @@ function LOGIC() { return this.x; } LOGIC.prototype.get = function LOGIC() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","LOGIC"); var options = { mat:["Truth Table (matrix of outputs)",this.mat.toString().replace(/,/g," ")], herit:["Accepts Inherited Events (0:No, 1:Yes)",this.herit], @@ -75,7 +77,6 @@ function LOGIC() { return new BasicBlock(this.x); } LOGIC.prototype.get_popup_title = function LOGIC() { - var set_param_popup_title = msprintf("Set %s block parameters","LOGIC"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/SHIFT.js b/js/IntegerOp/SHIFT.js index 60bb717e..21285d80 100644 --- a/js/IntegerOp/SHIFT.js +++ b/js/IntegerOp/SHIFT.js @@ -24,6 +24,8 @@ function SHIFT() { return this.x; } SHIFT.prototype.get = function SHIFT() { + var exprs = this.graphics.exprs; + this.set_param_popup_title = msprintf("Set %s block parameters","SHIFT"); var options = { Datatype:[msprintf("Data Type %s","(3:int32, 4:int16, 5:int8, ...)"),this.Datatype], nb:["Number of Bits to Shift Left (Negative number to shift right)",this.nb], @@ -132,7 +134,6 @@ function SHIFT() { return new BasicBlock(this.x); } SHIFT.prototype.get_popup_title = function SHIFT() { - var set_param_popup_title = msprintf("Set %s block parameters","SHIFT"); - return set_param_popup_title; + return this.set_param_popup_title; } } diff --git a/js/IntegerOp/SRFLIPFLOP.js b/js/IntegerOp/SRFLIPFLOP.js index 9172869f..31f3b6ca 100644 --- a/js/IntegerOp/SRFLIPFLOP.js +++ b/js/IntegerOp/SRFLIPFLOP.js @@ -36,6 +36,16 @@ function SRFLIPFLOP() { return this.x; } SRFLIPFLOP.prototype.get = function SRFLIPFLOP() { + if (typeof(o)=="Block"&&o.gui=="DOLLAR_m") { + var path = i; + break; + } + } + var newpar = list(); + var exprs = xx.graphics.exprs[1-1]; + this.model = xx.model; + var init_old = this.model.odstate[1-1]; + this.set_param_popup_title = msprintf("Set %s block parameters","SRFLIPFLOP"); var options = { init:["Initial Value",this.init], } @@ -80,7 +90,6 @@ function SRFLIPFLOP() { return new BasicBlock(this.x); } SRFLIPFLOP.prototype.get_popup_title = function SRFLIPFLOP() { - var set_param_popup_title = msprintf("Set %s block parameters","SRFLIPFLOP"); - return set_param_popup_title; + return this.set_param_popup_title; } } |