summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data_structures_correct/CSCOPE.js32
-rw-r--r--data_structures_correct/CSCOPXY3D.js36
-rw-r--r--data_structures_correct/CURV_f.js27
-rw-r--r--data_structures_correct/ConstantVoltage.js32
-rw-r--r--data_structures_correct/DELAY_f.js116
-rw-r--r--data_structures_correct/EVTDLY_f.js23
-rw-r--r--data_structures_correct/IN_f.js48
-rw-r--r--data_structures_correct/OUT_f.js50
-rw-r--r--data_structures_correct/REGISTER_f.js28
9 files changed, 392 insertions, 0 deletions
diff --git a/data_structures_correct/CSCOPE.js b/data_structures_correct/CSCOPE.js
new file mode 100644
index 0000000..87571d4
--- /dev/null
+++ b/data_structures_correct/CSCOPE.js
@@ -0,0 +1,32 @@
+function CSCOPE() {
+
+ CSCOPE.prototype.define = function CSCOPE() {
+ this.win = -1;
+ this.wdim = [[600],[400]];
+ this.wpos = [[-1],[-1]];
+ this.clrs = [[1],[3],[5],[7],[9],[11],[13],[15]];
+ this.N = 20;
+ this.ymin = -15;
+ this.ymax = 15;
+ this.per = 30;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["cscope"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([1]);
+ model.evtin = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([0], [this.ymin], [this.ymax], [this.per]);
+ model.ipar = new ScilabDouble([this.win], [1], [this.N], ...this.clrs, ...this.wpos, ...this.wdim);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([this.clrs.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp(this.wdim)], [this.ymin], [this.ymax], [this.per], [this.N], [0], [""]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CSCOPE\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ CSCOPE.prototype.details = function CSCOPE() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/CSCOPXY3D.js b/data_structures_correct/CSCOPXY3D.js
new file mode 100644
index 0000000..5f389a5
--- /dev/null
+++ b/data_structures_correct/CSCOPXY3D.js
@@ -0,0 +1,36 @@
+function CSCOPXY3D() {
+
+ CSCOPXY3D.prototype.define = function CSCOPXY3D() {
+ this.win = -1;
+ this.clrs = [[1],[2],[3],[4],[5],[6],[7],[13]];
+ this.siz = [[1],[1],[1],[1],[1],[1],[1],[1]];
+ this.wdim = [[600],[400]];
+ this.wpos = [[-1],[-1]];
+ this.N = 2;
+ this.param3ds = [[50],[280]];
+ this.vec_x = [[-15],[15]];
+ this.vec_y = [[-15],[15]];
+ this.vec_z = [[-15],[15]];
+ this.nbr_curves = 1;
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["cscopxy3d"]), new ScilabDouble([4]));
+ model.in = new ScilabDouble([1], [1], [1]);
+ model.in2 = new ScilabDouble([1], [1], [1]);
+ model.intyp = new ScilabDouble([1], [1], [1]);
+ model.evtin = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble(...this.vec_x, ...this.vec_y, ...this.vec_z, ...this.param3ds);
+ model.ipar = new ScilabDouble([this.win], [8], [this.N], ...this.clrs, ...this.siz, [8], ...this.wpos, ...this.wdim, [this.nbr_curves]);
+ model.blocktype = new ScilabString(["d"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var exprs = new ScilabString([this.nbr_curves], [this.clrs.toString().replace(/,/g, " ")], [this.siz.toString().replace(/,/g, " ")], [this.win], [sci2exp([])], [sci2exp(this.wdim)], [this.vec_x.toString().replace(/,/g, " ")], [this.vec_y.toString().replace(/,/g, " ")], [this.vec_z.toString().replace(/,/g, " ")], [this.param3ds.toString().replace(/,/g, " ")], [this.N]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CSCOPE\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ CSCOPXY3D.prototype.details = function CSCOPXY3D() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/CURV_f.js b/data_structures_correct/CURV_f.js
new file mode 100644
index 0000000..598f49e
--- /dev/null
+++ b/data_structures_correct/CURV_f.js
@@ -0,0 +1,27 @@
+function CURV_f() {
+
+ CURV_f.prototype.define = function CURV_f() {
+ this.xx = [[0],[1],[2]];
+ this.yy = [[-5],[5],[0]];
+ this.rect = [0,-5,2,5];
+ this.axisdata = [[2],[10],[2],[10]];
+ this.ipar = new ScilabDouble([size(this.xx, 1)], ...this.axisdata);
+ this.rpar = new ScilabDouble(...this.xx, ...this.yy, this.rect);
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["intplt"]);
+ model.in = new ScilabDouble();
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble(...this.xx, ...this.yy, ...colon_operator([this.rect]));
+ model.ipar = new ScilabDouble([size(this.xx, 1)], ...this.axisdata);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CURV_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i);
+ return new BasicBlock(this.x);
+ }
+ CURV_f.prototype.details = function CURV_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/ConstantVoltage.js b/data_structures_correct/ConstantVoltage.js
new file mode 100644
index 0000000..ec5fcd6
--- /dev/null
+++ b/data_structures_correct/ConstantVoltage.js
@@ -0,0 +1,32 @@
+function ConstantVoltage() {
+
+ ConstantVoltage.prototype.define = function ConstantVoltage() {
+ this.V = 0.01;
+
+ var model = scicos_model();
+ model.rpar = new ScilabDouble([this.V]);
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.sim = new ScilabString(["ConstantVoltage"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var mo = modelica();
+ mo.model = new ScilabString(["ConstantVoltage"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["V"]), list(new ScilabDouble([this.V])));
+ model.equations = mo;
+
+ var exprs = new ScilabString([this.V]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ConstantVoltage\",sz(1),sz(2));"]);
+ this.x = standard_define([1.5, 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 BasicBlock(this.x);
+ }
+ ConstantVoltage.prototype.details = function ConstantVoltage() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/DELAY_f.js b/data_structures_correct/DELAY_f.js
new file mode 100644
index 0000000..14e968c
--- /dev/null
+++ b/data_structures_correct/DELAY_f.js
@@ -0,0 +1,116 @@
+function DELAY_f () {
+
+ DELAY_f.prototype.define =function DELAY_f() {
+ var evtdly = new EVTDLY_f().internal();
+ evtdly.graphics.orig = new ScilabDouble([243,296]);
+ evtdly.graphics.sz = new ScilabDouble([40,40]);
+ evtdly.graphics.flip = new ScilabBoolean([true]);
+ evtdly.graphics.exprs = new ScilabString(["0.1"],["0"]);
+ evtdly.graphics.pein = new ScilabDouble([10]);
+ evtdly.graphics.peout = new ScilabDouble([7]);
+ evtdly.model.rpar = new ScilabDouble([0.1]);
+ evtdly.model.firing = new ScilabDouble([0]);
+ evtdly.model.uid = new ScilabString([count]); // changed
+ evtdly.doc = list(new ScilabString([count++]));
+ evtdly.model.outtyp = new ScilabDouble();
+
+ var register = new REGISTER_f().internal();
+ register.graphics.orig = new ScilabDouble([238,195]);
+ register.graphics.sz = new ScilabDouble([50,50]);
+ register.graphics.flip = new ScilabBoolean([true]);
+ register.graphics.exprs = new ScilabString(["0;0;0;0;0;0;0;0;0;0"]);
+ register.graphics.pin = new ScilabDouble([6]);
+ register.graphics.pout = new ScilabDouble([5]);
+ register.graphics.pein = new ScilabDouble([9]);
+ register.model.uid = new ScilabString([count]); // changed
+ register.doc = list(new ScilabString([count++]));
+ register.model.in2 = new ScilabDouble([1]);
+ register.model.intyp = new ScilabDouble([1]);
+ register.model.out2 = new ScilabDouble([1]);
+
+ var input_port = new IN_f().internal();
+ input_port.graphics.orig = new ScilabDouble([92,210]);
+ input_port.graphics.sz = new ScilabDouble([20,20]);
+ input_port.graphics.flip = new ScilabBoolean([true]);
+ input_port.graphics.exprs = new ScilabString(["1"],["1"]);
+ input_port.graphics.pout = new ScilabDouble([6]);
+ input_port.model.ipar = new ScilabDouble([1]);
+ input_port.model.uid = new ScilabString([count]); // changed
+ input_port.doc = list(new ScilabString([count++]));
+ input_port.model.outtyp = new ScilabDouble([-1]);
+
+ var output_port = new OUT_f().internal();
+ output_port.graphics.orig = new ScilabDouble([440,210]);
+ output_port.graphics.sz = new ScilabDouble([20,20]);
+ output_port.graphics.flip = new ScilabBoolean([true]);
+ output_port.graphics.exprs = new ScilabString(["1"],["1"]);
+ output_port.graphics.pin = new ScilabDouble([5]);
+ output_port.model.ipar = new ScilabDouble([1]);
+ output_port.model.uid = new ScilabString([count]); // changed
+ output_port.doc = list(new ScilabString([count++]));
+ output_port.model.outtyp = new ScilabDouble();
+
+ var split = new CLKSPLIT_f().internal();
+ split.graphics.orig = new ScilabDouble([263,271.2]);
+ split.graphics.pein = new ScilabDouble([7]);
+ split.graphics.peout = new ScilabDouble([9],[10]);
+ split.model.uid = new ScilabString([count]); // changed
+ split.doc = list(new ScilabString([count++]));
+
+ var diagram = scicos_diagram();
+ diagram.objs.push(input_port);
+ diagram.objs.push(output_port);
+ diagram.objs.push(register);
+ diagram.objs.push(evtdly);
+ diagram.objs.push(split);
+ diagram.objs.push(scicos_link({
+ xx: new ScilabDouble([296.6],[440]),
+ yy: new ScilabDouble([220],[220]),
+ from: new ScilabDouble([3,1,0]),
+ to: new ScilabDouble([2,1,1])}));
+ diagram.objs.push(scicos_link({
+ xx: new ScilabDouble([112],[229.4]),
+ yy: new ScilabDouble([220],[220]),
+ from: new ScilabDouble([1,1,0]),
+ to: new ScilabDouble([3,1,1])}));
+ diagram.objs.push(scicos_link({
+ xx: new ScilabDouble([263],[263]),
+ yy: new ScilabDouble([290.3],[271.2]),
+ ct: new ScilabDouble([5,-1]),
+ from: new ScilabDouble([4,1,0]),
+ to: new ScilabDouble([5,1,1])}));
+ diagram.objs.push(scicos_link({
+ xx: new ScilabDouble([263],[263]),
+ yy: new ScilabDouble([271.2],[250.7]),
+ ct: new ScilabDouble([5,-1]),
+ from: new ScilabDouble([5,1,0]),
+ to: new ScilabDouble([3,1,1])}));
+ diagram.objs.push(scicos_link({
+ xx: new ScilabDouble([263],[308.6],[308.6],[263],[263]),
+ yy: new ScilabDouble([271.2],[271.2],[367],[367],[341.7]),
+ ct: new ScilabDouble([5,-1]),
+ from: new ScilabDouble([5,2,0]),
+ to: new ScilabDouble([4,1,1])}));
+
+ this.x=scicos_block();
+ this.x.gui = new ScilabString(["DELAY_f"]);
+ this.x.graphics.sz = new ScilabDouble([2,2]);
+ this.x.graphics.gr_i = new ScilabDouble();
+ this.x.graphics.pin = new ScilabDouble([0]);
+ this.x.graphics.pout = new ScilabDouble([0]);
+ this.x.model.sim = new ScilabString(["csuper"]);
+ this.x.model.in = new ScilabDouble([1]);
+ this.x.model.out = new ScilabDouble([1]);
+ this.x.model.blocktype = new ScilabString(["h"]);
+ this.x.model.dep_ut = new ScilabBoolean([false,false]);
+ this.x.model.rpar=diagram;
+ this.x.graphics.in_implicit = new ScilabString(["E"]);
+ this.x.graphics.in_style = new ScilabString([""]);
+ this.x.graphics.out_implicit = new ScilabString(["E"]);
+ this.x.graphics.out_style = new ScilabString([""]);
+ return new BasicBlock(this.x);
+ }
+ DELAY_f.prototype.details = function DELAY_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/EVTDLY_f.js b/data_structures_correct/EVTDLY_f.js
new file mode 100644
index 0000000..04e38a0
--- /dev/null
+++ b/data_structures_correct/EVTDLY_f.js
@@ -0,0 +1,23 @@
+function EVTDLY_f () {
+
+ EVTDLY_f.prototype.internal = function EVTDLY_f() {
+ this.dt = 0.1;
+ this.ff = this.dt;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["evtdly"]);
+ model.evtin = new ScilabDouble([1]);
+ model.evtout = new ScilabDouble([1]);
+ model.rpar=new ScilabDouble([this.dt]);
+ model.blocktype = new ScilabString(["d"]);
+ model.firing=new ScilabDouble([this.ff]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+
+ var exprs = new ScilabString([this.dt],[sci2exp(this.ff)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTDLY_f\",sz(1),sz(2));"]);
+ var block = new standard_define(new ScilabDouble([2,2]),model,exprs,gr_i);
+ block.graphics.style = new ScilabString(["EVTDLY_f"]);
+ return block;
+ }
+}
diff --git a/data_structures_correct/IN_f.js b/data_structures_correct/IN_f.js
new file mode 100644
index 0000000..7527ab6
--- /dev/null
+++ b/data_structures_correct/IN_f.js
@@ -0,0 +1,48 @@
+function IN_f () {
+
+ IN_f.prototype.internal = function IN_f() {
+ this.prt = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["input"]);
+ model.out = new ScilabDouble([-1]);
+ model.out2 = new ScilabDouble([-2]);
+ model.outtyp = new ScilabDouble([-1]);
+ model.ipar=new ScilabDouble([this.prt]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+
+ var exprs = new ScilabString([sci2exp(this.prt)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IN_f\",sz(1),sz(2));"]);
+ var block=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i);
+ block.graphics.style = new ScilabString(["IN_f"]); // changed
+ block.graphics.out_implicit = new ScilabString(["E"]);
+ block.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]);
+ block.graphics.out_label = new ScilabString([""]);
+ return block;
+ }
+
+ IN_f.prototype.define = function IN_f() {
+ this.prt = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["input"]);
+ model.out = new ScilabDouble([-1]);
+ model.out2 = new ScilabDouble([-2]);
+ model.outtyp = new ScilabDouble([-1]);
+ model.ipar=new ScilabDouble([this.prt]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+
+ var exprs = new ScilabString([sci2exp(this.prt)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IN_f\",sz(1),sz(2));"]);
+ this.x=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i);
+ return new ExplicitInBlock(this.x);
+ }
+
+ IN_f.prototype.details = function IN_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/OUT_f.js b/data_structures_correct/OUT_f.js
new file mode 100644
index 0000000..9247aea
--- /dev/null
+++ b/data_structures_correct/OUT_f.js
@@ -0,0 +1,50 @@
+function OUT_f () {
+
+ OUT_f.prototype.internal = function OUT_f() {
+ this.n = -1;
+ this.prt = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["output"]);
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([-2]);
+ model.intyp = new ScilabDouble([-1]);
+ model.ipar=new ScilabDouble([this.prt]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+ var exprs = new ScilabString([sci2exp(this.prt)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OUT_f\",sz(1),sz(2));"]);
+ var block=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i);
+ block.graphics.style = new ScilabString(["OUT_f"]); // changed
+ block.graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]);
+ block.graphics.in_label = new ScilabString([""]);
+ block.graphics.in_implicit = new ScilabString(["E"]);
+ return block;
+ }
+
+ OUT_f.prototype.define = function OUT_f() {
+ this.n = -1;
+ this.prt = 1;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["output"]);
+ model.in1 = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([-2]);
+ model.intyp = new ScilabDouble([-1]);
+ model.ipar=new ScilabDouble([this.prt]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+
+ var exprs = new ScilabString([sci2exp(this.prt)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IN_f\",sz(1),sz(2));"]);
+ var block=new standard_define(new ScilabDouble([1,1]),model,exprs,gr_i);
+ block.graphics.style = new ScilabString(["OUT_f"]);
+ return new ExplicitOutBlock(this.x);
+ }
+
+ OUT_f.prototype.details = function OUT_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/REGISTER_f.js b/data_structures_correct/REGISTER_f.js
new file mode 100644
index 0000000..bf4c28e
--- /dev/null
+++ b/data_structures_correct/REGISTER_f.js
@@ -0,0 +1,28 @@
+function REGISTER_f () {
+
+ REGISTER_f.prototype.internal = function REGISTER_f() {
+ this.z0 = zeros(10,1);
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["delay"]);
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.evtin = new ScilabDouble([1]);
+ model.dstate= new ScilabDouble(...this.z0);
+ model.blocktype = new ScilabString(["d"]);
+ model.dep_ut = new ScilabBoolean([false,false]);
+
+ var exprs = new ScilabString([this.z0.toString().replace(/,/g, ";")]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"REGISTER_f\",sz(1),sz(2));"]);
+ var block=new standard_define(new ScilabDouble([2.5,2.5]),model,exprs,gr_i);
+ block.graphics.style = new ScilabString(["REGISTER_f"]);
+ block.graphics.in_implicit = new ScilabString(["E"]); // changed
+ block.graphics.out_implicit = new ScilabString(["E"]);
+ block.graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]);
+ block.graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]);
+ block.graphics.in_label = new ScilabString([""]);
+ block.graphics.out_label = new ScilabString([""]);
+ return block;
+ }
+}