[Tex/LaTex] Putting labels on arrow mark in Tikz’s picture

tikz-pgf

I've tried to manually put labels (1-2-3-4) on the arrows tip in the center of the connection lines but it seems not working good..How can i fix this?

enter image description here

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,intersections,shapes.geometric,decorations.pathmorphing,decorations.pathreplacing,decorations.shapes,decorations.markings,patterns,calc,fit,arrows,backgrounds,matrix}

\begin{document}
\begin{tikzpicture}[auto]

\tikzset{deco/.style={decoration={markings, mark=at position #1 with {\arrow{>} }},postaction={decorate}}}
\tikzset{trape/.style={trapezium,draw,shape border rotate=90,minimum width=2cm}}
\tikzset{box/.style={rectangle,draw,minimum height=1cm,minimum width=2.5cm}}
\tikzset{cerchi/.style={circle,draw,minimum size=1cm}}

\matrix [row sep={1.5cm}]
{
                            &[2cm]  \node [box] (genera) {}; &[2cm]                         &[1cm] \\
 \node [cerchi] (pompa) {}; &                                & \node [trape] (turbina) {};  & \node [cerchi] (ultiliz) {}; \\
                            & \node [cerchi] (condensa) {};  &                              &      \\
};

\begin{scope}[>=triangle 60]
 \draw [deco=0.6]  (genera)                      -|  node[pos=0.6]{2} (turbina.top right corner);
 \draw [deco=0.6]  (turbina.bottom left corner) |-   node[above=1mm,pos=0.71]{3} (condensa);
 \draw [deco=0.4]  (condensa)                    -|  node[above=1mm,pos=0.31]{4} (pompa);
 \draw [deco=0.6]  (pompa)                      |-   node[below=1mm,pos=0.63]{1} (genera);
\end{scope}

\draw [->,>=latex,very thick, shorten >=4 pt,shorten <=4pt] (pompa.south)--(pompa.north);

\node [coordinate] (B) at ($ (condensa.center)!.6!(condensa.west) $) {};
\node [coordinate] (C) at ($ (condensa.center)!.6!(condensa.east) $) {};
\node [coordinate] (A) at ($ (B)+(0,-1.5cm)$) {};
\node [coordinate] (D) at ($ (C)+(0,-1.5cm)$) {};
\draw (A)--(B);
\draw[decorate,decoration={zigzag,amplitude=3pt,segment length=8pt}] (B)--(C);
\draw (C)--(D);
\end{tikzpicture}



\end{document}

Best Answer

As I commented on one of your questions you can add a node to your deco style for numbering the arrows. Here is a customized version of it that puts the number always to the left of the line (relative to the direction). Change the -90 to +90 for the relative right or fine tune it further for yet another shift.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\tikzset{deco/.style 2 args={
            decoration={             
                        markings,   
                        mark=at position {#1} with { 
                                    \arrow{latex},
                                    \node[anchor=\pgfdecoratedangle-90] {#2};
                        }
            },
            postaction={decorate}
    }
}
\draw[deco={0.5}{A}] (0,0) -- (0,2);
\draw[deco={0.75}{B},deco={0.2}{C}] (0,2) -- (2,1);
\draw[deco={0.9}{D}] (2,1) -- (0,0);
\end{tikzpicture} 
\end{document}

This would give

enter image description here