diff options
Diffstat (limited to 'data_structures_correct')
-rw-r--r-- | data_structures_correct/DLRADAPT_f.js | 32 | ||||
-rw-r--r-- | data_structures_correct/MBLOCK.js | 45 | ||||
-rw-r--r-- | data_structures_correct/RELATIONALOP.js | 26 | ||||
-rw-r--r-- | data_structures_correct/RICC.js | 35 | ||||
-rw-r--r-- | data_structures_correct/ROOTCOEF.js | 35 | ||||
-rw-r--r-- | data_structures_correct/Resistor.js | 33 | ||||
-rw-r--r-- | data_structures_correct/SAMPHOLD_m.js | 27 | ||||
-rw-r--r-- | data_structures_correct/SATURATION.js | 28 | ||||
-rw-r--r-- | data_structures_correct/SAWTOOTH_f.js | 23 | ||||
-rw-r--r-- | data_structures_correct/SCALAR2VECTOR.js | 23 | ||||
-rw-r--r-- | data_structures_correct/SELECT_m.js | 35 | ||||
-rw-r--r-- | data_structures_correct/SHIFT.js | 30 | ||||
-rw-r--r-- | data_structures_correct/SIGNUM.js | 25 | ||||
-rw-r--r-- | data_structures_correct/SINBLK_f.js | 22 | ||||
-rw-r--r-- | data_structures_correct/SOM_f.js | 24 | ||||
-rw-r--r-- | data_structures_correct/SQRT.js | 24 | ||||
-rw-r--r-- | data_structures_correct/SUBMAT.js | 38 | ||||
-rw-r--r-- | data_structures_correct/SUM_f.js | 25 | ||||
-rw-r--r-- | data_structures_correct/SineVoltage.js | 38 | ||||
-rw-r--r-- | data_structures_correct/SourceP.js | 36 |
20 files changed, 604 insertions, 0 deletions
diff --git a/data_structures_correct/DLRADAPT_f.js b/data_structures_correct/DLRADAPT_f.js new file mode 100644 index 0000000..8b68940 --- /dev/null +++ b/data_structures_correct/DLRADAPT_f.js @@ -0,0 +1,32 @@ +function DLRADAPT_f() { + + DLRADAPT_f.prototype.define = function DLRADAPT_f() { + this.p = [[0], [1]]; + this.rn = []; + this.rd = [[math.complex(0.2, 0.8), math.complex(0.2, -0.8)], [math.complex(0.3, 0.7), math.complex(0.3, -0.7)]]; + this.g = [[1], [1]]; + this.last_u = []; + this.last_y = [[0], [0]]; + + var model = scicos_model(); + model.sim = new ScilabString(["dlradp"]); + model.in = new ScilabDouble([1], [1]); + model.out = new ScilabDouble([1]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble(...this.last_y); + model.rpar = new ScilabDouble(...this.p, ...real(colon_operator(this.rd)), ...math.im(colon_operator(this.rd)), ...this.g); + model.ipar = new ScilabDouble([0], [2], [2]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.p)], [sci2exp(this.rn)], [sci2exp(this.rd, 0)], [sci2exp(this.g)], [sci2exp(this.last_u)], [sci2exp(this.last_y)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DLRADAPT_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + DLRADAPT_f.prototype.details = function DLRADAPT_f() { + return this.x; + } +} diff --git a/data_structures_correct/MBLOCK.js b/data_structures_correct/MBLOCK.js new file mode 100644 index 0000000..e2b6725 --- /dev/null +++ b/data_structures_correct/MBLOCK.js @@ -0,0 +1,45 @@ +function MBLOCK() { + + MBLOCK.prototype.define = function MBLOCK() { + this.in1 = ["u1"]; + this.intype = ["I"]; + this.out = [["y1"],["y2"]]; + this.outtype = [["I"],["E"]]; + this.param = [["R"],["L"]]; + this.paramv = list(new ScilabDouble([0.1]), new ScilabDouble([0.0001])); + this.pprop = [[0],[0]]; + this.nameF = "generic"; + + var exprs = tlist(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"], new ScilabString(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"]), new ScilabString([sci2exp(this.in1)]), new ScilabString([sci2exp(this.intype)]), new ScilabString([sci2exp(this.out)]), new ScilabString([sci2exp(this.outtype)]), new ScilabString([sci2exp(this.param)]), list(new ScilabString([0.1]), new ScilabString([0.0001])), new ScilabString([sci2exp(this.pprop)]), new ScilabString([this.nameF]), new ScilabDouble()); + + var model = scicos_model(); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + model.rpar = []; + + for (var i = 0; i < this.paramv.length; i++) { + model.rpar.push(getData(this.paramv[i])); + } + + model.rpar = new ScilabDouble(...model.rpar); + var mo = modelica(); + mo.model = new ScilabString([this.nameF]); + mo.parameters = list(new ScilabString(...this.param), this.paramv); + model.sim = list(mo.model, new ScilabDouble([30004])); + mo.inputs = new ScilabString(this.in1); + mo.outputs = new ScilabString(...this.out); + model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "r"), 1)); + model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "r"), 1)); + model.equations = mo; + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MBLOCK\",sz(1),sz(2));"]); + + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + this.x.graphics.in_implicit = new ScilabString(this.intype); + this.x.graphics.out_implicit = new ScilabString(...this.outtype); + return new BasicBlock(this.x); + } + + MBLOCK.prototype.details = function MBLOCK() { + return this.x; + } +} diff --git a/data_structures_correct/RELATIONALOP.js b/data_structures_correct/RELATIONALOP.js new file mode 100644 index 0000000..100570e --- /dev/null +++ b/data_structures_correct/RELATIONALOP.js @@ -0,0 +1,26 @@ +function RELATIONALOP() { + + RELATIONALOP.prototype.define = function RELATIONALOP() { + this.ipar = 2; + this.label = "<"; + + var model = scicos_model(); + model.sim = list(new ScilabString(["relationalop"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1], [1]); + model.out = new ScilabDouble([1]); + model.ipar = new ScilabDouble([this.ipar]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.ipar], [0]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RELATIONALOP\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + this.x.graphics.style = new ScilabString(["fontSize=13;fontStyle=1;displayedLabel=" + label]); + return new BasicBlock(this.x); + } + RELATIONALOP.prototype.details = function RELATIONALOP() { + return this.x; + } +} + diff --git a/data_structures_correct/RICC.js b/data_structures_correct/RICC.js new file mode 100644 index 0000000..5664207 --- /dev/null +++ b/data_structures_correct/RICC.js @@ -0,0 +1,35 @@ +function RICC() { + + RICC.prototype.define = function RICC() { + this.function_name = "ricc_m"; + this.funtyp = 4; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1], [-1], [-1]); + model.in2 = new ScilabDouble([-1], [-1], [-1]); + model.intyp = new ScilabDouble([1, 1, 1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-1]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble([1], [1]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)], [sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RICC\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + RICC.prototype.details = function RICC() { + return this.x; + } +} + diff --git a/data_structures_correct/ROOTCOEF.js b/data_structures_correct/ROOTCOEF.js new file mode 100644 index 0000000..96e72c6 --- /dev/null +++ b/data_structures_correct/ROOTCOEF.js @@ -0,0 +1,35 @@ +function ROOTCOEF() { + + ROOTCOEF.prototype.define = function ROOTCOEF() { + this.function_name = "root_coef"; + this.funtyp = 4; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-2]); + model.out2 = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)], [sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ROOTCOEF\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + ROOTCOEF.prototype.details = function ROOTCOEF() { + return this.x; + } +} + diff --git a/data_structures_correct/Resistor.js b/data_structures_correct/Resistor.js new file mode 100644 index 0000000..c8ca7f4 --- /dev/null +++ b/data_structures_correct/Resistor.js @@ -0,0 +1,33 @@ +function Resistor() { + + Resistor.prototype.define = function Resistor() { + this.R = 0.01; + + var model = scicos_model(); + model.rpar = new ScilabDouble([this.R]); + model.sim = new ScilabString(["resistor"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Resistor"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["R"]), list(new ScilabDouble([this.R]))); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); + model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); + + var exprs = new ScilabString([this.R]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]); + this.x = standard_define([2, 1], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + Resistor.prototype.details = function Resistor() { + return this.x; + } +} + diff --git a/data_structures_correct/SAMPHOLD_m.js b/data_structures_correct/SAMPHOLD_m.js new file mode 100644 index 0000000..7c42b73 --- /dev/null +++ b/data_structures_correct/SAMPHOLD_m.js @@ -0,0 +1,27 @@ +function SAMPHOLD_m() { + + SAMPHOLD_m.prototype.define = function SAMPHOLD_m() { + var model = scicos_model(); + model.sim = list(new ScilabString(["samphold4_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.evtin = new ScilabDouble([1]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = [sci2exp(1)]; + + var gr_i = ["xstringb(orig(1),orig(2),\"SAMPHOLD_m\",sz(1),sz(2));"]; + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + + } + + SAMPHOLD_m.prototype.details = function SAMPHOLD_m() { + return this.x; + } +} diff --git a/data_structures_correct/SATURATION.js b/data_structures_correct/SATURATION.js new file mode 100644 index 0000000..99bd3fa --- /dev/null +++ b/data_structures_correct/SATURATION.js @@ -0,0 +1,28 @@ +function SATURATION() { + + SATURATION.prototype.define = function SATURATION() { + this.minp = -1; + this.maxp = 1; + this.rpar = [[this.maxp], [this.minp]]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["satur"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.nzcross = new ScilabDouble([2]); + model.nmode = 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], [parseInt(getData(model.nmode)[0])]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SATURATION\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + SATURATION.prototype.details = function SATURATION() { + return this.x; + } +} + diff --git a/data_structures_correct/SAWTOOTH_f.js b/data_structures_correct/SAWTOOTH_f.js new file mode 100644 index 0000000..75a8fec --- /dev/null +++ b/data_structures_correct/SAWTOOTH_f.js @@ -0,0 +1,23 @@ +function SAWTOOTH_f() { + + SAWTOOTH_f.prototype.define = function SAWTOOTH_f() { + + var model = scicos_model(); + model.sim = new ScilabString(["sawtth"]); + model.out = new ScilabDouble([1]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + + var exprs = new ScilabString([" "]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SAWTOOTH_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + SAWTOOTH_f.prototype.details = function SAWTOOTH_f() { + return this.x; + } +} diff --git a/data_structures_correct/SCALAR2VECTOR.js b/data_structures_correct/SCALAR2VECTOR.js new file mode 100644 index 0000000..f701a95 --- /dev/null +++ b/data_structures_correct/SCALAR2VECTOR.js @@ -0,0 +1,23 @@ +function SCALAR2VECTOR() { + + SCALAR2VECTOR.prototype.define = function SCALAR2VECTOR() { + this.nout = -1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["scalar2vector"]), new ScilabDouble([4])); + model.out = new ScilabDouble([this.nout]); + model.in = new ScilabDouble([1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.nout]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SCALAR2VECTOR\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + SCALAR2VECTOR.prototype.details = function SCALAR2VECTOR() { + return this.x; + } +} + diff --git a/data_structures_correct/SELECT_m.js b/data_structures_correct/SELECT_m.js new file mode 100644 index 0000000..95583a6 --- /dev/null +++ b/data_structures_correct/SELECT_m.js @@ -0,0 +1,35 @@ +function SELECT_m() { + + SELECT_m.prototype.define = function SELECT_m() { + this.z0 = 1; + this.nin = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["selector_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1], [-1]); + model.in2 = new ScilabDouble([-2], [-2]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([1]); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(); + model.firing = new ScilabDouble(); + model.evtin = new ScilabDouble(...ones(this.nin, 1)); + model.dstate = new ScilabDouble([this.z0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(1)], [sci2exp([this.nin])], [sci2exp([this.z0])]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SELECT_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + SELECT_m.prototype.details = function SELECT_m() { + return this.x; + } +} + diff --git a/data_structures_correct/SHIFT.js b/data_structures_correct/SHIFT.js new file mode 100644 index 0000000..a0e9283 --- /dev/null +++ b/data_structures_correct/SHIFT.js @@ -0,0 +1,30 @@ +function SHIFT() { + + SHIFT.prototype.define = function SHIFT() { + this.sgn = [[0],[0]]; + this.OPER = 0; + + var model = scicos_model(); + model.sim = list(new ScilabString(["shift_32_LA"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.out = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.out2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([3]); + model.outtyp = new ScilabDouble([3]); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(...this.sgn); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(3)], [sci2exp(0)], [sci2exp(0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SHIFT\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + SHIFT.prototype.details = function SHIFT() { + return this.x; + } +} diff --git a/data_structures_correct/SIGNUM.js b/data_structures_correct/SIGNUM.js new file mode 100644 index 0000000..1cbac1e --- /dev/null +++ b/data_structures_correct/SIGNUM.js @@ -0,0 +1,25 @@ +function SIGNUM() { + + SIGNUM.prototype.define = function SIGNUM() { + this.nu = -1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["signum"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.nu]); + model.out = new ScilabDouble([this.nu]); + model.nzcross = new ScilabDouble([this.nu]); + model.nmode = new ScilabDouble([this.nu]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SIGNUM\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + SIGNUM.prototype.details = function SIGNUM() { + return this.x; + } +} + diff --git a/data_structures_correct/SINBLK_f.js b/data_structures_correct/SINBLK_f.js new file mode 100644 index 0000000..170f5d5 --- /dev/null +++ b/data_structures_correct/SINBLK_f.js @@ -0,0 +1,22 @@ +function SINBLK_f() { + + SINBLK_f.prototype.define = function SINBLK_f() { + + var model = scicos_model(); + model.sim = new ScilabString(["sinblk"]); + model.in = new ScilabDouble([-1]); + model.out = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([" "]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SINBLK_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + SINBLK_f.prototype.details = function SINBLK_f() { + return this.x; + } +} + diff --git a/data_structures_correct/SOM_f.js b/data_structures_correct/SOM_f.js new file mode 100644 index 0000000..2d49214 --- /dev/null +++ b/data_structures_correct/SOM_f.js @@ -0,0 +1,24 @@ +function SOM_f() { + + SOM_f.prototype.define = function SOM_f() { + this.sgn = [[1], [1], [1]]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["sum"]), new ScilabDouble([2])); + model.in = new ScilabDouble([-1], [-1], [-1]); + model.out = new ScilabDouble([-1]); + model.rpar = new ScilabDouble(...this.sgn); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(1)], [sci2exp(this.sgn)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SOM_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2,2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + SINBLK_f.prototype.details = function SINBLK_f() { + return this.x; + } +} diff --git a/data_structures_correct/SQRT.js b/data_structures_correct/SQRT.js new file mode 100644 index 0000000..f9ddb24 --- /dev/null +++ b/data_structures_correct/SQRT.js @@ -0,0 +1,24 @@ +function SQRT() { + + SQRT.prototype.define = function SQRT() { + var model = scicos_model(); + model.sim = list(new ScilabString(["mat_sqrt"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SQRT\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + + SQRT.prototype.details = function SQRT() { + return this.x; + } +} diff --git a/data_structures_correct/SUBMAT.js b/data_structures_correct/SUBMAT.js new file mode 100644 index 0000000..ece918b --- /dev/null +++ b/data_structures_correct/SUBMAT.js @@ -0,0 +1,38 @@ +function SUBMAT() { + + SUBMAT.prototype.define = function SUBMAT() { + var model = scicos_model(); + + this.function_name = new ScilabString(["submat"]); + + this.funtyp = new ScilabDouble([4]); + model.sim = list(this.function_name, this.funtyp); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble([1], [1], [1], [1]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + this.label = new ScilabString([sci2exp(1)], [sci2exp(1)], [sci2exp(1)], [sci2exp(1)], [sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SUBMAT\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2.5, 2]), model, this.label, gr_i); + + return new BasicBlock(this.x); + + } + SUBMAT.prototype.details = function SUBMAT() { + return this.x; + + } +} diff --git a/data_structures_correct/SUM_f.js b/data_structures_correct/SUM_f.js new file mode 100644 index 0000000..6677eac --- /dev/null +++ b/data_structures_correct/SUM_f.js @@ -0,0 +1,25 @@ +function SUM_f() { + + SUM_f.prototype.define = function SUM_f() { + var model = scicos_model(); + + model.sim = list(new ScilabString(["plusblk"]), new ScilabDouble([2])); + model.in = new ScilabDouble([-1], [-1], [-1]); + model.out = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SUM_f\",sz(1),sz(2));"]); + var exprs = new ScilabString(); + + this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); + + return new RoundBlock(this.x); + + } + + SUM_f.prototype.details = function SUM_f() { + return this.x; + + } +} diff --git a/data_structures_correct/SineVoltage.js b/data_structures_correct/SineVoltage.js new file mode 100644 index 0000000..e2bd1e4 --- /dev/null +++ b/data_structures_correct/SineVoltage.js @@ -0,0 +1,38 @@ +function SineVoltage() { + + SineVoltage.prototype.define = function SineVoltage() { + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + + this.V = 1; + this.ph = 0; + this.frq = 1; + this.offset = 0; + this.start = 0; + + model.rpar = new ScilabDouble([this.V], [this.ph], [this.frq], [this.offset], [this.start]); + model.sim = new ScilabString(["SineVoltage"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["SineVoltage"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["V"], ["phase"], ["freqHz"], ["offset"], ["startTime"]), list(new ScilabDouble([this.V]), new ScilabDouble([this.ph]), new ScilabDouble([this.frq]), new ScilabDouble([this.offset]), new ScilabDouble([this.start]))); + model.equations = mo; + + var exprs = new ScilabString([this.V], [this.ph], [this.frq], [this.offset], [this.start]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + + SineVoltage.prototype.details = function SineVoltage() { + return this.x; + } +} diff --git a/data_structures_correct/SourceP.js b/data_structures_correct/SourceP.js new file mode 100644 index 0000000..20b9e5a --- /dev/null +++ b/data_structures_correct/SourceP.js @@ -0,0 +1,36 @@ +function SourceP() { + + SourceP.prototype.define = function SourceP() { + var model = scicos_model(); + + this.P0 = 300000; + this.T0 = 290; + this.H0 = 100000; + this.option_temperature = 1; + + model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]); + model.sim = new ScilabString(["Source"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Source"]); + mo.inputs = new ScilabDouble(); + mo.outputs = new ScilabString(["C"]); + mo.parameters = list(new ScilabString(["P0"], ["T0"], ["H0"], ["option_temperature"]), new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature])); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); + model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); + + var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SourceP\",sz(1),sz(2));"]); + this.x = new standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + + SourceP.prototype.details = function SourceP() { + return this.x; + } +} |