diff options
Diffstat (limited to 'data_structures_correct')
123 files changed, 4892 insertions, 3 deletions
diff --git a/data_structures_correct/CLKINV_f.js b/data_structures_correct/CLKINV_f.js index f9dadbc..70c142f 100644 --- a/data_structures_correct/CLKINV_f.js +++ b/data_structures_correct/CLKINV_f.js @@ -12,10 +12,30 @@ function CLKINV_f() { model.dep_ut = new ScilabBoolean([false, false]); var exprs = new ScilabString([this.prt]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKINV_f\",sz(1),sz(2));"]); this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); return new EventInBlock(this.x); } + CLKINV_f.prototype.internal = function CLKINV_f() { + this.prt = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["input"]); + model.evtout = new ScilabDouble([1]); + model.ipar = new ScilabDouble([this.prt]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([false, false]); + model.outtyp = new ScilabDouble(); + + var exprs = new ScilabString([this.prt]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKINV_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); + block.graphics.style = new ScilabString(["CLKINV_f"]); + return block; + } CLKINV_f.prototype.details = function CLKINV_f() { return this.x; } diff --git a/data_structures_correct/CLKOUTV_f.js b/data_structures_correct/CLKOUTV_f.js index 5d13410..5ea67f1 100644 --- a/data_structures_correct/CLKOUTV_f.js +++ b/data_structures_correct/CLKOUTV_f.js @@ -28,9 +28,11 @@ function CLKOUTV_f() { model.blocktype = new ScilabString(["d"]); model.firing = new ScilabDouble(); model.dep_ut = new ScilabBoolean([false, false]); - + model.outtyp = new ScilabDouble(); var exprs = new ScilabString([this.prt]); var block = new standard_define(new ScilabDouble([1, 1]), model, exprs, new ScilabString([" "])); + block.graphics.gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),"CLKOUTV_f",sz(1),sz(2));"]), new ScilabDouble([8])); + block.graphics.style = new ScilabString(["CLKOUTV_f"]); return block; } diff --git a/data_structures_correct/CLKSOM_f.js b/data_structures_correct/CLKSOM_f.js new file mode 100644 index 0000000..f67b2a4 --- /dev/null +++ b/data_structures_correct/CLKSOM_f.js @@ -0,0 +1,19 @@ +function CLKSOM_f() { + + CLKSOM_f.prototype.internal = function CLKSOM_f() { + + var model = scicos_model(); + model.sim = new ScilabString(["sum"]); + model.evtin = new ScilabDouble([1], [1], [1]); + model.evtout = new ScilabDouble([1]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([false, false]); + model.outtyp = new ScilabDouble(); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CLKSOM_f\",sz(1),sz(2));"]); + var block = standard_define(new ScilabDouble([1, 1]), model, [], gr_i); + block.graphics.style = new ScilabString(["CLKSOM_f"]) + return block; + } +} diff --git a/data_structures_correct/CONST_m.js b/data_structures_correct/CONST_m.js index b96a0e7..3031351 100644 --- a/data_structures_correct/CONST_m.js +++ b/data_structures_correct/CONST_m.js @@ -7,7 +7,8 @@ function CONST_m() { return options; } CONST_m.prototype.set = function CONST_m() { - this.c = [arguments[0]["vec"]]; + this.c = [parseInt(arguments[0]["vec"])]; + this.displayParameter = this.c; this.x.model.sim = list(new ScilabString(["cstblk4_m"]), new ScilabDouble([4])); this.x.model.opar = list(new ScilabDouble(this.c)); this.x.model.rpar = new ScilabDouble(); @@ -25,6 +26,7 @@ function CONST_m() { model.rpar = new ScilabDouble(this.c); model.opar = list(); model.blocktype = new ScilabString(["d"]); + this.displayParameter = [1]; model.dep_ut = new ScilabBoolean([false, false]); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CONST_m\",sz(1),sz(2));"]); diff --git a/data_structures_correct/COSBLK_f.js b/data_structures_correct/COSBLK_f.js new file mode 100644 index 0000000..4b845f1 --- /dev/null +++ b/data_structures_correct/COSBLK_f.js @@ -0,0 +1,20 @@ +function COSBLK_f () { + + COSBLK_f.prototype.define = function COSBLK_f() { + this.in1 = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["cosblk"]); + model.in = new ScilabDouble([-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),\"COSBLK_f\",sz(1),sz(2));"]); + this.x=new standard_define(new ScilabDouble([2,2]),model,new ScilabDouble(),gr_i); + return new BasicBlock(this.x); + } + COSBLK_f.prototype.details = function COSBLK_f() { + return this.x; + } +} 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/CVS.js b/data_structures_correct/CVS.js new file mode 100644 index 0000000..8091332 --- /dev/null +++ b/data_structures_correct/CVS.js @@ -0,0 +1,58 @@ +function CVS() { + + CVS.prototype.define = function CVS() { + this.ModelName = "CVS"; + this.PrametersValue = new ScilabDouble(); + this.ParametersName = new ScilabDouble(); + var model = scicos_model(); + this.Typein = []; + this.Typeout = []; + this.MI = []; + this.MO = []; + this.P = [[2,50,1,0],[70,98,2,0],[70,2,-2,0]]; + this.PortName = [["vin"],["p"],["n"]]; + + for (var i = 0; i < size(this.P, "r"); i++) { + if (this.P[i][2] == 1) { + this.Typein.push(["E"]); + this.MI.push(this.PortName[i]); + } + + if (this.P[i][2] == 2) { + this.Typein.push(["I"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == -1) { + this.Typeout.push(["E"]); + this.MO.push(this.PortName[i]); + } + if (this.P[i][2] == -2) { + this.Typeout.push(["I"]); + this.MO.push(this.PortName[i]); + } + } + + var mo = modelica(); + model.sim = new ScilabString([this.ModelName]); + mo.inputs = new ScilabString(...this.MI); + mo.outputs = new ScilabString(...this.MO); + model.rpar = this.PrametersValue; + mo.parameters = list(this.ParametersName, this.PrametersValue, new ScilabDouble(...zeros(getData(this.ParametersName)))); + var exprs = new ScilabDouble(); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CVS\",sz(1),sz(2));"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + mo.model = new ScilabString([this.ModelName]); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); + model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); + this.x = new standard_define(new ScilabDouble([2.1, 3]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabDouble(this.Typein); + this.x.graphics.out_implicit = new ScilabDouble(this.Typeout); + return new BasicBlock(this.x); + } + + CVS.prototype.details = function CVS() { + 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/Counter.js b/data_structures_correct/Counter.js new file mode 100644 index 0000000..c884e95 --- /dev/null +++ b/data_structures_correct/Counter.js @@ -0,0 +1,28 @@ +function Counter() { + + Counter.prototype.define = function Counter() { + this.minim = 0; + this.maxim = 2; + this.rule = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["counter"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0]); + model.ipar = new ScilabDouble([this.rule], [this.maxim], [this.minim]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.minim], [this.maxim], [this.rule]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Counter\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + Counter.prototype.details = function Counter() { + return this.x; + } +} diff --git a/data_structures_correct/CurrentSensor.js b/data_structures_correct/CurrentSensor.js new file mode 100644 index 0000000..1841fe9 --- /dev/null +++ b/data_structures_correct/CurrentSensor.js @@ -0,0 +1,29 @@ +function CurrentSensor() { + + CurrentSensor.prototype.define = function CurrentSensor() { + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1], [1]); + model.sim = new ScilabString(["CurrentSensor"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["CurrentSensor"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"], ["i"]); + model.equations = mo; + + var exprs = new ScilabDouble(); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CurrentSensor\",sz(1),sz(2));"]); + this.x = standard_define(new ScilabDouble([2, 2]), model, exprs, list(gr_i, new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"], ["E"]); + return new BasicBlock(this.x); + } + + CurrentSensor.prototype.details = function CurrentSensor() { + 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/DEMUX.js b/data_structures_correct/DEMUX.js new file mode 100644 index 0000000..4975c52 --- /dev/null +++ b/data_structures_correct/DEMUX.js @@ -0,0 +1,28 @@ +function DEMUX() { + + DEMUX.prototype.define = function DEMUX() { + this.out = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["multiplex"]), new ScilabDouble([4])); + model.in = new ScilabDouble([0]); + + var arr = []; + arr.push(math.range(-1, -this.out, -1, true)._data); + model.out = new ScilabDouble(...math.transpose(arr)); + model.ipar = new ScilabDouble([this.out]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.out]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DEMUX\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + DEMUX.prototype.details = function DEMUX() { + return this.x; + } +} diff --git a/data_structures_correct/DEMUX_f.js b/data_structures_correct/DEMUX_f.js new file mode 100644 index 0000000..ed0f26c --- /dev/null +++ b/data_structures_correct/DEMUX_f.js @@ -0,0 +1,27 @@ +function DEMUX_f() { + + DEMUX_f.prototype.define = function DEMUX_f() { + this.out = 2; + var arr = []; + arr.push(math.range(-1, -this.out, -1, true)._data); + + var model = scicos_model(); + model.sim = list(new ScilabString(["demux"]), new ScilabDouble([1])); + model.in = new ScilabDouble([0]); + model.out = new ScilabDouble(...math.transpose(arr)); + model.ipar = new ScilabDouble([this.out]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.out]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DEMUX_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + DEMUX_f.prototype.details = function DEMUX_f() { + return this.x; + } +} + 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/DOLLAR.js b/data_structures_correct/DOLLAR.js new file mode 100644 index 0000000..5e6dffb --- /dev/null +++ b/data_structures_correct/DOLLAR.js @@ -0,0 +1,27 @@ +function DOLLAR() { + + DOLLAR.prototype.define = function DOLLAR() { + this.z = 0; + this.inh = 0; + this.in1 = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([this.in1]); + model.evtin = new ScilabDouble([1 - this.inh]); + model.dstate = new ScilabDouble([this.z]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.z], [this.inh]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DOLLAR\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + DOLLAR.prototype.details = function DOLLAR() { + return this.x; + } +} + diff --git a/data_structures_correct/DOLLAR_f.js b/data_structures_correct/DOLLAR_f.js new file mode 100644 index 0000000..d4625b7 --- /dev/null +++ b/data_structures_correct/DOLLAR_f.js @@ -0,0 +1,27 @@ +function DOLLAR_f() { + + DOLLAR_f.prototype.define = function DOLLAR_f() { + this.z = 0; + this.inh = 0; + this.in1 = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["dollar"]); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([this.in1]); + model.evtin = new ScilabDouble([1 - this.inh]); + model.dstate = new ScilabDouble([this.z]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.z], [this.inh]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DOLLAR_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + DOLLAR_f.prototype.details = function DOLLAR_f() { + return this.x; + } +} + diff --git a/data_structures_correct/DOLLAR_m.js b/data_structures_correct/DOLLAR_m.js new file mode 100644 index 0000000..d39a88f --- /dev/null +++ b/data_structures_correct/DOLLAR_m.js @@ -0,0 +1,27 @@ +function DOLLAR_m() { + + DOLLAR_m.prototype.define = function DOLLAR_m() { + this.z = 0; + this.inh = 0; + this.in1 = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["dollar4"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([this.in1]); + model.evtin = new ScilabDouble([1 - this.inh]); + model.dstate = new ScilabDouble([this.z]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.z], [this.inh]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DOLLAR_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + DOLLAR_m.prototype.details = function DOLLAR_m() { + return this.x; + } +} + diff --git a/data_structures_correct/Diode.js b/data_structures_correct/Diode.js new file mode 100644 index 0000000..aab1eaf --- /dev/null +++ b/data_structures_correct/Diode.js @@ -0,0 +1,36 @@ +function Diode() { + + Diode.prototype.define = function Diode() { + + this.Ids = 1.e-6; + this.Vt = 0.04; + this.Maxexp = 15; + this.R = 1.e8; + + var model = scicos_model(); + model.rpar = new ScilabDouble([this.Ids], [this.Vt], [this.Maxexp], [this.R]); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.sim = new ScilabString(["Diode"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Diode"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["Ids", "Vt", "Maxexp", "R"]), list(new ScilabDouble([this.Ids]), new ScilabDouble([this.Vt]), new ScilabDouble([this.Maxexp]), new ScilabDouble([this.R]))); + model.equations = mo; + + var exprs = new ScilabString([this.Ids], [this.Vt], [this.Maxexp], [this.R]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Diode\",sz(1),sz(2));"]); + this.x = standard_define(new ScilabDouble([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); + } + Diode.prototype.details = function Diode() { + return this.x; + } +} diff --git a/data_structures_correct/EDGETRIGGER.js b/data_structures_correct/EDGETRIGGER.js new file mode 100644 index 0000000..5245267 --- /dev/null +++ b/data_structures_correct/EDGETRIGGER.js @@ -0,0 +1,25 @@ +function EDGETRIGGER() { + + EDGETRIGGER.prototype.internal = function EDGETRIGGER() { + this.edge = 1; + var model = scicos_model(); + model.sim = list(new ScilabString(["edgetrig"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0]); + model.nzcross = new ScilabDouble([1]); + model.ipar = new ScilabDouble([this.edge]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.edge]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"EDGETRIGGER",sz(1),sz(2));"]); + var block = standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + block.graphics.style = new ScilabString(["EDGETRIGGER"]); + return block; + } +} diff --git a/data_structures_correct/EDGE_TRIGGER.js b/data_structures_correct/EDGE_TRIGGER.js new file mode 100644 index 0000000..20aa23a --- /dev/null +++ b/data_structures_correct/EDGE_TRIGGER.js @@ -0,0 +1,114 @@ +function EDGE_TRIGGER() { + + EDGE_TRIGGER.prototype.define = function EDGE_TRIGGER() { + var scs_m_1 = scicos_diagram(); + scs_m_1.objs.push(new EDGETRIGGER().internal()); + scs_m_1.objs.push(new IFTHEL_f().internal()); + scs_m_1.objs.push(new IN_f().internal()); + scs_m_1.objs.push(new CLKOUTV_f().internal()); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + + var blk = scs_m_1.objs[0]; + var graphics = blk.graphics; + var model = blk.model; + graphics.orig = new ScilabDouble([60, 0]); + graphics.sz = new ScilabDouble([60, 40]); + graphics.exprs = new ScilabString(["0"]); + graphics.in_implicit = new ScilabString(["E"]); + graphics.out_implicit = new ScilabString(["E"]); + graphics.in_style = new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]); + graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); + graphics.in_label = new ScilabString([""]); + graphics.out_label = new ScilabString([""]); + model.ipar = new ScilabDouble([0]); + graphics.pin = new ScilabDouble([5]); + graphics.pout = new ScilabDouble([6]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[0] = blk; + + blk = scs_m_1.objs[1]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([160, 0]); + graphics.sz = new ScilabDouble([60, 40]); + graphics.exprs = new ScilabString(["0"], ["0"]); + model.evtin = new ScilabDouble(); + model.nzcross = new ScilabDouble([0]); + model.nmode = new ScilabDouble([0]); + graphics.pin = new ScilabDouble([6]); + graphics.peout = new ScilabDouble([7], [0]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[1] = blk; + + blk = scs_m_1.objs[2]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([0, 10]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pout = new ScilabDouble([5]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[2] = blk; + + blk = scs_m_1.objs[3]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([170, -60]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pein = new ScilabDouble([7]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[3] = blk; + + var lnk = scs_m_1.objs[4]; + lnk.xx = new ScilabDouble([64], [96]); + lnk.yy = new ScilabDouble([-40], [-20]); + lnk.from = new ScilabDouble([3, 1, 0]); + lnk.to = new ScilabDouble([1, 1, 1]); + scs_m_1.objs[4] = lnk; + + lnk = scs_m_1.objs[5]; + lnk.xx = new ScilabDouble([164], [196]); + lnk.yy = new ScilabDouble([-20], [-20]); + lnk.from = new ScilabDouble([1, 1, 0]); + lnk.to = new ScilabDouble([2, 1, 1]); + scs_m_1.objs[5] = lnk; + + lnk = scs_m_1.objs[6]; + lnk.xx = new ScilabDouble([220], [220]); + lnk.yy = new ScilabDouble([-44], [-96]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([2, 1, 0]); + lnk.to = new ScilabDouble([4, 1, 1]); + scs_m_1.objs[6] = lnk; + + model = scicos_model(); + model.sim = new ScilabString(["csuper"]); + model.in = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = scs_m_1; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"EDGE_TRIGGER",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + EDGE_TRIGGER.prototype.details = function EDGE_TRIGGER() { + return this.x; + } +} diff --git a/data_structures_correct/ENDBLK.js b/data_structures_correct/ENDBLK.js new file mode 100644 index 0000000..e3ca767 --- /dev/null +++ b/data_structures_correct/ENDBLK.js @@ -0,0 +1,106 @@ +function ENDBLK() { + + ENDBLK.prototype.define = function ENDBLK() { + var scs_m_1 = scicos_diagram({ + version: new ScilabString(["scicos4.2"]), + props: scicos_params({ + wpar: new ScilabDouble([600, 450, 0, 0, 600, 450]), + Title: new ScilabString(["ENDBLK"]), + tol: new ScilabDouble([0.0001], [0.000001], [Math.pow(10, -10)], [100001], [0], [0], [0]), + tf: new ScilabDouble([100000]), + context: new ScilabString([" "]), + void1: new ScilabDouble(), + options: tlist(["scsopt", "3D", "Background", "Link", "ID", "Cmap"], new ScilabString(["scsopt", "3D", "Background", "Link", "ID", "Cmap"]), list(new ScilabBoolean([true]), new ScilabDouble([33])), new ScilabDouble([8, 1]), new ScilabDouble([1, 5]), list(new ScilabDouble([5, 1]), new ScilabDouble([4, 1])), new ScilabDouble([0.8, 0.8, 0.8])), + void2: new ScilabDouble(), + void3: new ScilabDouble(), + doc: list() + }) + }); + scs_m_1.objs.push(scicos_block({ + gui: new ScilabString(["END_c"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([272.104, 249.11733]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1.000E+08"]), + pin: new ScilabDouble(), + pout: new ScilabDouble(), + pein: new ScilabDouble([2]), + peout: new ScilabDouble([2]), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"END_c",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabDouble(), + out_implicit: new ScilabDouble(), + style: new ScilabString(["END_c"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["scicosexit"]), new ScilabDouble([4])), + in: new ScilabDouble(), + in2: new ScilabDouble(), + intyp: new ScilabDouble(), + out: new ScilabDouble(), + out2: new ScilabDouble(), + outtyp: new ScilabDouble(), + evtin: new ScilabDouble([1]), + evtout: new ScilabDouble([1]), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["d"]), + firing: new ScilabDouble([1.000E+08]), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m_1.objs.push(scicos_link({ + xx: new ScilabDouble([292.104], [292.104], [261.83733], [261.83733], [292.104], [292.104]), + yy: new ScilabDouble([243.40305], [234.45067], [234.45067], [305.584], [305.584], [294.83162]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([5, -1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + + var model = scicos_model({ + sim: new ScilabString(["csuper"]), + in: new ScilabDouble(), + in2: new ScilabDouble(), + intyp: new ScilabDouble([1]), + out: new ScilabDouble(), + out2: new ScilabDouble(), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: scs_m_1, + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["h"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list() + }); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"ENDBLK",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + ENDBLK.prototype.details = function ENDBLK() { + return this.x; + } +} diff --git a/data_structures_correct/END_c.js b/data_structures_correct/END_c.js new file mode 100644 index 0000000..37c6f21 --- /dev/null +++ b/data_structures_correct/END_c.js @@ -0,0 +1,24 @@ +function END_c() { + + END_c.prototype.define = function END_c() { + this.tf = 100000000; + + var model = scicos_model(); + model.sim = list(new ScilabString(["scicosexit"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.firing = new ScilabDouble([this.tf]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.tf]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"END_c\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + END_c.prototype.details = function END_c() { + return this.x; + } +} + diff --git a/data_structures_correct/ESELECT_f.js b/data_structures_correct/ESELECT_f.js new file mode 100644 index 0000000..dc0ab87 --- /dev/null +++ b/data_structures_correct/ESELECT_f.js @@ -0,0 +1,29 @@ +function ESELECT_f() { + + ESELECT_f.prototype.define = function ESELECT_f() { + this.out = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["eselect"]), new ScilabDouble([-2])); + model.in = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([-1]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble(...ones(this.out, 1)); + model.blocktype = new ScilabString(["l"]); + model.firing = new ScilabDouble(...ones(this.out, 1)); + model.dep_ut = new ScilabBoolean([true, false]); + model.nmode = new ScilabDouble([0]); + model.nzcross = new ScilabDouble([0]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ESELECT_f\",sz(1),sz(2));"]);; + + var exprs = new ScilabString([this.out], [1], [parseInt(getData(model.nmode))]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + ESELECT_f.prototype.details = function ESELECT_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/EVTGEN_f.js b/data_structures_correct/EVTGEN_f.js new file mode 100644 index 0000000..ba7197f --- /dev/null +++ b/data_structures_correct/EVTGEN_f.js @@ -0,0 +1,22 @@ +function EVTGEN_f() { + + EVTGEN_f.prototype.define = function EVTGEN_f() { + this.tt = 0; + + var model = scicos_model(); + model.sim = new ScilabString(["trash"]); + model.evtout = new ScilabDouble([1]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([this.tt]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.tt]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTGEN_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + EVTGEN_f.prototype.details = function EVTGEN_f() { + return this.x; + } +} diff --git a/data_structures_correct/EVTVARDLY.js b/data_structures_correct/EVTVARDLY.js new file mode 100644 index 0000000..816c0a5 --- /dev/null +++ b/data_structures_correct/EVTVARDLY.js @@ -0,0 +1,25 @@ +function EVTVARDLY() { + + EVTVARDLY.prototype.define = function EVTVARDLY() { + + var model = scicos_model(); + model.sim = list(new ScilabString(["evtvardly"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([parseInt(getData(model.firing), 10)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EVTVARDLY\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + EVTVARDLY.prototype.details = function EVTVARDLY() { + return this.x; + } +} + diff --git a/data_structures_correct/EXPBLK_m.js b/data_structures_correct/EXPBLK_m.js new file mode 100644 index 0000000..b5cf28b --- /dev/null +++ b/data_structures_correct/EXPBLK_m.js @@ -0,0 +1,28 @@ +function EXPBLK_m() { + + EXPBLK_m.prototype.define = function EXPBLK_m() { + this.in1 = 1; + this.a = math.E; + + var model = scicos_model(); + model.sim = list(new ScilabString(["expblk_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.a]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString(["%e"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXPBLK_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + EXPBLK_m.prototype.details = function EXPBLK_m() { + return this.x; + } +} diff --git a/data_structures_correct/EXTRACT.js b/data_structures_correct/EXTRACT.js new file mode 100644 index 0000000..387f465 --- /dev/null +++ b/data_structures_correct/EXTRACT.js @@ -0,0 +1,35 @@ +function EXTRACT() { + + EXTRACT.prototype.define = function EXTRACT() { + this.function_name = "extract"; + 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([-2]); + model.intyp = new ScilabDouble([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, 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])], [sci2exp([1])]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXTRACT\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + EXTRACT.prototype.details = function EXTRACT() { + return this.x; + } +} + diff --git a/data_structures_correct/EXTRACTBITS.js b/data_structures_correct/EXTRACTBITS.js new file mode 100644 index 0000000..4f16f21 --- /dev/null +++ b/data_structures_correct/EXTRACTBITS.js @@ -0,0 +1,27 @@ +function EXTRACTBITS() { + + EXTRACTBITS.prototype.define = function EXTRACTBITS() { + this.numb = []; + + var model = scicos_model(); + model.sim = list(new ScilabString(["extract_bit_32_UH0"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.intyp = new ScilabDouble([3]); + model.outtyp = new ScilabDouble([3]); + model.ipar = new ScilabDouble([0, ...this.numb]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(3)], [sci2exp(1)], [sci2exp(0)], [sci2exp(0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXTRACTBITS\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + EXTRACTBITS.prototype.details = function EXTRACTBITS() { + return this.x; + } +} diff --git a/data_structures_correct/EXTRACTOR.js b/data_structures_correct/EXTRACTOR.js new file mode 100644 index 0000000..c8d7a1b --- /dev/null +++ b/data_structures_correct/EXTRACTOR.js @@ -0,0 +1,24 @@ +function EXTRACTOR() { + + EXTRACTOR.prototype.define = function EXTRACTOR() { + this.ind = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["extractor"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.out = new ScilabDouble([1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + model.ipar = new ScilabDouble([this.ind]); + + var exprs = new ScilabString([sci2exp(this.ind)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"EXTRACTOR\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + EXTRACTOR.prototype.details = function EXTRACTOR() { + return this.x; + } +} + diff --git a/data_structures_correct/EXTTRI.js b/data_structures_correct/EXTTRI.js new file mode 100644 index 0000000..96fdb39 --- /dev/null +++ b/data_structures_correct/EXTTRI.js @@ -0,0 +1,35 @@ +function EXTTRI() { + + EXTTRI.prototype.define = function EXTTRI() { + this.function_name = "extrilz"; + 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([-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(); + 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),\"EXTTRI\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + EXTTRI.prototype.details = function EXTTRI() { + return this.x; + } +} + diff --git a/data_structures_correct/Extract_Activation.js b/data_structures_correct/Extract_Activation.js new file mode 100644 index 0000000..a13fc27 --- /dev/null +++ b/data_structures_correct/Extract_Activation.js @@ -0,0 +1,129 @@ +function Extract_Activation() { + + Extract_Activation.prototype.define = function Extract_Activation() { + var scs_m_1 = scicos_diagram(); + scs_m_1.objs.push(new IFTHEL_f().internal()); + scs_m_1.objs.push(new CLKSOMV_f().internal()); + scs_m_1.objs.push(new IN_f().internal()); + scs_m_1.objs.push(new CLKOUTV_f().internal()); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + + var blk = scs_m_1.objs[0]; + var graphics = blk.graphics; + + var model = blk.model; + graphics.orig = new ScilabDouble([80, 0]); + graphics.sz = new ScilabDouble([60, 40]); + graphics.flip = new ScilabBoolean([true]); + graphics.exprs = new ScilabString(["0"], ["0"]); + model.evtin = new ScilabDouble(); + model.nzcross = new ScilabDouble([0]); + model.nmode = new ScilabDouble([0]); + graphics.pin = new ScilabDouble([7]); + graphics.peout = new ScilabDouble([5], [6]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[0] = blk; + + blk = scs_m_1.objs[1]; + graphics = blk.graphics; + model = blk.model; + model.outtyp = new ScilabDouble(); + model.evtin = new ScilabDouble([-1], [-1], [-1]); + model.evtout = new ScilabDouble([-1]); + graphics.orig = new ScilabDouble([80, -80]); + graphics.sz = new ScilabDouble([80, 40]); + graphics.flip = new ScilabBoolean([true]); + graphics.pein = new ScilabDouble([5], [6], [0]); + graphics.peout = new ScilabDouble([8]); + graphics.style = new ScilabString(["CLKSOMV_f"]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[1] = blk; + + blk = scs_m_1.objs[2]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([0, 10]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.flip = new ScilabBoolean([true]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pout = new ScilabDouble([7]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[2] = blk; + + blk = scs_m_1.objs[3]; + graphics = blk.graphics; + model = blk.model; + model.outtyp = new ScilabDouble(); + graphics.style = new ScilabString(["CLKOUTV_f"]); + graphics.orig = new ScilabDouble([110, -140]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.flip = new ScilabBoolean([true]); + graphics.exprs = new ScilabString(["1"]); + graphics.gr_i = list(new ScilabString(["xstringb(orig(1),orig(2),\"CLKOUTV_f\",sz(1),sz(2));"]), new ScilabDouble([8])); + model.ipar = new ScilabDouble([1]); + graphics.pein = new ScilabDouble([8]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[3] = blk; + + var lnk = scs_m_1.objs[4]; + lnk.xx = new ScilabDouble([140], [140]); + lnk.yy = new ScilabDouble([-44], [-76]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([1, 1, 0]); + lnk.to = new ScilabDouble([2, 1, 1]); + scs_m_1.objs[4] = lnk; + + lnk = scs_m_1.objs[5]; + lnk.xx = new ScilabDouble([160], [160]); + lnk.yy = new ScilabDouble([-44], [-76]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([1, 2, 0]); + lnk.to = new ScilabDouble([2, 2, 1]); + scs_m_1.objs[5] = lnk; + + lnk = scs_m_1.objs[6]; + lnk.xx = new ScilabDouble([64], [116]); + lnk.yy = new ScilabDouble([-40], [-20]); + lnk.from = new ScilabDouble([3, 1, 0]); + lnk.to = new ScilabDouble([1, 1, 1]); + scs_m_1.objs[6] = lnk; + + lnk = scs_m_1.objs[7]; + lnk.xx = new ScilabDouble([160], [160]); + lnk.yy = new ScilabDouble([-124], [-176]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([2, 1, 0]); + lnk.to = new ScilabDouble([4, 1, 1]); + scs_m_1.objs[7] = lnk; + + model = scicos_model(); + model.sim = new ScilabString(["csuper"]); + model.in = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = scs_m_1; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Extract_Activation\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + + Extract_Activation.prototype.details = function Extract_Activation() { + return this.x; + } +} diff --git a/data_structures_correct/FROMMO.js b/data_structures_correct/FROMMO.js new file mode 100644 index 0000000..e854ad0 --- /dev/null +++ b/data_structures_correct/FROMMO.js @@ -0,0 +1,33 @@ +function FROMMO() { + + FROMMO.prototype.define = function FROMMO() { + + var model = scicos_model(); + model.sim = new ScilabString(["frommo"]); + model.in = new ScilabDouble(); + model.in2 = new ScilabDouble(); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([-1]); + model.ipar = new ScilabDouble(); + model.opar = list(new ScilabString(["A"])); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var mo = modelica(); + mo.model = new ScilabString(["frommo"]); + mo.outputs = new ScilabString(["n"]); + + var exprs = new ScilabString(["A"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"FROMMO\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + FROMMO.prototype.details = function FROMMO() { + return this.x; + } +} + diff --git a/data_structures_correct/Flowmeter.js b/data_structures_correct/Flowmeter.js new file mode 100644 index 0000000..4e5b7c9 --- /dev/null +++ b/data_structures_correct/Flowmeter.js @@ -0,0 +1,61 @@ +function Flowmeter() { + + Flowmeter.prototype.define = function Flowmeter() { + this.ModelName = "Flowmeter"; + this.PrametersValue = 1; + this.ParametersName = "Qini"; + + var model = scicos_model(); + + this.Typein = []; + this.Typeout = []; + + this.MI = []; + this.MO = []; + this.P = [[50,105,-1,90],[0,10,2,0],[101,10,-2,0]]; + this.PortName = [["Mesure"],["C1"],["C2"]]; + + for (var i = 0; i < size(this.P, "r"); i++) { + if (this.P[i][2] == 1) { + this.Typein.push(["E"]); + this.MI.push(this.PortName[i]); + } + + if (this.P[i][2] == 2) { + this.Typein.push(["I"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == -1) { + this.Typeout.push(["E"]); + this.MO.push(this.PortName[i]); + } + if (this.P[i][2] == -2) { + this.Typeout.push(["I"]); + this.MO.push(this.PortName[i]); + } + } + + var mo = modelica(); + model.sim = new ScilabString([this.ModelName]); + mo.inputs = new ScilabString(...this.MI); + mo.outputs = new ScilabString(...this.MO); + model.rpar = new ScilabDouble([this.PrametersValue]); + mo.parameters = list(new ScilabString([this.ParametersName]), new ScilabDouble([this.PrametersValue]), new ScilabDouble(zeros([this.ParametersName]))); + var exprs = new ScilabString(["1"]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Flowmeter\",sz(1),sz(2));"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + mo.model = new ScilabString([this.ModelName]); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); + model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabDouble(this.Typein); + this.x.graphics.out_implicit = new ScilabDouble(this.Typeout); + return new BasicBlock(this.x); + } + + Flowmeter.prototype.details = function Flowmeter() { + return this.x; + } +} diff --git a/data_structures_correct/GAINBLK.js b/data_structures_correct/GAINBLK.js new file mode 100644 index 0000000..f4d758e --- /dev/null +++ b/data_structures_correct/GAINBLK.js @@ -0,0 +1,30 @@ +function GAINBLK() { + + GAINBLK.prototype.define = function GAINBLK() { + this.gain = 1; + this.in1 = -1; + this.out = -1; + this.in2 = -2; + this.out2 = -2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["gainblk"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([this.out]); + model.in2 = new ScilabDouble([this.in2]); + model.out2 = new ScilabDouble([this.out2]); + model.rpar = new ScilabDouble([this.gain]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.gain)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GAINBLK\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + GAINBLK.prototype.details = function GAINBLK() { + return this.x; + } +} + diff --git a/data_structures_correct/GAIN_f.js b/data_structures_correct/GAIN_f.js new file mode 100644 index 0000000..b102bab --- /dev/null +++ b/data_structures_correct/GAIN_f.js @@ -0,0 +1,26 @@ +function GAIN_f() { + + GAIN_f.prototype.define = function GAIN_f() { + this.gain = 1; + this.in1 = 1; + this.out = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["gain"]); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.gain]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.gain)], [sci2exp(this.in1)], [sci2exp(this.out)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GAIN_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + GAIN_f.prototype.details = function GAIN_f() { + return this.x; + } +} + diff --git a/data_structures_correct/GENERAL_f.js b/data_structures_correct/GENERAL_f.js new file mode 100644 index 0000000..d70a82e --- /dev/null +++ b/data_structures_correct/GENERAL_f.js @@ -0,0 +1,29 @@ +function GENERAL_f() { + + GENERAL_f.prototype.define = function GENERAL_f() { + var rpar = [[0],[0],[0],[0]]; + + this.in1 = 1; + this.out = 1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1])); + model.nzcross = new ScilabDouble([this.in1]); + model.in = new ScilabDouble([this.in1]); + model.evtout = new ScilabDouble(...ones(this.out, 1)); + model.rpar = new ScilabDouble([0], [0], [0], [0]); + model.blocktype = new ScilabString(["z"]); + model.firing = -new ScilabDouble(...ones(this.out, 1)); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.in1)], [sci2exp(this.out)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GENERAL_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + GENERAL_f.prototype.details = function GENERAL_f() { + return this.x; + } +} diff --git a/data_structures_correct/GENSIN_f.js b/data_structures_correct/GENSIN_f.js new file mode 100644 index 0000000..66542ea --- /dev/null +++ b/data_structures_correct/GENSIN_f.js @@ -0,0 +1,26 @@ +function GENSIN_f() { + + GENSIN_f.prototype.define = function GENSIN_f() { + this.rpar = [[1], [1], [0]]; + + var model = scicos_model(); + model.sim = new ScilabString(["gensin"]); + model.in = new ScilabDouble(); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.rpar = new ScilabDouble([1], [1], [0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + + var exprs = new ScilabString(this.rpar[0], this.rpar[1], this.rpar[2]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GENSIN_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + GENSIN_f.prototype.details = function GENSIN_f() { + return this.x; + } +} + diff --git a/data_structures_correct/GENSQR_f.js b/data_structures_correct/GENSQR_f.js new file mode 100644 index 0000000..4a48f00 --- /dev/null +++ b/data_structures_correct/GENSQR_f.js @@ -0,0 +1,25 @@ +function GENSQR_f() { + + GENSQR_f.prototype.define = function GENSQR_f() { + this.Amplitude = 1; + + var model = scicos_model(); + model.sim = new ScilabString(["gensqr"]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble([this.Amplitude]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.Amplitude]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GENSQR_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + GENSQR_f.prototype.details = function GENSQR_f() { + return this.x; + } +} diff --git a/data_structures_correct/GOTO.js b/data_structures_correct/GOTO.js new file mode 100644 index 0000000..7f0a421 --- /dev/null +++ b/data_structures_correct/GOTO.js @@ -0,0 +1,28 @@ +function GOTO() { + + GOTO.prototype.define = function GOTO() { + var model = scicos_model(); + model.sim = new ScilabString(["goto"]); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([-1]); + model.out = new ScilabDouble(); + model.out2 = new ScilabDouble(); + model.outtyp = new ScilabDouble([1]); + model.ipar = new ScilabDouble([1]); + model.opar = list(new ScilabString(["A"])); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString(["A"], [sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GOTO\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i); + this.x.graphics.id = new ScilabString(["Goto"]); + return new BasicBlock(this.x) + } + + GOTO.prototype.details = function GOTO() { + return this.x; + } +} diff --git a/data_structures_correct/GOTOMO.js b/data_structures_correct/GOTOMO.js new file mode 100644 index 0000000..19361c9 --- /dev/null +++ b/data_structures_correct/GOTOMO.js @@ -0,0 +1,33 @@ +function GOTOMO() { + + GOTOMO.prototype.define = function GOTOMO() { + + var model = scicos_model(); + model.sim = new ScilabString(["gotomo"]); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble(); + model.out = new ScilabDouble(); + model.out2 = new ScilabDouble(); + model.outtyp = new ScilabDouble([1]); + model.ipar = new ScilabDouble([1]); + model.opar = list(new ScilabString(["A"])); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var mo = modelica(); + mo.model = new ScilabString(["gotomo"]); + mo.inputs = new ScilabString(["p"]); + + var exprs = new ScilabString(["A"], [sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GOTOMO\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i); + this.x.graphics.in_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + GOTOMO.prototype.details = function GOTOMO() { + return this.x; + } +} + diff --git a/data_structures_correct/GotoTagVisibilityMO.js b/data_structures_correct/GotoTagVisibilityMO.js new file mode 100644 index 0000000..06a4356 --- /dev/null +++ b/data_structures_correct/GotoTagVisibilityMO.js @@ -0,0 +1,29 @@ +function GotoTagVisibilityMO() { + + GotoTagVisibilityMO.prototype.define = function GotoTagVisibilityMO() { + + var model = scicos_model(); + model.sim = new ScilabString(["gototagvisibilitymo"]); + model.in = new ScilabDouble(); + model.in2 = new ScilabDouble(); + model.out = new ScilabDouble(); + model.out2 = new ScilabDouble(); + model.evtin = new ScilabDouble(); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.opar = list(new ScilabString(["A"])); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabBoolean([false]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString(["A"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GotoTagVisibilityMO\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + GotoTagVisibilityMO.prototype.details = function GotoTagVisibilityMO() { + return this.x; + } +} + diff --git a/data_structures_correct/Ground.js b/data_structures_correct/Ground.js new file mode 100644 index 0000000..9ebe910 --- /dev/null +++ b/data_structures_correct/Ground.js @@ -0,0 +1,30 @@ +function Ground() { + + Ground.prototype.define = function Ground() { + + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble(); + model.sim = new ScilabString(["Ground"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Ground"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabDouble(); + model.equations = mo; + + var exprs = new ScilabString([""]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]); + this.x = standard_define(new ScilabDouble([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 GroundBlock(this.x); + } + + Ground.prototype.details = function Ground() { + return this.x; + } +} diff --git a/data_structures_correct/Gyrator.js b/data_structures_correct/Gyrator.js new file mode 100644 index 0000000..3c716af --- /dev/null +++ b/data_structures_correct/Gyrator.js @@ -0,0 +1,57 @@ +function Gyrator() { + + Gyrator.prototype.define = function Gyrator() { + this.ModelName = "Gyrator"; + this.PrametersValue = [[1],[1]]; + this.ParametersName = [["G1"],["G2"]]; + this.model = scicos_model(); + this.Typein = []; + this.Typeout = []; + this.MI = []; + this.MO = []; + this.P = [[2.5, 90, 2, 0],[2.5, 10, 2, 0],[97.5, 90, -2, 0],[97.5, 10, -2, 0]]; + this.PortName = [["p1"],["n1"],["p2"],["n2"]]; + + for (var i = 0; i < size(this.P, "r"); i++) { + if (this.P[i][2] == 1) { + this.Typein.push(["E"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == 2) { + this.Typein.push(["I"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == -1) { + this.Typeout.push(["E"]); + this.MO.push(this.PortName[i]); + } + if (this.P[i][2] == -2) { + this.Typeout.push(["I"]); + this.MO.push(this.PortName[i]); + } + } + var model = scicos_model(); + var mo = modelica(); + model.sim = new ScilabString([this.ModelName]); + mo.inputs = new ScilabString(...this.MI); + mo.outputs = new ScilabString(...this.MO); + console.log(this.MI); + model.rpar = new ScilabDouble(...this.PrametersValue); + mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName))); + var exprs = new ScilabString(["1"], ["1"]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"Gyrator",sz(1),sz(2));"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + mo.model = new ScilabString([this.ModelName]); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); + model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); + this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabString(...this.Typein); + this.x.graphics.out_implicit = new ScilabString(...this.Typeout); + return new BasicBlock(this.x); + } + Gyrator.prototype.details = function Gyrator() { + return this.x; + } +} diff --git a/data_structures_correct/HALT_f.js b/data_structures_correct/HALT_f.js new file mode 100644 index 0000000..1d51549 --- /dev/null +++ b/data_structures_correct/HALT_f.js @@ -0,0 +1,24 @@ +function HALT_f() { + + HALT_f.prototype.define = function HALT_f() { + this.n = 0; + + var model = scicos_model(); + model.sim = new ScilabString(["hltblk"]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0]); + model.ipar = new ScilabDouble([0]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.n]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HALT_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + HALT_f.prototype.details = function HALT_f() { + return this.x; + } +} + diff --git a/data_structures_correct/HYSTHERESIS.js b/data_structures_correct/HYSTHERESIS.js new file mode 100644 index 0000000..cea39de --- /dev/null +++ b/data_structures_correct/HYSTHERESIS.js @@ -0,0 +1,29 @@ +function HYSTHERESIS() { + + HYSTHERESIS.prototype.define = function HYSTHERESIS() { + this.in1 = 1; + this.ipar = 0; + this.nzz = 2; + this.rpar = [[1], [0], [1], [0]]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["hystheresis"]), new ScilabDouble([4])); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble(...this.rpar); + model.nzcross = new ScilabDouble([this.nzz]); + model.nmode = new ScilabDouble([1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString(...this.rpar, [Math.sign(this.nzz)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"HYSTHERESIS\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + HYSTHERESIS.prototype.details = function HYSTHERESIS() { + return this.x; + } +} + diff --git a/data_structures_correct/INIMPL_f.js b/data_structures_correct/INIMPL_f.js new file mode 100644 index 0000000..4b35d43 --- /dev/null +++ b/data_structures_correct/INIMPL_f.js @@ -0,0 +1,28 @@ +function INIMPL_f() { + + INIMPL_f.prototype.define = function INIMPL_f() { + var model = scicos_model(); + model.sim = new ScilabString(["inimpl"]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([1]); + model.ipar = new ScilabDouble([1]); + model.dep_ut = new ScilabBoolean([false, false]); + model.blocktype = new ScilabString(["c"]); + + var mo = modelica(); + mo.model = new ScilabString(["PORT"]); + mo.outputs = new ScilabString(["n"]); + mo.inputs = new ScilabDouble(); + model.equations = mo; + + var exprs = new ScilabString(["1"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"INIMPL_f",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new ImplicitInBlock(this.x); + } + INIMPL_f.prototype.details = function INIMPL_f() { + return this.x; + } +} diff --git a/data_structures_correct/INTEGRAL_f.js b/data_structures_correct/INTEGRAL_f.js new file mode 100644 index 0000000..2bd0b45 --- /dev/null +++ b/data_structures_correct/INTEGRAL_f.js @@ -0,0 +1,24 @@ +function INTEGRAL_f() { + + INTEGRAL_f.prototype.define = function INTEGRAL_f() { + this.x0 = 0; + + var model = scicos_model(); + model.sim = new ScilabString(["integr"]); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.state = new ScilabDouble([this.x0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + + var exprs = new ScilabString([sci2exp(this.x0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INTEGRAL_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + INTEGRAL_f.prototype.details = function INTEGRAL_f() { + return this.x; + } +} + diff --git a/data_structures_correct/INTEGRAL_m.js b/data_structures_correct/INTEGRAL_m.js new file mode 100644 index 0000000..042d5ff --- /dev/null +++ b/data_structures_correct/INTEGRAL_m.js @@ -0,0 +1,29 @@ +function INTEGRAL_m() { + + INTEGRAL_m.prototype.define = function INTEGRAL_m() { + this.maxp = 1; + this.minp = -1; + this.rpar = []; + + var model = scicos_model(); + model.state = new ScilabDouble([0]); + model.sim = list(new ScilabString(["integral_func"]), new ScilabDouble([4])); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.in2 = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.rpar = new ScilabDouble(); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + + var exprs = new ScilabString([0], [0], [0], [this.maxp], [this.minp]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INTEGRAL_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + INTEGRAL_m.prototype.details = function INTEGRAL_m() { + return this.x; + } +} + diff --git a/data_structures_correct/INTMUL.js b/data_structures_correct/INTMUL.js new file mode 100644 index 0000000..e24c496 --- /dev/null +++ b/data_structures_correct/INTMUL.js @@ -0,0 +1,29 @@ +function INTMUL() { + + INTMUL.prototype.define = function INTMUL() { + this.sgn = 0; + + var model = scicos_model(); + model.sim = list(new ScilabString(["matmul_i32"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1], [-2]); + model.out = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2], [-3]); + model.out2 = new ScilabDouble([-3]); + model.intyp = new ScilabDouble([3, 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)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INTMUL\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + INTMUL.prototype.details = function INTMUL() { + return this.x; + } +} + diff --git a/data_structures_correct/INVBLK.js b/data_structures_correct/INVBLK.js new file mode 100644 index 0000000..34da523 --- /dev/null +++ b/data_structures_correct/INVBLK.js @@ -0,0 +1,23 @@ +function INVBLK() { + + INVBLK.prototype.define = function INVBLK() { + this.in1 = -1; + + var model = scicos_model(); + model.sim = list(new ScilabString(["invblk4"]), new ScilabDouble([4])); + 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([" "]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"INVBLK\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + INVBLK.prototype.details = function INVBLK() { + return this.x; + } +} + 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/ISELECT_m.js b/data_structures_correct/ISELECT_m.js new file mode 100644 index 0000000..e2f2c10 --- /dev/null +++ b/data_structures_correct/ISELECT_m.js @@ -0,0 +1,35 @@ +function ISELECT_m() { + + ISELECT_m.prototype.define = function ISELECT_m() { + this.z0 = 1; + this.nout = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["selector_m"]), new ScilabDouble([4])); + model.out = new ScilabDouble([-1], [-1]); + model.out2 = new ScilabDouble([-2], [-2]); + model.outtyp = new ScilabDouble([1]); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = 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.nout, 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.nout)], [sci2exp(this.z0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ISELECT_m\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + ISELECT_m.prototype.details = function ISELECT_m() { + return this.x; + } +} + diff --git a/data_structures_correct/IdealTransformer.js b/data_structures_correct/IdealTransformer.js index 3c97211..4a8666f 100644 --- a/data_structures_correct/IdealTransformer.js +++ b/data_structures_correct/IdealTransformer.js @@ -38,7 +38,6 @@ function IdealTransformer() { mo.inputs = new ScilabString(...this.MI); mo.outputs = new ScilabString(...this.MO); model.rpar = new ScilabDouble(this.PrametersValue); - console.log(zeros(getData(this.ParametersName))); mo.parameters = list(new ScilabString(this.ParametersName), new ScilabDouble(this.PrametersValue), new ScilabDouble(zeros(getData(this.ParametersName)))); var exprs = new ScilabString(["1"]); var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IdealTransformer\",sz(1),sz(2));"]); diff --git a/data_structures_correct/Inductor.js b/data_structures_correct/Inductor.js new file mode 100644 index 0000000..851a005 --- /dev/null +++ b/data_structures_correct/Inductor.js @@ -0,0 +1,34 @@ +function Inductor() { + + Inductor.prototype.define = function Inductor() { + this.L = 1.0E-5; + + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.L.toExponential(1)]); + model.sim = new ScilabString(["Inductor"]); + + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Inductor"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["n"]); + mo.parameters = list(new ScilabString(["L"]), list(new ScilabDouble([this.L.toExponential(1)]))); + model.equations = mo; + + var exprs = new ScilabString([this.L]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Inductor\",sz(1),sz(2));"]); + this.x = standard_define([2, 0.9], 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); + } + Inductor.prototype.details = function Inductor() { + return this.x; + } +} + diff --git a/data_structures_correct/LOGBLK_f.js b/data_structures_correct/LOGBLK_f.js new file mode 100644 index 0000000..07f70f9 --- /dev/null +++ b/data_structures_correct/LOGBLK_f.js @@ -0,0 +1,25 @@ +function LOGBLK_f() { + + LOGBLK_f.prototype.define = function LOGBLK_f() { + this.in1 = 1; + this.a = Math.E; + + var model = scicos_model(); + model.sim = new ScilabString(["logblk"]); + model.in = new ScilabDouble([-1]); + model.out = new ScilabDouble([-1]); + model.rpar = new ScilabDouble([this.a]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString(["%e"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"LOGBLK_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + LOGBLK_f.prototype.details = function LOGBLK_f() { + return this.x; + } +} + diff --git a/data_structures_correct/LOGICAL_OP.js b/data_structures_correct/LOGICAL_OP.js new file mode 100644 index 0000000..c7ccea1 --- /dev/null +++ b/data_structures_correct/LOGICAL_OP.js @@ -0,0 +1,26 @@ +function LOGICAL_OP() { + + LOGICAL_OP.prototype.define = function LOGICAL_OP() { + this.in1 = [[-1], [-1]]; + this.ipar = 0; + this.nin = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["logicalop"]), new ScilabDouble([4])); + model.in = new ScilabDouble(...this.in1); + 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.nin], [this.ipar]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"LOGICAL_OP\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + LOGICAL_OP.prototype.details = function LOGICAL_OP() { + return this.x; + } +} + diff --git a/data_structures_correct/LOOKUP_f.js b/data_structures_correct/LOOKUP_f.js new file mode 100644 index 0000000..bce7f4c --- /dev/null +++ b/data_structures_correct/LOOKUP_f.js @@ -0,0 +1,21 @@ +function LOOKUP_f() { + + LOOKUP_f.prototype.define = function LOOKUP_f() { + + var model = scicos_model(); + model.sim = new ScilabString(["lookup"]); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble([-2], [-1], [1], [2], [-1], [1], [-1], [1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"LOOKUP_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, [], gr_i); + return new BasicBlock(this.x); + } + LOOKUP_f.prototype.details = function LOOKUP_f() { + return this.x; + } +} + diff --git a/data_structures_correct/MATBKSL.js b/data_structures_correct/MATBKSL.js new file mode 100644 index 0000000..22a873c --- /dev/null +++ b/data_structures_correct/MATBKSL.js @@ -0,0 +1,35 @@ +function MATBKSL() { + + MATBKSL.prototype.define = function MATBKSL() { + this.function_name = "mat_bksl"; + 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]); + model.in2 = new ScilabDouble([-2], [-3]); + model.intyp = new ScilabDouble([1, 1]); + model.out = new ScilabDouble([-2]); + model.out2 = new ScilabDouble([-3]); + 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)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATBKSL\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATBKSL.prototype.details = function MATBKSL() { + return this.x; + } +} + diff --git a/data_structures_correct/MATCATH.js b/data_structures_correct/MATCATH.js new file mode 100644 index 0000000..b1dc096 --- /dev/null +++ b/data_structures_correct/MATCATH.js @@ -0,0 +1,35 @@ +function MATCATH() { + + MATCATH.prototype.define = function MATCATH() { + this.funtyp = 4; + this.function_name = "mat_cath"; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1], [-1]); + model.in2 = new ScilabDouble([-2], [-3]); + model.intyp = new ScilabDouble([1, 1]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([0]); + 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(2)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATCATH\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 3]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATCATH.prototype.details = function MATCATH() { + return this.x; + } +} + diff --git a/data_structures_correct/MATCATV.js b/data_structures_correct/MATCATV.js new file mode 100644 index 0000000..317309b --- /dev/null +++ b/data_structures_correct/MATCATV.js @@ -0,0 +1,36 @@ +function MATCATV() { + + MATCATV.prototype.define = function MATCATV() { + this.l1 = [[2], [2]]; + this.function_name = "mat_catv"; + this.funtyp = 4; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in2 = new ScilabDouble([-1], [-1]); + model.in = new ScilabDouble([-2], [-3]); + model.intyp = new ScilabDouble([-1, -1]); + model.out = new ScilabDouble([0]); + 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(2)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATCATV\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 3]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATCATV.prototype.details = function MATCATV() { + return this.x; + } +} + diff --git a/data_structures_correct/MATDET.js b/data_structures_correct/MATDET.js new file mode 100644 index 0000000..7005d7c --- /dev/null +++ b/data_structures_correct/MATDET.js @@ -0,0 +1,36 @@ +function MATDET() { + + MATDET.prototype.define = function MATDET() { + var model = scicos_model(); + + this.function_name = "mat_det"; + this.funtyp = 4; + + 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([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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATDET\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + + MATDET.prototype.details = function MATDET() { + return this.x; + } +} diff --git a/data_structures_correct/MATDIAG.js b/data_structures_correct/MATDIAG.js new file mode 100644 index 0000000..c622a95 --- /dev/null +++ b/data_structures_correct/MATDIAG.js @@ -0,0 +1,35 @@ +function MATDIAG() { + + MATDIAG.prototype.define = function MATDIAG() { + this.function_name = "mat_diag"; + 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([-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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATDIAG\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATDIAG.prototype.details = function MATDIAG() { + return this.x; + } +} + diff --git a/data_structures_correct/MATDIV.js b/data_structures_correct/MATDIV.js new file mode 100644 index 0000000..6715345 --- /dev/null +++ b/data_structures_correct/MATDIV.js @@ -0,0 +1,37 @@ +function MATDIV() { + + MATDIV.prototype.define = function MATDIV() { + var model = scicos_model(); + + this.function_name = "mat_div"; + this.funtyp = 4; + + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1], [-2]); + model.in2 = new ScilabDouble([-3], [-3]); + model.intyp = new ScilabDouble([1, 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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATDIV\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + + MATDIV.prototype.details = function MATDIV() { + return this.x; + } + +} diff --git a/data_structures_correct/MATEIG.js b/data_structures_correct/MATEIG.js new file mode 100644 index 0000000..aefc690 --- /dev/null +++ b/data_structures_correct/MATEIG.js @@ -0,0 +1,35 @@ +function MATEIG() { + + MATEIG.prototype.define = function MATEIG() { + this.function_name = "mat_vps"; + 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([-1]); + model.out2 = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([2]); + 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),\"MATEIG\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATEIG.prototype.details = function MATEIG() { + return this.x; + } +} + diff --git a/data_structures_correct/MATEXPM.js b/data_structures_correct/MATEXPM.js new file mode 100644 index 0000000..6e58a87 --- /dev/null +++ b/data_structures_correct/MATEXPM.js @@ -0,0 +1,34 @@ +function MATEXPM() { + + MATEXPM.prototype.define = function MATEXPM() { + this.function_name = "mat_expm"; + 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([-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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATEXPM\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATEXPM.prototype.details = function MATEXPM() { + return this.x; + } +} + diff --git a/data_structures_correct/MATINV.js b/data_structures_correct/MATINV.js new file mode 100644 index 0000000..e118137 --- /dev/null +++ b/data_structures_correct/MATINV.js @@ -0,0 +1,35 @@ +function MATINV() { + + MATINV.prototype.define = function MATINV() { + this.function_name = "mat_inv"; + 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([-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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATINV\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATINV.prototype.details = function MATINV() { + return this.x; + } +} + diff --git a/data_structures_correct/MATLU.js b/data_structures_correct/MATLU.js new file mode 100644 index 0000000..126d164 --- /dev/null +++ b/data_structures_correct/MATLU.js @@ -0,0 +1,35 @@ +function MATLU() { + + MATLU.prototype.define = function MATLU() { + this.function_name = "mat_lu"; + 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([-1], [-1]); + model.out2 = new ScilabDouble([-1], [-1]); + model.outtyp = new ScilabDouble([1, 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)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATLU\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATLU.prototype.details = function CSCOPE() { + return this.x; + } +} + diff --git a/data_structures_correct/MATMAGPHI.js b/data_structures_correct/MATMAGPHI.js new file mode 100644 index 0000000..0748d27 --- /dev/null +++ b/data_structures_correct/MATMAGPHI.js @@ -0,0 +1,35 @@ +function MATMAGPHI() { + + MATMAGPHI.prototype.define = function MATMAGPHI() { + this.function_name = "matz_abs"; + 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([-2]); + model.intyp = new ScilabDouble([2]); + model.out = new ScilabDouble([-1], [-1]); + model.out2 = new ScilabDouble([-2], [-2]); + model.outtyp = new ScilabDouble([1, 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)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATMAGPHI\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATMAGPHI.prototype.details = function MATMAGPHI() { + return this.x; + } +} + diff --git a/data_structures_correct/MATMUL.js b/data_structures_correct/MATMUL.js new file mode 100644 index 0000000..88f425b --- /dev/null +++ b/data_structures_correct/MATMUL.js @@ -0,0 +1,24 @@ +function MATMUL() { + + MATMUL.prototype.define = function MATMUL() { + + var model = scicos_model(); + model.sim = list(new ScilabString(["matmul_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1], [-2]); + model.in2 = new ScilabDouble([-2], [-3]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-3]); + model.dep_ut = new ScilabBoolean([true, false]); + model.ipar = new ScilabDouble([1]); + + var label = new ScilabString([sci2exp(parseInt(getData(model.ipar)))]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATMUL\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATMUL.prototype.details = function MATMUL() { + return this.x; + } +} + diff --git a/data_structures_correct/MATPINV.js b/data_structures_correct/MATPINV.js new file mode 100644 index 0000000..855d8a3 --- /dev/null +++ b/data_structures_correct/MATPINV.js @@ -0,0 +1,36 @@ +function MATPINV() { + + MATPINV.prototype.define = function MATPINV() { + this.function_name = "mat_pinv"; + 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.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + 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)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATPINV\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATPINV.prototype.details = function MATPINV() { + return this.x; + } +} + diff --git a/data_structures_correct/MATRESH.js b/data_structures_correct/MATRESH.js new file mode 100644 index 0000000..1db99fa --- /dev/null +++ b/data_structures_correct/MATRESH.js @@ -0,0 +1,35 @@ +function MATRESH() { + + MATRESH.prototype.define = function MATRESH() { + this.function_name = "mat_reshape"; + 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([-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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)], [sci2exp([1, 1])], [sci2exp([1, 1])]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATRESH\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATRESH.prototype.details = function MATRESH() { + return this.x; + } +} + diff --git a/data_structures_correct/MATSING.js b/data_structures_correct/MATSING.js new file mode 100644 index 0000000..d99399e --- /dev/null +++ b/data_structures_correct/MATSING.js @@ -0,0 +1,36 @@ +function MATSING() { + + MATSING.prototype.define = function MATSING() { + var model = scicos_model(); + + this.function_name = "mat_sing"; + this.funtyp = 4; + + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([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([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),\"MATSING\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + + MATSING.prototype.details = function MATSING() { + return this.x; + } +} diff --git a/data_structures_correct/MATSUM.js b/data_structures_correct/MATSUM.js new file mode 100644 index 0000000..5af9624 --- /dev/null +++ b/data_structures_correct/MATSUM.js @@ -0,0 +1,35 @@ +function MATSUM() { + + MATSUM.prototype.define = function MATSUM() { + this.function_name = "mat_sum"; + 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([-2]); + model.intyp = new ScilabDouble([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(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)], [sci2exp(0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATSUM\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATSUM.prototype.details = function MATSUM() { + return this.x; + } +} + diff --git a/data_structures_correct/MATTRAN.js b/data_structures_correct/MATTRAN.js new file mode 100644 index 0000000..2ab793a --- /dev/null +++ b/data_structures_correct/MATTRAN.js @@ -0,0 +1,23 @@ +function MATTRAN() { + + MATTRAN.prototype.define = function MATTRAN() { + + var model = scicos_model(); + model.sim = list(new ScilabString(["mattran_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.out = new ScilabDouble([-2]); + model.out2 = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATTRAN\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATTRAN.prototype.details = function MATTRAN() { + return this.x; + } +} + diff --git a/data_structures_correct/MATZCONJ.js b/data_structures_correct/MATZCONJ.js new file mode 100644 index 0000000..7ef31bf --- /dev/null +++ b/data_structures_correct/MATZCONJ.js @@ -0,0 +1,35 @@ +function MATZCONJ() { + + MATZCONJ.prototype.define = function MATZCONJ() { + this.function_name = "matz_conj"; + 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([-2]); + model.intyp = new ScilabDouble([2]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([2]); + 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 ScilabDouble(); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATZCONJ\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATZCONJ.prototype.details = function MATZCONJ() { + return this.x; + } +} + diff --git a/data_structures_correct/MAXMIN.js b/data_structures_correct/MAXMIN.js new file mode 100644 index 0000000..c9d7ce6 --- /dev/null +++ b/data_structures_correct/MAXMIN.js @@ -0,0 +1,23 @@ +function MAXMIN() { + + MAXMIN.prototype.define = function MAXMIN() { + var model = scicos_model(); + model.sim = list(new ScilabString(["minmax"]), new ScilabDouble([4])); + model.out = new ScilabDouble([1]); + model.in = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + model.ipar = new ScilabDouble([0]); + + var exprs = new ScilabString(...math.transpose([[2, 1, 1]])); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MAXMIN\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + this.x.graphics.style = new ScilabString(["MAXMIN;displayedLabel=MAX"]); + return new BasicBlock(this.x); + } + + MAXMIN.prototype.details = function MAXMIN() { + return this.x; + } +} diff --git a/data_structures_correct/MCLOCK_f.js b/data_structures_correct/MCLOCK_f.js new file mode 100644 index 0000000..b6e1b67 --- /dev/null +++ b/data_structures_correct/MCLOCK_f.js @@ -0,0 +1,139 @@ +function MCLOCK_f() { + + MCLOCK_f.prototype.define = function MCLOCK_f() { + this.nn = 2; + this.dt = 0.1; + var exprs = new ScilabString([this.dt], [this.nn]); + + var mfclck = new MFCLCK_f().internal(); + mfclck.graphics.orig = new ScilabDouble([334, 199]); + mfclck.graphics.sz = new ScilabDouble([40, 40]); + mfclck.graphics.flip = new ScilabBoolean([true]); + mfclck.graphics.exprs = exprs; + mfclck.graphics.pein = new ScilabDouble([12]); + mfclck.graphics.peout = new ScilabDouble([4], [3]); + mfclck.model.rpar = new ScilabDouble([0.1]); + mfclck.model.ipar = new ScilabDouble([this.nn]); + mfclck.model.firing = new ScilabDouble([-1, 0]); + mfclck.model.uid = new ScilabString([count]); + mfclck.doc = list(new ScilabString([count++])); + + var clksom = new CLKSOM_f().internal(); + clksom.graphics.orig = new ScilabDouble([457, 161]); + clksom.graphics.sz = new ScilabDouble([16.666667, 16.666667]); + clksom.graphics.flip = new ScilabBoolean([true]); + clksom.graphics.exprs = new ScilabString(["0.1"], ["0.1"]); + clksom.graphics.pein = new ScilabDouble([4], [9], [0]); + clksom.graphics.peout = new ScilabDouble([5]); + clksom.model.uid = new ScilabString([count]); + clksom.doc = list(new ScilabString([count++])); + + var output_port1 = new CLKOUT_f().internal(); + output_port1.graphics.orig = new ScilabDouble([509, 261]); + output_port1.graphics.sz = new ScilabDouble([20, 20]); + output_port1.graphics.flip = new ScilabBoolean([true]); + output_port1.graphics.exprs = new ScilabString(["1"]); + output_port1.graphics.pein = new ScilabDouble([10]); + output_port1.model.ipar = new ScilabDouble([1]); + output_port1.model.uid = new ScilabString([count]); + output_port1.doc = list(new ScilabString([count++])); + + var output_port2 = new CLKOUT_f().internal(); + output_port2.graphics.orig = new ScilabDouble([509, 142]); + output_port2.graphics.sz = new ScilabDouble([20, 20]); + output_port2.graphics.flip = new ScilabBoolean([true]); + output_port2.graphics.exprs = new ScilabString(["2"]); + output_port2.graphics.pein = new ScilabDouble([13]); + output_port2.model.ipar = new ScilabDouble([2]); + output_port2.model.uid = new ScilabString([count]); + output_port2.doc = list(new ScilabString([count++])); + + var split1 = new CLKSPLIT_f().internal(); + split1.graphics.orig = new ScilabDouble([411.92504, 169.33333]); + split1.graphics.pein = new ScilabDouble([3]); + split1.graphics.peout = new ScilabDouble([9], [10]); + split1.model.uid = new ScilabString([count]); + split1.doc = list(new ScilabString([count++])); + + var split2 = new CLKSPLIT_f().internal(); + split2.graphics.orig = new ScilabDouble([482.45315, 169.33333]); + split2.graphics.pein = new ScilabDouble([5]); + split2.graphics.peout = new ScilabDouble([12], [13]); + split2.model.uid = new ScilabString([count]); + split2.doc = list(new ScilabString([count++])); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"MCLOCK_f",sz(1),sz(2));"]); + + var diagram = scicos_diagram(); + diagram.objs.push(mfclck); + diagram.objs.push(clksom); + diagram.objs.push(output_port1); + diagram.objs.push(output_port2); + diagram.objs.push(split1); + diagram.objs.push(split2); + + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([360.7], [360.7], [411.9]), + yy: new ScilabDouble([193.3], [169.3], [169.3]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([1, 2, 0]), + to: new ScilabDouble([5, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([347.3], [347.3], [461.8], [461.8]), + yy: new ScilabDouble([193.3], [155.5], [155.5], [161]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([2, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([468.9], [482.5]), + yy: new ScilabDouble([169.3], [169.3]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([2, 1, 0]), + to: new ScilabDouble([6, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([411.9], [457]), + yy: new ScilabDouble([169.3], [169.3]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([5, 1, 0]), + to: new ScilabDouble([2, 2, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([411.9], [411.9], [509]), + yy: new ScilabDouble([169.3], [271], [271]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([5, 2, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([482.5], [489.6], [489.6], [354], [354]), + yy: new ScilabDouble([169.3], [169.3], [338.3], [338.3], [244.7]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([6, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + diagram.objs.push(scicos_link({ + xx: new ScilabDouble([482.4], [482.4], [509]), + yy: new ScilabDouble([169.3], [152], [152]), + ct: new ScilabDouble([10, -1]), + from: new ScilabDouble([6, 2, 0]), + to: new ScilabDouble([4, 1, 1]) + })); + + this.x = scicos_block(); + this.x.gui = new ScilabString(["MCLOCK_f"]); + this.x.graphics.sz = new ScilabDouble([3, 2]); + this.x.graphics.gr_i = gr_i; + this.x.model.sim = new ScilabString(["csuper"]); + this.x.model.evtout = new ScilabDouble([1], [1]); + this.x.model.blocktype = new ScilabString(["h"]); + this.x.model.rpar = diagram; + this.x.graphics.peout = new ScilabDouble([0], [0]); + return new BasicBlock(this.x); + } + MCLOCK_f.prototype.details = function MCLOCK_f() { + return this.x; + } +} diff --git a/data_structures_correct/MFCLCK_f.js b/data_structures_correct/MFCLCK_f.js new file mode 100644 index 0000000..6e0a6aa --- /dev/null +++ b/data_structures_correct/MFCLCK_f.js @@ -0,0 +1,50 @@ +function MFCLCK_f() { + + MFCLCK_f.prototype.define = function MFCLCK_f() { + this.nn = 2; + this.dt = 0.1; + + var model = scicos_model(); + model.sim = new ScilabString(["mfclck"]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1], [1]); + model.dstate = new ScilabDouble([0]); + model.rpar = new ScilabDouble([this.dt]); + model.ipar = new ScilabDouble([this.nn]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1], [0]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.dt], [this.nn]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MFCLCK_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MFCLCK_f.prototype.internal = function MFCLCK_f() { + this.nn = 2; + this.dt = 0.1; + + var model = scicos_model(); + model.sim = new ScilabString(["mfclck"]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1], [1]); + model.dstate = new ScilabDouble([0]); + model.rpar = new ScilabDouble([this.dt]); + model.ipar = new ScilabDouble([this.nn]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1], [0]); + model.dep_ut = new ScilabBoolean([false, false]); + model.outtyp = new ScilabDouble(); + + var exprs = new ScilabString([this.dt], [this.nn]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MFCLCK_f\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + block.graphics.style = new ScilabString(["MFCLCK_f"]); + return block; + } + MFCLCK_f.prototype.details = function MFCLCK_f() { + return this.x; + } +} diff --git a/data_structures_correct/MIN_f.js b/data_structures_correct/MIN_f.js new file mode 100644 index 0000000..e64f3af --- /dev/null +++ b/data_structures_correct/MIN_f.js @@ -0,0 +1,24 @@ +function MIN_f() { + + MIN_f.prototype.define = function MIN_f() { + this.in1 = -1; + + var model = scicos_model(); + model.sim = new ScilabString(["minblk"]); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0], [0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.in1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MIN_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MIN_f.prototype.details = function MIN_f() { + return this.x; + } +} + diff --git a/data_structures_correct/MUX.js b/data_structures_correct/MUX.js new file mode 100644 index 0000000..f968deb --- /dev/null +++ b/data_structures_correct/MUX.js @@ -0,0 +1,26 @@ +function MUX() { + + MUX.prototype.define = function MUX() { + this.in1 = 2; + var arr = []; + arr.push(math.range(-1, -this.in1, -1, true)._data); + + var model = scicos_model(); + model.sim = list(new ScilabString(["multiplex"]), new ScilabDouble([4])); + model.in = new ScilabDouble(...math.transpose(arr)); + model.out = new ScilabDouble([0]); + model.ipar = new ScilabDouble([this.in1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.in1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MUX\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MUX.prototype.details = function MUX() { + return this.x; + } +} + diff --git a/data_structures_correct/MUX_f.js b/data_structures_correct/MUX_f.js new file mode 100644 index 0000000..fa55526 --- /dev/null +++ b/data_structures_correct/MUX_f.js @@ -0,0 +1,26 @@ +function MUX_f() { + + MUX_f.prototype.define = function MUX_f() { + this.in1 = 2; + var arr = []; + arr.push(math.range(-1, -this.in1, -1, true)._data); + + var model = scicos_model(); + model.sim = list(new ScilabString(["mux"]), new ScilabDouble([1])); + model.in = new ScilabDouble(...math.transpose(arr)); + model.out = new ScilabDouble([0]); + model.ipar = new ScilabDouble([this.in1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.in1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MUX_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([0.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MUX_f.prototype.details = function MUX_f() { + return this.x; + } +} + diff --git a/data_structures_correct/M_SWITCH.js b/data_structures_correct/M_SWITCH.js new file mode 100644 index 0000000..ec04419 --- /dev/null +++ b/data_structures_correct/M_SWITCH.js @@ -0,0 +1,26 @@ +function M_SWITCH() { + + M_SWITCH.prototype.define = function M_SWITCH() { + this.in1 = [[1], [-1], [-1]]; + this.ipar = [[1], [3]]; + this.nin = 2; + + var model = scicos_model(); + model.sim = list(new ScilabString(["mswitch"]), new ScilabDouble([4])); + model.in = new ScilabDouble(...this.in1); + 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.nin], ...this.ipar); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"M_SWITCH\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + M_SWITCH.prototype.details = function M_SWITCH() { + return this.x; + } +} + diff --git a/data_structures_correct/M_freq.js b/data_structures_correct/M_freq.js new file mode 100644 index 0000000..e335809 --- /dev/null +++ b/data_structures_correct/M_freq.js @@ -0,0 +1,24 @@ +function M_freq() { + + M_freq.prototype.define = function M_freq() { + var model = scicos_model(); + model.sim = list(new ScilabString(["m_frequ"]), new ScilabDouble([4])); + model.evtout = new ScilabDouble([1], [1], [1]); + model.evtin = new ScilabDouble([1]); + model.rpar = new ScilabDouble(); + model.opar = list(new ScilabDouble([1, 1, 0], [1, 1, 1], [1, 3, 2]), new ScilabDouble([1]), new ScilabDouble([0]), new ScilabDouble([0])); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([0, -1, -1]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([sci2exp([[1], [2]])], [sci2exp([[0], [0]])]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"M_freq\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + + M_freq.prototype.details = function M_freq() { + return this.x; + } +} diff --git a/data_structures_correct/Modulo_Count.js b/data_structures_correct/Modulo_Count.js new file mode 100644 index 0000000..dfff095 --- /dev/null +++ b/data_structures_correct/Modulo_Count.js @@ -0,0 +1,46 @@ +function Modulo_Count() { + + Modulo_Count.prototype.define = function Modulo_Count() { + this.ini_c = 0; + this.base = 3; + + var model = scicos_model(); + model.sim = list(new ScilabString(["modulo_count"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.dstate = new ScilabDouble([this.ini_c]); + model.ipar = new ScilabDouble([this.base]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.ini_c], [this.base]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Modulo_Count\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + Modulo_Count.prototype.internal = function Modulo_Count() { + this.ini_c = 0; + this.base = 3; + + var model = scicos_model(); + model.sim = list(new ScilabString(["modulo_count"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.dstate = new ScilabDouble([this.ini_c]); + model.ipar = new ScilabDouble([this.base]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.ini_c], [this.base]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Modulo_Count\",sz(1),sz(2));"]); + var block = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + block.graphics.style = new ScilabString(["Modulo_Count"]); + return block; + } + Modulo_Count.prototype.details = function Modulo_Count() { + return this.x; + } +} diff --git a/data_structures_correct/NMOS.js b/data_structures_correct/NMOS.js new file mode 100644 index 0000000..feac070 --- /dev/null +++ b/data_structures_correct/NMOS.js @@ -0,0 +1,40 @@ +function NMOS() { + + NMOS.prototype.define = function NMOS() { + this.W = 20.e-6; + this.L = 6.e-6; + this.Beta = 0.041e-3; + this.Vt = 0.8; + this.K2 = 1.144; + this.K5 = 0.7311; + this.dW = -2.5e-6; + this.dL = -1.5e-6; + this.RDS = 1.e+7; + + var model = scicos_model(); + model.sim = new ScilabString(["NMOS"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["NMOS"]); + mo.outputs = new ScilabString(["D"], ["B"], ["S"]); + mo.inputs = new ScilabString(["G"]); + mo.parameters = list(new ScilabString(["W"], ["L"], ["Beta"], ["Vt"], ["K2"], ["K5"], ["dW"], ["dL"], ["RDS"]), new ScilabDouble([this.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS])); + 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.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NMOS\",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"], ["I"], ["I"]); + return new BasicBlock(this.x); + } + NMOS.prototype.details = function NMOS() { + return this.x; + } +} + diff --git a/data_structures_correct/NPN.js b/data_structures_correct/NPN.js new file mode 100644 index 0000000..f6f9c9d --- /dev/null +++ b/data_structures_correct/NPN.js @@ -0,0 +1,56 @@ +function NPN() { + + NPN.prototype.define = function NPN() { + this.ModelName = "NPN"; + this.PrametersValue = [[50], [0.1], [0], [0.02], [1.200e-10], [5.000e-09], [1.000e-12], [4.000e-13], [5.000e-13], [0.8], [0.4], [0.8], [0.333], [1.000e-15], [1.000e-15], [0.02585], [40]]; + this.ParametersName = [["Bf"], ["Br"], ["Is"], ["Vak"], ["Tauf"], ["Taur"], ["Ccs"], ["Cje"], ["Cjc"], ["Phie"], ["Me"], ["Phic"], ["Mc"], ["Gbc"], ["Gbe"], ["Vt"], ["EMinMax"]]; + this.model = scicos_model(); + this.Typein = []; + this.Typeout = []; + this.MI = []; + this.MO = []; + this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]]; + this.PortName = [["C"], ["B"], ["E"]]; + + for (var i = 0; i < size(this.P, "r"); i++) { + if (this.P[i][2] == 1) { + this.Typein.push(["E"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == 2) { + this.Typein.push(["I"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == -1) { + this.Typeout.push(["E"]); + this.MO.push(this.PortName[i]); + } + if (this.P[i][2] == -2) { + this.Typeout.push(["I"]); + this.MO.push(this.PortName[i]); + } + } + var model = scicos_model(); + var mo = modelica(); + model.sim = new ScilabString([this.ModelName]); + mo.inputs = new ScilabString(...this.MI); + mo.outputs = new ScilabString(...this.MO); + model.rpar = new ScilabDouble(...this.PrametersValue); + mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName))); + var exprs = new ScilabString(["50"], ["0.1"], ["1.e-16"], ["0.02"], ["0.12e-9"], ["5e-9"], ["1e-12"], ["0.4e-12"], ["0.5e-12"], ["0.8"], ["0.4"], ["0.8"], ["0.333"], ["1e-15"], ["1e-15"], ["0.02585"], ["40"]); + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"NPN",sz(1),sz(2));"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + mo.model = new ScilabString([this.ModelName]); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); + model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); + this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabString(...this.Typein); + this.x.graphics.out_implicit = new ScilabString(...this.Typeout); + return new BasicBlock(this.x); + } + NPN.prototype.details = function NPN() { + return this.x; + } +} diff --git a/data_structures_correct/NRMSOM_f.js b/data_structures_correct/NRMSOM_f.js new file mode 100644 index 0000000..f80bb88 --- /dev/null +++ b/data_structures_correct/NRMSOM_f.js @@ -0,0 +1,24 @@ +function NRMSOM_f() { + + NRMSOM_f.prototype.define = function NRMSOM_f() { + this.in1 = [[-1], [-1]]; + this.nin = 2; + + var model = scicos_model(); + model.sim = new ScilabString(["junk"]); + model.in = new ScilabDouble(...this.in1); + model.out = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.nin]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NRMSOM_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([.2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + NRMSOM_f.prototype.details = function NRMSOM_f() { + return this.x; + } +} + diff --git a/data_structures_correct/OUTIMPL_f.js b/data_structures_correct/OUTIMPL_f.js new file mode 100644 index 0000000..c5846e7 --- /dev/null +++ b/data_structures_correct/OUTIMPL_f.js @@ -0,0 +1,30 @@ +function OUTIMPL_f() { + + OUTIMPL_f.prototype.define = function OUTIMPL_f() { + var model = scicos_model(); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([1]); + + this.prt = 1; + model.sim = new ScilabString(["outimpl"]); + model.ipar = new ScilabDouble([1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var mo = modelica(); + mo.model = new ScilabString(["PORT"]); + mo.inputs = new ScilabString(["n"]); + mo.outputs = new ScilabDouble(); + model.equations = mo; + + var exprs = new ScilabString(["1"]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"OUTIMPL_f",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); + this.x.graphics.in_implicit = new ScilabString(["I"]); + return new ImplicitOutBlock(this.x); + } + OUTIMPL_f.prototype.details = function OUTIMPL_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..d632563 --- /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),\"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"]); + return new ExplicitOutBlock(this.x); + } + + OUT_f.prototype.details = function OUT_f() { + return this.x; + } +} diff --git a/data_structures_correct/OpAmp.js b/data_structures_correct/OpAmp.js new file mode 100644 index 0000000..055bdde --- /dev/null +++ b/data_structures_correct/OpAmp.js @@ -0,0 +1,34 @@ +function OpAmp() { + + OpAmp.prototype.define = function OpAmp() { + this.S = []; + this.Z = []; + + var model = scicos_model(); + model.sim = new ScilabString(["OpAmp"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = model.sim; + mo.inputs = new ScilabString(["in_p"], ["in_n"]); + mo.outputs = new ScilabString(["out"]); + mo.parameters = list(new ScilabDouble(), new ScilabDouble()); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); + model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); + model.rpar = new ScilabDouble(); + + var exprs = new ScilabString(); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OpAmp\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 5]), model, exprs, gr_i); + this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]); + this.x.graphics.out_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + OpAmp.prototype.details = function OpAmp() { + return this.x; + } +} + diff --git a/data_structures_correct/PDE.js b/data_structures_correct/PDE.js new file mode 100644 index 0000000..2aa3a6d --- /dev/null +++ b/data_structures_correct/PDE.js @@ -0,0 +1,24 @@ +function PDE() { + + PDE.prototype.define = function PDE() { + this.params_pde = tlist(["paramspde", "a", "b", "txt_exp", "check_op1", "a1", "b1", "check_op2", "a2", "b2", "check_op3", "a3", "b3", "check_op4", "a4", "b4", "check_op5", "a5", "b5", "check_op6", "a6", "b6", "check_op7", "a7", "b7", "discr_cst", "discr_non_cst", "signe", "rad_automatique", "rad_manuel", "methode", "ord1", "ord2", "ord3", "degre", "nnode", "txt_pas", "CI", "dCI", "CLa", "CLa_exp", "CLb", "CLb_exp", "points"], new ScilabString(["paramspde"], ["a"], ["b"], ["txt_exp"], ["check_op1"], ["a1"], ["b1"], ["check_op2"], ["a2"], ["b2"], ["check_op3"], ["a3"], ["b3"], ["check_op4"], ["a4"], ["b4"], ["check_op5"], ["a5"], ["b5"], ["check_op6"], ["a6"], ["b6"], ["check_op7"], ["a7"], ["b7"], ["discr_cst"], ["discr_non_cst"], ["signe"], ["rad_automatique"], ["rad_manuel"], ["methode"], ["ord1"], ["ord2"], ["ord3"], ["degre"], ["nnode"], ["txt_pas"], ["CI"], ["dCI"], ["CLa"], ["CLa_exp"], ["CLb"], ["CLb_exp"], ["points"]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP1(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP2(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP3(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP4(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP5(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP6(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP7(t)"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString(["0"]), new ScilabString(["IN_CL1(t)"]), new ScilabString(["0"]), new ScilabString(["IN_CL2(t)"]), new ScilabString([""])); + + var model = scicos_model(); + model.state = new ScilabDouble(...zeros(10, 1)); + model.sim = list(new ScilabString(["PDE"]), new ScilabDouble([0])); + model.in = new ScilabDouble([1], [1], [1], [1], [1]); + model.out = new ScilabDouble([10], [0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + + var label = list(this.params_pde, new ScilabDouble(), new ScilabString([""])); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PDE\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 3]), model, label, gr_i); + return new BasicBlock(this.x); + } + PDE.prototype.details = function PDE() { + return this.x; + } +} + diff --git a/data_structures_correct/PID.js b/data_structures_correct/PID.js new file mode 100644 index 0000000..894446b --- /dev/null +++ b/data_structures_correct/PID.js @@ -0,0 +1,626 @@ +function PID() { + + PID.prototype.define = function PID() { + var scs_m = scicos_diagram({ + version: new ScilabString(["scicos4.2"]), + props: scicos_params({ + wpar: new ScilabDouble([600, 450, 0, 0, 600, 450]), + Title: new ScilabString(["PID"]), + tol: new ScilabDouble([0.0001], [0.000001], [1.000E-10], [100001], [0], [0], [0]), + tf: new ScilabDouble([100000]), + context: new ScilabString([" "]), + void1: new ScilabDouble(), + options: tlist(["scsopt", "3D", "Background", "Link", "ID", "Cmap"], new ScilabString(["scsopt", "3D", "Background", "Link", "ID", "Cmap"]), list(new ScilabBoolean([true]), new ScilabDouble([33])), new ScilabDouble([8, 1]), new ScilabDouble([1, 5]), list(new ScilabDouble([5, 1]), new ScilabDouble([4, 1])), new ScilabDouble([0.8, 0.8, 0.8])), + void2: new ScilabDouble(), + void3: new ScilabDouble(), + doc: list() + }) + }); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["INTEGRAL_m"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([318.304, 183.11733]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["0"], ["0"], ["0"], ["1"], ["-1"]), + pin: new ScilabDouble([7]), + pout: new ScilabDouble([9]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"INTEGRAL_m",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString(["1/s"]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""]), + style: new ScilabString(["INTEGRAL_m"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["integral_func"]), new ScilabDouble([4])), + in: new ScilabDouble([1]), + in2: new ScilabDouble([1]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([1]), + out2: new ScilabDouble([1]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble([0]), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, true]), + label: new ScilabString(["1/s"]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["SUMMATION"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([387.97067, 172.85067]), + sz: new ScilabDouble([40, 60]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"], ["[1;1;1]"]), + pin: new ScilabDouble([10], [9], [11]), + pout: new ScilabDouble([19]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"SUMMATION",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"], ["E"], ["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""], [""], [""]), + out_label: new ScilabString([""]), + style: new ScilabString(["SUMMATION"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["summation"]), new ScilabDouble([4])), + in: new ScilabDouble([-1], [-1], [-1]), + in2: new ScilabDouble([-2], [-2], [-2]), + intyp: new ScilabDouble([1], [1], [1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble([1], [1], [1]), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["GAINBLK"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([321.23733, 235.91733]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble([17]), + pout: new ScilabDouble([10]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"GAINBLK",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""]), + style: new ScilabString(["GAINBLK"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["gainblk"]), new ScilabDouble([4])), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([-2]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble([1]), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["DERIV"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([319.03733, 135.45067]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabDouble(), + pin: new ScilabDouble([8]), + pout: new ScilabDouble([11]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"DERIV",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString(["s"]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""]), + style: new ScilabString(["DERIV"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["deriv"]), new ScilabDouble([4])), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([-2]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["x"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString(["s"]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["GAINBLK"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([255.23733, 183.11733]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble([13]), + pout: new ScilabDouble([7]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"GAINBLK",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""]), + style: new ScilabString(["GAINBLK"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["gainblk"]), new ScilabDouble([4])), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([-2]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble([1]), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["GAINBLK"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([255.23733, 135.45067]), + sz: new ScilabDouble([40, 40]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble([14]), + pout: new ScilabDouble([8]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"GAINBLK",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""]), + style: new ScilabString(["GAINBLK"]) + }), + model: scicos_model({ + sim: list(new ScilabString(["gainblk"]), new ScilabDouble([4])), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([-2]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([-2]), + outtyp: new ScilabDouble([1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble([1]), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["SPLIT_f"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([234.704, 203.11733]), + sz: new ScilabDouble([0.3333333, 0.3333333]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabDouble(), + pin: new ScilabDouble([16]), + pout: new ScilabDouble([16], [17], [0]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"SPLIT_f",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"], ["E"], ["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""], [""], [""]), + style: new ScilabString(["SPLIT_f"]) + }), + model: scicos_model({ + sim: new ScilabString(["lsplit"]), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([1]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1], [-1], [-1]), + out2: new ScilabDouble([1], [1], [1]), + outtyp: new ScilabDouble([1], [1], [1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["SPLIT_f"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([233.97067, 203.11733]), + sz: new ScilabDouble([0.3333333, 0.3333333]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabDouble(), + pin: new ScilabDouble([21]), + pout: new ScilabDouble([18], [19], [0]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"SPLIT_f",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabString(["E"], ["E"], ["E"]), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"], ["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + out_label: new ScilabString([""], [""], [""]), + style: new ScilabString(["SPLIT_f"]) + }), + model: scicos_model({ + sim: new ScilabString(["lsplit"]), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([1]), + intyp: new ScilabDouble([1]), + out: new ScilabDouble([-1], [-1], [-1]), + out2: new ScilabDouble([1], [1], [1]), + outtyp: new ScilabDouble([1], [1], [1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble(), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([true, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["OUT_f"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([456.5421, 192.85067]), + sz: new ScilabDouble([20, 20]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble([19]), + pout: new ScilabDouble(), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"OUT_f",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabString(["E"]), + out_implicit: new ScilabDouble(), + in_style: new ScilabString(["ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0"]), + in_label: new ScilabString([""]), + style: new ScilabString(["OUT_f"]) + }), + model: scicos_model({ + sim: new ScilabString(["output"]), + in: new ScilabDouble([-1]), + in2: new ScilabDouble([1]), + intyp: new ScilabDouble([-1]), + out: new ScilabDouble(), + out2: new ScilabDouble(), + outtyp: new ScilabDouble(), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble([1]), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + scs_m.objs.push(scicos_block({ + gui: new ScilabString(["IN_f"]), + graphics: scicos_graphics({ + orig: new ScilabDouble([193.97067, 193.11733]), + sz: new ScilabDouble([20, 20]), + flip: new ScilabBoolean([true]), + theta: new ScilabDouble([0]), + exprs: new ScilabString(["1"]), + pin: new ScilabDouble(), + pout: new ScilabDouble([21]), + pein: new ScilabDouble(), + peout: new ScilabDouble(), + gr_i: list(new ScilabString(["xstringb(orig(1),orig(2),"IN_f",sz(1),sz(2));"]), new ScilabDouble([8])), + id: new ScilabString([""]), + in_implicit: new ScilabDouble(), + out_implicit: new ScilabString(["E"]), + out_style: new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]), + out_label: new ScilabString([""]), + style: new ScilabString(["IN_f"]) + }), + model: scicos_model({ + sim: new ScilabString(["input"]), + in: new ScilabDouble(), + in2: new ScilabDouble(), + intyp: new ScilabDouble(), + out: new ScilabDouble([-1]), + out2: new ScilabDouble([1]), + outtyp: new ScilabDouble([-1]), + evtin: new ScilabDouble(), + evtout: new ScilabDouble(), + state: new ScilabDouble(), + dstate: new ScilabDouble(), + odstate: list(), + rpar: new ScilabDouble(), + ipar: new ScilabDouble([1]), + opar: list(), + blocktype: new ScilabString(["c"]), + firing: new ScilabDouble(), + dep_ut: new ScilabBoolean([false, false]), + label: new ScilabString([""]), + nzcross: new ScilabDouble([0]), + nmode: new ScilabDouble([0]), + equations: list(), + uid: new ScilabString([count]) + }), + doc: list(new ScilabString([count++])) + })); + + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([303.80876], [309.73257]), + yy: new ScilabDouble([203.11733], [203.11733]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([5, 1, 0]), + to: new ScilabDouble([1, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([303.80876], [310.4659]), + yy: new ScilabDouble([155.45067], [155.45067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([6, 1, 0]), + to: new ScilabDouble([4, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([366.87543], [379.39924]), + yy: new ScilabDouble([203.11733], [202.85067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([1, 1, 0]), + to: new ScilabDouble([2, 2, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([369.80876], [379.39924], [379.39924]), + yy: new ScilabDouble([255.91733], [255.91733], [217.85067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([3, 1, 0]), + to: new ScilabDouble([2, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([367.60876], [379.39924], [379.39924]), + yy: new ScilabDouble([155.45067], [155.45067], [187.85067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([4, 1, 0]), + to: new ScilabDouble([2, 3, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([234.704], [246.6659]), + yy: new ScilabDouble([203.11733], [203.11733]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([12, 1, 0]), + to: new ScilabDouble([5, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([234.704], [234.704], [246.6659]), + yy: new ScilabDouble([203.11733], [155.45067], [155.45067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([12, 2, 0]), + to: new ScilabDouble([6, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([233.97067], [234.704]), + yy: new ScilabDouble([203.11733], [203.11733]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([15, 1, 0]), + to: new ScilabDouble([12, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([233.97067], [233.97067], [312.6659]), + yy: new ScilabDouble([203.11733], [255.91733], [255.91733]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([15, 2, 0]), + to: new ScilabDouble([3, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([436.5421], [456.5421]), + yy: new ScilabDouble([202.85067], [202.85067]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([2, 1, 0]), + to: new ScilabDouble([18, 1, 1]) + })); + scs_m.objs.push(scicos_link({ + xx: new ScilabDouble([213.97067], [233.97067]), + yy: new ScilabDouble([203.11733], [203.11733]), + id: new ScilabString(["drawlink"]), + thick: new ScilabDouble([0, 0]), + ct: new ScilabDouble([1, 1]), + from: new ScilabDouble([20, 1, 0]), + to: new ScilabDouble([15, 1, 1]) + })); + + var model = scicos_model(); + model.sim = new ScilabString(["csuper"]); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.blocktype = new ScilabString(["h"]); + model.firing = new ScilabBoolean([false]); + model.dep_ut = new ScilabBoolean([false, false]); + model.rpar = scs_m; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PID\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + PID.prototype.details = function PID() { + return this.x; + } +} diff --git a/data_structures_correct/PNP.js b/data_structures_correct/PNP.js new file mode 100644 index 0000000..cb5843a --- /dev/null +++ b/data_structures_correct/PNP.js @@ -0,0 +1,63 @@ +function PNP() { + + PNP.prototype.define = function PNP() { + this.ModelName = "PNP"; + this.PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; + this.ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; + + var model = scicos_model(); + this.Typein = []; + this.Typeout = []; + this.MI = []; + this.MO = []; + this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]]; + this.PortName = [["C"], ["B"], ["E"]]; + + for (var i = 0; i < size(this.P, "r"); i++) { + if (this.P[i][2] == 1) { + this.Typein.push(["E"]); + this.MI.push(this.PortName[i]); + } + + if (this.P[i][2] == 2) { + this.Typein.push(["I"]); + this.MI.push(this.PortName[i]); + } + if (this.P[i][2] == -1) { + this.Typeout.push(["E"]); + this.MO.push(this.PortName[i]); + } + if (this.P[i][2] == -2) { + this.Typeout.push(["I"]); + this.MO.push(this.PortName[i]); + } + } + + var mo = modelica(); + model.sim = new ScilabString([this.ModelName]); + mo.inputs = new ScilabString(...this.MI); + mo.outputs = new ScilabString(...this.MO); + model.rpar = new ScilabDouble(...this.PrametersValue); + + var arr = []; + arr.push(zeros(getData(this.ParametersName))); + mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...math.transpose(arr))); + var exprs = new ScilabString(["50"], ["0.1"], ["1.e-16"], ["0.02"], ["0.12e-9"], ["5e-9"], ["1e-12"], ["0.4e-12"], ["0.5e-12"], ["0.8"], ["0.4"], ["0.8"], ["0.333"], ["1e-15"], ["1e-15"], ["0.02585"], ["40"]); + var gr_i = "xstringb(orig(1),orig(2),\"PNP\",sz(1),sz(2));" + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, true]); + mo.model = new ScilabString([this.ModelName]); + model.equations = mo; + model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); + model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); + this.x.graphics.in_implicit = new ScilabDouble(...this.Typein); + this.x.graphics.out_implicit = new ScilabDouble(...this.Typeout); + + return new BasicBlock(this.x); + } + + PNP.prototype.details = function PNP() { + return this.x; + } +} diff --git a/data_structures_correct/POSTONEG_f.js b/data_structures_correct/POSTONEG_f.js new file mode 100644 index 0000000..97d9aa6 --- /dev/null +++ b/data_structures_correct/POSTONEG_f.js @@ -0,0 +1,24 @@ +function POSTONEG_f() { + + POSTONEG_f.prototype.define = function POSTONEG_f() { + this.rpar = [[-1], [-1], [-1], [0]]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1])); + model.nzcross = new ScilabDouble([1]); + model.in = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = new ScilabDouble([-1], [-1], [-1], [0]); + model.blocktype = new ScilabString(["z"]); + model.dep_ut = new ScilabBoolean([true, false]); + model.firing = new ScilabDouble([-1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"POSTONEG_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, [], gr_i); + return new BasicBlock(this.x); + } + POSTONEG_f.prototype.details = function POSTONEG_f() { + return this.x; + } +} + diff --git a/data_structures_correct/PRODUCT.js b/data_structures_correct/PRODUCT.js new file mode 100644 index 0000000..0e9e6c8 --- /dev/null +++ b/data_structures_correct/PRODUCT.js @@ -0,0 +1,23 @@ +function PRODUCT() { + + PRODUCT.prototype.define = function PRODUCT() { + this.sgn = [[1],[-1]]; + + var model = scicos_model(); + model.sim = list(new ScilabString(["product"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1], [-1]); + model.out = new ScilabDouble([-1]); + model.ipar = new ScilabDouble(...this.sgn); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.sgn)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"PRODUCT",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 3]), model, exprs, gr_i); + return new Product(this.x); + } + PRODUCT.prototype.details = function PRODUCT() { + return this.x; + } +} diff --git a/data_structures_correct/PROD_f.js b/data_structures_correct/PROD_f.js new file mode 100644 index 0000000..d46b7d9 --- /dev/null +++ b/data_structures_correct/PROD_f.js @@ -0,0 +1,19 @@ +function PROD_f() { + + PROD_f.prototype.define = function PROD_f() { + + var model = scicos_model(); + model.sim = list(new ScilabString(["prod"]), new ScilabDouble([2])); + model.in = new ScilabDouble([-1], [-1]); + model.out = new ScilabDouble([-1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + this.x = new standard_define(new ScilabDouble([1, 1]), model, new ScilabDouble(), new ScilabString()); + return new RoundBlock(this.x); + } + PROD_f.prototype.details = function PROD_f() { + return this.x; + } +} + diff --git a/data_structures_correct/PerteDP.js b/data_structures_correct/PerteDP.js new file mode 100644 index 0000000..e5060b1 --- /dev/null +++ b/data_structures_correct/PerteDP.js @@ -0,0 +1,41 @@ +function PerteDP() { + + PerteDP.prototype.define = function PerteDP() { + this.L = 10; + this.D = 0.2; + this.lambda = 0.03; + this.z1 = 0; + this.z2 = 0; + this.p_rho = 0; + + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]); + model.sim = new ScilabString(["PerteDP"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["PerteDP"]); + mo.inputs = new ScilabString(["C1"]); + mo.outputs = new ScilabString(["C2"]); + mo.parameters = list(new ScilabString(["L"], ["D"], ["lambda"], ["z1"], ["z2"], ["p_rho"]), new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho])); + 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.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PerteDP\",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); + } + PerteDP.prototype.details = function PerteDP() { + return this.x; + } + +} + diff --git a/data_structures_correct/PotentialSensor.js b/data_structures_correct/PotentialSensor.js new file mode 100644 index 0000000..fb2581b --- /dev/null +++ b/data_structures_correct/PotentialSensor.js @@ -0,0 +1,31 @@ +function PotentialSensor() { + + PotentialSensor.prototype.define = function PotentialSensor() { + + var model = scicos_model(); + model.in = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.rpar = new ScilabDouble(); + model.sim = new ScilabString(["PotentialSensor"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["PotentialSensor"]); + mo.inputs = new ScilabString(["p"]); + mo.outputs = new ScilabString(["v"]); + model.equations = mo; + + var exprs = new ScilabString([""]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PotentialSensor\",sz(1),sz(2));"]); + this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); + this.x.graphics.in_implicit = new ScilabString(["I"]); + this.x.graphics.out_implicit = new ScilabString(["E"]); + return new BasicBlock(this.x); + } + PotentialSensor.prototype.details = function PotentialSensor() { + return this.x; + } +} + diff --git a/data_structures_correct/PuitsP.js b/data_structures_correct/PuitsP.js new file mode 100644 index 0000000..4cffe74 --- /dev/null +++ b/data_structures_correct/PuitsP.js @@ -0,0 +1,34 @@ +function PuitsP() { + + PuitsP.prototype.define = function PuitsP() { + this.P0 = 100000; + this.T0 = 290; + this.H0 = 100000; + this.option_temperature = 1; + + var model = scicos_model(); + model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]); + model.sim = new ScilabString(["Puits"]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var mo = modelica(); + mo.model = new ScilabString(["Puits"]); + mo.inputs = new ScilabString(["C"]); + mo.outputs = new ScilabDouble(); + 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)); + + var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PuitsP\",sz(1),sz(2));"]); + this.x = standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble(0))); + this.x.graphics.in_implicit = new ScilabString(["I"]); + return new BasicBlock(this.x); + } + PuitsP.prototype.details = function PuitsP() { + return this.x; + } +} + 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/READAU_f.js b/data_structures_correct/READAU_f.js new file mode 100644 index 0000000..38f3d96 --- /dev/null +++ b/data_structures_correct/READAU_f.js @@ -0,0 +1,33 @@ +function READAU_f() { + + READAU_f.prototype.define = function READAU_f() { + this.frmt = "uc "; + this.fname = "test.au"; + this.lunit = 0; + this.N = 20; + this.M = 1; + this.tmask = []; + this.swap = 0; + this.offset = 1; + this.outmask = 1; + this.ievt = 0; + this.nout = size(this.outmask, "*"); + var model = scicos_model(); + model.sim = list(new ScilabString(["readau"]), new ScilabDouble([2])); + model.out = new ScilabDouble([this.nout]); + model.evtin = new ScilabDouble([1]); + model.dstate = new ScilabDouble([1], [1], [this.lunit], ...zeros(this.N * this.M, 1)); + model.ipar = new ScilabDouble([this.fname.length], ..._str2code(this.frmt), [this.ievt], [this.N], [this.M], [this.swap], [this.offset], ..._str2code(this.fname), [this.outmask]); + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.fname], [this.N], [this.swap]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"READAU_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + READAU_f.prototype.details = function READAU_f() { + return this.x; + } +} diff --git a/data_structures_correct/READC_f.js b/data_structures_correct/READC_f.js new file mode 100644 index 0000000..a851fbb --- /dev/null +++ b/data_structures_correct/READC_f.js @@ -0,0 +1,39 @@ +function READC_f() { + + READC_f.prototype.define = function READC_f() { + this.frmt = "d "; + this.fname = "foo"; + this.lunit = 0; + this.N = 20; + this.M = 1; + this.rpar = []; + this.tmask = 0; + this.swap = 0; + this.offset = 1; + this.outmask = 1; + this.ievt = 0; + this.nout = size(this.outmask, "*"); + + var ipar = new ScilabDouble([this.fname.length], ..._str2code(this.frmt), [this.ievt], [this.N], [this.M], [this.swap], [this.offset], ..._str2code(this.fname), [this.tmask], [this.outmask]); + + var model = scicos_model(); + model.sim = list(new ScilabString(["readc"]), new ScilabDouble([2])); + model.out = new ScilabDouble([this.nout]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble(); + model.dstate = new ScilabDouble([1], [1], [this.lunit], ...zeros(this.N * this.M, 1)); + model.ipar = ipar; + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString(["[]"], [this.outmask], [this.fname], [this.frmt], [this.M], [this.N], [this.offset], [this.swap]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"READC_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + READC_f.prototype.details = function READC_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; + } +} 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/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; + } +} + diff --git a/data_structures_correct/RFILE_f.js b/data_structures_correct/RFILE_f.js new file mode 100644 index 0000000..f0d79e7 --- /dev/null +++ b/data_structures_correct/RFILE_f.js @@ -0,0 +1,36 @@ +function RFILE_f() { + + RFILE_f.prototype.define = function RFILE_f() { + this.out = 1; + this.nout = this.out; + this.frmt = "(7(e10.3,1x))"; + this.fname = "foo"; + this.lunit = 0; + this.N = 2; + this.rpar = []; + this.tmask = 0; + this.outmask = 1; + + var ipar = new ScilabDouble([this.fname.length], [this.frmt.length], [0], [this.N], ..._str2code(this.fname), ..._str2code(this.frmt), [this.tmask], [this.outmask]); + + var dstate = new ScilabDouble([1], [1], [this.lunit], ...zeros((this.nout) * this.N, 1)); + + var model = scicos_model(); + model.sim = new ScilabString(["readf"]); + model.out = new ScilabDouble([this.nout]); + model.evtin = new ScilabDouble([1]); + model.dstate = dstate; + model.ipar = ipar; + model.blocktype = new ScilabString(["d"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([sci2exp([])], [sci2exp(this.outmask)], [this.fname], [this.frmt], [this.N], [this.out]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"RFILE_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + RFILE_f.prototype.details = function RFILE_f() { + 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/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/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/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/combine_script.bat b/data_structures_correct/combine_script.bat new file mode 100644 index 0000000..54d2926 --- /dev/null +++ b/data_structures_correct/combine_script.bat @@ -0,0 +1 @@ +copy /b *.js ..\combined.js diff --git a/data_structures_correct/fortran_block.js b/data_structures_correct/fortran_block.js new file mode 100644 index 0000000..adfa5ef --- /dev/null +++ b/data_structures_correct/fortran_block.js @@ -0,0 +1,29 @@ +function fortran_block() { + + fortran_block.prototype.define = function fortran_block() { + var model = scicos_model(); + model.sim = list(new ScilabString([" "]), new ScilabDouble([1001])); + model.in = new ScilabDouble([1]); + model.out = 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([0]); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + this.funam = "forty"; + + var label = list(new ScilabString([sci2exp(parseInt(getData(model.in)))], [sci2exp(parseInt(getData(model.out)))], [sci2exp(getData(model.rpar))], [this.funam]), list(new ScilabDouble())); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"fortran_block\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([4, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + fortran_block.prototype.details = function fortran_block() { + return this.x; + } +} diff --git a/data_structures_correct/freq_div.js b/data_structures_correct/freq_div.js new file mode 100644 index 0000000..c8cb1cc --- /dev/null +++ b/data_structures_correct/freq_div.js @@ -0,0 +1,146 @@ +function freq_div() { + + freq_div.prototype.define = function freq_div() { + var scs_m_1 = scicos_diagram(); + scs_m_1.objs.push(new Modulo_Count().internal()); + scs_m_1.objs.push(new CLKINV_f().internal()); + scs_m_1.objs.push(new CLKOUTV_f().internal()); + scs_m_1.objs.push(new IFTHEL_f().internal()); + scs_m_1.objs.push(new CLKSPLIT_f().internal()); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + scs_m_1.objs.push(scicos_link({})); + + var blk = scs_m_1.objs[0]; + var graphics = blk.graphics; + var model = blk.model; + graphics.orig = new ScilabDouble([0, -100]); + graphics.sz = new ScilabDouble([60, 40]); + graphics.exprs = new ScilabString(["0"], ["3"]); + model.dstate = new ScilabDouble([3]); + model.ipar = new ScilabDouble([3]); + graphics.pout = new ScilabDouble([7]); + graphics.pein = new ScilabDouble([10]); + graphics.out_implicit = new ScilabString(["E"]); + graphics.out_style = new ScilabString(["ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10.0;rotation=0"]); + graphics.out_label = new ScilabString([""]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[0] = blk; + + blk = scs_m_1.objs[1]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([120, 0]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.peout = new ScilabDouble([6]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[1] = blk; + + blk = scs_m_1.objs[2]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([130, -160]); + graphics.sz = new ScilabDouble([20, 20]); + graphics.exprs = new ScilabString(["1"]); + model.ipar = new ScilabDouble([1]); + graphics.pein = new ScilabDouble([8]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[2] = blk; + + blk = scs_m_1.objs[3]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([100, -100]); + graphics.sz = new ScilabDouble([60, 40]); + graphics.exprs = new ScilabString(["1"], ["0"]); + model.ipar = new ScilabDouble([1]); + graphics.pin = new ScilabDouble([7]); + graphics.pein = new ScilabDouble([9]); + graphics.peout = new ScilabDouble([0], [8]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[3] = blk; + + blk = scs_m_1.objs[4]; + graphics = blk.graphics; + model = blk.model; + graphics.orig = new ScilabDouble([127, -33]); + graphics.sz = new ScilabDouble([7, 7]); + graphics.pein = new ScilabDouble([6]); + graphics.peout = new ScilabDouble([9], [10]); + model.uid = new ScilabString([count]); + blk.doc = list(new ScilabString([count++])); + blk.graphics = graphics; + blk.model = model; + scs_m_1.objs[4] = blk; + + var lnk = scs_m_1.objs[5]; + lnk.xx = new ScilabDouble([170], [170.5]); + lnk.yy = new ScilabDouble([-44], [-75]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([2, 1, 0]); + lnk.to = new ScilabDouble([5, 1, 1]); + scs_m_1.objs[5] = lnk; + + lnk = scs_m_1.objs[6]; + lnk.xx = new ScilabDouble([104], [136]); + lnk.yy = new ScilabDouble([-100], [-100]); + lnk.from = new ScilabDouble([1, 1, 0]); + lnk.to = new ScilabDouble([4, 1, 1]); + scs_m_1.objs[6] = lnk; + + lnk = scs_m_1.objs[7]; + lnk.xx = new ScilabDouble([180], [180]); + lnk.yy = new ScilabDouble([-124], [-176]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([4, 2, 0]); + lnk.to = new ScilabDouble([3, 1, 1]); + scs_m_1.objs[7] = lnk; + + lnk = scs_m_1.objs[8]; + lnk.xx = new ScilabDouble([170], [170.5]); + lnk.yy = new ScilabDouble([-44], [-75]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([5, 1, 0]); + lnk.to = new ScilabDouble([4, 1, 1]); + scs_m_1.objs[8] = lnk; + + lnk = scs_m_1.objs[9]; + lnk.xx = new ScilabDouble([169], [170]); + lnk.yy = new ScilabDouble([-90], [-76]); + lnk.xx = new ScilabDouble([0, 30, 1]); + lnk.yy = new ScilabDouble([0, -30, 1]); + lnk.ct = new ScilabDouble([5, -1]); + lnk.from = new ScilabDouble([5, 2, 0]); + lnk.to = new ScilabDouble([1, 1, 1]); + scs_m_1.objs[9] = lnk; + + model = scicos_model(); + model.sim = new ScilabString(["csuper"]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1]); + model.rpar = scs_m_1; + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"freq_div",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, new ScilabDouble(), gr_i); + return new BasicBlock(this.x); + } + freq_div.prototype.details = function freq_div() { + return this.x; + } +} |