summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-07 15:19:57 +0530
committerGitHub2016-07-07 15:19:57 +0530
commitf4aa80b4e1fbb3f1bc7e05d87ae19bbd3e90b8ec (patch)
tree35cf5984635c6dd5764a1b5e4b8c6b652391c198
parenta208df08c1bb92e99f753eac0e3e617f5e2c1d15 (diff)
parent893f6a07baaacc3f95743d44ecbe484542f0d5c7 (diff)
downloadxcos-on-web-f4aa80b4e1fbb3f1bc7e05d87ae19bbd3e90b8ec.tar.gz
xcos-on-web-f4aa80b4e1fbb3f1bc7e05d87ae19bbd3e90b8ec.tar.bz2
xcos-on-web-f4aa80b4e1fbb3f1bc7e05d87ae19bbd3e90b8ec.zip
Merge pull request #146 from avi-psvm-dutta/master
Implement SOM_f Block
-rw-r--r--data_structures_correct/SOM_f.js24
-rw-r--r--data_structures_correct/SUBMAT.js38
2 files changed, 62 insertions, 0 deletions
diff --git a/data_structures_correct/SOM_f.js b/data_structures_correct/SOM_f.js
new file mode 100644
index 0000000..2d49214
--- /dev/null
+++ b/data_structures_correct/SOM_f.js
@@ -0,0 +1,24 @@
+function SOM_f() {
+
+ SOM_f.prototype.define = function SOM_f() {
+ this.sgn = [[1], [1], [1]];
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["sum"]), new ScilabDouble([2]));
+ model.in = new ScilabDouble([-1], [-1], [-1]);
+ model.out = new ScilabDouble([-1]);
+ model.rpar = new ScilabDouble(...this.sgn);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([sci2exp(1)], [sci2exp(this.sgn)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SOM_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2,2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ SINBLK_f.prototype.details = function SINBLK_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/SUBMAT.js b/data_structures_correct/SUBMAT.js
new file mode 100644
index 0000000..ece918b
--- /dev/null
+++ b/data_structures_correct/SUBMAT.js
@@ -0,0 +1,38 @@
+function SUBMAT() {
+
+ SUBMAT.prototype.define = function SUBMAT() {
+ var model = scicos_model();
+
+ this.function_name = new ScilabString(["submat"]);
+
+ this.funtyp = new ScilabDouble([4]);
+ model.sim = list(this.function_name, this.funtyp);
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([-2]);
+ model.intyp = new ScilabDouble([1]);
+ model.out = new ScilabDouble([-1]);
+ model.out2 = new ScilabDouble([-2]);
+ model.outtyp = new ScilabDouble([1]);
+ model.evtin = new ScilabDouble();
+ model.evtout = new ScilabDouble();
+ model.state = new ScilabDouble();
+ model.dstate = new ScilabDouble();
+ model.rpar = new ScilabDouble();
+ model.ipar = new ScilabDouble([1], [1], [1], [1]);
+ model.blocktype = new ScilabString(["c"]);
+ model.firing = new ScilabDouble();
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ this.label = new ScilabString([sci2exp(1)], [sci2exp(1)], [sci2exp(1)], [sci2exp(1)], [sci2exp(1)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SUBMAT\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2.5, 2]), model, this.label, gr_i);
+
+ return new BasicBlock(this.x);
+
+ }
+ SUBMAT.prototype.details = function SUBMAT() {
+ return this.x;
+
+ }
+}