From 99054727b91a0b90271488894fae7ee62bff5e03 Mon Sep 17 00:00:00 2001 From: OLSSON Hans Date: Fri, 9 Oct 2020 11:42:58 +0200 Subject: [PATCH] Break lines in better ways. --- chapters/annotations.tex | 53 +++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/chapters/annotations.tex b/chapters/annotations.tex index 97f012d8c..70273de42 100644 --- a/chapters/annotations.tex +++ b/chapters/annotations.tex @@ -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 @@ -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 @@ -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) @@ -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 @@ -1672,22 +1676,24 @@ \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") @@ -1695,10 +1701,12 @@ \subsubsection{Conversion rules}\label{conversion-rules} 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; @@ -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; @@ -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}