diff options
author | Adhitya Kamakshidasan | 2016-06-23 10:54:58 +0530 |
---|---|---|
committer | GitHub | 2016-06-23 10:54:58 +0530 |
commit | 31cb449bf715e30530c70fa099b0e74e484bbc5e (patch) | |
tree | 4df01d983ab9cb8bc59f3f7d5f5c035bc235db89 | |
parent | 3eac6131c21a15d2b7a972e6862d01214357fa50 (diff) | |
parent | 3353738f687567fd643e308b4755e5ee1f8f090a (diff) | |
download | xcos-on-web-31cb449bf715e30530c70fa099b0e74e484bbc5e.tar.gz xcos-on-web-31cb449bf715e30530c70fa099b0e74e484bbc5e.tar.bz2 xcos-on-web-31cb449bf715e30530c70fa099b0e74e484bbc5e.zip |
Merge pull request #53 from ASP1234/master
Minor Change
-rw-r--r-- | data_structures_correct/ANDLOG_f.js | 2 | ||||
-rw-r--r-- | data_structures_correct/CMSCOPE.js | 37 | ||||
-rw-r--r-- | data_structures_correct/CONST_m.js | 2 | ||||
-rw-r--r-- | data_structures_correct/EVTDLY_c.js | 4 | ||||
-rw-r--r-- | data_structures_correct/IFTHEL_f.js | 6 | ||||
-rw-r--r-- | dependencies.js | 12 | ||||
-rw-r--r-- | details.js | 9 | ||||
-rw-r--r-- | finalmodsheet.xsl | 11 | ||||
-rw-r--r-- | images/ScilabExecute.png | bin | 0 -> 660 bytes |
9 files changed, 68 insertions, 15 deletions
diff --git a/data_structures_correct/ANDLOG_f.js b/data_structures_correct/ANDLOG_f.js index 674a653..0fe3b2f 100644 --- a/data_structures_correct/ANDLOG_f.js +++ b/data_structures_correct/ANDLOG_f.js @@ -1,6 +1,6 @@ function ANDLOG_f() { - ANDLOG_f.prototype.internal = function() { + ANDLOG_f.prototype.internal = function ANDLOG_f() { var model = scicos_model(); model.sim = new ScilabString(["andlog"]); model.out = new ScilabDouble([1]); diff --git a/data_structures_correct/CMSCOPE.js b/data_structures_correct/CMSCOPE.js index b5d1562..e00ee14 100644 --- a/data_structures_correct/CMSCOPE.js +++ b/data_structures_correct/CMSCOPE.js @@ -1,4 +1,41 @@ function CMSCOPE() { + CMSCOPE.prototype.get = function CMSCOPE() { + + var options = { + in1: ["Input ports sizes", this.in1.toString().replace(/,/g, " ")], + clrs: ["Drawing colors (>0) or mark (<0)", this.clrs.toString().replace(/,/g, " ")], + win: ["Output window number (-1 for automatic)", this.win], + wpos: ["Output window position", sci2exp([])], + wdim: ["Output window sizes", sci2exp([])], + ymin: ["Ymin vector", this.ymin.toString().replace(/,/g, " ")], + ymax: ["Ymax vector", this.ymax.toString().replace(/,/g, " ")], + per: ["Refresh period", this.per.toString().replace(/,/g, " ")], + N: ["Buffer size", this.N], + heritance: ["Accept herited events 0/1", 0], + nom: ["Name of Scope (label&Id)", ""] + }; + return options; + } + CMSCOPE.prototype.set = function CMSCOPE() { + this.in1 = inverse(arguments[0]["in1"]); + this.clrs = inverse(arguments[0]["clrs"]); + this.win = parseInt((arguments[0]["win"])); + this.ymin = inverse(arguments[0]["ymin"]); + this.ymax = inverse(arguments[0]["ymax"]); + this.per = inverse(arguments[0]["per"]); + this.N = parseInt((arguments[0]["N"])); + this.heritance = parseInt((arguments[0]["heritance"])); + this.nom = arguments[0]["nom"]; + this.yy = [...transpose(this.ymin), ...transpose(this.ymax)]; + this.period = transpose(this.per); + this.x.model.ipar = new ScilabDouble([this.win], [this.in1.length], [this.N], ...this.wpos, ...this.wdim, ...this.in1, this.clrs[0], this.clrs[1],[this.heritance]); + this.x.model.label = new ScilabString([this.nom]); + this.x.model.evtin = new ScilabDouble(...ones(1-this.heritance,1)); + this.x.graphics.id = new ScilabString([this.nom]); + this.x.model.rpar = new ScilabDouble([0], ...colon_operator(this.period), ...colon_operator(this.yy)); + this.x.graphics.exprs = new ScilabString([this.in1.toString().replace(/,/g, " ")], [this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp([])], [this.ymin.toString().replace(/,/g, " ")], [this.ymax.toString().replace(/,/g, " ")], [this.per.toString().replace(/,/g, " ")], [this.N], [0], [""]); + return new BasicBlock(this.x); + } CMSCOPE.prototype.define = function CMSCOPE() { this.win = -1; this.in1 = [ diff --git a/data_structures_correct/CONST_m.js b/data_structures_correct/CONST_m.js index 410fffa..b96a0e7 100644 --- a/data_structures_correct/CONST_m.js +++ b/data_structures_correct/CONST_m.js @@ -8,6 +8,8 @@ function CONST_m() { } CONST_m.prototype.set = function CONST_m() { this.c = [arguments[0]["vec"]]; + this.x.model.sim = list(new ScilabString(["cstblk4_m"]), new ScilabDouble([4])); + this.x.model.opar = list(new ScilabDouble(this.c)); this.x.model.rpar = new ScilabDouble(); this.x.graphics.exprs = new ScilabString([sci2exp(this.c)]); return new BasicBlock(this.x); diff --git a/data_structures_correct/EVTDLY_c.js b/data_structures_correct/EVTDLY_c.js index 16e5101..46b336c 100644 --- a/data_structures_correct/EVTDLY_c.js +++ b/data_structures_correct/EVTDLY_c.js @@ -1,6 +1,6 @@ function EVTDLY_c() { - EVTDLY_c.prototype.internal = function() { + EVTDLY_c.prototype.internal = function EVTDLY_c() { var dt = 0.1; var ff = 0.0; var model = scicos_model(); @@ -21,7 +21,7 @@ function EVTDLY_c() { } - EVTDLY_c.prototype.define = function EVTDLY_C() { + EVTDLY_c.prototype.define = function EVTDLY_c() { this.dt = 0.1; this.ff = 0.0; var model = scicos_model(); diff --git a/data_structures_correct/IFTHEL_f.js b/data_structures_correct/IFTHEL_f.js index ff1a229..ebe8c6e 100644 --- a/data_structures_correct/IFTHEL_f.js +++ b/data_structures_correct/IFTHEL_f.js @@ -1,6 +1,6 @@ function IFTHEL_f() { - IFTHEL_f.prototype.internal = function() { + IFTHEL_f.prototype.internal = function IFTHEL_f() { var model = scicos_model(); model.sim = list(new ScilabString(["ifthel"]), new ScilabDouble([-1])); model.in = new ScilabDouble([1]); @@ -27,7 +27,7 @@ function IFTHEL_f() { return block; } - IFTHEL_f.prototype.define = function IFTHEL_F() { + IFTHEL_f.prototype.define = function IFTHEL_f() { var model = scicos_model(); model.sim = list(new ScilabString(["ifthel"]), new ScilabDouble([-1])); model.in = new ScilabDouble([1]); @@ -54,7 +54,7 @@ function IFTHEL_f() { return new BasicBlock(this.x); } - IFTHEL_f.prototype.details = function IFTHEL_F() { + IFTHEL_f.prototype.details = function IFTHEL_f() { return this.x; } } diff --git a/dependencies.js b/dependencies.js index c662af0..4176712 100644 --- a/dependencies.js +++ b/dependencies.js @@ -1,6 +1,9 @@ var dir = ["data_structures_correct"]; var fileextension = "."; +var script = document.createElement("script"); + script.src = "math.js"; + document.head.appendChild(script); $.each(dir, function(index, value) { $.ajax({ // http://stackoverflow.com/a/18480589 url: value, @@ -237,4 +240,13 @@ function size() { return res[arguments[1]]; } } +} + +function inverse() { + var str = "[[" + var arg = arguments[0]; + arg = arg.replace(/ /g, "],["); + str += arg + "]]"; + var array = JSON.parse(str); + return array; }
\ No newline at end of file @@ -273,7 +273,10 @@ function ScilabDouble() { for (i = 0; i < this.height; i++) { for (j = 0; j < this.width; j++) { this["data" + i + j] = new data(); + if(array[i][j] % 1 == 0) this["data" + i + j].realPart = array[i][j].toFixed(1); + else + this["data" + i + j].realPart = array[i][j]; this["data" + i + j].line = i; this["data" + i + j].column = j; } @@ -327,7 +330,7 @@ function createInstanceTag() { function CLKIN_f() { - CLKIN_f.prototype.internal = function() { + CLKIN_f.prototype.internal = function CLKIN_f() { var model = scicos_model(); var port = 1; @@ -350,7 +353,7 @@ function CLKIN_f() { function CLKOUT_f() { - CLKOUT_f.prototype.internal = function() { + CLKOUT_f.prototype.internal = function CLKOUT_f() { var model = scicos_model(); var port = 1; @@ -373,7 +376,7 @@ function CLKOUT_f() { function CLKSPLIT_f() { - CLKSPLIT_f.prototype.internal = function() { + CLKSPLIT_f.prototype.internal = function CLKSPLIT_f() { var model = scicos_model(); model.sim = new ScilabString(["split"]); model.evtin = new ScilabDouble([-1]); diff --git a/finalmodsheet.xsl b/finalmodsheet.xsl index 7c94af2..0546481 100644 --- a/finalmodsheet.xsl +++ b/finalmodsheet.xsl @@ -134,6 +134,9 @@ Look for TAG:Break1!!! <xsl:when test="@style='CommandPort'"> <xsl:call-template name="CommandPort" /> </xsl:when> + <xsl:when test="@style='Split'"> + <xsl:call-template name="SplitBlock" /> + </xsl:when> <xsl:otherwise> <!-- Maverick --> <!-- TAG:Break1 @@ -1160,14 +1163,10 @@ Look for TAG:Break1!!! <xsl:value-of select="@simulationFunctionName" /> </xsl:attribute> </xsl:if> - <xsl:if test="@simulationFunctionType"> - <xsl:attribute name="simulationFunctionType"> - <xsl:value-of select="@simulationFunctionType" /> - </xsl:attribute> - </xsl:if> + <xsl:attribute name="simulationFunctionType">DEFAULT</xsl:attribute> <xsl:if test="@style"> <xsl:attribute name="style"> - <xsl:value-of select="@style" /> + <xsl:value-of select="@name" /> </xsl:attribute> </xsl:if> <xsl:if test="@value"> diff --git a/images/ScilabExecute.png b/images/ScilabExecute.png Binary files differnew file mode 100644 index 0000000..a7de0fe --- /dev/null +++ b/images/ScilabExecute.png |