Skip to content

Commit

Permalink
Clean up whitespace
Browse files Browse the repository at this point in the history
This includes getting rid of some tabs and making sure that lines of some listings fit inside the text width.
  • Loading branch information
henrikt-ma committed Oct 14, 2020
1 parent 4fea2eb commit 51e360e
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 163 deletions.
44 changes: 21 additions & 23 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ \section{Vendor-Specific Annotations}\label{vendor-specific-annotations}
\begin{example}
\begin{lstlisting}[language=modelica]
annotation (
Icon(coordinateSystem(extent={{-100,-100}, {100,100}}),
graphics={__NameOfVendor(Circle(center={0,0}, radius=10))}) );
Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}),
graphics = {__NameOfVendor(Circle(center = {0, 0}, radius = 10))}));
\end{lstlisting}
This introduces a new graphical primitive \lstinline!Circle! using the
hierarchical variant of vendor-specific annotations.
\begin{lstlisting}[language=modelica]
annotation (
Icon(coordinateSystem(extent={{-100,-100}, {100,100}}),
graphics={Rectangle(extent={{-5,-5},{7,7}}, __NameOfVendor_shadow=2)}) );
Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}),
graphics = {Rectangle(extent = {{-5, -5}, {7, 7}},
__NameOfVendor_shadow = 2)}));
\end{lstlisting}
This introduces a new attribute \lstinline!__NameOfVendor_shadow!
for the \lstinline!Rectangle! primitive using the simple variant of
Expand Down Expand Up @@ -88,11 +89,7 @@ \section{Annotations for Documentation}\label{annotations-for-documentation}
annotation "(" DocumentationClass "=" true ")"
\end{lstlisting}

Only allowed as class annotation on any kind of class and implies that
this class and all classes within it are treated as having the
annotation \lstinline!preferredView="info"!. If the annotation \lstinline!preferredView! is
explicitly set for a class, it has precedence over a \lstinline!DocumentationClass!
annotation.
Only allowed as class annotation on any kind of class and implies that this class and all classes within it are treated as having the annotation \lstinline!preferredView = "info"!. If the annotation \lstinline!preferredView! is explicitly set for a class, it has precedence over a \lstinline!DocumentationClass! annotation.

\begin{nonnormative}
A tool may display such classes in special ways. For example, the description texts of the classes might be displayed instead
Expand Down Expand Up @@ -586,13 +583,13 @@ \subsection{Extends clause}\label{extends-clause}
\begin{lstlisting}[language=modelica]
model A
extends B annotation(
IconMap(extent={{-100,-100}, {100,100}},primitivesVisible=false),
DiagramMap(extent={{-50,-50}, {0,0}},primitivesVisible=true)
IconMap(extent = {{-100, -100}, {100, 100}}, primitivesVisible = false),
DiagramMap(extent = {{-50, -50}, {0, 0}}, primitivesVisible = true)
);
end A;

model B
extends C annotation(DiagramMap(primitivesVisible=false));
extends C annotation(DiagramMap(primitivesVisible = false));
...
end B;
\end{lstlisting}
Expand All @@ -609,7 +606,7 @@ \subsection{Connections}\label{connections1}
\begin{example}
\begin{lstlisting}[language=modelica]
connect(a.x, b.x)
annotation(Line(points={{-25,30}, {10,30}, {10, -20}, {40,-20}}));
annotation(Line(points = {{-25, 30}, {10, 30}, {10, -20}, {40, -20}}));
\end{lstlisting}
\end{example}

Expand All @@ -625,14 +622,15 @@ \subsection{Connections}\label{connections1}
String fontName;
TextStyle textStyle[:];
Color textColor = lineColor;
TextAlignment horizontalAlignment = if index<0 then TextAlignment.Right else TextAligment.Left;
TextAlignment horizontalAlignment =
if index < 0 then TextAlignment.Right else TextAligment.Left;
Integer index;
end Text;
\end{lstlisting}

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 \lstinline!"%first"! and \lstinline!"%second"! to indicate the connectors in the connect-equation.

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

The \lstinline!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 \lstinline!FilledShape! is deprecated, but kept for compatibility reasons. The default value for \lstinline!horizontalAlignment! is deprecated. Having a zero size for the \lstinline!extent! is deprecated and is handled as if upper part is moved up an appropriate amount.

Expand All @@ -644,7 +642,7 @@ \subsection{Connections}\label{connections1}
\end{lstlisting}
Draws a connection line and adds the text \emph{axisControlBus1}
ending at \{-6, 3\}+\{-25, -65\} and 4 vertical units of space for the text.
Using a height of zero, such as \lstinline!extent=[-6,3; -6,3]! is deprecated, but gives similar result.
Using a height of zero, such as \lstinline!extent = [-6, 3; -6, 3]! is deprecated, but gives similar result.
\end{example}

\subsection{Graphical primitives}\label{graphical-primitives}
Expand Down Expand Up @@ -888,15 +886,14 @@ \subsubsection{Mouse input}\label{mouse-input}
variable when the rectangle is clicked on:
\begin{lstlisting}[language=modelica]
annotation (Icon(
graphics={Rectangle(
extent=[0,0; 20,20],
fillColor=if on then {255,0,0} else {0,0,255})},
interaction={OnMouseDownSetBoolean (on, not on)}));
graphics = {Rectangle(
extent = [0, 0; 20, 20],
fillColor = if on then {255, 0, 0} else {0, 0, 255})},
interaction = {OnMouseDownSetBoolean(on, not on)}));
\end{lstlisting}
\end{example}

In a similar way, a variable can be changed when the mouse button is
\emph{released}:
In a similar way, a variable can be changed when the mouse button is \emph{released}:
\begin{lstlisting}[language=modelica]
record OnMouseUpSetBoolean
Boolean variable "Name of variable to change when mouse button released";
Expand All @@ -908,7 +905,7 @@ \subsubsection{Mouse input}\label{mouse-input}

\begin{example}
\begin{lstlisting}[language=modelica]
interaction={ OnMouseDownSetBoolean(on, true), OnMouseUpSetBoolean(on, false)};
interaction = {OnMouseDownSetBoolean(on, true), OnMouseUpSetBoolean(on, false)};
\end{lstlisting}
\end{example}

Expand All @@ -933,6 +930,7 @@ \subsubsection{Mouse input}\label{mouse-input}
Real maxValue;
end OnMouseMoveYSetReal;
\end{lstlisting}

\subsubsection{Edit input}\label{edit-input}

The \lstinline!OnMouseDownEditInteger! interaction object presents an input field
Expand Down
4 changes: 2 additions & 2 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,8 @@ \section{Class Declarations}\label{class-declarations}

long-class-specifier :
IDENT description-string composition end IDENT
| extends IDENT [ class-modification ] description-string composition
end IDENT
| extends IDENT [ class-modification ] description-string
composition end IDENT

short-class-specifier :
IDENT "=" base-prefix name [ array-subscripts ]
Expand Down
10 changes: 1 addition & 9 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,7 @@ \section{Function as a Specialized Class}\label{function-as-a-specialized-class}
\begin{nonnormative}
It is a quality of implementation how much analysis a tool performs in order to determine if the output variables are computed.
\end{nonnormative}
A function \emph{cannot contain} calls to the
Modelica \emph{built-in operators} \lstinline!der!, \lstinline!initial!,
\lstinline!terminal!, \lstinline!sample!,
\lstinline!pre!, \lstinline!edge!, \lstinline!change!,
\lstinline!reinit!, \lstinline!delay!, \lstinline!cardinality!,
\lstinline!inStream!, \lstinline!actualStream!,
to the operators of the built-in package \lstinline!Connections!, to the operators
defined in \cref{synchronous-language-elements} and \cref{state-machines}, and is not allowed to contain
when-statements.
A function \emph{cannot contain} calls to the Modelica \emph{built-in operators} \lstinline!der!, \lstinline!initial!, \lstinline!terminal!, \lstinline!sample!, \lstinline!pre!, \lstinline!edge!, \lstinline!change!, \lstinline!reinit!, \lstinline!delay!, \lstinline!cardinality!, \lstinline!inStream!, \lstinline!actualStream!, to the operators of the built-in package \lstinline!Connections!, to the operators defined in \cref{synchronous-language-elements} and \cref{state-machines}, and is not allowed to contain when-statements.
\item
The dimension \emph{sizes} not declared with (:) of each array result
or array local variable (i.e., a non-input components) of a
Expand Down
Loading

0 comments on commit 51e360e

Please sign in to comment.