Allow empty signalbar and print nothing

This commit is contained in:
Bertrand Benjamin 2018-04-01 18:13:23 +03:00
parent 279dc026b6
commit 99b017586c

View File

@ -119,24 +119,28 @@
}
\newcommand{\filledSignalBar}[1]{%
\IfEqCase{#1}{%
{e}{%
{}{%
}
{3}{%
\EmptySignalBar
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
\filldraw[fill=green] (3, 0) rectangle ++(0.8, 4);
}
{2}{%
\EmptySignalBar
\filldraw[fill=green] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=green] (1, 0) rectangle ++(0.8, 2);
\filldraw[fill=green] (2, 0) rectangle ++(0.8, 3);
}
{1}{%
\EmptySignalBar
\filldraw[fill=yellow] (0, 0) rectangle ++(0.8, 1);
\filldraw[fill=yellow] (1, 0) rectangle ++(0.8, 2);
}
{0}{%
\EmptySignalBar
\filldraw[fill=red] (0, 0) rectangle ++(0.8, 1);
}
}[\PackageError{Assesment}{Undefinded type of answer: #1}{}]%
@ -144,7 +148,6 @@
\newcommand{\SignalBar}[1]{%
\begin{tikzpicture}[scale=0.15]
\EmptySignalBar
\filledSignalBar{#1}
\end{tikzpicture}
}