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

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