summaryrefslogtreecommitdiff
path: root/data_structures_correct
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-11 19:42:27 +0530
committerGitHub2016-07-11 19:42:27 +0530
commitf1a66d584eafe7882f90998f18d31669fc668026 (patch)
treee27fbe02cb75748e0699bdbb10d71721ba440266 /data_structures_correct
parent41f8bd25b33eedd0b255cbc5449bab16cf3c957f (diff)
parent7cc3439659f36f12e9f2d236a941b1eeea94dc40 (diff)
downloadxcos-on-web-f1a66d584eafe7882f90998f18d31669fc668026.tar.gz
xcos-on-web-f1a66d584eafe7882f90998f18d31669fc668026.tar.bz2
xcos-on-web-f1a66d584eafe7882f90998f18d31669fc668026.zip
Merge pull request #163 from ASP1234/master
Implement Blocks and dependency fn
Diffstat (limited to 'data_structures_correct')
-rw-r--r--data_structures_correct/SWITCH_f.js27
-rw-r--r--data_structures_correct/TANBLK_f.js23
-rw-r--r--data_structures_correct/TCLSS.js34
-rw-r--r--data_structures_correct/TEXT_f.js25
-rw-r--r--data_structures_correct/TIME_DELAY.js28
-rw-r--r--data_structures_correct/TIME_f.js18
-rw-r--r--data_structures_correct/TKSCALE.js26
7 files changed, 181 insertions, 0 deletions
diff --git a/data_structures_correct/SWITCH_f.js b/data_structures_correct/SWITCH_f.js
new file mode 100644
index 0000000..ec4e1d7
--- /dev/null
+++ b/data_structures_correct/SWITCH_f.js
@@ -0,0 +1,27 @@
+function SWITCH_f() {
+
+ SWITCH_f.prototype.define = function SWITCH_f() {
+ this.i0 = 0;
+ this.in1 = [[-1], [-1]];
+ this.nin = 2;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["switchn"]), new ScilabDouble([2]));
+ model.in = new ScilabDouble(...this.in1);
+ model.out = new ScilabDouble([-1]);
+ model.ipar = new ScilabDouble([this.i0]);
+ model.blocktype = new ScilabString(["c"]);
+ model.firing = new ScilabDouble();
+ model.dep_ut = new ScilabBoolean([true, true]);
+
+ var exprs = new ScilabString([this.nin], [this.i0 + 1]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SWITCH_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ SWITCH_f.prototype.details = function SWITCH_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TANBLK_f.js b/data_structures_correct/TANBLK_f.js
new file mode 100644
index 0000000..d468e84
--- /dev/null
+++ b/data_structures_correct/TANBLK_f.js
@@ -0,0 +1,23 @@
+function TANBLK_f() {
+
+ TANBLK_f.prototype.define = function TANBLK_f() {
+ this.in1 = -1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["tanblk"]);
+ model.in = new ScilabDouble([this.in1]);
+ model.out = new ScilabDouble([this.in1]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([sci2exp(in1)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TANBLK_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ TANBLK_f.prototype.details = function TANBLK_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TCLSS.js b/data_structures_correct/TCLSS.js
new file mode 100644
index 0000000..e102d93
--- /dev/null
+++ b/data_structures_correct/TCLSS.js
@@ -0,0 +1,34 @@
+function TCLSS() {
+
+ TCLSS.prototype.define = function TCLSS() {
+ this.x0 = 0;
+ this.A = 0;
+ this.B = 1;
+ this.C = 1;
+ this.D = 0;
+ this.in1 = 1;
+ this.nx = size(this.x0, "*");
+ this.out = 1;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["tcslti4"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble([this.in1], [this.nx]);
+ model.out = new ScilabDouble([this.out]);
+ model.evtin = new ScilabDouble([1]);
+ model.state = new ScilabDouble([this.x0]);
+ model.rpar = new ScilabDouble([this.A], [this.B], [this.C], [this.D]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var exprs = new ScilabString([sci2exp(this.A)], [sci2exp(this.B)], [sci2exp(this.C)], [sci2exp(this.D)], [sci2exp(this.x0)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TCLSS\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+
+ TCLSS.prototype.details = function TCLSS() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TEXT_f.js b/data_structures_correct/TEXT_f.js
new file mode 100644
index 0000000..cb5a481
--- /dev/null
+++ b/data_structures_correct/TEXT_f.js
@@ -0,0 +1,25 @@
+function TEXT_f() {
+
+ TEXT_f.prototype.define = function TEXT_f() {
+ this.font = 2;
+ this.siz = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["text"]);
+ model.rpar = new ScilabString(["Text"]);
+ model.ipar = new ScilabDouble([this.font], [this.siz]);
+
+ var exprs = ["Text", this.font, this.siz];
+
+ var graphics = scicos_graphics();
+ graphics.orig = new ScilabDouble([0, 0]);
+ graphics.sz = new ScilabDouble([2, 1]);
+ graphics.exprs = new ScilabString(exprs);
+ this.x = mlist(["Text", "graphics", "model", "void", "gui"], new ScilabString(["Text", "graphics", "model", "void", "gui"]), graphics, model, new ScilabString([" "]), new ScilabString(["TEXT_f"]));
+ return new TextBlock(this.x);
+ }
+
+ TEXT_f.prototype.details = function TEXT_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TIME_DELAY.js b/data_structures_correct/TIME_DELAY.js
new file mode 100644
index 0000000..8438941
--- /dev/null
+++ b/data_structures_correct/TIME_DELAY.js
@@ -0,0 +1,28 @@
+function TIME_DELAY() {
+
+ TIME_DELAY.prototype.define = function TIME_DELAY() {
+ this.nin = 1;
+ this.T = 1;
+ this.init = 0;
+ this.N = 1024;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["time_delay"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble([this.nin]);
+ model.out = new ScilabDouble([this.nin]);
+ model.rpar = new ScilabDouble([this.T, this.init]);
+ model.ipar = new ScilabDouble([this.N]);
+ model.blocktype = new ScilabString(["x"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var exprs = new ScilabString([this.T], [this.init], [this.N]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TIME_DELAY\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3.5, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ TIME_DELAY.prototype.details = function TIME_DELAY() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TIME_f.js b/data_structures_correct/TIME_f.js
new file mode 100644
index 0000000..a9c233c
--- /dev/null
+++ b/data_structures_correct/TIME_f.js
@@ -0,0 +1,18 @@
+function TIME_f() {
+
+ TIME_f.prototype.define = function TIME_f() {
+ var model = scicos_model();
+ model.sim = new ScilabString(["timblk"]);
+ model.out = new ScilabDouble([1]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TIME_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ TIME_f.prototype.details = function TIME_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/TKSCALE.js b/data_structures_correct/TKSCALE.js
new file mode 100644
index 0000000..532a923
--- /dev/null
+++ b/data_structures_correct/TKSCALE.js
@@ -0,0 +1,26 @@
+function TKSCALE() {
+
+ TKSCALE.prototype.define = function TKSCALE() {
+ this.a = -10;
+ this.b = 10;
+ this.f = 1;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["tkscaleblk"]), new ScilabDouble([5]));
+ model.out = new ScilabDouble([1]);
+ model.evtin = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([this.a], [this.b], [this.f]);
+ model.blocktype = new ScilabString(["d"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var exprs = new ScilabString([sci2exp(this.a)], [sci2exp(this.b)], [sci2exp(this.f)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"TKSCALE\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+
+ TKSCALE.prototype.details = function TKSCALE() {
+ return this.x;
+ }
+}