summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorASP12342016-07-05 03:34:18 +0000
committerASP12342016-07-05 03:34:18 +0000
commit1997de6371546faf027c61fb0ecedd80e19bb44d (patch)
treef3fadfa4915c056acf179c8ef03717bb7266214c
parent81da447552fea9d334a8f53f44dfae461074dbb8 (diff)
downloadxcos-on-web-1997de6371546faf027c61fb0ecedd80e19bb44d.tar.gz
xcos-on-web-1997de6371546faf027c61fb0ecedd80e19bb44d.tar.bz2
xcos-on-web-1997de6371546faf027c61fb0ecedd80e19bb44d.zip
Implement GOTO Block
-rwxr-xr-xblocks_xcos/GOTO.xcos80
-rw-r--r--data_structures_correct/GOTO.js28
2 files changed, 65 insertions, 43 deletions
diff --git a/blocks_xcos/GOTO.xcos b/blocks_xcos/GOTO.xcos
index caa5818..508ca69 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>
+<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> \ No newline at end of file
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;
+ }
+}