Skip to content

Commit

Permalink
Break oversize listing lines in convertModifiers examples
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Dec 16, 2021
1 parent efd9e03 commit 9968f48
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions chapters/annotations.tex
Expand Up @@ -1725,21 +1725,20 @@ \subsubsection{Conversion rules}\label{conversion-rules}
using the parameter.
\end{nonnormative}


\begin{example}
The conversion
\begin{lstlisting}[language=modelica]
convertClass("Modelica.Thermal.FluidHeatFlow.Components.IsolatedPipe",
"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");
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%"},
Expand All @@ -1748,37 +1747,39 @@ \subsubsection{Conversion rules}\label{conversion-rules}
"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");
"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.Blocks.Math.LinearDependency linearDep(y0=2, k2=1);
Modelica.StateGraph.Temporary.NumericValue tempValue(
Value = 10, hideConnector = true);
Modelica.Blocks.Math.LinearDependency linearDep(y0 = 2, k2 = 1);
model A
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStationaryDCMachines.DC_ElectricalExcited;
end A;
model B
extends A;
Boolean b=quasiStationary;
Boolean b = quasiStationary;
end B;
\end{lstlisting}
to
\begin{lstlisting}[language=modelica]
Modelica.Thermal.FluidHeatFlow.Components.Pipe pipe1(useHeatPort=false);
Modelica.Blocks.Interaction.Show.RealValue(number=10, use_numberPort=not true);
Modelica.Blocks.Math.LinearDependency linearDep(y0=2, k1=0, k2=2);
Modelica.Thermal.FluidHeatFlow.Components.Pipe pipe1(useHeatPort = false);
Modelica.Blocks.Interaction.Show.RealValue(
number = 10, use_numberPort = not true);
Modelica.Blocks.Math.LinearDependency linearDep(y0 = 2, k1 = 0, k2 = 2);
model A
import Modelica.Electrical.Machines.BasicMachines;
extends BasicMachines.QuasiStaticDCMachines.DC_ElectricalExcited;
end A;
model B
extends A;
Boolean b=a.quasiStatic;
Boolean b = a.quasiStatic;
end B;
\end{lstlisting}
The \lstinline!convertElement! call for \lstinline!DC_ElectricalExcited! is needed to avoid relying on base classes in the original library where \lstinline!DC_ElectricalExcited! inherits from \lstinline!PartialBasicDCMachine!.
Expand Down

0 comments on commit 9968f48

Please sign in to comment.