summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-06-28 15:22:25 +0530
committerGitHub2016-06-28 15:22:25 +0530
commitbf6434775c55b6ff6ae64a2d04e9c716abbad42f (patch)
tree63501fa5a8b843585f56a2e83859ec8ebca8a4f7
parent167620f4fb8f11719b1cef833df89a963d0e1aec (diff)
parent77ceb043452df1b63493920b2dc736529a122e7c (diff)
downloadxcos-on-web-bf6434775c55b6ff6ae64a2d04e9c716abbad42f.tar.gz
xcos-on-web-bf6434775c55b6ff6ae64a2d04e9c716abbad42f.tar.bz2
xcos-on-web-bf6434775c55b6ff6ae64a2d04e9c716abbad42f.zip
Merge pull request #75 from grenadier-amit/master
Implement CONST block
-rw-r--r--data_structures_correct/CONST.js26
-rw-r--r--data_structures_correct/CONSTRAINT_c.js25
2 files changed, 51 insertions, 0 deletions
diff --git a/data_structures_correct/CONST.js b/data_structures_correct/CONST.js
new file mode 100644
index 0000000..4efcdc8
--- /dev/null
+++ b/data_structures_correct/CONST.js
@@ -0,0 +1,26 @@
+function CONST() {
+
+
+ CONST.prototype.define = function CONST() {
+
+ this.C = 1;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["cstblk4"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble();
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([this.C]);
+ model.blocktype = new ScilabString(["d"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var exprs = new ScilabString([sci2exp(this.C)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONST\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ CONST.prototype.details = function CONST() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/CONSTRAINT_c.js b/data_structures_correct/CONSTRAINT_c.js
new file mode 100644
index 0000000..88b734b
--- /dev/null
+++ b/data_structures_correct/CONSTRAINT_c.js
@@ -0,0 +1,25 @@
+function CONSTRAINT_c() {
+
+ CONSTRAINT_c.prototype.define = function CONSTRAINT_c() {
+
+ this.x0 = [[0],[0]];
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["constraint_c"]), new ScilabDouble([10004]));
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.ipar = new ScilabDouble([0]);
+ model.state = new ScilabDouble(...this.x0);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var exprs = new ScilabString([0]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONSTRAINT_c\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ CONSTRAINT_c.prototype.details = function CONSTRAINT_c() {
+ return this.x;
+ }
+}