Smart-Home am Beispiel der Präsenzerkennung im Raum Projektarbeit Lennart Heimbs, Johannes Krug, Sebastian Dohle und Kevin Holzschuh bei Prof. Oliver Hofmann SS2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pub_sub_arch.tex 3.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. % Tikz File mqtt_pub_sub.tex
  2. \documentclass{standalone}
  3. \usepackage{tikz}
  4. \usepackage{graphicx}
  5. \begin{document}
  6. \begin{tikzpicture}
  7. %\draw[help lines] (-7,-5) grid (7,5);
  8. % Broker
  9. \draw (0,0) circle (2);
  10. \node[] at (0,-1.5) (broker) {\textbf{Broker}};
  11. \node[inner sep=0pt] (broker_pc) at (0,0)
  12. {\includegraphics[width=0.1\textwidth]{images/pc.png}};
  13. % Publisher
  14. \pgfmathsetmacro\xl{-6};
  15. \pgfmathsetmacro\xr{-3};
  16. \pgfmathsetmacro\w{(\xl+\xr)};
  17. \pgfmathsetmacro\y{6};
  18. % Text
  19. \node[] at (\w/2,-\y/2-0.25) (pubs) {\textbf{MQTT Clients}};
  20. % Images
  21. \node[inner sep=0pt] (laptop) at (\w/2,\y/3)
  22. {\includegraphics[width=0.1\textwidth]{images/laptop.png}};
  23. \node[inner sep=0pt] (mcu) at (\w/2,\y/3-\y/3)
  24. {\includegraphics[width=0.1\textwidth]{images/muc.png}};
  25. \node[inner sep=0pt] (pc) at (\w/2,\y/3-\y/3-\y/3)
  26. {\includegraphics[width=0.1\textwidth]{images/pc.png}};
  27. \draw (\xl-0.25, \y/2-0.25) -- (\xl-0.25, -\y/2+0.25); % left
  28. \draw (\xl, \y/2) arc (90:180:0.25); % top left
  29. \draw (\xl, \y/2) -- (\xr, \y/2); % top
  30. \draw (\xr+0.25, \y/2-0.25) arc (0:90:0.25); % top right
  31. \draw (\xr+0.25, \y/2-0.25) -- (\xr+0.25, -\y/2+0.25); % right
  32. \draw (\xr, -\y/2) arc (270:360:0.25); % bottom right
  33. \draw (\xl,-\y/2) -- (\xr,-\y/2); % bottom
  34. \draw (\xl-0.25, -\y/2+0.25) arc (180:270:0.25); % bottom left
  35. % Subscriber
  36. \pgfmathsetmacro\xl{3}
  37. \pgfmathsetmacro\xr{6}
  38. \pgfmathsetmacro\w{(\xl+\xr)};
  39. \pgfmathsetmacro\y{6}
  40. \node[] at (\w/2,-\y/2-0.25) (subs) {\textbf{MQTT Clients}};
  41. % Images
  42. \node[inner sep=0pt] (server) at (\w/2,\y/3-1)
  43. {\includegraphics[width=0.1\textwidth]{images/server.png}};
  44. \node[inner sep=0pt] (sub_mcu) at (\w/2,\y/3-3)
  45. {\includegraphics[width=0.1\textwidth]{images/muc.png}};
  46. \draw (\xl-0.25, \y/2-0.25) -- (\xl-0.25, -\y/2+0.25); % left
  47. \draw (\xl, \y/2) arc (90:180:0.25); % top left
  48. \draw (\xl, \y/2) -- (\xr, \y/2); % top
  49. \draw (\xr+0.25, \y/2-0.25) arc (0:90:0.25); % top right
  50. \draw (\xr+0.25, \y/2-0.25) -- (\xr+0.25, -\y/2+0.25); % right
  51. \draw (\xr, -\y/2) arc (270:360:0.25); % bottom right
  52. \draw (\xl,-\y/2) -- (\xr,-\y/2); % bottom
  53. \draw (\xl-0.25, -\y/2+0.25) arc (180:270:0.25); % bottom left
  54. % arrows
  55. \draw[ultra thick, ->] (mcu) -- (broker_pc);
  56. \draw[ultra thick, ->] (laptop) -- (broker_pc);
  57. \draw[ultra thick, ->] (pc) -- (broker_pc);
  58. \draw[ultra thick, ->] (sub_mcu) -- (broker_pc);
  59. \draw[dashed, ultra thick, <-] (server) -- (broker_pc);
  60. \draw[dashed, ultra thick, ->] (broker_pc.10) to (sub_mcu.north west);
  61. % legend
  62. \draw[dashed, ultra thick, ->] (-4,-4) -- (-1,-4);
  63. \node[] (Sub) at (-2.5,-4.25) {Subscribe};
  64. \draw[ultra thick, ->] (1,-4) -- (4,-4);
  65. \node[] (Pub) at (2.5,-4.25) {Publish};
  66. \end{tikzpicture}
  67. \end{document}