ans =
()
// Create a diagram containing 2 summation blocks and an empty link
-Sum = BIGSOM_f("define");
+Sum = BIGSOM_f("define");
objectCreated( 2 , BLOCK )
propertyUpdated( 2 , BLOCK , GEOMETRY ) : NO_CHANGES
propertyUpdated( 2 , BLOCK , GEOMETRY ) : SUCCESS
propertyUpdated( 2 , BLOCK , NMODE ) : NO_CHANGES
propertyUpdated( 2 , BLOCK , UID ) : NO_CHANGES
propertyUpdated( 2 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
-Scope = CSCOPE("define");
+Scope1 = CSCOPE("define");
objectCreated( 6 , BLOCK )
propertyUpdated( 6 , BLOCK , GEOMETRY ) : NO_CHANGES
propertyUpdated( 6 , BLOCK , GEOMETRY ) : SUCCESS
propertyUpdated( 6 , BLOCK , NMODE ) : NO_CHANGES
propertyUpdated( 6 , BLOCK , UID ) : NO_CHANGES
propertyUpdated( 6 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
-lnk = scicos_link();
-objectCreated( 9 , LINK )
-propertyUpdated( 9 , LINK , CONTROL_POINTS ) : NO_CHANGES
-propertyUpdated( 9 , LINK , CONTROL_POINTS ) : NO_CHANGES
-propertyUpdated( 9 , LINK , LABEL ) : NO_CHANGES
-propertyUpdated( 9 , LINK , THICK ) : NO_CHANGES
-propertyUpdated( 9 , LINK , COLOR ) : NO_CHANGES
-propertyUpdated( 9 , LINK , KIND ) : NO_CHANGES
-propertyUpdated( 9 , LINK , SOURCE_PORT ) : NO_CHANGES
-propertyUpdated( 9 , LINK , DESTINATION_PORT ) : NO_CHANGES
-scs_m = scicos_diagram( objs=list(Sum,Scope,lnk) )
-objectCreated( 10 , DIAGRAM )
-propertyUpdated( 10 , DIAGRAM , TITLE ) : NO_CHANGES
-propertyUpdated( 10 , DIAGRAM , PATH ) : NO_CHANGES
-propertyUpdated( 10 , DIAGRAM , PROPERTIES ) : NO_CHANGES
-propertyUpdated( 10 , DIAGRAM , PROPERTIES ) : NO_CHANGES
-propertyUpdated( 10 , DIAGRAM , CONTEXT ) : NO_CHANGES
+Scope2 = CSCOPE("define");
+objectCreated( 9 , BLOCK )
+propertyUpdated( 9 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , GEOMETRY ) : SUCCESS
+propertyUpdated( 9 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , EXPRS ) : SUCCESS
+objectCreated( 10 , PORT )
+propertyUpdated( 10 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 10 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 9 , BLOCK , INPUTS ) : SUCCESS
+objectCreated( 11 , PORT )
+propertyUpdated( 11 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 11 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 9 , BLOCK , EVENT_INPUTS ) : SUCCESS
+propertyUpdated( 9 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 10 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 10 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 10 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , SIM_FUNCTION_NAME ) : SUCCESS
+propertyUpdated( 9 , BLOCK , SIM_FUNCTION_API ) : SUCCESS
+propertyUpdated( 10 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 10 , PORT , DATATYPE ) : NO_CHANGES
+propertyUpdated( 11 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 9 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , RPAR ) : SUCCESS
+propertyUpdated( 9 , BLOCK , IPAR ) : SUCCESS
+propertyUpdated( 9 , BLOCK , SIM_BLOCKTYPE ) : SUCCESS
+propertyUpdated( 9 , BLOCK , SIM_DEP_UT ) : SUCCESS
+propertyUpdated( 9 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
+lnk = scicos_link(); // Data link
+objectCreated( 12 , LINK )
+propertyUpdated( 12 , LINK , CONTROL_POINTS ) : NO_CHANGES
+propertyUpdated( 12 , LINK , CONTROL_POINTS ) : NO_CHANGES
+propertyUpdated( 12 , LINK , LABEL ) : NO_CHANGES
+propertyUpdated( 12 , LINK , THICK ) : NO_CHANGES
+propertyUpdated( 12 , LINK , COLOR ) : NO_CHANGES
+propertyUpdated( 12 , LINK , KIND ) : NO_CHANGES
+propertyUpdated( 12 , LINK , SOURCE_PORT ) : NO_CHANGES
+propertyUpdated( 12 , LINK , DESTINATION_PORT ) : NO_CHANGES
+lnk2 = scicos_link(ct=[1,-1]); // Activation link
+objectCreated( 13 , LINK )
+propertyUpdated( 13 , LINK , CONTROL_POINTS ) : NO_CHANGES
+propertyUpdated( 13 , LINK , CONTROL_POINTS ) : NO_CHANGES
+propertyUpdated( 13 , LINK , LABEL ) : NO_CHANGES
+propertyUpdated( 13 , LINK , THICK ) : NO_CHANGES
+propertyUpdated( 13 , LINK , COLOR ) : NO_CHANGES
+propertyUpdated( 13 , LINK , KIND ) : SUCCESS
+propertyUpdated( 13 , LINK , SOURCE_PORT ) : NO_CHANGES
+propertyUpdated( 13 , LINK , DESTINATION_PORT ) : NO_CHANGES
+scs_m = scicos_diagram( objs=list(Sum,Scope1,Scope2,lnk,lnk2) )
+objectCreated( 14 , DIAGRAM )
+propertyUpdated( 14 , DIAGRAM , TITLE ) : NO_CHANGES
+propertyUpdated( 14 , DIAGRAM , PATH ) : NO_CHANGES
+propertyUpdated( 14 , DIAGRAM , PROPERTIES ) : NO_CHANGES
+propertyUpdated( 14 , DIAGRAM , PROPERTIES ) : NO_CHANGES
+propertyUpdated( 14 , DIAGRAM , CONTEXT ) : NO_CHANGES
propertyUpdated( 2 , BLOCK , PARENT_DIAGRAM ) : SUCCESS
propertyUpdated( 6 , BLOCK , PARENT_DIAGRAM ) : SUCCESS
-propertyUpdated( 9 , LINK , PARENT_DIAGRAM ) : SUCCESS
-propertyUpdated( 10 , DIAGRAM , CHILDREN ) : SUCCESS
-propertyUpdated( 10 , DIAGRAM , VERSION_NUMBER ) : NO_CHANGES
+propertyUpdated( 9 , BLOCK , PARENT_DIAGRAM ) : SUCCESS
+propertyUpdated( 12 , LINK , PARENT_DIAGRAM ) : SUCCESS
+propertyUpdated( 13 , LINK , PARENT_DIAGRAM ) : SUCCESS
+propertyUpdated( 14 , DIAGRAM , CHILDREN ) : SUCCESS
+propertyUpdated( 14 , DIAGRAM , VERSION_NUMBER ) : NO_CHANGES
scs_m =
scicos_diagram type :
props
gui
doc
(3)
+scicos_Block type :
+ graphics
+ model
+ gui
+ doc
+ (4)
+scicos_Link type :
+ xx
+ yy
+ id
+ thick
+ ct
+ from
+ to
+ (5)
scicos_Link type :
xx
yy
ct
from
to
-// Link output port #1 of block #1 (ID #5 in this example) with input port #1 of block #2 (ID #7)
-// The link ID is #10
+// Link output port #1 of block #1 with input port #1 of block #2
l = scs_m.objs;
-l(3).from = [1 1 0]; // Link block #1
+l(4).from = [1 1 0]; // Link block #1
propertyUpdated( 5 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-propertyUpdated( 9 , LINK , SOURCE_PORT ) : SUCCESS
+propertyUpdated( 12 , LINK , SOURCE_PORT ) : SUCCESS
l(1).graphics.pout // Check that block #1 is connected to the link
ans =
- 3.
+ 4.
l(1).model.out // "
ans =
- 1.
-l(3).to = [2 1 1]; // Link block #2
+l(4).to = [2 1 1]; // Link block #2
propertyUpdated( 7 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-propertyUpdated( 9 , LINK , DESTINATION_PORT ) : SUCCESS
-l(3).from
+propertyUpdated( 12 , LINK , DESTINATION_PORT ) : SUCCESS
+l(4).from
ans =
1. 1. 0.
-l(3).to
+l(4).to
ans =
2. 1. 1.
l(2).graphics.pin // Check that block #2 is connected to the link
ans =
- 3.
+ 4.
l(2).model.in // "
ans =
- 1.
-// Change the end of the link to input port #2 of block #2 (ID #8)
-l(3).to = [2 2 1];
+// Change the end of the link to input port #2 of block #2
+l(4).to = [2 2 1];
propertyUpdated( 7 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-objectCreated( 11 , PORT )
-propertyUpdated( 11 , PORT , IMPLICIT ) : NO_CHANGES
-propertyUpdated( 11 , PORT , PORT_KIND ) : SUCCESS
-propertyUpdated( 11 , PORT , SOURCE_BLOCK ) : SUCCESS
-propertyUpdated( 11 , PORT , CONNECTED_SIGNALS ) : NO_CHANGES
-propertyUpdated( 11 , PORT , DATATYPE ) : SUCCESS
+objectCreated( 15 , PORT )
+propertyUpdated( 15 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 15 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 15 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 15 , PORT , CONNECTED_SIGNALS ) : NO_CHANGES
+propertyUpdated( 15 , PORT , DATATYPE ) : SUCCESS
propertyUpdated( 6 , BLOCK , INPUTS ) : SUCCESS
-propertyUpdated( 11 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-propertyUpdated( 9 , LINK , DESTINATION_PORT ) : SUCCESS
-l(3).from
+propertyUpdated( 15 , PORT , CONNECTED_SIGNALS ) : SUCCESS
+propertyUpdated( 12 , LINK , DESTINATION_PORT ) : SUCCESS
+l(4).from
ans =
1. 1. 0.
-l(3).to
+l(4).to
ans =
2. 2. 1.
l(2).graphics.pin // Check that block #2 is connected to the link
ans =
0.
- 3.
+ 4.
l(2).model.in // "
ans =
- 1.
- 1.
// Disconnect the source, the destination is also disconnected
-l(3).from = [0 0 0];
+l(4).from = [0 0 0];
propertyUpdated( 5 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-propertyUpdated( 11 , PORT , CONNECTED_SIGNALS ) : SUCCESS
-propertyUpdated( 9 , LINK , SOURCE_PORT ) : SUCCESS
-propertyUpdated( 9 , LINK , DESTINATION_PORT ) : SUCCESS
-l(3).from
+propertyUpdated( 15 , PORT , CONNECTED_SIGNALS ) : SUCCESS
+propertyUpdated( 12 , LINK , SOURCE_PORT ) : SUCCESS
+propertyUpdated( 12 , LINK , DESTINATION_PORT ) : SUCCESS
+l(4).from
ans =
0. 0. 0.
-l(3).to
+l(4).to
ans =
0. 0. 0.
l(1).graphics.pout // Check that both blocks are unconnected
ans =
0.
0.
+// Now link the two Scope blocks together by adding an event output port to block #3
+l(5).from = [2 1 1]; // Link the input of block #2
+propertyUpdated( 8 , PORT , CONNECTED_SIGNALS ) : SUCCESS
+propertyUpdated( 13 , LINK , SOURCE_PORT ) : SUCCESS
+l(5).to = [3 1 0]; // Add an event output to block #3 and link it to the previous
+objectCreated( 16 , PORT )
+propertyUpdated( 16 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 16 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 16 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 16 , PORT , CONNECTED_SIGNALS ) : NO_CHANGES
+propertyUpdated( 16 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 9 , BLOCK , EVENT_OUTPUTS ) : SUCCESS
+propertyUpdated( 16 , PORT , CONNECTED_SIGNALS ) : SUCCESS
+propertyUpdated( 13 , LINK , DESTINATION_PORT ) : SUCCESS
+l(5).from
+ ans =
+ 2. 1. 1.
+l(5).to
+ ans =
+ 3. 2. 0.
+l(2).graphics.pein
+ ans =
+ 5.
+l(2).model.evtin
+ ans =
+ - 1.
+l(3).graphics.peout
+ ans =
+ 5.
+l(3).model.evtout
+ ans =
+ - 1.
+// Verify that it is impossible to link two inputs or two outputs together
+l(5).from = [2 1 0]; // Two outputs
+scicos_setfield: Wrong value for input argument #2: unable to set "from".
+l(5).to = [3 1 1]; // Two inputs
+scicos_setfield: Wrong value for input argument #2: unable to set "to".