summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-06 12:41:06 +0530
committerGitHub2016-07-06 12:41:06 +0530
commit496dd42d6af4e1a08baeb4b43e3d53e9bc1235ab (patch)
treeff64f6a442c8105114007260fcc5c20cfce52d29
parent7f58c97e98d297369e2c75e317f838309b0686b2 (diff)
parentf2d37cf939283f5cd35b40b82e7bafc9e98908df (diff)
downloadxcos-on-web-496dd42d6af4e1a08baeb4b43e3d53e9bc1235ab.tar.gz
xcos-on-web-496dd42d6af4e1a08baeb4b43e3d53e9bc1235ab.tar.bz2
xcos-on-web-496dd42d6af4e1a08baeb4b43e3d53e9bc1235ab.zip
Merge pull request #133 from Pooja-Mahadev-Soundalgekar/master
ds_QUANT_f
-rw-r--r--data_structures_correct/QUANT_f.js26
-rw-r--r--data_structures_correct/RAMP.js29
-rw-r--r--data_structures_correct/RAND_m.js39
-rw-r--r--data_structures_correct/RATELIMITER.js26
-rw-r--r--data_structures_correct/RELAY_f.js28
5 files changed, 148 insertions, 0 deletions
diff --git a/data_structures_correct/QUANT_f.js b/data_structures_correct/QUANT_f.js
new file mode 100644
index 0000000..1934882
--- /dev/null
+++ b/data_structures_correct/QUANT_f.js
@@ -0,0 +1,26 @@
+function QUANT_f() {
+
+ QUANT_f.prototype.define = function QUANT_f() {
+ this.pas = 0.1;
+ this.meth = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["qzrnd"]);
+ model.in = new ScilabDouble([-1]);
+ model.out = new ScilabDouble([-1]);
+ model.rpar = new ScilabDouble([this.pas]);
+ model.ipar = new ScilabDouble([this.meth]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([this.pas], [this.meth]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"QUANT_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ QUANT_f.prototype.details = function QUANT_f() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/RAMP.js b/data_structures_correct/RAMP.js
new file mode 100644
index 0000000..947aa27
--- /dev/null
+++ b/data_structures_correct/RAMP.js
@@ -0,0 +1,29 @@
+function RAMP() {
+
+ RAMP.prototype.define = function RAMP() {
+ this.slope = 0;
+ this.iout = 0;
+ this.stt = 0;
+ this.rpar = [[this.slope], [this.stt], [this.iout]];
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["ramp"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble();
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble(...this.rpar);
+ model.blocktype = new ScilabString(["c"]);
+ model.nmode = new ScilabDouble([1]);
+ model.nzcross = new ScilabDouble([1]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var exprs = new ScilabString(...this.rpar);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RAMP\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ RAMP.prototype.details = function RAMP() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/RAND_m.js b/data_structures_correct/RAND_m.js
new file mode 100644
index 0000000..e5eff23
--- /dev/null
+++ b/data_structures_correct/RAND_m.js
@@ -0,0 +1,39 @@
+function RAND_m() {
+
+ RAND_m.prototype.define = function RAND_m() {
+ this.a = 0;
+ this.b = 1;
+ this.dt = 0;
+ this.flag = 0;
+ this.function_name = "rndblk_m";
+ this.funtyp = 4;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp]));
+ model.in = new ScilabDouble();
+ model.in2 = new ScilabDouble();
+ model.intyp = new ScilabDouble();
+ model.out = new ScilabDouble([1]);
+ model.out2 = new ScilabDouble([1]);
+ model.outtyp = new ScilabDouble([1]);
+ model.evtin = new ScilabDouble([1]);
+ model.evtout = new ScilabDouble();
+ model.state = new ScilabDouble();
+ model.dstate = new ScilabDouble([parseInt(Math.random() * 10000000)], [0 * this.a]);
+ model.rpar = new ScilabDouble([this.a, this.b]);
+ model.ipar = new ScilabDouble([this.flag]);
+ model.blocktype = new ScilabString(["d"]);
+ model.firing = new ScilabDouble();
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var exprs = new ScilabString([sci2exp(1)], [this.flag], [sci2exp([this.a])], [sci2exp([this.b])], [sci2exp([parseInt(getData(model.dstate)[0]), parseInt(Math.random() * 10000000)])]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RAND_m\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ RAND_m.prototype.details = function RAND_m() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/RATELIMITER.js b/data_structures_correct/RATELIMITER.js
new file mode 100644
index 0000000..881b020
--- /dev/null
+++ b/data_structures_correct/RATELIMITER.js
@@ -0,0 +1,26 @@
+function RATELIMITER() {
+
+ RATELIMITER.prototype.define = function RATELIMITER() {
+ this.minp = -1;
+ this.maxp = 1;
+ this.rpar = [[this.maxp], [this.minp]];
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["ratelimiter"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble(...this.rpar);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([this.maxp], [this.minp]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RATELIMITER\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3.5, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ RATELIMITER.prototype.details = function RATELIMITER() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/RELAY_f.js b/data_structures_correct/RELAY_f.js
new file mode 100644
index 0000000..5b323d5
--- /dev/null
+++ b/data_structures_correct/RELAY_f.js
@@ -0,0 +1,28 @@
+function RELAY_f() {
+
+ RELAY_f.prototype.define = function RELAY_f() {
+ this.i0 = 0;
+ this.in1 = [[-1], [-1]];
+ this.nin = 2;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["relay"]), new ScilabDouble([2]));
+ model.in = new ScilabDouble(...this.in1);
+ model.out = new ScilabDouble([-1]);
+ model.evtin = new ScilabDouble(...ones(this.in1));
+ model.dstate = 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),\"RELAY_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ RELAY_f.prototype.details = function RELAY_f() {
+ return this.x;
+ }
+}
+