Assigning a specific connection type to a connector in Modelica

In Modelica, you can define annotations attached to an object, such as a connector, that change their graphic appearance.

Is it also possible to determine what the connection from one connector to another will look like? For example, two instances of the foo connector class will always have a dashed line as the connection, and two of the bar class will have a thicker full line.

So far, I noticed that the connection lines take on the color of the outer contour of the connector, but that's it. And I did not find anything in the documentation related to this.

+4
source share
2 answers

Yes, it is possible:

Modelica.Blocks.Examples.BusUsage_Utilities.ControlBus, (Modelica.Icons.SignalBus) :

Rectangle icon

, ,

change the type of connection via annotation

ControlBusses : Connection Between ControlBusses

Modelica.Blocks.Examples.BusUsage .

,

+4

Rene Just Nielsen , LinePattern :

parameter Boolean dashy=true;
.....
equation
  connect(pipe3.port_b,pipe4. port_a) annotation (Line(
      points={{20,0},{20,0},{20,10},{0,10},{0,16},{0,20},{0,20}},
      color={0,127,255},
      thickness=0.5,
      pattern=if dashy then LinePattern.Dash else LinePattern.Solid));

: , , , , , . Boolean , , true false, , if m_flow<0.

+2

All Articles