diff options
-rwxr-xr-x | blocks_xcos/GOTO.xcos | 78 | ||||
-rw-r--r-- | data_structures_correct/CLKSOM_f.js | 19 | ||||
-rw-r--r-- | data_structures_correct/DEMUX_f.js | 27 | ||||
-rw-r--r-- | data_structures_correct/GOTO.js | 28 | ||||
-rw-r--r-- | data_structures_correct/Ground.js | 30 | ||||
-rw-r--r-- | data_structures_correct/MCLOCK_f.js | 139 | ||||
-rw-r--r-- | data_structures_correct/MFCLCK_f.js | 26 | ||||
-rw-r--r-- | data_structures_correct/NMOS.js | 40 | ||||
-rw-r--r-- | data_structures_correct/NRMSOM_f.js | 24 | ||||
-rw-r--r-- | data_structures_correct/OpAmp.js | 34 | ||||
-rw-r--r-- | data_structures_correct/PDE.js | 24 | ||||
-rw-r--r-- | data_structures_correct/POSTONEG_f.js | 24 | ||||
-rw-r--r-- | data_structures_correct/PROD_f.js | 19 | ||||
-rw-r--r-- | data_structures_correct/PerteDP.js | 41 | ||||
-rw-r--r-- | data_structures_correct/PotentialSensor.js | 31 | ||||
-rw-r--r-- | data_structures_correct/PuitsP.js | 34 | ||||
-rw-r--r-- | dependencies.js | 83 | ||||
-rw-r--r-- | finalmodsheet.xsl | 10 |
18 files changed, 659 insertions, 52 deletions
diff --git a/blocks_xcos/GOTO.xcos b/blocks_xcos/GOTO.xcos index caa5818..a8f787c 100755 --- a/blocks_xcos/GOTO.xcos +++ b/blocks_xcos/GOTO.xcos @@ -1,44 +1,38 @@ <?xml version="1.0" encoding="UTF-8"?> -<XcosDiagram background="-1" title="Untitled"> - <!--Xcos - 1.0 - scilab-5.5.2 - 20150331 1152--> - <Array as="context" scilabClass="String[]"> - <add value=""/> - </Array> - <mxGraphModel as="model"> - <root> - <mxCell id="-1b7beca7:15524560360:-7b7b"/> - <mxCell id="-1b7beca7:15524560360:-7b7c" parent="-1b7beca7:15524560360:-7b7b"/> - <BasicBlock id="-1b7beca7:15524560360:-7b79" interfaceFunctionName="GOTO" parent="-1b7beca7:15524560360:-7b7c" simulationFunctionName="goto" simulationFunctionType="DEFAULT" style="GOTO"> - <ScilabString as="exprs" height="2" width="1"> - <data column="0" line="0" value="A"/> - <data column="0" line="1" value="1"/> - </ScilabString> - <ScilabDouble as="realParameters" height="0" width="0"/> - <ScilabDouble as="integerParameters" height="1" width="1"> - <data column="0" line="0" realPart="1.0"/> - </ScilabDouble> - <Array as="objectsParameters" scilabClass="ScilabList"> - <ScilabString height="1" width="1"> - <data column="0" line="0" value="A"/> - </ScilabString> - </Array> - <ScilabDouble as="nbZerosCrossing" height="1" width="1"> - <data column="0" line="0" realPart="0.0"/> - </ScilabDouble> - <ScilabDouble as="nmode" height="1" width="1"> - <data column="0" line="0" realPart="0.0"/> - </ScilabDouble> - <Array as="oDState" scilabClass="ScilabList"/> - <Array as="equations" scilabClass="ScilabList"/> - <mxGeometry as="geometry" height="7.0" width="7.0" x="37.5" y="37.0"/> - </BasicBlock> - <ExplicitInputPort dataType="UNKNOW_TYPE" id="-1b7beca7:15524560360:-7b78" ordering="1" parent="-1b7beca7:15524560360:-7b79" style="ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0" value=""> - <mxGeometry as="geometry" height="8.0" width="8.0" x="-8.0" y="-3.5"/> - </ExplicitInputPort> - <mxCell connectable="0" id="-1b7beca7:15524560360:-7b79#identifier" parent="-1b7beca7:15524560360:-7b79" style="noLabel=0;opacity=0;" value="Goto" vertex="1"> - <mxGeometry as="geometry" relative="1" x="0.5" y="1.1"/> - </mxCell> - </root> - </mxGraphModel> - <mxCell as="defaultParent" id="-1b7beca7:15524560360:-7b7c" parent="-1b7beca7:15524560360:-7b7b"/> +<XcosDiagram background="-1" title="Untitled - 12:26:42 PM"> + <!--Xcos - 1.0 - scilab-5.5.2 - 20150331 1152--> + <mxGraphModel as="model"> + <root> + <mxCell id="60e6c3c2:155b4b1be58:-7ffb" /> + <mxCell id="60e6c3c2:155b4b1be58:-7ffc" parent="60e6c3c2:155b4b1be58:-7ffb" /> + <BasicBlock id="60e6c3c2:155b4b1be58:-7fe1" interfaceFunctionName="GOTO" parent="60e6c3c2:155b4b1be58:-7ffc" simulationFunctionName="goto" simulationFunctionType="DEFAULT" style="GOTO"> + <ScilabString as="exprs" height="2" width="1"> + <data column="0" line="0" value="A" /> + <data column="0" line="1" value="1" /> + </ScilabString> + <ScilabDouble as="realParameters" height="0" width="0" /> + <ScilabDouble as="integerParameters" height="1" width="1"> + <data column="0" line="0" realPart="1.0" /> + </ScilabDouble> + <Array as="objectsParameters" scilabClass="ScilabList"> + <ScilabString height="1" width="1"> + <data column="0" line="0" value="A" /> + </ScilabString> + </Array> + <ScilabDouble as="nbZerosCrossing" height="1" width="1"> + <data column="0" line="0" realPart="0.0" /> + </ScilabDouble> + <ScilabDouble as="nmode" height="1" width="1"> + <data column="0" line="0" realPart="0.0" /> + </ScilabDouble> + <Array as="oDState" scilabClass="ScilabList" /> + <Array as="equations" scilabClass="ScilabList" /> + <mxGeometry as="geometry" height="20.0" width="40.0" x="130.0" y="170.0" /> + </BasicBlock> + <ExplicitInputPort dataType="UNKNOW_TYPE" id="60e6c3c2:155b4b1be58:-7fe0" ordering="1" parent="60e6c3c2:155b4b1be58:-7fe1" style="ExplicitInputPort;align=left;verticalAlign=middle;spacing=10.0;rotation=0" value=""> + <mxGeometry as="geometry" height="8.0" width="8.0" x="-8.0" y="6.0" /> + </ExplicitInputPort> + </root> + </mxGraphModel> + <mxCell as="defaultParent" id="60e6c3c2:155b4b1be58:-7ffc" parent="60e6c3c2:155b4b1be58:-7ffb" /> </XcosDiagram> 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/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/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/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/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 index abdeabe..6e0a6aa 100644 --- a/data_structures_correct/MFCLCK_f.js +++ b/data_structures_correct/MFCLCK_f.js @@ -12,7 +12,7 @@ function MFCLCK_f() { model.rpar = new ScilabDouble([this.dt]); model.ipar = new ScilabDouble([this.nn]); model.blocktype = new ScilabString(["d"]); - model.firing = new ScilabDouble([-1, 0]); + model.firing = new ScilabDouble([-1], [0]); model.dep_ut = new ScilabBoolean([false, false]); var exprs = new ScilabString([this.dt], [this.nn]); @@ -21,8 +21,30 @@ function MFCLCK_f() { 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/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/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/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/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/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/dependencies.js b/dependencies.js index ea46827..51341e4 100644 --- a/dependencies.js +++ b/dependencies.js @@ -7,13 +7,10 @@ $.getScript('combined.js'); /* $.ajax({ type: "POST", - // Invoke filenames.php url: "filenames.php", - // Receive the resultant filenames from the php script in JSON format dataType: "json", - // Add url for the required folder data: { url: "/data_structures_correct/" @@ -420,6 +417,86 @@ function RoundBlock() { } } +function GroundBlock() { + + if (arguments.length > 0) { + var options = arguments[0]; + this.angle = options.angle; // Not Known + this.blockType = getData(options.model.blocktype)[0]; + var dep_ut = getData(options.model.dep_ut); + if (dep_ut[0] == "true") + this.dependsOnU = "1"; + this.id = options.id; + this.interfaceFunctionName = arguments.callee.caller.name; + this.ordering = options.ordering; + this.parent = options.parent; + if (options.model.sim instanceof Array) { + this.simulationFunctionName = getData(options.model.sim[0])[0]; + var func_type; + switch (getData(options.model.sim[1])[0].toString()) { + case "-2.0": + func_type = "ESELECT"; + break; + case "-1.0": + func_type = "IFTHENELSE"; + break; + case "1.0": + func_type = "TYPE_1"; + break; + case "2.0": + func_type = "TYPE_2"; + break; + case "3.0": + func_type = "TYPE_3"; + break; + case "4.0": + func_type = "C_OR_FORTRAN"; + break; + case "5.0": + func_type = "SCILAB"; + break; + case "99.0": + func_type = "DEBUG"; + break; + case "1001.0": + func_type = "DYNAMIC_FORTRAN_1"; + break; + case "2001.0": + func_type = "DYNAMIC_C_1"; + break; + case "2004.0": + func_type = "DYNAMIC_EXPLICIT_4"; + break; + case "10001.0": + func_type = "OLDBLOCKS"; + break; + case "10004.0": + func_type = "IMPLICIT_C_OR_FORTRAN"; + break; + case "30004.0": + func_type = "MODELICA"; + break; + } + this.simulationFunctionType = func_type; + } else { + this.simulationFunctionName = getData(options.model.sim)[0]; + this.simulationFunctionType = "DEFAULT"; + } + this.style = arguments.callee.caller.name; + this.value = options.value; // Not Known + this.exprs = options.graphics.exprs; + this.realParameters = options.model.rpar; + this.integerParameters = options.model.ipar; + this.objectsParameters = options.model.opar; + this.nbZerosCrossing = options.model.nzcross; + this.nmode = options.model.nmode; + this.oDState = list(); + this.equations = options.model.equations; // Not Known + this.blockName = "GroundBlock"; + this.blockElementName = arguments.callee.caller.name; + } +} + function zeros() { if (arguments.length == 0) { return [0]; diff --git a/finalmodsheet.xsl b/finalmodsheet.xsl index 9226a66..d7ff4f5 100644 --- a/finalmodsheet.xsl +++ b/finalmodsheet.xsl @@ -172,7 +172,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="Object" match="Object"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -200,7 +200,7 @@ Look for TAG:Break1!!! --> <xsl:template name="Array" match="Array"> <xsl:element name="Array"> - <xsl:if test="name(..)='BasicBlock' or @as='context' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock'"> + <xsl:if test="name(..)='BasicBlock' or @as='context' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -821,7 +821,7 @@ Look for TAG:Break1!!! <xsl:apply-templates /> </xsl:element> </xsl:template> - <xsl:template name="GroudBlock" match="GroudBlock"> + <xsl:template name="GroundBlock" match="GroundBlock"> <xsl:element name="GroundBlock"> <xsl:if test="@dependsOnU"> <xsl:attribute name="dependsOnU"> @@ -1581,7 +1581,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabDouble" match="ScilabDouble"> <xsl:element name="ScilabDouble"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> @@ -1613,7 +1613,7 @@ Look for TAG:Break1!!! </xsl:template> <xsl:template name="ScilabString" match="ScilabString"> <xsl:element name="ScilabString"> - <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock'"> + <xsl:if test="name(..)='BasicBlock' or name(..)='AfficheBlock' or name(..)='BigSom' or name(..)='EventInBlock' or name(..)='EventOutBlock' or name(..)='RoundBlock' or name(..)='GroundBlock' or name(..)='EventInBlock' or name(..)='EventOutBlock'"> <xsl:if test="@as"> <xsl:attribute name="as"> <xsl:value-of select="@as" /> |