summaryrefslogtreecommitdiff
path: root/data_structures_correct
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-05 11:31:00 +0530
committerGitHub2016-07-05 11:31:00 +0530
commitdc36ddca0ba67a86725bb584a33bcc59c12e6015 (patch)
treed39e65c607bfd2d5c11dd523cbcfc6aa264fd96c /data_structures_correct
parent81da447552fea9d334a8f53f44dfae461074dbb8 (diff)
parent99ef8777a7bda86af4e85d15a71ba1c73f85da4b (diff)
downloadxcos-on-web-dc36ddca0ba67a86725bb584a33bcc59c12e6015.tar.gz
xcos-on-web-dc36ddca0ba67a86725bb584a33bcc59c12e6015.tar.bz2
xcos-on-web-dc36ddca0ba67a86725bb584a33bcc59c12e6015.zip
Merge pull request #120 from ASP1234/master
Implement GOTO Block
Diffstat (limited to 'data_structures_correct')
-rw-r--r--data_structures_correct/GOTO.js28
-rw-r--r--data_structures_correct/Ground.js30
2 files changed, 58 insertions, 0 deletions
diff --git a/data_structures_correct/GOTO.js b/data_structures_correct/GOTO.js
new file mode 100644
index 0000000..7f0a421
--- /dev/null
+++ b/data_structures_correct/GOTO.js
@@ -0,0 +1,28 @@
+function GOTO() {
+
+ GOTO.prototype.define = function GOTO() {
+ var model = scicos_model();
+ model.sim = new ScilabString(["goto"]);
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([-2]);
+ model.intyp = new ScilabDouble([-1]);
+ model.out = new ScilabDouble();
+ model.out2 = new ScilabDouble();
+ model.outtyp = new ScilabDouble([1]);
+ model.ipar = new ScilabDouble([1]);
+ model.opar = list(new ScilabString(["A"]));
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var exprs = new ScilabString(["A"], [sci2exp(1)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GOTO\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i);
+ this.x.graphics.id = new ScilabString(["Goto"]);
+ return new BasicBlock(this.x)
+ }
+
+ GOTO.prototype.details = function GOTO() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/Ground.js b/data_structures_correct/Ground.js
new file mode 100644
index 0000000..9ebe910
--- /dev/null
+++ b/data_structures_correct/Ground.js
@@ -0,0 +1,30 @@
+function Ground() {
+
+ Ground.prototype.define = function Ground() {
+
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble();
+ model.sim = new ScilabString(["Ground"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = modelica();
+ mo.model = new ScilabString(["Ground"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabDouble();
+ model.equations = mo;
+
+ var exprs = new ScilabString([""]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]);
+ this.x = standard_define(new ScilabDouble([1, 1]), model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new GroundBlock(this.x);
+ }
+
+ Ground.prototype.details = function Ground() {
+ return this.x;
+ }
+}