Skip to content

Commit

Permalink
Closes #2170
Browse files Browse the repository at this point in the history
Clarified text-annotations on connections, with updated example.
  • Loading branch information
HansOlsson committed May 10, 2019
1 parent 3004426 commit f62ec3e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ \subsection{Connections}\doublelabel{connections1}
The optional Text-primitive defines a text that will be written on the
connection line. It has the following definition (\emph{it is not equal
to the Text-primitive as part of graphics -- the differences are marked as bold lines}):
% NOTE: Technically just the names - not the entire lines are marked ni bold
% NOTE: Technically just the names - not the entire lines are marked in bold
\begin{lstlisting}[language=modelica,escapechar=!,emph={horizontalAlignment,string,index}, emphstyle=\textbf]
record Text
extends GraphicItem;
Expand All @@ -654,25 +654,31 @@ \subsection{Connections}\doublelabel{connections1}
end Text;
\end{lstlisting}

The index is one of the points of Line (numbered 1, 2, 3, \ldots{} where
-1 can be used to indicate the last one). The string may use the special
The \lstinline!index! is one of the points of Line (numbered 1, 2, 3, \ldots{} where
negative numbers count from the end, thus -1 indicate the last one). The \lstinline!string!
may use the special
symbols ``\%first'' and ``\%second'' to indicate the connectors in the
connect-equation.

The \lstinline!extent! and \lstinline!rotation! is relative to the \lstinline!origin! (default \lstinline!{0,0}!)
and the \lstinline!origin! is relative to the point on the Line.

The textColor attribute defines the color of the text. The text is drawn
with transparent background and no border around the text (and without
outline). The contents inherited from FilledShape is deprecated.
The default value for horizontalAlignment is deprecated.
Having a zero size for the extent is deprecated and is handled as if upper part is moved up an approprimate amount.

{[}\emph{Example:}
\begin{lstlisting}[language=modelica]
connect(controlBus.axisControlBus1, axis1.axisControlBus) annotation (
Text(string="%first", index=-1, extent=[-6,3; -6,3]),
Text(string="%first", index=-1, extent=[-6,3; -6,7]),
Line(points={{-80,-10},{-80,-14.5},{-79,-14.5},{-79,-17},{-65,-17},{-65,-65},
{-25,-65}}));
\end{lstlisting}
\emph{Draws a connection line and adds the text ''axisControlBus1''
ending at \{-6, 3\}+\{-25, -65\}.}

ending at \{-6, 3\}+\{-25, -65\} and 4 vertical units of space for the text.
Using \lstinline!extent=[-6,3; -6,3]! is deprecated, but gives similar result.}
{]}

\subsection{Graphical primitives}\doublelabel{graphical-primitives}
Expand Down

0 comments on commit f62ec3e

Please sign in to comment.