To show ArrayPorts in the UI (the-grid/the-graph#51) it would be helpful if the index were defined in the edge. Is there a way to do this in FBP?
Otherwise, the only way to find its index is by the order of the edges, which seems fragile. And the only way to know if it is an ArrayPort (#90) is by waiting for the component def from the library.
Example from the book:
Read(THFILERD) OUT ->
IN Count(THCOUNT) OUT ->
IN  Concatenate(THMERGE) OUT ->
Count COUNT -> IN Concatenate,
'data.fil' -> OPT Read;
It uses IN  , and OUT  would be the obvious choice.
This needs a compatibility fallback, i.e. setting index based on order edges are specified when loading the JSON specification if no index is provided there.
This is also connected with the UI-side of things: noflo/noflo-ui#14
I think this won't be safe to do with the old-style ArrayPort, but should work with the new isAddressable() ports from #136
I want to bump this up for https://github.com/automata/noflo-canvas/issues/1 (scratch own itch prioritization).
I guess we need a Graph method to change index? Should it be a property on the edge (not metadata, since it changes how the graph works)? Should it also sort the edges, for compatibility and legibility?
@bergie could you prioritize this in noflo so I can make it happen in the-graph?
Also, is there a way that I can query noflo if a port is addressable? I guess with if edge.src.index? I could infer it, but it would be nice to get before any edges are added.
Add support for specifying array port index in connections, refs nofl…
@alfa256 I just added array port index support into the FBP parser:
SomeNode OUT -> IN OtherNode
Initial indexed connection support, refs #128
Initial indexed connection support, refs noflo/noflo#128
@forresto ok, initial support is now in. Would you like to experiment with how that would connect with the UI?
Add some edge indexes to the tests, refs noflo/noflo#128
Tentative connection index support in protocol, refs noflo/noflo#128