Skip to content

Commit

Permalink
Clarify that Figure.caption and identifiers have an empty default;
Browse files Browse the repository at this point in the history
and special rules for empty identifiers.
Note that Plot.caption is not the empty string as default as there is a more complicated explanation.
Closes #2851
  • Loading branch information
HansOlsson committed Mar 15, 2021
1 parent e4f879c commit 991023b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chapters/annotations.tex
Expand Up @@ -75,19 +75,19 @@ \subsection{Annotations for Figures}\label{annotations-for-figures}
\begin{lstlisting}[language=modelica]
record Figure
String title = "" "Title meant for display";
String identifier "Identifier meant for programmatic access";
String identifier = "" "Identifier meant for programmatic access";
String group = "" "Name of plot group";
Boolean preferred = false "Automatically display figure after simulation";
Plot[:] plots "Plots";
String caption "Figure caption";
String caption = "" "Figure caption";
end Figure;
\end{lstlisting}

A \fmtannotationindex{Figure} is a graphical container that can contain several \lstinline!plots! described by \fmtannotationindex{Plot} annotations:
\begin{lstlisting}[language=modelica]
record Plot
String title "Title meant for display";
String identifier "Identifier meant for programmatic access";
String identifier = "" "Identifier meant for programmatic access";
Curve[:] curves "Plot curves";
Axis x "X axis properties";
Axis y "Y axis properties";
Expand All @@ -109,10 +109,11 @@ \subsection{Annotations for Figures}\label{annotations-for-figures}
The \lstinline!identifier! in \lstinline!Figure! and \lstinline!Plot! is an optional \lstinline!String! identifier, and is intended to identify the
\lstinline!Figure! and \lstinline!Plot! for programmatic access. The \lstinline!figures! annotation is inherited in the sense that each class has
a collection of figures comprised by the contents of the \lstinline!figures! annotation in the class itself, as well as the \lstinline!figures! annotations
from any base classes. A \lstinline!Figure! must be uniquely identified by its \lstinline!identifier! and a class having it in its collection. This
from any base classes. A \lstinline!Figure! must be uniquely identified by its \lstinline!identifier! and a class having it in its collection. This
means that a \lstinline!Figure! \lstinline!identifier! must be unique among all \lstinline!Figure! annotations within the same \lstinline!figures!
annotation as well as among all \lstinline!figures! annotations from inherited classes. A \lstinline!Plot! \lstinline!identifier! on the other hand
is only required to be unique among the \lstinline!plots! in the the same \lstinline!Figure! annotation.
If the identifier is an empty string it cannot be used for programmatic access and is exempt from the uniqueness requirement.

\begin{nonnormative}
For \lstinline!Figure!, this makes it possible to reference the plot from a
Expand Down

0 comments on commit 991023b

Please sign in to comment.