Skip to content

Commit

Permalink
Break lines in better ways.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Oct 9, 2020
1 parent 09a57ee commit 9905472
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions chapters/annotations.tex
Expand Up @@ -43,7 +43,8 @@ \section{Annotations for Documentation}\label{annotations-for-documentation}

\begin{lstlisting}[language=grammar]
documentation-annotation:
annotation "(" Documentation "(" "info" "=" STRING ["," "revisions" "=" STRING ] ")" ")"
annotation "(" Documentation "(" "info" "=" STRING
["," "revisions" "=" STRING ] ")" ")"
\end{lstlisting}
The \lstinline!Documentation! annotation can contain the \lstinline!info! annotation
giving a textual description, the \lstinline!revisions! annotation giving a list
Expand Down Expand Up @@ -1162,11 +1163,12 @@ \section{Annotations for the Graphical User Interface}\label{annotations-for-the

A component declaration or a short replaceable class definition may have the following annotation:
\begin{lstlisting}[language=modelica]
annotation(Dialog(enable = true, tab = "General",
annotation(Dialog(enable = true,
tab = "General",
group = "",
showStartAttribute = false,
colorSelector = false,
groupImage="modelica://MyPackage/Resources/Images/switch.png",
groupImage="modelica://MyPackage/Resources/Images/load.png",
connectorSizing = false));
\end{lstlisting}
For a short replaceable class definition only the fields \lstinline!tab!, \lstinline!group!, \lstinline!enable! and
Expand Down Expand Up @@ -1504,8 +1506,9 @@ \subsection{Version Handling}\label{version-handling}

\subsubsection{Conversion rules}\label{conversion-rules}

% Using mbox to avoid having line starting with ","
There are a number of functions: \lstinline!convertClass!, \lstinline!convertClassIf!,
\lstinline!convertElement!, \lstinline!convertModifiers!, \lstinline!convertMessage! defined as follows. The
\lstinline!convertElement!, \mbox{\lstinline!convertModifiers!,} \lstinline!convertMessage! defined as follows. The
calls of these functions do not directly convert, instead they define
conversion rules as below. The order between the function calls does not
matter, instead the longer paths (in terms number of hierarchical names)
Expand Down Expand Up @@ -1606,7 +1609,8 @@ \subsubsection{Conversion rules}\label{conversion-rules}
\begin{lstlisting}[language=modelica]
convertModifiers("OldClass",
{"OldModifier1=default1", "OldModifier2=default2", ...},
{"NewModifier1=...%OldModifier2%...", "NewModifier2=...", ...} [, simplify=true] )
{"NewModifier1=...%OldModifier2%...", "NewModifier2=...", ...}
[, simplify=true] )
\end{lstlisting}

Normal case; if any modifier among \lstinline!OldModifier! exist then replace all of
Expand Down Expand Up @@ -1672,33 +1676,37 @@ \subsubsection{Conversion rules}\label{conversion-rules}
The conversion
\begin{lstlisting}[language=modelica]
convertClass("Modelica.Thermal.FluidHeatFlow.Components.IsolatedPipe",
"Modelica.Thermal.FluidHeatFlow.Components.Pipe")
"Modelica.Thermal.FluidHeatFlow.Components.Pipe")
convertModifiers({"Modelica.Thermal.FluidHeatFlow.Components.IsolatedPipe"},
fill("",0), {"useHeatPort=false"})
fill("",0), {"useHeatPort=false"})

convertClass("Modelica.StateGraph.Temporary.NumericValue",
"Modelica.Blocks.Interaction.Show.RealValue")
"Modelica.Blocks.Interaction.Show.RealValue")
convertModifiers("Modelica.StateGraph.Temporary.NumericValue",
{"Value"}, {"number=%Value%"})
{"Value"}, {"number=%Value%"})
convertModifiers("Modelica.StateGraph.Temporary.NumericValue",
{"hideConnector"}, {"use_numberPort=not %hideConnector%"})
{"hideConnector"}, {"use_numberPort=not %hideConnector%"})

convertModifiers("Modelica.Blocks.Math.LinearDependency",
{"y0=0", "k1=0", "k2=0"}, {"y0=%y0%", "k1=%y0%*%k1%", "k2=%y0%*%k2%"}, true)
convertClass("Modelica.Electrical.Machines.BasicMachines.QuasiStationaryDCMachines",
"Modelica.Electrical.Machines.BasicMachines.QuasiStaticDCMachines")
convertElement({"Modelica.Electrical.Machines.Interfaces.PartialBasicDCMachine"},
{"y0=0", "k1=0", "k2=0"}, {"y0=%y0%", "k1=%y0%*%k1%", "k2=%y0%*%k2%"},
true)
convertClass(
"Modelica.Electrical.Machines.BasicMachines.QuasiStationaryDCMachines",
"Modelica.Electrical.Machines.BasicMachines.QuasiStaticDCMachines")
convertElement("Modelica.Electrical.Machines.Interfaces.PartialBasicDCMachine",
"quasiStationary", "quasiStatic")
convertElement("Modelica.Electrical.Machines.BasicMachines.QuasiStationaryDCMachines.DC_ElectricalExcited",
"quasiStationary", "quasiStatic")
\end{lstlisting}
converts
\begin{lstlisting}[language=modelica]
Modelica.Thermal.FluidHeatFlow.Components.IsolatedPipe pipe1;
Modelica.StateGraph.Temporary.NumericValue tempValue(Value=10, hideConnector=true);
Modelica.StateGraph.Temporary.NumericValue tempValue(Value=10,
hideConnector=true);
Modelica.Blocks.Math.LinearDependency linearDep(y0=2, k2=1);
model A
extends Modelica.Electrical.Machines.BasicMachines.QuasiStationaryDCMachines.DC_ElectricalExcited;
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStationaryDCMachines.DC_ElectricalExcited;
end A;
model B
extends A;
Expand All @@ -1711,7 +1719,8 @@ \subsubsection{Conversion rules}\label{conversion-rules}
Modelica.Blocks.Interaction.Show.RealValue(number=10, use_numberPort=not true);
Modelica.Blocks.Math.LinearDependency linearDep(y0=2, k1=0, k2=2);
model A
extends Modelica.Electrical.Machines.BasicMachines.QuasiStaticDCMachines.DC_ElectricalExcited;
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStaticDCMachines.DC_ElectricalExcited;
end A;
model B
extends A;
Expand Down Expand Up @@ -1762,12 +1771,12 @@ \subsection{Version Date and Build Information}\label{version-date-and-build-inf
\begin{lstlisting}[language=modelica]
String versionDate "UTC date of first version build (in format: YYYY-MM-DD)";
Integer versionBuild "Larger number is a more recent maintenance update";
String dateModified "UTC date and time of the latest change to the package in the
following format (with one space between date and time):
YYYY-MM-DD hh:mm:ssZ";
String dateModified "UTC date and time of the latest change to the package
in the following format (with one space between date
and time): YYYY-MM-DD hh:mm:ssZ";
String revisionId "Revision identifier of the version management system used
to manage this library. It marks the latest submitted change to
any file belonging to the package";
to manage this library. It marks the latest submitted
change to any file belonging to the package";
\end{lstlisting}

\begin{example}
Expand Down

0 comments on commit 9905472

Please sign in to comment.