Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Multi-directional connections; or: How to model electrical wires?
Multi-directional connections; or: How to model electrical wires? [message #1743120] Mon, 12 September 2016 11:27 Go to next message
Stefan W.Friend
Messages: 6
Registered: October 2011
Junior Member
Hello,
I want to design a schematic editor (for electrical networks) with Sirius.

My model consists of a "Schematic" class which can contain many instances of "Element"s (diodes, resistors etc.). Each "Element" has a number of "Port"s (typically 2, for transistors: 3). Currently I'm investigating how to model the wires connecting the ports of the elements. Each port can be connected to many other ports bi-directional because the electrical current can flow in both directions, too.

My current idea is modelling these connections as a "Wire" class which does not has any target or source but simply "wired ports" (like a multi-directional connection). Unfortunately I didn't found any documentation on how to design a diagram representation for this special use case with Sirius.

Did you have an idea how I can solve this?
Maybe there is already something like a modelling "design pattern" for such cases (wire connections)?

Thank you very much in advance!
Best regards,
Stefan

[Updated on: Mon, 12 September 2016 11:32]

Report message to a moderator

Re: Multi-directional connections; or: How to model electrical wires? [message #1743122 is a reply to message #1743120] Mon, 12 September 2016 12:01 Go to previous messageGo to next message
Matt Se is currently offline Matt SeFriend
Messages: 29
Registered: February 2016
Junior Member
Maybe use EEnums for the kind of the ports?
And bi-directional in/output ports?
Any other special cases you probably need to code by hand
Re: Multi-directional connections; or: How to model electrical wires? [message #1743132 is a reply to message #1743120] Mon, 12 September 2016 13:44 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
Assuming a given Wire instance can only connect two ports, you need to define an element-based edge mapping (see [1]), where the domain class is Wire. Even if in your domain there is no distinction between a source and destination, you will need to decide which one of the connected port is the "source" and which one is the "target" from the point of view of Sirius.

You can find an example in the sample modeler available at https://github.com/ObeoNetwork/Flow-Designer/, for example on the "Processor to Processor" edge mapping (see attached screenshot).

[1] https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#edges


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Multi-directional connections; or: How to model electrical wires? [message #1743137 is a reply to message #1743132] Mon, 12 September 2016 14:18 Go to previous messageGo to next message
Stefan W.Friend
Messages: 6
Registered: October 2011
Junior Member
Hello,
thank you very much for your answers!
The element-based edge mapping of Sirius only supports connecting two ports. An electrical wire can interconnect many ports and all of them have a common voltage level. I thought of the class "Wire" as an Association Class which can have references to 1..* ports. But as you mentioned there is no generic concept how to map this to an Edge representation.
Is there an extension point or API for providing own graphical representations (other than Nodes or Edges)?

Best regards,
Stefan
Re: Multi-directional connections; or: How to model electrical wires? [message #1743313 is a reply to message #1743137] Wed, 14 September 2016 09:30 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 705
Registered: July 2009
Senior Member
It is not possible to have edges with more than 2 ends, sorry.

Depending on your case, there might be a workaround, using the capability for an edge to have either its source or its target (not both) be another edge. It would look like this:
* define a first element-based edge mapping which represent the Wire and connect the first 2 ports;
* define a second edge mapping, this time a reference-based mapping. It source mapping would be the first one above, and its "Target Find Expression" would return all the Wire's ports except for the first two.

This would create an asymetry in how the connections are represented, and added complexity in the associated tools to take it into account.

The only other approach I see would be representing the Wire itself by a node (which could be made very small visually) with oubound connections, but while more symetrical/consistent, visually it may not give the result you're looking for.

Regards,
Pierre-Charles

--
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Get and set Text size in any DNode and DEdge
Next Topic:Export created model as PNML
Goto Forum:
  


Current Time: Wed Sep 25 12:42:08 GMT 2024

Powered by FUDForum. Page generated in 0.05847 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top