architecture documents added

pull/111/head
Robert Gawron 2019-08-05 17:53:43 +03:00
rodzic fd5e3152c0
commit 8496743783
3 zmienionych plików z 131 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,58 @@
\documentclass[tikz, border=5mm]{standalone}
\usepackage{textcomp}
\usetikzlibrary{arrows.meta,decorations.markings,fit,calc, positioning}
\definecolor{componentColor}{RGB}{220,220,220}
\definecolor{systemColor}{RGB}{250,250,250}
\tikzset{component/.append style={fill=componentColor, align=center, draw, minimum width=2cm, minimum height=1.5cm, rounded corners=.3cm}}
\tikzset{system/.style={ component, fill=systemColor, rounded corners=0cm}}
\begin{document}
\begin{tikzpicture}[node distance=1.5cm and 3cm]
% Nodes
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\node (chamber) [component] {Ionization chamber};
\node (hwpower) [component, above=of chamber] {HV power supply};
\node (amplifier) [component, right=of chamber] {Amplifier};
\node (adc) [component, right=of amplifier] {ADC\\ (MCP3425A0T-ECH)};
\node (cpu) [component, right=of adc] {acquisition\\ (STM8S003F3P6TR)};
\node (gui) [component, above=of cpu] {User Interface (3xLED)};
\node (uartconverter) [system, right=of cpu] {UART to USB};
\node (stm8programmer) [system, below=of cpu] {STM8 programmer};
\node (pi) [system, below=of uartconverter] {Data processing\\ (RaspberryPi 3B)};
\node (pc) [system, below=of pi] {Local PC};
\begin{pgfonlayer}{background}
\node[system , draw, thick, inner xsep=1em, inner ysep=1em, fit=(chamber) (hwpower) (amplifier) (adc) (cpu) ] {\Large Ionization Chamber Board};
\end{pgfonlayer}
% Connectors
\begin{scope}[->]
\draw [-{Latex[scale=3.0]}] (hwpower) -- node[anchor=east, minimum width=.25cm, draw=none] {400V DC} (chamber);
\draw [-{Latex[scale=3.0]}] (chamber) -- node[anchor=south, minimum height=.25cm, draw=none] {} (amplifier);
\draw [-{Latex[scale=3.0]}] (amplifier) -- node[anchor=south, minimum height=.25cm, draw=none] {} (adc);
\draw [-{Latex[scale=3.0]}] (cpu) -- node[anchor=south, minimum height=.25cm, draw=none] {UART} (uartconverter);
\draw [-{Latex[scale=3.0]}] (cpu) -- node[anchor=east, minimum height=.25cm, draw=none] {GPIO} (gui);
\draw [-{Latex[scale=3.0]}] (adc) -- node[anchor=south, minimum height=.25cm, draw=none] {I2C} (cpu);
\draw [-{Latex[scale=3.0]}] (stm8programmer) -- node[anchor=east, minimum height=.25cm, draw=none] {SWIM} (cpu);
\draw [-{Latex[scale=3.0]}] (pi) -- node[anchor=south, minimum height=.25cm, draw=none] {USB} (stm8programmer);
\draw [-{Latex[scale=3.0]}] (uartconverter) -- node[anchor=east, minimum height=.25cm, draw=none] {USB} (pi);
\draw [-{Latex[scale=3.0]}] (pi) -- node[anchor=east, minimum height=.25cm, draw=none] {ethernet} (pc);
\end{scope}
\end{tikzpicture}
\end{document}

Wyświetl plik

@ -0,0 +1,46 @@
\documentclass[tikz, border=5mm]{standalone}
\usepackage{textcomp}
\usepackage{graphicx}
\usetikzlibrary{arrows.meta,decorations.markings,fit,calc, positioning}
\usetikzlibrary{calc,positioning,shapes,decorations.pathreplacing}
% the styles for short and long nodes
\tikzset{
short/.style={draw,rectangle,text height=6pt,text depth=13pt,text width=30pt,align=center,fill=yellow!30},
long/.style={short,text width=60pt}
}
\begin{document}
% the short nodes \shnode{<label>}{<right of>}{<text>}
\def\shnode#1#2#3{%
\node[short,right=of #1] (#2) {#3}}
% the long nodes \lnode{<label>}{<right of>}{<text>}
\def\lnode#1#2#3{%
\node[long,right=of #1] (#2) {#3}}
\noindent\begin{tikzpicture}[node distance=-\pgflinewidth]
\node (StartPoint) [text depth=13pt, text height=6pt]{};
\shnode{StartPoint}{MsgId}{msg id};
\shnode{MsgId}{MsgLen}{msg length};
\lnode{MsgLen}{Configuration}{ADC configuration};
\lnode{Configuration}{MSBADC}{MSB ADC value};
\lnode{MSBADC}{LSBADC}{LSB ADC value};
\lnode{LSBADC}{CRC}{CRC};
\draw[decorate,decoration={brace,raise=3pt}] (MsgId.north west) -- node[above=4pt] {Preamble} (MsgLen.north east);
\draw[decorate,decoration={brace,raise=3pt}] (Configuration.north west) -- node[above=4pt] {Data} (LSBADC.north east);
\draw[decorate,decoration={brace,raise=3pt}] (CRC.north west) -- node[above=4pt] {CRC} (CRC.north east);
\draw (MsgId.south west) -- +(0,-1.2cm);
\draw (MsgLen.south east) -- +(0,-1.2cm);
\draw[<->] ( $ (MsgId.south west) +(0,-0.6cm) $ ) -- node[fill=white] {1 Byte} ( $ (MsgLen.south east) +(0,-0.6cm) $ );
\end{tikzpicture}
\end{document}

Wyświetl plik

@ -0,0 +1,27 @@
#!/bin/bash
# generate .png from all .tex in current directory
for filename_with_extension in *.tex
do
echo "processing $filename_with_extension..."
# remove file exctension to made file handling easier
filename=${filename_with_extension%.*}
# convert .tex to .png
pdflatex $filename.tex
pdfcrop $filename.pdf $filename-tmp.pdf
pdftoppm -png -r 800 $filename-tmp.pdf $filename
# remove junk files
rm $filename.aux
rm $filename.log
rm $filename-tmp.pdf
rm $filename.pdf
rm texput.log
done