Skip to content
Snippets Groups Projects
Commit 2829d1b0 authored by Noel Dan Le's avatar Noel Dan Le
Browse files

Added tikz-uml command to use cars as actors

parent 0a965eee
Branches
No related merge requests found
doc/mainDocument/img/Car.png

3.69 KiB

......@@ -9,11 +9,11 @@
\usepackage[hidelinks]{hyperref}
\usepackage{tabularx} % used for better table formatting see: https://en.wikibooks.org/wiki/LaTeX/Tables#The_tabularx_package
\usepackage[table]{xcolor}
\usepackage{graphicx} % Bilder, Fotos
\usepackage{subfiles} % split doc into multiple .tex subfiles
\usepackage{graphicx} % Bilder, Fotos
\usepackage{subfiles} % split doc into multiple .tex subfiles
\graphicspath{ {./img/} }
\usepackage{float} % used to allow the [H] option for tables, etc.
\usepackage{verbatim} % makes multiline comments possible via \begin{comment}\end{comment}
\usepackage{verbatim} % makes multiline comments possible via \begin{comment}\end{comment}
\usepackage{ifthen, tikz, xstring, calc, pgfopts} % required for tikz-uml
\usepackage{../tikz-uml}
......@@ -53,7 +53,7 @@
%%% DOCUMENT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\maketitle
\tableofcontents
......@@ -61,7 +61,7 @@
\subfile{sections/organisation}
\subfile{sections/ausbaustufen}
\subfile{sections/usecases}
\subfile{sections/architektur}
\subfile{sections/architektur}
\subfile{sections/modspez}
\subfile{sections/test}
\subfile{sections/auswertung}
......@@ -76,6 +76,5 @@
\phantomsection
\addcontentsline{toc}{section}{Bibliography}
\printbibliography
\end{document}
\end{document}
\ No newline at end of file
......@@ -15,7 +15,7 @@
\end{figure}
\begin{figure}[h]
\begin{center}
\includegraphics[scale=0.5]{Systemarchitektur}
\includegraphics[scale=0.5]{SystemArchitektur}
\end{center}
\caption{Odriod-System}
\label{fig:hardware-sys}
......@@ -201,6 +201,6 @@
\subsection{Softwarearchitktur}
%tikz oder drawio
\includegraphics[width=\textwidth]{SoftwareArch}
\includegraphics[width=\textwidth]{SoftwareArchitektur}
\end{document}
\ No newline at end of file
......@@ -12,15 +12,15 @@
\umlusecase[x=3, y=-17, width=34mm, fill=green!30]{\nameref{UC:changeSpeed}}
\end{umlsystem}
\umlactor[x=0, y=-10]{Operator}
\umlactor[x=14, y=-10]{LV}
\umlactor[x=14, y=-5]{FV}
\umlactor[x=14, y=-15]{PFV}
\umlactor[x=14, y=1]{GV}
\umlactor[x=0, y=-11]{Operator}
\umlcar[x=15, y=-10]{LV}
\umlcar[x=15, y=-5]{FV}
\umlcar[x=15, y=-15]{PFV}
\umlcar[x=15, y=1]{GV}
\umlHVHinherit[arm2=10mm]{LV}{GV}
\umlHVHinherit[arm2=10mm]{FV}{GV}
\umlHVHinherit[arm2=10mm]{PFV}{GV}
\umlHVHinherit[arm2=16mm]{LV}{GV}
\umlHVHinherit[arm2=16mm]{FV}{GV}
\umlHVHinherit[arm2=16mm]{PFV}{GV}
\umlassoc{Operator}{usecase-1}
\umlassoc{Operator}{usecase-4}
......
......@@ -2790,6 +2790,84 @@
%
}%
%-----------------------------------------------------------------------------------------------
%
% copy and paste of the above section in order to replace the actor symbol with a car picture
%
% define the actor symbol
% optional : global tikzpicture styles
\newcommand{\picturedcar}[1]{%
\pgfkeys{/tikzuml/picactor/.cd, scale/.initial=1, .unknown/.code={}}%
\pgfkeys{/tikzuml/picactor/.cd,#1}%
\pgfkeys{/tikzuml/picactor/.cd, scale/.get=\tikzumlPicturedActorScale}%
%
\begin{tikzpicture}[#1]%
\node at (0,0) {\includegraphics[width=3em]{img/Car.png}};%
\end{tikzpicture}%
}%
%
% define an actor
% arg : var name
% optional : x, y: coordinates of the actor
% scale: scale factor of the actor symbol
% below: distance between the actor symbol and its name below
% draw, text: colors
% style: to manage every default TikZ option
% no coords: to tell that the actor position is defined relatively
% to another node (automatically used with TikZ options above, below, left, right, below left, ...)
\newcommand{\umlcar}[2][]{%
\stepcounter{tikzumlActorNum}%
\pgfkeys{/tikzuml/actor/.cd, x/.initial=\tikzumlDefaultX, y/.initial=\tikzumlDefaultX, scale/.initial=1, below/.initial=\tikzumlActorDefaultBelow,%
draw/.initial=\tikzumlDefaultDrawColor, text/.initial=\tikzumlDefaultTextColor,%
style/.style={},%
no coords/.is if=tikzumlactorWithoutCoords,%
no coords=false,%
.unknown/.code={%
\let\keyname=\pgfkeyscurrentname%
\let\keyvalue=\pgfkeyscurrentvalue%
\ifthenelse{\equal{\keyname}{above}\OR%
\equal{\keyname}{left}\OR%
\equal{\keyname}{below}\OR%
\equal{\keyname}{right}\OR%
\equal{\keyname}{above left}\OR%
\equal{\keyname}{above right}\OR%
\equal{\keyname}{below left}\OR%
\equal{\keyname}{below right}}{%
\IfSubStr{\keyvalue}{ of }{%
\pgfkeys{/tikzuml/actor/.cd, no coords}%
}{}%
}{}%
\ifx\keyvalue\pgfkeysnovalue%
\pgfkeys{/tikzuml/actor/.cd, style/.append style/.expand once={\keyname}}%
\else%
\pgfkeys{/tikzuml/actor/.cd, style/.append style/.expand twice={\expandafter\keyname\expandafter=\keyvalue}}%
\fi%
%\errmessage{TIKZUML ERROR : in umlactor, invalid option \keyname}%
}%
}%
\pgfkeys{/tikzuml/actor/.cd, #1}%
\pgfkeys{/tikzuml/actor/.cd,%
x/.get=\tikzumlActorX, y/.get=\tikzumlActorY, scale/.get=\tikzumlActorScale,%
below/.get=\tikzumlActorBelow,%
draw/.get=\tikzumlActorDrawColor, text/.get=\tikzumlActorTextColor}%
%
\def\tikzumlActorName{#2}%
\begingroup%
\def\_{_}\edef\x{\endgroup%
\def\noexpand\tikzumlActorNodeName{\tikzumlActorName}}\x%
%
\def\tikzumlActorPos{\tikzumlActorX,\tikzumlActorY}%
%
\iftikzumlactorWithoutCoords%
\node[tikzuml actor style, text=\tikzumlActorTextColor, font=\tikzumlDefaultFont, /tikzuml/actor/style] (\tikzumlActorNodeName) {\picturedcar{scale=\tikzumlActorScale, fill=white, draw=\tikzumlActorDrawColor, thick}};%
\else%
\node[tikzuml actor style, text=\tikzumlActorTextColor, font=\tikzumlDefaultFont, /tikzuml/actor/style] (\tikzumlActorNodeName) at (\tikzumlActorPos) {\picturedcar{scale=\tikzumlActorScale, fill=white, draw=\tikzumlActorDrawColor, thick}};%
\fi%
\node[text=\tikzumlActorTextColor, font=\tikzumlDefaultFont, below=\tikzumlActorScale*\tikzumlActorBelow] at (\tikzumlActorNodeName) {\tikzumlActorName};%
%
}%
%-----------------------------------------------------------------------------------------------
% shortcuts for include and extend relation
\newcommand{\umlinclude}[3][]{%
\pgfkeys{/tikzuml/includerelation/.cd,%
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment