Skip to content

Commit

Permalink
Apply it to the new annotations and some old.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Dec 1, 2023
1 parent 0d29c5f commit 65505e9
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions chapters/annotations.tex
Expand Up @@ -39,8 +39,8 @@ \section{Documentation}\label{annotations-for-documentation}\label{documentation
The \fmtannotationindex{Documentation} annotation has the following contents, where the \lstinline!info! and \lstinline!revisions! annotations are described in \cref{annotation-info-revisions}, and the \lstinline!figures! annotation is described in \cref{annotations-for-figures}:
\begin{lstlisting}[language=modelica]
record Documentation
String info = "" "Description of the class";
String revisions = "" "Revision history";
constant String info = "" "Description of the class";
constant String revisions = "" "Revision history";
Figure[:] figures = {}; "Simulation result figures";
end Documentation;
\end{lstlisting}
Expand Down Expand Up @@ -393,7 +393,7 @@ \section{Symbolic Processing}\label{annotations-for-symbolic-processing}\label{s

\begin{annotationdefinition}[Evaluate]
\begin{synopsis}\begin{lstlisting}
Boolean Evaluate;
parameter Boolean Evaluate;
\end{lstlisting}\end{synopsis}
\begin{semantics}
The annotation \lstinline!Evaluate! can occur in the component declaration, its type declaration, or a base class of the type-declaration.
Expand Down Expand Up @@ -466,10 +466,10 @@ \section{Simulations}\label{annotations-for-simulations}\label{simulations}
\begin{synopsis}
\begin{lstlisting}[language=modelica]
record experiment
Real StartTime(unit = "s") = 0;
Real StopTime(unit = "s");
Real Interval(unit = "s");
Real Tolerance(unit = "1");
parameter Real StartTime(unit = "s") = 0;
parameter Real StopTime(unit = "s");
parameter Real Interval(unit = "s");
parameter Real Tolerance(unit = "1");
end experiment;
\end{lstlisting}
\end{synopsis}
Expand All @@ -484,7 +484,7 @@ \section{Simulations}\label{annotations-for-simulations}\label{simulations}

\begin{annotationdefinition}[HideResult]
\begin{synopsis}\begin{lstlisting}
Boolean HideResult;
parameter Boolean HideResult;
\end{lstlisting}\end{synopsis}
\begin{semantics}
\lstinline!HideResult = true! defines that the model developer proposes to not show the simulation results of the corresponding component.
Expand All @@ -502,7 +502,7 @@ \section{Simulations}\label{annotations-for-simulations}\label{simulations}
\begin{annotationdefinition}[TestCase]
\begin{synopsis}\begin{lstlisting}
record TestCase
Boolean shouldPass;
constant Boolean shouldPass;
end TestCase;
\end{lstlisting}\end{synopsis}
\begin{semantics}
Expand All @@ -525,7 +525,7 @@ \subsection{Single Use of Class}\label{annotation-for-single-use-of-class}\label
For state machines it is useful to have single instances of local classes.
This can be done using:
\begin{lstlisting}[language=modelica]
Boolean singleInstance;
constant Boolean singleInstance;
\end{lstlisting}

The annotation \fmtannotationindex{singleInstance} if \lstinline!true! in a class indicates that there should only be one component instance of the class, and it should be in the same scope as the class is defined.
Expand All @@ -536,7 +536,7 @@ \subsection{Connection Restrictions}\label{connection-restrictions}

A connector component declaration may have the following annotation:
\begin{lstlisting}[language=modelica, mathescape=true]
String mustBeConnected = "$\mathit{message}$";
constant String mustBeConnected = "$\mathit{message}$";
\end{lstlisting}%
\annotationindex{mustBeConnected}

Expand Down Expand Up @@ -564,7 +564,7 @@ \subsection{Connection Restrictions}\label{connection-restrictions}

A connector component declaration may have the following annotation:
\begin{lstlisting}[language=modelica, mathescape=true]
String mayOnlyConnectOnce = "$\mathit{message}$";
constant String mayOnlyConnectOnce = "$\mathit{message}$";
\end{lstlisting}%
\annotationindex{mayOnlyConnectOnce}

Expand Down Expand Up @@ -1263,14 +1263,14 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
This section describes the annotations that are used to define properties of the graphical user interface.

\begin{lstlisting}[language=modelica, mathescape=true]
String preferredView = $\mathit{view}$;
constant String preferredView = $\mathit{view}$;
\end{lstlisting}

The \fmtannotationindex{preferredView} annotation defines the default view when selecting the class.
The $\mathit{view}$ is a \lstinline!String! literal where \lstinline!"info"! means class documentation (``information''), \lstinline!"diagram"! means diagram view, \lstinline!"icon"! means icon view, and \lstinline!"text"! means Modelica source code (``text'').

\begin{lstlisting}
Boolean DocumentationClass;
constant Boolean DocumentationClass;
\end{lstlisting}%
\annotationindex{DocumentationClass}

Expand All @@ -1283,7 +1283,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
\end{nonnormative}

\begin{lstlisting}[language=modelica, mathescape=true]
String defaultComponentName = "$\mathit{name}$";
constant String defaultComponentName = "$\mathit{name}$";
\end{lstlisting}%
\annotationindex{defaultComponentName}

Expand All @@ -1292,7 +1292,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
When automatically deriving a name, any trailing `\lstinline!1!' in the \lstinline!defaultComponentName! shall be disregarded.

\begin{lstlisting}[language=modelica, mathescape=true]
String defaultComponentPrefixes = "$\mathit{prefixes}$";
constant String defaultComponentPrefixes = "$\mathit{prefixes}$";
\end{lstlisting}%
\annotationindex{defaultComponentPrefixes}

Expand All @@ -1311,7 +1311,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte
\end{nonnormative}

\begin{lstlisting}[language=modelica, mathescape=true]
String missingInnerMessage = "$\mathit{message}$";
constant String missingInnerMessage = "$\mathit{message}$";
\end{lstlisting}%
\annotationindex{missingInnerMessage}

Expand All @@ -1337,7 +1337,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte

A simple type or component of a simple type may have:
\begin{lstlisting}[language=modelica]
Boolean absoluteValue;
constant Boolean absoluteValue;
\end{lstlisting}%
\annotationindex{absoluteValue}

Expand All @@ -1350,7 +1350,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte

A model or block definition may contain:
\begin{lstlisting}[language=modelica]
Boolean defaultConnectionStructurallyInconsistent;
constant Boolean defaultConnectionStructurallyInconsistent;
\end{lstlisting}%
\annotationindex{defaultConnectionStructurallyInconsistent}

Expand All @@ -1365,7 +1365,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte

A class may have the following annotation:
\begin{lstlisting}[language=modelica, mathescape=true]
String obsolete = "$\mathit{message}$";
constant String obsolete = "$\mathit{message}$";
\end{lstlisting}%
\annotationindex{obsolete}

Expand All @@ -1375,7 +1375,7 @@ \section{Graphical User Interface}\label{annotations-for-the-graphical-user-inte

A component declaration may have the following annotation:
\begin{lstlisting}[language=modelica, mathescape=true]
String unassignedMessage = "$\mathit{message}$";
constant String unassignedMessage = "$\mathit{message}$";
\end{lstlisting}%
\annotationindex{unassignedMessage}

Expand Down

0 comments on commit 65505e9

Please sign in to comment.