Skip to content

Commit

Permalink
Avoid hard coded numbers.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Feb 26, 2021
1 parent c3e011c commit 48f4f94
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions chapters/annotations.tex
Expand Up @@ -1479,7 +1479,7 @@ \subsection{Connector Sizing}\label{connector-sizing}
connectors, it is automatically updated according to the following
rules:
\begin{enumerate}
\item
\item \label{connectorSizing:addVector}
If a new connection line is drawn between one outside and one
inside vector of connectors both dimensioned with (\lstinline!connectorSizing!)
parameters, a connection between the two vectors is performed and the
Expand All @@ -1501,21 +1501,21 @@ \subsection{Connector Sizing}\label{connector-sizing}
equation
connect(inPorts, step1.inPorts); // new connect equation
\end{lstlisting}
\item
\item \label{connectorSizing:deleteVector}
If a connection line is deleted between one outside and one
inside vector of connectors both dimensioned with (\lstinline!connectorSizing!)
parameters, the connect equation is removed and the (\lstinline!connectorSizing!)
parameter of the component is set to zero or the modifier is removed.
\emph{Example:} Assume the connection line in (3) is removed.
\emph{Example:} Assume the connection line in the resulting example in case~\ref{connectorSizing:addVector} is removed.
This results in:
\begin{lstlisting}[language=modelica]
parameter Integer nIn=0 annotation(Dialog(connectorSizing=true));
Step_in inPorts[nIn];
Step step1; // modifier nIn=nIn is removed
\end{lstlisting}
\item
\item \label{connectorSizing:addScalar}
If a new connection line is drawn to an inside connector with
\lstinline!connectorSizing! and case 1 does not apply then, the parameter is
\lstinline!connectorSizing! and case~\ref{connectorSizing:addVector} does not apply then, the parameter is
incremented by one and the connection is performed for the new highest
index. \emph{Example:} Assume that 3 connections are present and a new
connection is performed. The result is:
Expand All @@ -1530,9 +1530,9 @@ \subsection{Connector Sizing}\label{connector-sizing}
not sufficient to only provide a mechanism to always connect to the
last index. Instead, some mechanism to select an index conveniently
should be provided.
\item
\item \label{connectorSizing:deleteScalar}
If a connection line is deleted to an inside connector with
\lstinline!connectorSizing! and case 2 does not apply then, then the
\lstinline!connectorSizing! and case~\ref{connectorSizing:deleteVector} does not apply then, then the
(\lstinline!connectorSizing!) parameter is decremented by one and all connections
with index above the deleted connection index are also decremented by
one. \emph{Example:}Assume there are 4 connections:
Expand Down

0 comments on commit 48f4f94

Please sign in to comment.