<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% !TeX encoding = utf8
%  !TeX spellcheck = fr 
\NeedsTeXFormat{LaTeX2e}[1999/01/01]
\ProvidesPackage{schemabloc}[version 1.9]

\RequirePackage{ifthen}
\RequirePackage{tikz}

\usetikzlibrary{shapes,arrows,positioning,fit}

%macros dessin des schÃ©ma-blocs mise Ã&nbsp; jour 11 mars 20013
% version 1.6

%initialisation des styles
\tikzset{blocstyle/.style={draw, rectangle, 
    minimum height=3em, minimum width=3em,right}
    }

\tikzset{sbStyleLien/.style={-&gt;,&gt;=latex'},
sbStyleBloc/.style={draw, rectangle},
sbStyleBlocPatate/.style={},
sbStyleSum/.style={}
}
%\tikzstyle{sbStyleLien}=[,]
%\tikzstyle{sbStyleBloc}=[draw, rectangle,]
%\tikzstyle{sbStyleBlocPatate}=[]
%\tikzstyle{sbStyleSum}=[ ]%style Sum CC
% Commandes de changement de style
\newcommand{\sbStyleLienDefaut}{
%\tikzstyle{sbStyleLien}=[-&gt;,&gt;=latex']
\tikzset{sbStyleLien/.style={-&gt;,&gt;=latex'}}
}
\newcommand{\sbStyleLien}[1]{
\tikzset{sbStyleLien/.style={-&gt;,&gt;=latex',#1}}
%\tikzstyle{sbStyleLien}+=[#1]
}

\newcommand{\sbStyleBloc}[1]{
\tikzset{sbStyleBloc/.style={#1}}
%\tikzstyle{sbStyleBloc}+=[#1]
}
\newcommand{\sbStyleBlocDefaut}{
\tikzset{sbStyleBloc/.style={draw, rectangle}}
%\tikzstyle{sbStyleBloc}=[draw, rectangle,]
}

\newcommand{\sbStyleSum}[1]{
\tikzset{sbStyleSum/.style={#1}}
%\tikzstyle{sbStyleSum}+=[#1]
}

\newcommand{\sbStyleSumDefaut}{
\tikzstyle{sbStyleSum}=[draw, circle,]
}%style Sum default CC


% Commandes d'entrÃ©e et sortie
\newcommand{\sbEntree}[2][0,0]{
    \node [coordinate, name=#2] at (#1) {};
\sbDecaleNoeudx[0]{#2}{#2}
}

\newcommand{\sbEntrees}[2][0,0]{
    \node [coordinate, name=#2] at(#1) {};
\sbDecaleNoeudx[0]{#2}{#2}
}
\newcommand{\sbSortie}[3][2]{
    \node [coordinate, right of=#3droite, node distance=#1em,%
 minimum size=0em,right] (#2) {};
}

\newcommand{\sbSortieL}[3][2]{
    \node [coordinate, right of=#3droite, node distance=#1em,%
 minimum size=0em,right] (#2) {};
 \sbRelier{#3}{#2}
}

%Commandes de Bloc
\newcommand{\sbBloc}[4][2]{
\node [blocstyle, right of = #4droite,
node distance=#1em,sbStyleBloc,right] (#2) {#3};
\coordinate (#2droite) at (#2.east);
%\coordinate (BlocdeFindroite) at (#2.east);
}

\newcommand{\sbBlocPatate}[4][2]{
\node [draw, cloud, cloud puffs=5, draw, 
    minimum height=3em, minimum width=5em, right of = #4droite,
node distance=#1em,sbStyleBlocPatate,right] (#2) {#3};
\coordinate (#2droite) at (#2.east);
}

\newcommand{\sbBlocr}[4][2]{
\node [blocstyle, left of = #4gauche, 
node distance=#1em, sbStyleBloc,left] (#2) {#3};
\coordinate (#2gauche) at (#2.west);
}

\newcommand{\sbBlocL}[4][2]{
\node [blocstyle, right of = #4droite,node distance=#1em%
,sbStyleBloc,right] (#2) {#3};
\coordinate (#2droite) at (#2.east);
\coordinate (BlocdeFindroite) at (#2.east);
 \draw [sbStyleLien,auto] (#4) --  (#2) node[midway](#4-#2){};
}

\newcommand{\sbBlocrL}[4][2]{
\node [draw, rectangle, 
    minimum height=3em, minimum width=3em, left of = #4gauche, 
node distance=#1em, sbStyleBloc,left] (#2) {#3};
\node (#2gauche) at (#2.west){};
\node (BlocdeFingauche) at (#2.west){};
 \draw [sbStyleLien,auto] (#4) --  (#2)node[name=#4-#2] {};
}

\newcommand{\sbBlocseul}[4][1.5]{
\sbEntree{E1}
\sbBloc[#1]{Blocseul}{#3}{E1}
\sbSortie[#1]{S1}{Blocseul}
\sbRelier[#2]{E1}{Blocseul}
\sbRelier[#4]{Blocseul}{S1}
}

%\Commande de lien
\newcommand{\sbRelier}[3][]{
 \draw [sbStyleLien,auto] (#2) -- 
   (#3)node[pos=0.5,name=#2-#3]{#1}coordinate[pos=0.25,name=#2-#3-1]coordinate[pos=0.75,name=#2-#3-2];
}

\newcommand{\sbRelieryx}[2]{
\draw [sbStyleLien] (#1.south) --   (#1.south  |-#2) --(#2)  ;
}

\newcommand{\sbRelierxy}[3][]{
\draw [sbStyleLien] (#2)  -|    (#3) coordinate[name=#2-#3-1,pos=0.25]
 node[name=#2-#3,near end,right] {#1} ;
}

\newcommand{\sbRenvoi}[4][4]{
\node [below =#1em of #2, minimum size=0em](retour#2) {};
\draw [sbStyleLien] (#2.south)--(retour#2.south)   -|    (#3)node[name=#2-#3,near end,right] {#4} ;
}

\newcommand{\sbNomLien}[3][0.4]{
\node[above of=#2, node distance=#1em] (#2nom) at (#2) {#3};
}
%Commande comparateurs et sommateurs

\newcommand*{\sbCompSum}{\@ifstar\sbCompSumNorm\sbCompSumUsuel}

\newcommand*{\sbCompSumr}{\@ifstar\sbCompSumNormr\sbCompSumUsuelr}


\newcommand{\sbCompSumUsuel}[7][4]{
    \node [draw, circle,minimum size=2em, right of=#3droite%
,sbStyleSum,node distance=#1em] (#2) {};
	 \node [draw,sbStyleSum, cross out,minimum size=1.414em,
	 right of=#3droite,node distance=#1em] {};
	 \node [above of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#4$};
	 \node [below of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#5$};
	 \node [left of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#6$};
	 \node [right of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#7$};
\node (#2droite) at (#2.east){};
\node (#2gauche) at (#2.west){};
}



\newcommand{\sbCompSumUsuelr}[7][4]{
    \node [draw, circle,minimum size=2em, left of=#3gauche%
,sbStyleSum,node distance=#1em] (#2) {};
	 \node [draw,sbStyleSum, cross out,minimum size=1.414em,%
left of=#3gauche,node distance=#1em] {};
	 \node [above of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#4$};
	 \node [below of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#5$};
	 \node [left of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#6$};
	 \node [right of=#2,node distance=0.6em,sbStyleSum,inner sep=0] {$#7$};
\node (#2droite) at (#2.east){};
\node (#2gauche) at (#2.west){};
}

\newcommand{\sbCompSumNorm}[7][4]{
    \node [draw, circle,minimum size=1.5em, right of=#3,sbStyleSum,node distance=#1em,,sbStyleSum] (#2) {};
    \node [ fit=(#2),inner sep=0.5em] (compext)  {};
\node at( compext.75){$#4$};
\node at( compext.-75){$#5$};
\node at( compext.165){$#6$};
\node at( compext.15){$#7$};
\node (#2droite) at (#2.east){};
\node (#2gauche) at (#2.west){};
}

\newcommand{\sbCompSumNormr}[7][4]{
    \node [draw, circle,minimum size=1.5em, left of=#3%
,sbStyleSum,node distance=#1em,,sbStyleSum] (#2) {};
    \node [ fit=(#2),inner sep=0.5em] (compext)  {};
\node at( compext.75){$#4$};\node at( compext.-75){$#5$};\node at( compext.165){$#6$};\node at( compext.15){$#7$};
\node (#2droite) at (#2.east){};
\node (#2gauche) at (#2.west){};
}

\newcommand{\sbSum}[6][4]{
    \node [draw, circle,minimum size=1.5em, right of=#3,node distance=#1em,
label=175:$#4$,label=-85:$#5$,label=85:$#6$,sbStyleSum] (#2) {};
\node (#2droite) at (#2.east){};
\node (#2gauche) at (#2.west){};
}

\newcommand*{\sbComp}{\@ifstar\sbCompNorm\sbCompUsuel}
\newcommand{\sbCompUsuel}[3][4]{
\sbCompSum[#1]{#2}{#3}{}{-}{+}{}
}
\newcommand{\sbCompNorm}[3][4]{
\sbCompSum*[#1]{#2}{#3}{}{-}{+}{}
}

\newcommand*{\sbCompr}{\@ifstar\sbCompNormr\sbCompUsuelr}
\newcommand{\sbCompUsuelr}[3][4]{
\sbCompSumr[#1]{#2}{#3}{}{-}{}{+}
}
\newcommand{\sbCompNormr}[3][4]{
\sbCompSumr*[#1]{#2}{#3}{}{-}{}{+}
}

\newcommand*{\sbCompL}{\@ifstar\sbCompNormL\sbCompUsuelL}
\newcommand{\sbCompUsuelL}[3][4]{
\sbCompSum[#1]{#2}{#3}{}{-}{+}{}
\sbRelier[]{#3}{#2}
}
\newcommand{\sbCompNormL}[3][4]{
\sbCompSum*[#1]{#2}{#3}{}{-}{+}{}
\sbRelier[]{#3}{#2}
}

\newcommand*{\sbCompLr}{\@ifstar\sbCompNormLr\sbCompUsuelLr}
\newcommand{\sbCompUsuelLr}[3][4]{
\sbCompSumr[#1]{#2}{#3}{}{-}{}{+}
\sbRelier[]{#3}{#2}
}
\newcommand{\sbCompNormLr}[3][4]{
\sbCompSumr*[#1]{#2}{#3}{}{-}{}{+}
\sbRelier[]{#3}{#2}
}

\newcommand*{\sbComph}{\@ifstar\sbComphNorm\sbComphUsuel}
\newcommand{\sbComphUsuel}[3][4]{
\sbCompSum[#1]{#2}{#3}{-}{}{+}{}
}
\newcommand{\sbComphNorm}[3][4]{
\sbCompSum*[#1]{#2}{#3}{-}{}{+}{}
}

\newcommand*{\sbComphr}{\@ifstar\sbComphNormr\sbComphUsuelr}
\newcommand{\sbComphUsuelr}[3][4]{
\sbCompSumr[#1]{#2}{#3}{-}{}{}{+}
}

\newcommand{\sbComphNormr}[3][4]{
\sbCompSumr*[#1]{#2}{#3}{-}{}{}{+}
}

\newcommand*{\sbSumh}{\@ifstar\sbSumhNorm\sbSumhUsuel}
\newcommand{\sbSumhUsuel}[3][4]{
\sbCompSum[#1]{#2}{#3}{+}{}{+}{}
}
\newcommand{\sbSumhNorm}[3][4]{
\sbCompSum*[#1]{#2}{#3}{+}{}{+}{}
}

\newcommand*{\sbSumhr}{\@ifstar\sbSumhNormr\sbSumhUsuelr}
\newcommand{\sbSumhUsuelr}[3][4]{
\sbCompSumr[#1]{#2}{#3}{+}{}{}{+}
}
\newcommand{\sbSumhNormr}[3][4]{
\sbCompSumr*[#1]{#2}{#3}{+}{}{}{+}
}

\newcommand*{\sbSumb}{\@ifstar\sbSumbNorm\sbSumbUsuel}
\newcommand{\sbSumbUsuel}[3][4]{
\sbCompSum[#1]{#2}{#3}{}{+}{+}{}
}
\newcommand{\sbSumbNorm}[3][4]{
\sbCompSum*[#1]{#2}{#3}{}{+}{+}{}
}

\newcommand*{\sbSumbr}{\@ifstar\sbSumbNormr\sbSumbUsuelr}
\newcommand{\sbSumbUsuelr}[3][4]{
\sbCompSumr[#1]{#2}{#3}{}{+}{}{+}
}
\newcommand{\sbSumbNormr}[3][4]{
\sbCompSumr*[#1]{#2}{#3}{}{+}{}{+}
}


%Commandes de dï¿½calage de noeud

\newcommand{\sbDecaleNoeudy}[3][5]{
\node [below of=#2, node distance=#1em, minimum size=0em](#3) {};
\node (#3droite) at (#3){};
\node (#3gauche) at (#3){};
}

\newcommand{\sbDecaleNoeudyZ}[3][5]{
\node [below of=#2, minimum size=0em,inner sep=0](#3) {};
\node (#3droite) at (#3){};
\node (#3gauche) at (#3){};
}
\newcommand{\sbDecaleNoeudx}[3][5]{
\node [right of=#2, node distance=#1em, minimum size=0em](#3) {};
\node (#3droite) at (#3){};
\node (#3gauche) at (#3){};
}

\newcommand{\sbDecaleNoeudxy}[4]{
\sbDecaleNoeudy[#2]{#3}{#4}
\sbDecaleNoeudx[#1]{#4}{4}
}


%==============ChaÃ®nes et Boucles===========

\newcommand{\sbChaine}[3][4]{
\foreach \x/\y [remember=\x as \lastx (initially #2)] in {#3}
{\sbBlocL[#1]{\x}{\y}{\lastx}
}
}


\newcommand{\sbChaineComp}[3][4]{
\sbDecaleNoeudx[2]{#2}{V#2}
\sbComp[#1]{Comp#2}{V#2}\sbRelier{#2}{Comp#2}
\sbChaine[#1]{Comp#2}{#3}
}

\newcommand{\sbChaineRetour}[3][4]{
\foreach \x/\y [remember=\x as \lastx (initially #2)] in {#3}
{\sbBlocrL[#1]{\x}{\y}{\lastx}
}
}


\newcommand{\sbBoucleSeule}[4][4]{
\sbDecaleNoeudx[2]{#2}{V#2}
\sbComp[#1]{Comp#2}{V#2}\sbRelier{#2}{Comp#2}
\sbChaine[#1]{Comp#2}{#3}
\sbSortie[#1]{#4}{BlocdeFin}
\draw [sbStyleLien,auto] (BlocdeFindroite.base) --
 (#4) node[pos=0.5,name=FindeChaine-#4] {};
\sbRenvoi{FindeChaine-#4}{Comp#2}{}
}


\newcommand{\sbBoucle}[3][4]{
\sbComp[#1]{Comp#2}{#2}\sbRelier{#2}{Comp#2}
\sbChaine[#1]{Comp#2}{#3}
\draw [sbStyleLien,auto,-] (BlocdeFindroite.base) --++(1em,0)%
coordinate[name=FindeChaine];
\sbRenvoi{FindeChaine}{Comp#2}{}
}

\newcommand{\sbBoucleRetour}[4][4]{
\sbDecaleNoeudx[2]{#2}{V#2}
\sbComp[#1]{Comp#2}{V#2}
\sbRelier{#2}{Comp#2}
\sbChaine[#1]{Comp#2}{#3}
\draw [sbStyleLien,auto,-] (BlocdeFindroite.base) --++(1em,0)%
coordinate[name=FindeChaine];
\sbDecaleNoeudy[5]{FindeChaine}{sbDebutRetour}
\sbChaineRetour[#1]{sbDebutRetour}{#4}
\draw [sbStyleLien] (FindeChaine) |- (sbDebutRetour.west) ;
\draw [sbStyleLien] (BlocdeFingauche.base)  --   (BlocdeFingauche.base -|Comp#2) -- (Comp#2) node[name=sbNomRetour,near end,right] {};
}
</pre></body></html>