From 7f5b699d25823a8507fd74704e6a3b3ac8a6bdbb Mon Sep 17 00:00:00 2001 From: "Prof. Dr. Matthias Jung DL9MJ" Date: Sun, 18 May 2025 10:17:18 +0200 Subject: [PATCH] feature: added latex template to build pictures --- latex/BNetzA-Fragenkatalog.cls | 139 ++++ latex/DARC-ausbildungsmaterialien.sty | 341 ++++++++ latex/settings-pre.tex | 3 + latex/settings.tex | 1065 +++++++++++++++++++++++++ 4 files changed, 1548 insertions(+) create mode 100644 latex/BNetzA-Fragenkatalog.cls create mode 100644 latex/DARC-ausbildungsmaterialien.sty create mode 100644 latex/settings-pre.tex create mode 100644 latex/settings.tex diff --git a/latex/BNetzA-Fragenkatalog.cls b/latex/BNetzA-Fragenkatalog.cls new file mode 100644 index 0000000..aff0655 --- /dev/null +++ b/latex/BNetzA-Fragenkatalog.cls @@ -0,0 +1,139 @@ +\ProvidesClass{BNetzA-Fragenkatalog} + +\ExplSyntaxOn +\keys_define:nn {ptxcd/Fragenkatalog} { + tagging .bool_gset:N = \g_ptxcd_tagging_bool, + tagging .initial:n = false, +} +\ExplSyntaxOff + +\ProcessKeyOptions[ptxcd/Fragenkatalog] + +\disable@package@load{physics}{} + +\LoadClass[ngerman, 10pt,twocolumn=true,fontsize=9pt,parskip=half-,listof=leveldown,bibliography=leveldown]{scrreprt} +\deftocheading{toc}{\section*{\contentsname}} + +\input{settings-pre.tex} + +\RequirePackage{DARC-ausbildungsmaterialien} + +\input{settings.tex} +\makeatletter% to ensure right setup -> todo cleanup settings + +\usepackage{geometry} +\geometry{ + a4paper, + left=25mm, + right=25mm, + top=25mm, + bottom=20mm, + columnsep=1cm, +} +\usepackage{anyfontsize} + +%\usepackage[no-math]{fontspec} +\defaultfontfeatures[BundesSans] +{ + UprightFont = BundesSans-Office-Regular.ttf, + ItalicFont = BundesSans-Office-Italic.ttf, + BoldFont = BundesSans-Office-Bold.ttf, + BoldItalicFont = BundesSans-Office-BoldItalic.ttf +} +\defaultfontfeatures[BundesSerif] +{ + UprightFont = BundesSerif-Office-Regular.ttf, + ItalicFont = BundesSerif-Office-Italic.ttf, + BoldFont = BundesSerif-Office-Bold.ttf, + BoldItalicFont = BundesSerif-Office-BoldItalic.ttf +} +\setsansfont{BundesSans} +\setmainfont{BundesSerif} + + +\AfterTOCHead[toc]{\sffamily} + +\definecolor{BNetzAblue}{RGB}{28,71,113} +\definecolor{BNetzAgray}{RGB}{127,127,127} + +\addtokomafont{section}{\color{BNetzAblue}\fontsize{22pt}{25pt}\selectfont} +\setkomafont{chapter}{\usekomafont{section}} +\addtokomafont{subsection}{\color{BNetzAblue}\fontsize{15pt}{18pt}\selectfont} +\addtokomafont{subsubsection}{\color{BNetzAblue}\fontsize{11pt}{15pt}\selectfont} + +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{4} + +\RedeclareSectionCommand[style=chapter,afterindent=false,beforeskip=0pt,afterskip=20pt,tocindent=0pt,tocentryformat=\bfseries\fontsize{11pt}{14pt}\selectfont, + tocpagenumberformat=\sffamily\bfseries, + tocnumwidth=2em, + tocentrybeforeskip=\baselineskip]{section} +\RedeclareSectionCommand[ + beforeskip=6pt,runin=false, + afterskip=12pt, + tocentrybeforeskip=1em plus 1pt, + tocentrynumwidth=2.5em, + tocentryentryformat=\bfseries, + tocindent=0pt + ]{subsection} +\RedeclareSectionCommand[ + beforeskip=\baselineskip, + runin=false, + afterskip=1ex plus .2ex, + tocindent=2.5em]{subsubsection} +\RedeclareSectionCommand[beforeskip=0pt,runin=false,afterskip=15pt]{paragraph} +\RedeclareSectionCommand[beforeskip=\baselineskip,runin=false,afterskip=15pt]{subparagraph} + +\renewcommand*{\thesection}{\arabic{section}} +\renewcommand*{\chapterpagestyle}{scrheadings} + +\renewcommand\addsectiontocentry[2]{% + \addtocentrydefault{section}{#1}{\TOCUppercase{#2}}% +} + +\ExplSyntaxOn +\DeclareRobustCommand{\TOCUppercase}[1]{\texorpdfstring{\text_uppercase:n {#1}}{#1}} +\ExplSyntaxOff + +\KOMAoptions{parskip=full-} + +\usepackage[footsepline=false] {scrlayer-scrpage} + +\setkomafont{pageheadfoot}{\sffamily\footnotesize} +\setkomafont{pagenumber}{\sffamily\bfseries\textcolor{white}} + +\DeclareNewLayer[ + background, + topmargin, + mode=picture, + oddpage, + outermargin, + addhoffset=-10mm, + width=10mm, + height=15mm, + contents={ + \putLL{% + \textcolor{BNetzAgray}{\rule{10mm}{\layerheight}}% + } + \putC{\makebox(0,0){\pagemark}} +} +]{swatch.odd} +\DeclareNewLayer[ + clone=swatch.odd, + evenpage, + addhoffset=38mm +]{swatch.even} +% add the layers to pagestyle scrheadings: +\AddLayersAtBeginOfPageStyle{scrheadings}{swatch.odd,swatch.even} + +\raggedbottom +\raggedright% flush left alignment + +\ExplSyntaxOn +\bool_if:NT \g_ptxcd_tagging_bool {\file_input:n {tagging-setup}} +\ExplSyntaxOff + + +\setcounter{page}{5}%Manual page offset, handle with care! + +\endinput diff --git a/latex/DARC-ausbildungsmaterialien.sty b/latex/DARC-ausbildungsmaterialien.sty new file mode 100644 index 0000000..9196275 --- /dev/null +++ b/latex/DARC-ausbildungsmaterialien.sty @@ -0,0 +1,341 @@ +\ProvidesPackage{DARC-ausbildungsmaterialien} + + +\RequirePackage{mathtools} +\@fleqnfalse + +\PassOptionsToPackage{ngerman}{babel} +\RequirePackage{babel} +\RequirePackage{microtype} + +%fonts +\RequirePackage{libertinus} +\RequirePackage{sourcesanspro} +\RequirePackage{sourceserifpro} +\RequirePackage{anyfontsize} + +\RequirePackage{enumitem} + +\RequirePackage{listings} +\lstset{ + basicstyle=\ttfamily\color{red} +} + +\RequirePackage{circuitikz} + +\RequirePackage{multicol} + +\RequirePackage[ddmmyyyy,hhmmss]{datetime} +\renewcommand{\dateseparator}{.} + +\RequirePackage{ragged2e} + +\RequirePackage{tabularray} +\SetTblrInner{row{1} = {font=\bfseries}}% bold first row + +\RequirePackage{tabularx} +\RequirePackage{multirow} + +\Ifundefinedorrelax{scr@fnt@questiontext}{ + %TODO cleanup, but only use if not yet defined + % currently only in book + \newkomafont{questiontext}{\bfseries\boldmath} + \newkomafont{questionlabel}{\sffamily\bfseries} + \newcolumntype{x}[1]{>{\centering\let\newline\\\arraybackslash}p{#1}} + \newcolumntype{t}{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}p{0.85\linewidth}} + \newcolumntype{s}{>{\RaggedRight\let\newline\\\arraybackslash\hspace{0pt}}p{0.35\linewidth}} + \newcolumntype{q}{>{\raggedleft\usekomafont{questionlabel}}p{0.15\linewidth}<{\hspace*{1ex}}} + \newcolumntype{h}{>{\usekomafont{questionlabel}}p{0.15\linewidth}} +} {} + + + +\usepackage[locale=DE,]{siunitx} + +\usepackage{anyfontsize} +\UseTblrLibrary{siunitx} +\sisetup{ + reset-text-family = false , + reset-text-series = false , + number-mode=match, + unit-mode=match, + per-mode=fraction +} +\DeclareSIUnit{\baud}{Bd} +\DeclareSIUnit{\dBi}{dBi} +\DeclareSIUnit{\dBm}{dBm} +\DeclareSIUnit{\dBu}{dBu} +\DeclareSIUnit{\dBV}{dbV} +\DeclareSIUnit{\dBW}{dBW} +\DeclareSIUnit{\ppm}{ppm} +\DeclareSIUnit{\pps}{pps} +\DeclareSIUnit{\CPM}{CPM} +\DeclareSIUnit{\WPM}{WPM} +\DeclareSIUnit\noop{\relax} % For printing prefixes + +\newcommand*{\eff}{{\operatorname{eff}}} + +\newcommand{\mytag}[1]{% + \tikz[baseline=(X.base)]\node [draw=red,fill=gray!40,semithick,rectangle,inner sep=2pt, rounded corners=3pt] (X) {#1};% +} + +\newif\if@DARCinQuestion + +\ExplSyntaxOn +\cs_new:Nn \__ptxcd_question_table_head:nnn { + \tl_set:Nn \l_ptxcd_question_tl {#1} + \makebox[0.15\linewidth][l]{\usekomafont{questionlabel}#1} + \parbox[t]{.85\linewidth}{ + \RaggedRight\let\newline\\\arraybackslash\hspace{0pt} + \@DARCinQuestiontrue + {\usekomafont{questiontext}#2} + \tl_if_blank:nF {#3} { + {#3} + } + } + \\*[.3\parskip] +} + + + +\AddToHook{begindocument}[DARC-ausbildungsmaterialien-question]{ + \let\Question\relax% avoid conflict with unicde-math-symbol + \newenvironment{questiontabular}[1]{ + \setlength{\tabcolsep}{0pt}% + \noindent\begin{tabular}{#1} + }{ + \end{tabular} + } + + \NewDocumentCommand{\Question}{+m+m+m+m+m+m+m} + {% + \par + \__ptxcd_question_table_head:nnn{#1}{#2}{#3} + \begin{questiontabular}{qt} + A & {#4} \\ + B & {#5} \\ + C & {#6} \\ + D & {#7} + \end{questiontabular} + \par + } + + \NewDocumentCommand{\QuestionMD}{+m+m+m+m+m+m+m} + {% + \par + \__ptxcd_question_table_head:nnn{#1}{#2}{#3} + \begin{questiontabular}{qt} + A & {#4} \\[10pt] + B & {#5} \\[10pt] + C & {#6} \\[10pt] + D & {#7} + \end{questiontabular}% + \par + } + + \NewDocumentCommand{\QuestionTwoCol}{+m+m+m+m+m+m+m}{ + \par + \__ptxcd_question_table_head:nnn{#1}{#2}{#3} + \begin{questiontabular}{qsqs} + A & {#4} & B & {#5} \\ + C & {#6} & D & {#7} + \end{questiontabular}% + \par + } +} + +\ExplSyntaxOff + +\PassOptionsToPackage{hidelinks}{hyperref} +\RequirePackage{hyperref} + +\RequirePackage{qrcode} +\newcommand*{\MarginQR}[1]{\marginline{\qrcode{#1}}} + +\ExplSyntaxOn +\bool_lazy_and:nnTF {\bool_if_exist_p:N \g__ptxcd_print_bool} {\g__ptxcd_print_bool} { + \definecolor{DARCgreen}{cmyk}{.9,.05,.7,0} + \definecolor{DARCorange}{cmyk}{0,.3,1,0} + \definecolor{DARCred}{cmyk}{.05,.8,1,0} + \definecolor{DARCblue}{cmyk}{.8,.15,0,0} + \definecolor{DARCgray}{cmyk}{.05,0,0,.3} + + \definecolor{unit-title}{cmyk}{.45,0,.45,0} + \definecolor{attention-title}{cmyk}{0,.1,.4,0} + \definecolor{danger-title}{cmyk}{0,.4,.4,0} + \definecolor{hint-title}{cmyk}{.3,.05,0,0} + \definecolor{advanced-title}{cmyk}{.05,0,0,.1} + + \definecolor{DARCdarkblue}{cmyk}{0.88,0.52,0.27,0.11} + + \definecolor{r}{cmyk} {0.00,0.20,0.40,0.00} + \definecolor{rsilver}{cmyk}{0.29,0.21,0.22,0.03} + \definecolor{rgold}{cmyk} {0.15,0.35,0.98,0.04} + \definecolor{rbrown}{cmyk} {0.25,0.75,1.00,0.30} + \definecolor{rblack}{cmyk} {0.00,0.00,0.00,1.00} + \definecolor{rred}{cmyk} {1.00,1.00,0.00,0.00} + \definecolor{rorange}{cmyk}{0.02,0.56,0.92,0.00} + \definecolor{ryellow}{cmyk}{0.00,0.00,1.00,0.00} + \definecolor{rgreen}{cmyk} {0.94,0.31,0.96,0.24} + \definecolor{rblue}{cmyk} {1.00,0.84,0.06,0.01} + \definecolor{rviolet}{cmyk}{0.77,0.82,0.00,0.00} + \definecolor{rgrey}{cmyk} {0.62,0.52,0.50,0.47} + \definecolor{rwhite}{cmyk} {0.04,0.03,0.04,0.00} +} { + \definecolor{DARCgreen}{RGB}{0,155,110} + \definecolor{DARCorange}{RGB}{250,180,0} + \definecolor{DARCred}{RGB}{225,80,35} + \definecolor{DARCblue}{RGB}{0,160,220} + \definecolor{DARCgray}{RGB}{190,190,190} + + \definecolor{unit-title}{RGB}{155,205,185} + \definecolor{attention-title}{RGB}{255,230,170} + \definecolor{danger-title}{RGB}{245,175,150} + \definecolor{hint-title}{RGB}{185,220,245} + \definecolor{advanced-title}{RGB}{225,230,235} + + \definecolor{DARCdarkblue}{RGB}{43, 103, 140} + + \definecolor{r}{rgb}{0.98, 0.84, 0.65} + \definecolor{rsilver}{rgb}{0.75, 0.75, 0.75} + \definecolor{rgold}{rgb}{0.85, 0.65, 0.13} + \definecolor{rbrown}{rgb}{0.59, 0.29, 0.0} + \definecolor{rblack}{rgb}{0,0,0} + \definecolor{rred}{rgb}{0.89, 0.0, 0.13} + \definecolor{rorange}{rgb}{0.93, 0.53, 0.18} + \definecolor{ryellow}{rgb}{1.0, 0.96, 0.0} + \definecolor{rgreen}{rgb}{0.0, 0.42, 0.24} + \definecolor{rblue}{rgb}{0.06, 0.2, 0.65} + \definecolor{rviolet}{rgb}{0.56, 0.0, 1.0} + \definecolor{rgrey}{rgb}{0.33, 0.33, 0.33} + \definecolor{rwhite}{rgb}{0.96, 0.96, 0.96} +} + +\ExplSyntaxOff + +\colorlet{danger-frame}{DARCred} +\colorlet{attention-frame}{DARCorange} +\colorlet{unit-frame}{DARCgreen} +\colorlet{hint-frame}{DARCblue} +\colorlet{advanced-frame}{DARCgray} + + +%TODO Icons +\RequirePackage{fontawesome5} + +\RequirePackage{tcolorbox} +\tcbuselibrary{skins} +\makeatletter +\tcbset{ + marginboxstyle/.style={ + enhanced, + colbacktitle=red!10,coltitle=black, + interior hidden, + colframe=pink, + frame code={\fill[tcbcolframe](frame.north west)rectangle(interior.south west);}, + boxsep=0pt, + left=1mm,right=0pt,top=2pt,bottom=0pt, + toptitle=1pt,bottomtitle=1pt,before title=\strut, + fonttitle=\footnotesize, + fontupper=\footnotesize, + title code={\fill[tcbcolbacktitle]([xshift={\kvtcb@lefttitle-1pt}]title.south west)rectangle(title.north east);}, + before upper={\renewenvironment{figure}{\def\@captype{figure}}{}\renewenvironment{table}{\def\@captype{table}}{}} + } +} + +\newkomafont{marginpar}{\normalfont\footnotesize} + +\newcommand*{\setupDARCmargin}{% + \usekomafont{marginpar}% + \setkomafont{caption}{\footnotesize}% + \renewcommand*{\figurename}{Abb.}% + \renewcommand*{\tablename}{Tab.}% + \renewenvironment{figure}{\def\@captype{figure}}{}% + \renewenvironment{table}{\def\@captype{table}}{}% + \ignorespaces% +} + +\newcommand{\Margin}[1]{\DARCmarginpar{#1}} + +\providecommand{\DARCmarginpar}[1]{% + \marginpar{% + \setupDARCmargin + #1% + } +} + +\newcommand{\MarginBoxDanger}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=danger-title,colframe=danger-frame, title=\faExclamationTriangle\space Gefahr]#1\end{tcolorbox}} + +\newcommand{\MarginBoxAttention}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=attention-title,colframe=attention-frame,title=\faExclamationCircle\space Achtung]#1\end{tcolorbox}} + +\newcommand{\MarginBoxTip}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=hint-title,colframe=hint-frame,title=\faInfoCircle\space Tipp]#1\end{tcolorbox}} + +\newcommand{\WebBoxTip}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=hint-title,colframe=hint-frame,title=\faInfoCircle\space Tipp]#1\end{tcolorbox} + +} + +\newcommand{\MarginBoxUnit}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=unit-title,colframe=unit-frame, title=\faRuler\space Neue Einheit]#1\end{tcolorbox}} + +\newcommand{\MarginBoxInDepth}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=advanced-title,colframe=advanced-frame,title={\faLightbulb[regular]\space Vertiefung}]#1\end{tcolorbox}} + +\newcommand{\BoxInDepth}[1]{\begin{tcolorbox}[marginboxstyle,colbacktitle=advanced-title,colframe=advanced-frame,title={\faLightbulb[regular]\space Vertiefung}]#1\end{tcolorbox} + +} + +\newcommand{\MarginDanger}[1]{\Margin{\DeclareEmphSequence{\bfseries\color{DARCred}}\MarginBoxDanger{#1}\DeclareEmphSequence{\bfseries\color{DARCblue}}}} + +\newcommand{\MarginAttention}[1]{\Margin{\DeclareEmphSequence{\bfseries\color{DARCorange}}\MarginBoxAttention{#1}\DeclareEmphSequence{\bfseries\color{DARCblue}}}} + +\newcommand{\MarginTip}[1]{\Margin{\MarginBoxTip{#1}}} + +\newcommand{\WebTip}[1]{\WebBoxTip{#1}} + +\newcommand{\MarginUnit}[1]{\Margin{\DeclareEmphSequence{\bfseries\color{DARCgreen}}\MarginBoxUnit{#1}\DeclareEmphSequence{\bfseries\color{DARCblue}}}} + +\newcommand{\MarginInDepth}[1]{\Margin{\DeclareEmphSequence{\bfseries\color{DARCgray}}\MarginBoxInDepth{#1}\DeclareEmphSequence{\bfseries\color{DARCblue}}}} + +\newcommand{\WebInDepth}[1]{\BoxInDepth{\DeclareEmphSequence{\bfseries\color{DARCgray}}#1\DeclareEmphSequence{\bfseries\color{DARCblue}}}} + +\newcommand{\FullWidth}[1]{#1} + +\ExplSyntaxOn +\cs_if_exist:NF \__ptxcd_floatbox_sep: { + \skip_new:N \g__ptxcd_floatbox_skip + \skip_gset:Nn \g__ptxcd_floatbox_skip{.5\baselineskip minus .25\baselineskip} + \cs_new:Nn \__ptxcd_floatbox_sep: { + \par + \skip_vertical:N \g__ptxcd_floatbox_skip + } +} + +\newcommand{\WebMargin}[1]{ + \__ptxcd_floatbox_sep: + \noindent\parbox{\linewidth}{#1} + \__ptxcd_floatbox_sep: +} % In Web the content will be in the margin, in TeX it should go to the main text + +\ExplSyntaxOff + +\tcbset{QSO/.style={ + enhanced,boxrule=0pt, + frame empty,colback=DARClightgray,fontupper=\footnotesize, + interior code={ + \fill[tcbcolback](frame.north west)to(frame.north east)to([yshift=-\ht\strutbox]interior.north east)to(interior.south east)to(interior.south west)to([yshift=-\ht\strutbox]interior.north west)--cycle; + } +}} +\newcommand{\QSOown}[1]{\begin{tcolorbox}[ + QSO, + leftrule=\ht\strutbox, + right skip=.1\linewidth +]% +#1% +\end{tcolorbox}} + +\newcommand{\QSOother}[1]{\begin{tcolorbox}[ + QSO, + rightrule=\ht\strutbox, + left skip=.1\linewidth]% + #1% +\end{tcolorbox}} + +\endinput diff --git a/latex/settings-pre.tex b/latex/settings-pre.tex new file mode 100644 index 0000000..939a81e --- /dev/null +++ b/latex/settings-pre.tex @@ -0,0 +1,3 @@ +\PassOptionsToPackage{fleqn}{amsmath} +\usepackage{amsmath} +\usepackage{amssymb} diff --git a/latex/settings.tex b/latex/settings.tex new file mode 100644 index 0000000..a45482b --- /dev/null +++ b/latex/settings.tex @@ -0,0 +1,1065 @@ +\PassOptionsToPackage{locale=DE}{siunitx} +\PassOptionsToPackage{straightvoltages, europeanresistors, european inductor}{circuitikz} + +\usepackage[locale=DE]{siunitx} +\usepackage{ifthen} +\usepackage{mathtools} +\usepackage{unicode-math} +\setmathfont{Libertinus Math} + +\usepackage{circuitikz} +\makeatletter +\let\empty\relax +\makeatother +\usepackage{pgfplots} +\usepackage{pgfmath} +\usepackage{pgfplotstable} + +\usepackage{etoolbox} +\usepackage{xcolor} +\usepackage{MnSymbol} + +\usepackage{wasysym} +\usepackage{tikz-dimline} +\AtBeginDocument{\RenewCommandCopy\qty\SI} % Fix um qty doppeldefinition zu vermeiden +\usepackage{tikz-3dplot} +%\usepackage{filecontents}% removed as obsolete + +%TODO remove? +\usepackage{varwidth} +\usepackage{pgf-spectra} +\usepgfspectralibrary{pgfplots} + +% TODO +% hier mal hart forciert, weil if ggf nicht geht? +% define colormap and check if cmyk is enforced +%\def\test#1{cmyk} +%\ifx\XC@tgt@mod\test +% \pgfplotsset{colormap={slategraywhite}{cmyk=(0,0,0,.8) cmyk=(0,0,0,0)}} +%\else + \pgfplotsset{colormap={slategraywhite}{rgb255=(50,50,50) rgb255=(255,255,255)}} +%\fi + + +\usetikzlibrary{math,perspective,intersections,arrows,arrows.meta,positioning,calc,shapes.symbols,decorations.pathmorphing,patterns,shapes.geometric,matrix,3d,backgrounds,babel,pgfplots.polar,decorations.pathreplacing,calligraphy,decorations.text,svg.path,optics} +\usepgfplotslibrary{fillbetween} +\pgfplotsset{compat=1.18} +\DeclareSIUnit{\baud}{Bd} + +\sisetup{ + range-phrase=--, + range-units=single +} + +\usepackage[euler]{textgreek} + +% Setze die Enden der optischen Pfeile etc. auf 60 grad: +\ctikzset{ + opto end arrow={Triangle}, + tunable end arrow={Triangle} +} + +% Grundsätzlich alle Pfeile als Triangle TODO, danach suchen und dann loeschen! +\tikzset{ + myarrow/.style={-Triangle} +} +\ctikzset{ + resistor=european, + voltage=straight +} + +\tikzstyle{digitalNumber}=[draw=DARCgray, fill=white, minimum width=0.5, minimum height=0.5, rounded corners=1, font=\bfseries] + +% Gekritzelte Linie (Bild 315) +\pgfdeclaredecoration{penciline}{initial}{ + \state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance, + auto corner on length=1mm,]{ + \pgfpathcurveto% + {% From + \pgfqpoint{\pgfdecoratedinputsegmentremainingdistance} + {\pgfdecorationsegmentamplitude} + } + {% Control 1 + \pgfmathrand + \pgfpointadd{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}} + {\pgfqpoint{-\pgfdecorationsegmentaspect + \pgfdecoratedinputsegmentremainingdistance}% + {\pgfmathresult\pgfdecorationsegmentamplitude} + } + } + {%TO + \pgfpointadd{\pgfpointdecoratedinputsegmentlast}{\pgfpoint{1pt}{1pt}} + } + } + \state{final}{} +} + +% Bandplan bänder in Bild 750 und 749 +\let\band\relax% conflict… requires cleanup … \providecommand? +\newcommand{\band}[7]{% + \draw[draw=red] (-5,#1) rectangle (5,#2); + \draw ( 40,#1) node[right,rotate=0, text=red](){\footnotesize\textbf{\SI{#6}{#7}}}; + \draw ( 20,#1) node[rotate=0](){\footnotesize\SI{#3}{#5}}; + \draw (-20,#2) node[rotate=0](){\footnotesize\SI{#4}{#5}}; +} + +\let\bandB\relax% conflict… requires cleanup … \providecommand? +\newcommand{\bandB}[7]{% + \draw[draw=red] (-5,#1) rectangle (5,#2); + \draw ( 40,#1) node[right,rotate=0, text=red](){\footnotesize\textbf{\SI{#6}{#7}}}; + \draw ( 20,#1) node[rotate=0,above](){\footnotesize\SI{#3}{#5}}; + \draw (-20,#2) node[rotate=0,above](){\footnotesize\SI{#4}{#5}}; +} + +\newcommand{\bandC}[7]{% + \draw[draw=red] (#1,-5) rectangle (#2,5); + \draw (#1, 65.0) node[rotate=-90, text=red](){\footnotesize\textbf{\SI{#6}{#7}}}; + \draw (#1, 27.5) node[rotate=-90](){\footnotesize\SI{#3}{#5}}; + \draw (#2,-27.5) node[rotate=-90](){\footnotesize\SI{#4}{#5}}; +} + +\newcommand{\bandD}[5]{% + \draw[draw=red] (#1,-5) rectangle (#2,5); + \draw (#1+50000000, 27.5) node[rotate=-90](){\footnotesize\SI{#3}{#5}}; + \draw (#2+50000000,-27.5) node[rotate=-90](){\footnotesize\SI{#4}{#5}}; +} + +% Symbol für das Gleichstrom +\newcommand{\textdirectcurrent}{% + \settowidth{\dimen0}{$=$}% + \vbox to .85ex {\offinterlineskip + \hbox to \dimen0{\leaders\hrule\hfill} + \vskip.35ex + \hbox to \dimen0{% + \leaders\hrule\hskip.2\dimen0\hfill + \leaders\hrule\hskip.2\dimen0\hfill + \leaders\hrule\hskip.2\dimen0 + } + \vfill + }% +} +\newcommand{\mathdirectcurrent}{\mathrel{\textdirectcurrent}} + +% Zum Messen von Abständen +\makeatletter +\newcommand{\Distance}[3]{% from https://tex.stackexchange.com/q/56353/121799 + \tikz@scan@one@point\pgfutil@firstofone($#1-#2$)\relax + \pgfmathsetmacro{#3}{round(0.99626*veclen(\the\pgf@x,\the\pgf@y)/0.0283465)/1000} +} +\makeatother + +% Bemaßung zeichnen: +\NewDocumentCommand\DARCmeasure{O{black} O{middle} m m m m m}{% 1:[color], 2:[top], 3:start, 4:end, 5:shift, 6:rotate, 7:text + \path($(#3)+(#5)$) coordinate(start); + \path($(#4)+(#5)$) coordinate(end); + \ifthenelse{\equal{#2}{top}}{ + \draw ($(start)!0.5!(end)$) coordinate(middle); + \node[rotate=#6, anchor=south] (text) at (middle) {\textcolor{#1}{#7}}; + \draw[draw=#1, |Triangle-] (start) -- (middle); + \draw[draw=#1, |Triangle-] (end) -- (middle); + }{ + \node[rotate=#6] (text) at ($(start)!0.5!(end)$) {\textcolor{#1}{#7}}; + \draw[draw=#1, |Triangle-] (start) -- (text.west); + \draw[draw=#1, |Triangle-] (end) -- (text.east); + } +} + +% Magic von Marei zur Skalierung der Bilder +\makeatletter +\ExplSyntaxOn +\box_new:N \l_ptxcd_image_box + +\cs_if_exist:NF \if@DARCinQuestion {\newif\if@DARCinQuestion} + +\fp_if_exist:NF \l_ptxcd_tmp_fp {\fp_new:N \l_ptxcd_tmp_fp} +\fp_set:Nn \l_ptxcd_tmp_fp {1} + +\int_new:N \g_DARC_image_fail_int +\seq_new:N \g__DARC_image_fail_seq +\dim_new:N \l__DARC_image_width_dim +\box_new:N \l_ptxcd_image_orig_box + +\newcommand*{\getDarcImageFactor}{\fp_use:N \l_ptxcd_tmp_fp} + + + +\NewDocumentCommand{\DARCimageOnly}{smm}{ + \setmathfont{Libertinus Math} + \ptxcd_image_autoscale_setup:nnn {#1} {#2} {#3} + \usepackage{geometry} + \usepackage{} + \geometry{paperwidth=\box_wd:N \l_ptxcd_image_box, paperheight=\box_ht_plus_dp:N \l_ptxcd_image_box,margin=0pt} + \pagestyle{empty} + \setlength{\topskip}{0pt}% necessary because otherwhise \topskip could exceed \paperheight + \begin{document} + \box_use:N \l_ptxcd_image_box + \end{document} +} + +\seq_new:N \g__ptxcd_image_size_seq +\prop_new:N \g__ptxcd_image_size_cache_prop +\bool_new:N \l__ptxcd_disable_autoscale_bool +\newcommand*{\disableDARCautoscale}{\bool_set_true:N \l__ptxcd_disable_autoscale_bool} + +\cs_new:Nn \ptxcd_image_autoscale_setup:nnn { + \prop_if_in:NnTF \g__ptxcd_image_size_cache_prop {#2} { + \fp_set:Nn \l_ptxcd_tmp_fp {\prop_item:Nn \g__ptxcd_image_size_cache_prop {#2}} + \hbox_gset:Nn \l_ptxcd_image_box { + \tikzset{x=\fp_use:N \l_ptxcd_tmp_fp cm,y=\fp_use:N \l_ptxcd_tmp_fp cm} + \file_if_exist_input:n {img/#2}% + \ifvmode\else\unskip\fi + } + \seq_gput_right:Nx \g__ptxcd_image_size_seq {#2=\prop_item:Nn \g__ptxcd_image_size_cache_prop {#2}} + } { + \hbox_gset:Nn \l_ptxcd_image_orig_box { + \file_if_exist_input:n {img/#3}% + \ifvmode\else\unskip\fi% + } + \bool_if:NT \l__ptxcd_disable_autoscale_bool \use_iii:nnnn + \IfBooleanTF{#1}{ + \box_gset_eq:NN \l_ptxcd_image_box \l_ptxcd_image_orig_box + } { + \dim_compare:nNnTF {\box_wd:N \l_ptxcd_image_orig_box} = {\c_zero_dim} { + \fp_set:Nn \l_ptxcd_tmp_fp {1} + } { + \if@DARCinQuestion + \dim_compare:nTF {#2 =\linewidth} { + \dim_set:Nn \l__DARC_image_width_dim {\columnwidth} + } { + \dim_set:Nn \l__DARC_image_width_dim {#2} + } + \else + \dim_set:Nn \l__DARC_image_width_dim {#2} + \fi + \fp_set:Nn \l_ptxcd_tmp_fp {\dim_to_decimal_in_unit:nn {\l__DARC_image_width_dim} {\box_wd:N \l_ptxcd_image_orig_box}} + \hbox_gset:Nn \l_ptxcd_image_box { + \tikzset{x=\fp_use:N \l_ptxcd_tmp_fp cm,y=\fp_use:N \l_ptxcd_tmp_fp cm} + \file_if_exist_input:n {img/#3}% + \ifvmode\else\unskip\fi + } + \bool_lazy_and:nnT + { \dim_compare_p:nNn {\box_wd:N \l_ptxcd_image_box} < {\l__DARC_image_width_dim -1em} } + { ! \dim_compare_p:nNn {\box_wd:N \l_ptxcd_image_box} = {\box_wd:N \l_ptxcd_image_orig_box}} + { + \fp_set:Nn \l_ptxcd_tmp_fp { 1 + \dim_to_decimal_in_unit:nn {\l__DARC_image_width_dim- \box_wd:N \l_ptxcd_image_orig_box} {\box_wd:N \l_ptxcd_image_box - \box_wd:N \l_ptxcd_image_orig_box} * (\l_ptxcd_tmp_fp -1)} + \hbox_gset:Nn \l_ptxcd_image_box { + \tikzset{x=\fp_use:N \l_ptxcd_tmp_fp cm,y=\fp_use:N \l_ptxcd_tmp_fp cm} + \file_if_exist_input:n {img/#3}% + \ifvmode\else\unskip\fi + } + } + \dim_compare:nNnTF {\box_wd:N \l_ptxcd_image_box} = {\box_wd:N \l_ptxcd_image_orig_box} { + \seq_gput_right:Nx \g__ptxcd_image_size_seq {#3=1} + }{ + \seq_gput_right:Nx \g__ptxcd_image_size_seq {#3=\fp_use:N \l_ptxcd_tmp_fp} + } + } + } + } +} + +\newcommand*{\DARCimageCache}[1]{ + \prop_gset_from_keyval:Nn \g__ptxcd_image_size_cache_prop {#1} +} + +\hook_gput_code:nnn {enddocument/afterlastpage}{write-DARCimage-size-cache}{ + \iow_now:Ne \@auxout { + \exp_not:N \DARCimageCache{ + \seq_use:Nn \g__ptxcd_image_size_seq {,} + } + } +} + +\NewDocumentCommand{\DARCimage}{sO{Bild~zur~Prüfungsfrage~\l_ptxcd_question_tl}mm}{ + \par\smallskip + \begingroup + \ptxcd_image_autoscale_setup:nnn {#1} {#3} {#4} + \dim_compare:nNnTF {\box_wd:N \l_ptxcd_image_box} > {\linewidth} + { + \makebox[\linewidth][r]{\box_use:N \l_ptxcd_image_box} + } { + \makebox[\linewidth][c]{\box_use:N \l_ptxcd_image_box} + } + \endgroup +} +\ExplSyntaxOff +\makeatother + +% Neue TL, wird bald in einem zukünftigen circuittikz sein: +% https://github.com/circuitikz/circuitikz/issues/694 +\makeatletter +\newif\ifpgf@circ@bare@tline +\ctikzset{bipoles/tline/bare/.is if=pgf@circ@bare@tline} +\pgfcircdeclarebipolescaled{RF} +{ +\savedmacro{\recessright}{\edef\recessright{\ifpgf@circ@bare@tline -0.4\else 0.0\fi}} +\anchor{center right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=0pt} +\anchor{top right}{\northeast \advance\pgf@x by -0.4\pgf@y} +\anchor{bottom right}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@y=-\pgf@y} +\anchor{center left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=0pt} +\anchor{top left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x} +\anchor{bottom left}{\northeast \advance\pgf@x by -0.4\pgf@y\pgf@x=-\pgf@x\pgf@y=-\pgf@y} +\anchor{right}{\northeast \advance\pgf@x by \recessright\pgf@y\pgf@y=0pt} +} +{\ctikzvalof{bipoles/tline/height}} +{tline} +{\ctikzvalof{bipoles/tline/height}} +{\ctikzvalof{bipoles/tline/width}} +{ +\pgf@circ@res@step=.4\pgf@circ@res@up % the size of the ellipsis is proportional to the height +\pgfscope +\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} +\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}} +\pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@step}{\pgf@circ@res@up}} +\pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up} +\pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@down}} +\pgfpatharc{-90}{90}{\pgf@circ@res@step and \pgf@circ@res@up} +\pgf@circ@draworfill +\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{\pgf@circ@res@up}} +\pgfpatharc{-90}{90}{-\pgf@circ@res@step and -\pgf@circ@res@up} +\pgfusepath{stroke} +\endpgfscope +\ifpgf@circ@bare@tline\else +\pgfsetlinewidth{\pgfstartlinewidth} +\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@step}{0pt}} +\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} +\pgfusepath{stroke} +\fi +} +\makeatother + +% Neues mikrofon, wird irgendwann teil von circuit tikzi und kann dann hier +% gelöscht werden: https://github.com/circuitikz/circuitikz/issues/689 +% < +\makeatletter +\ctikzset{bipoles/tlmic/height/.initial=.5} +\ctikzset{bipoles/tlmic/depth/.initial=.5} +\ctikzset{bipoles/tlmic/width/.initial=.5}% +\pgfcircdeclarebipolescaled{misc} +{} +{\ctikzvalof{bipoles/tlmic/depth}} +{tlmic} +{\ctikzvalof{bipoles/tlmic/height}} +{\ctikzvalof{bipoles/tlmic/width}}{ + + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\pgf@circ@res@up} + \pgf@circ@draworfill + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{tlmic} + +\makeatother +% /> + +% Power Plug +\makeatletter +\ctikzset{bipoles/plug/height/.initial=.5} +\ctikzset{bipoles/plug/width/.initial=.5}% +\pgfcircdeclarebipolescaled{misc} +{} +{\ctikzvalof{bipoles/plug/height}} +{plug} +{\ctikzvalof{bipoles/plug/height}} +{\ctikzvalof{bipoles/plug/width}}{ + + %\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\pgf@circ@res@up} + \pgfusepath{fill} + %\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + %\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + %\pgfusepath{draw} + % Plus: + \color{black} + \pgfsetstrokecolor{black} + \pgfpathrectangle{\pgfpoint{0.0\pgf@circ@res@step}{-0.1\pgf@circ@res@step}}{\pgfpoint{-0.2\pgf@circ@res@step}{+0.1\pgf@circ@res@step}}% + \pgfusepath{fill} +} +\pgfcirc@activate@bipole@simple{l}{plug} +\makeatother + +%% bgenerator und bgeneratorshape block +% Eine submission nach circuittikz wurde durchgeführt: +% https://github.com/circuitikz/circuitikz/pull/693 +% < +\makeatletter +% +\def\pgfcirc@twoport@draw@narrowsine#1{% #1 -> y shift + \pgfscope + \pgfsetlinewidth{\pgfstartlinewidth} + \pgftransformyshift{#1\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{.125\pgf@circ@res@step}{0\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.125\pgf@circ@res@step}{.125\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.125\pgf@circ@res@step}{-.125\pgf@circ@res@step}} + \pgfpathsine{\pgfpoint{.125\pgf@circ@res@step}{-.125\pgf@circ@res@step}} + \pgfpathcosine{\pgfpoint{.125\pgf@circ@res@step}{.125\pgf@circ@res@step}} + \pgfusepath{draw} + \endpgfscope +} +% +\ctikzset{bipoles/bgenerator/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/bgenerator/width}} +{bgenerator} +{\ctikzvalof{bipoles/bgenerator/width}} +{\ctikzvalof{bipoles/bgenerator/width}} +{ + \pgfcirc@twoport@draw@narrowsine{0.25}{0} + \pgfcirc@twoport@draw@narrowsine{0.0}{0} + \pgfcirc@twoport@draw@narrowsine{-0.25}{0} + \pgftext[x=0.45\pgf@circ@res@left]{\ctikzvalof{bipoles/twoport/text}} +} +\pgfcirc@activate@bipole@simple{l}{bgenerator} +\makeatother +%> + +%Q-Generator TODO: Update pull request +\makeatletter +% +\ctikzset{bipoles/qgenerator/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/qgenerator/width}} +{qgenerator} +{\ctikzvalof{bipoles/qgenerator/width}} +{\ctikzvalof{bipoles/qgenerator/width}} +{ + \pgfcirc@twoport@draw@narrowsine{0.45}{0} + \pgfcirc@twoport@draw@narrowsine{0.20}{0} + \pgfcirc@twoport@draw@narrowsine{-0.05}{0} + \pgftext[x=0.45\pgf@circ@res@left,y=0.25\pgf@circ@res@up]{\ctikzvalof{bipoles/twoport/text}} + \pgfpathmoveto{\pgfpoint{-0.7\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{ 0.7\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathrectangle{\pgfpoint{-0.7\pgf@circ@res@step}{-0.7\pgf@circ@res@step}}{\pgfpoint{1.4\pgf@circ@res@step}{0.2\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.7\pgf@circ@res@step}{-0.85\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{ 0.7\pgf@circ@res@step}{-0.85\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{qgenerator} +\makeatother + +%Clock-Generator in PR committed +\makeatletter +% +\ctikzset{bipoles/cgenerator/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/cgenerator/width}} +{cgenerator} +{\ctikzvalof{bipoles/cgenerator/width}} +{\ctikzvalof{bipoles/cgenerator/width}} +{ + \pgfpathmoveto{\pgfpoint{-0.70\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.42\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.42\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.14\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.14\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.14\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.14\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.42\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.42\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.70\pgf@circ@res@step}{-0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{cgenerator} +\makeatother + +%Sine Table: in PR committed +\makeatletter +% +\ctikzset{bipoles/sinetable/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/sinetable/width}} +{sinetable} +{\ctikzvalof{bipoles/sinetable/width}} +{\ctikzvalof{bipoles/sinetable/width}} +{ + \pgfcirc@twoport@draw@sine{0.0}{0} + \pgfcirc@set@arrows{tunable}{}{latex} + \pgfpathmoveto{\pgfpoint{-0.70\pgf@circ@res@step}{-0.70\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.70\pgf@circ@res@step}{-0.70\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.70\pgf@circ@res@step}{-0.70\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.70\pgf@circ@res@step}{+0.70\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{sinetable} +\makeatother + +%Register: in pull request committed +\makeatletter +% +\ctikzset{bipoles/register/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{ + \savedanchor\northwest{ + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@y=\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen + \pgf@y=.5\pgf@y + \pgf@x=-\ctikzvalof{bipoles/twoport/width}\pgf@circ@scaled@Rlen + \pgf@x=.5\pgf@x + } + \anchor{clk}{\northwest\pgf@y=0.5\pgf@y} +} +{\ctikzvalof{bipoles/register/width}} +{register} +{\ctikzvalof{bipoles/register/width}} +{\ctikzvalof{bipoles/register/width}} +{ + \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{+0.70\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.60\pgf@circ@res@step}{+0.50\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-1.00\pgf@circ@res@step}{+0.30\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{register} +\makeatother + +%% Bias-T, wurde in PR committed +\makeatletter +\ctikzset{bipoles/biast/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/biast/width}} +{biast} +{\ctikzvalof{bipoles/biast/width}} +{\ctikzvalof{bipoles/biast/width}} +{ + \pgfpathmoveto{\pgfpoint{-0.80\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Line to Plate 1 + \pgfpathlineto{\pgfpoint{-0.50\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.50\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Plate 1 + \pgfpathlineto{\pgfpoint{-0.50\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.50\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.50\pgf@circ@res@step}{-0.80\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Plate 1 + \pgfpathlineto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.80\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Line to Center + \pgfpathlineto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathcircle{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.50\pgf@circ@res@step}}{0.075\pgf@circ@res@step} + \pgfusepath{fill} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Line to Right + \pgfpathlineto{\pgfpoint{ 0.80\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.50\pgf@circ@res@step}} % Line to Coils + \pgfpathlineto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} % Arc1 + \pgfpatharc{-90}{90}{0.09\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-0.02\pgf@circ@res@step}} % Arc2 + \pgfpatharc{-90}{90}{0.09\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{+0.16\pgf@circ@res@step}} % Arc3 + \pgfpatharc{-90}{90}{0.09\pgf@circ@res@step} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{+0.36\pgf@circ@res@step}} % Arc4 + \pgfpatharc{-90}{90}{0.09\pgf@circ@res@step} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{+0.52\pgf@circ@res@step}} % Line to Coils + \pgfpathlineto{\pgfpoint{ 0.00\pgf@circ@res@step}{+0.80\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{biast} +\makeatother + +%% variable allpass filter +% Eine submission nach circuittikz wurde durchgeführt: +% https://github.com/circuitikz/circuitikz/pull/693 +\makeatletter +\ctikzset{bipoles/vallpass/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/vallpass/width}} +{vallpass} +{\ctikzvalof{bipoles/vallpass/width}} +{\ctikzvalof{bipoles/vallpass/width}} +{ + \pgfcirc@twoport@draw@sine{0.5}{0} + \pgfcirc@twoport@draw@sine{0.0}{0} + \pgfcirc@twoport@draw@sine{-0.5}{0} + \pgfcirc@set@arrows{tunable}{}{latex} + \pgfpathmoveto{\pgfpoint{0.7\pgf@circ@res@left}{0.5\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@right}{0.8\pgf@circ@res@up}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{vallpass} +\makeatother + +%% ngenerator committed to PR +% < +\makeatletter +% +\ctikzset{bipoles/ngenerator/width/.initial=.7} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/ngenerator/width}} +{ngenerator} +{\ctikzvalof{bipoles/ngenerator/width}} +{\ctikzvalof{bipoles/ngenerator/width}} +{ + \pgfcirc@twoport@draw@sine{0.5}{0} + \pgftext[y=-0.35\pgf@circ@res@up]{\ctikzvalof{bipoles/twoport/text}} +} +\pgfcirc@activate@bipole@simple{l}{ngenerator} +\makeatother +%> + +% Camera wurde zu PR committed +\makeatletter +\ctikzset{bipoles/camera/height/.initial=1.2} +\ctikzset{bipoles/camera/depth/.initial=.3} +\ctikzset{bipoles/camera/width/.initial=.4} +\pgfcircdeclarebipolescaled{misc} +{} +{\ctikzvalof{bipoles/camera/depth}} +{camera} +{\ctikzvalof{bipoles/camera/height}} +{\ctikzvalof{bipoles/camera/width}}{ + \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.7\pgf@circ@res@up}} + {\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{0.5\pgf@circ@res@left}{.7\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.8\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{.7\pgf@circ@res@up}} + \pgfpathclose + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@draworfill +} +\pgfcirc@activate@bipole@simple{l}{camera} + +\makeatother + +% TRX +\makeatletter +\ctikzset{bipoles/trx/width/.initial=1} +\ctikzset{bipoles/trx/height/.initial=.4} +\pgfcirc@define@twoports{blocks} +{ + \anchor{plus}{\northeast \advance\pgf@y by -0.2\pgf@x\pgf@x=-\pgf@x} + \anchor{minus}{\northeast \advance\pgf@y by -0.2\pgf@x\pgf@x=-\pgf@x\pgf@y=-\pgf@y} +} +{\ctikzvalof{bipoles/trx/height}} +{trx} +{\ctikzvalof{bipoles/trx/height}} +{\ctikzvalof{bipoles/trx/width}} +{ + % VFO-Rad: + \pgfpathcircle{\pgfpoint{0.60\pgf@circ@res@step}{0.00\pgf@circ@res@step}}{0.25\pgf@circ@res@step} + \pgfpathcircle{\pgfpoint{0.68\pgf@circ@res@step}{0.10\pgf@circ@res@step}}{0.06\pgf@circ@res@step} + % Lautstärke und Rauschsperre: + \pgfpathcircle{\pgfpoint{-0.8\pgf@circ@res@step}{+0.15\pgf@circ@res@step}}{0.1\pgf@circ@res@step} + \pgfpathcircle{\pgfpoint{-0.8\pgf@circ@res@step}{-0.15\pgf@circ@res@step}}{0.1\pgf@circ@res@step} + % Bildschirm: + \pgfpathrectangle{\pgfpoint{-0.55\pgf@circ@res@step}{-0.25\pgf@circ@res@step}}{\pgfpoint{+0.75\pgf@circ@res@step}{+0.5\pgf@circ@res@step}}% + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{trx} +\makeatother + +% SWR, wurde committed +\makeatletter +\ctikzset{bipoles/swr/width/.initial=0.6} +\ctikzset{bipoles/swr/height/.initial=.4} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/swr/height}} +{swr} +{\ctikzvalof{bipoles/swr/height}} +{\ctikzvalof{bipoles/swr/width}} +{ + % Bildschirm: + \pgfpathrectangle{\pgfpoint{-0.6\pgf@circ@res@step}{-0.4\pgf@circ@res@step}}{\pgfpoint{+1.2\pgf@circ@res@step}{+0.9\pgf@circ@res@step}}% + \pgfusepath{draw} + % Zeiger: + \pgfpathmoveto{\pgfpoint{+0.30\pgf@circ@res@step}{-0.40\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.30\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfusepath{draw} + \pgfpathmoveto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.40\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.30\pgf@circ@res@step}{+0.35\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{swr} +\makeatother + +% Power Supply +% wurde committed +\makeatletter +\ctikzset{bipoles/power/width/.initial=1} +\ctikzset{bipoles/power/height/.initial=.4} +\pgfcirc@define@twoports{blocks} +{ + \anchor{u1}{\northeast \advance\pgf@y by -0.2\pgf@x\pgf@x=-\pgf@x} + \anchor{u2}{\northeast \advance\pgf@y by -0.2\pgf@x\pgf@x=-\pgf@x\pgf@y=-\pgf@y} + \anchor{plus}{\northeast \advance\pgf@y by -0.2\pgf@x \advance\pgf@x by -0.25\pgf@x} + \anchor{minus}{\northeast \advance\pgf@y by -0.2\pgf@x\pgf@y=-\pgf@y \advance\pgf@x by -0.25\pgf@x} +} +{\ctikzvalof{bipoles/power/height}} +{power} +{\ctikzvalof{bipoles/power/height}} +{\ctikzvalof{bipoles/power/width}} +{ + % Plus: + \color{red} + \pgfsetstrokecolor{red} + \pgfpathcircle{\pgfpoint{0.75\pgf@circ@res@step}{0.20\pgf@circ@res@step}}{0.075\pgf@circ@res@step}% + \pgfusepath{fill} + \pgfpathmoveto{\pgfpoint{0.50\pgf@circ@res@step}{0.20\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.60\pgf@circ@res@step}{0.20\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{0.55\pgf@circ@res@step}{0.25\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.55\pgf@circ@res@step}{0.15\pgf@circ@res@step}} + \pgfusepath{stroke} + % Minus: + \color{black} + \pgfsetstrokecolor{black} + \pgfpathcircle{\pgfpoint{0.75\pgf@circ@res@step}{-0.20\pgf@circ@res@step}}{0.075\pgf@circ@res@step}% + \pgfusepath{fill} + \pgfpathmoveto{\pgfpoint{0.50\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{0.60\pgf@circ@res@step}{-0.20\pgf@circ@res@step}} + \pgfusepath{stroke} + % Displays: + \pgfpathrectangle{\pgfpoint{-0.5\pgf@circ@res@step}{0.00\pgf@circ@res@step}}{\pgfpoint{+0.4\pgf@circ@res@step}{+0.25\pgf@circ@res@step}}% + \pgfpathrectangle{\pgfpoint{-0.0\pgf@circ@res@step}{0.00\pgf@circ@res@step}}{\pgfpoint{+0.4\pgf@circ@res@step}{+0.25\pgf@circ@res@step}}% + % Poti: + \pgfpathcircle{\pgfpoint{-0.30\pgf@circ@res@step}{-0.20\pgf@circ@res@step}}{0.075\pgf@circ@res@step}% + \pgfusepath{draw} + % Switch: + \pgfpathrectangle{\pgfpoint{-0.9\pgf@circ@res@step}{0.00\pgf@circ@res@step}}{\pgfpoint{+0.15\pgf@circ@res@step}{+0.25\pgf@circ@res@step}}% + \pgfpathmoveto{\pgfpoint{-0.90\pgf@circ@res@step}{0.125\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{0.125\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{power} +\makeatother + +% TODO muss skalierbar und konnektierbar werden: +\newcommand{\AsymCloud}[3]{ + \begin{scope}[shift={#1},scale=#3] + \draw (-1.6,-0.7) .. controls (-2.3,-1.1) + and (-2.7,0.3) .. (-1.7,0.3)coordinate(asy1) .. controls (-1.6,0.7) + and (-1.2,0.9) .. (-0.8,0.7) .. controls (-0.5,1.5) + and (0.6,1.3) .. (0.7,0.5) .. controls (1.5,0.4) + and (1.2,-1) .. (0.4,-0.6)coordinate(asy2) .. controls (0.2,-1) + and (-0.2,-1) .. (-0.5,-0.7) .. controls (-0.9,-1) + and (-1.3,-1) .. cycle; + \node at ($(asy1)!0.5!(asy2)$) {#2}; + \end{scope} +} + +% TV, has been comitted to PR +\makeatletter +\ctikzset{bipoles/tv/width/.initial=0.6} +\ctikzset{bipoles/tv/height/.initial=.4} +\pgfcirc@define@twoports{blocks} +{} +{\ctikzvalof{bipoles/tv/height}} +{tv} +{\ctikzvalof{bipoles/tv/height}} +{\ctikzvalof{bipoles/tv/width}} +{ + \pgfsetlinewidth{2\pgflinewidth} % double in size + % Beine: + \pgfpathmoveto{\pgfpoint{+0.60\pgf@circ@res@step}{-1.10\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{+0.30\pgf@circ@res@step}{-0.70\pgf@circ@res@step}} + \pgfusepath{draw} + % + \pgfpathmoveto{\pgfpoint{-0.60\pgf@circ@res@step}{-1.10\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{-0.30\pgf@circ@res@step}{-0.70\pgf@circ@res@step}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{tv} +\makeatother + +% Oberwellen: in PR committed +\makeatletter +\ctikzset{monopoles/harmonics/width/.initial=0.5}% +% additional shape with the harmonics +\pgfdeclareshape{harmonics}{ + \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}} + \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}} + \anchor{center}{\pgfpointorigin} + \savedanchor{\northeast}{ + \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen} + \pgf@circ@res@step=\ctikzvalof{monopoles/harmonics/width}\pgf@circ@scaled@Rlen + \pgf@x=\pgf@circ@res@step + \pgf@y=\pgf@circ@res@step + } + \anchor{text}{ + \northeast + \pgf@y=\dimexpr\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax + } + \anchor{top}{\northeast\pgf@x=0pt} + \anchor{right}{\northeast\pgf@y=0pt} + \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt} + \anchor{bottom}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt} + \anchor{north}{\northeast\pgf@x=0pt} + \anchor{north east}{\northeast} + \anchor{east}{\northeast\pgf@y=0pt} + \anchor{south east}{\northeast\pgf@y=-\pgf@y} + \anchor{south}{\northeast\pgf@y=-\pgf@y\pgf@x=0pt} + \anchor{south west}{\northeast\pgf@y=-\pgf@y\pgf@x=-\pgf@x} + \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0pt} + \anchor{north west}{\northeast\pgf@x=-\pgf@x} + \pgf@circ@draw@component{ + \pgf@circ@scaled@Rlen=\scaledRlen + \pgf@circ@res@step=\ctikzvalof{monopoles/waves/width}\pgf@circ@scaled@Rlen + \pgf@circ@res@step=0.5\pgf@circ@res@step + \pgf@circ@setcolor + \pgfscope + % define a triangle for clipping the waves + \pgfpathmoveto{\pgfpoint{-2\pgf@circ@res@step}{0pt}} + \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{1\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{2.1\pgf@circ@res@step}{-1\pgf@circ@res@step}} + \pgfpathclose + \pgfusepath{clip} + % ...and build the waves as clipped circles + \c@pgf@counta=32\pgf@circ@res@other=0.125\pgf@circ@res@step + \pgfmathloop% + \ifnum\c@pgf@counta>1 + \pgfpathcircle{\pgfpoint{-2\pgf@circ@res@step}{0pt}}{\the\c@pgf@counta*\pgf@circ@res@other} + \advance\c@pgf@counta-1\relax% + \repeatpgfmathloop + \pgfusepath{draw} + \endpgfscope + } +} + +\makeatother + +% morse code +\newcommand{\MorseDotLength}{2pt} +\newcommand{\MorseDahLength}{9pt} +\newcommand{\MorseThickness}{1.5pt} +\newcommand{\MorseCharSep}{\hspace{9pt}} +\newcommand{\MorseWordSep}{\hspace{21pt}} + +\newcommand{\MorseDit}{\raisebox{0.5ex}{\rule{\MorseDotLength}{\MorseThickness}\hspace{\MorseDotLength}}} +\newcommand{\MorseDah}{\raisebox{0.5ex}{\rule{\MorseDahLength}{\MorseThickness}\hspace{\MorseDotLength}}} + +\newcommand{\smartphone}[3] % #1 = (x,y); #2 = width; #3 = name +{ + % äußeres Rechteck + \node (#3) at #1 [draw, minimum width=#2*1, minimum height=#2*1.7, rounded corners=0.1*#2] {}; + % Bildschirm + \node (#3_screen) at #1 [draw, minimum width=#2*0.8, minimum height=#2*1.2] {}; + % Home-Button + \node [draw, circle, minimum size=#2*0.15, inner sep=0, below=#2*0.05 of #3_screen] {}; + % Lautsprecher + \node [draw, fill, inner sep=0, minimum width=#2*0.6, minimum height=0.005cm, above=#2*0.1 of #3_screen] {}; +} + +\newcommand{\computer}[2] % #1 = (x,y); #2 = name +{ + % Bildschirm + \draw (#1) node [draw, anchor=center, minimum width=1.0cm, minimum height=0.5cm, rounded corners=0.5, double] (#2) {}; + % Tastatur + \draw (#2.south) ++(0,-0.05) node [draw, anchor=north, minimum width=1.0cm, minimum height=0.04cm, rounded corners=0.5, inner sep=0] {}; +} + +% Kommandos für TRX-Bildschirme + +\newcommand{\dist}{0.25} +% +\newcommand{\swr}[6]{% 1:x1 2:y1 3:x2 4:y2 5:percent 6:Label + \pgfmathsetlengthmacro \val {(#1)+(#5)*((#3)-(#1))} + \fill[gray] (#1,#2) rectangle (\val,#4); + \draw[very thick] (#1,#2) rectangle (#3,#4); + \foreach \i in {1,...,4} { + \pgfmathsetlengthmacro \x {(#1)+(\i-1)*((#3)-(#1))/3} + \node at (\x,#2-1.25*\dist) {\ifthenelse{\i=4}{$\infty$}{\i}}; + } + \node[anchor=west,inner sep=0,outer sep=0] at (#1,#4+1.25*\dist) {#6}; +} +% +\newcommand{\alc}[6]{% 1:x1 2:y1 3:x2 4:y2 5:percent 6:Label + \pgfmathsetlengthmacro \val {(#1)+(#5)*((#3)-(#1))} + \pgfmathsetlengthmacro \alcmax {(#1)+(0.66)*((#3)-(#1))} + \fill[gray] (#1,#2) rectangle (\val,#4); + \draw[very thick] (#1,#2) rectangle (#3,#4); + \draw[ultra thick, DARCgreen] (#1,#2-0.5*\dist) -- (\alcmax,#2-0.5*\dist); + \draw[ultra thick, DARCred] (\alcmax,#2-0.5*\dist) -- (#3,#2-0.5*\dist); + \node[anchor=west,inner sep=0,outer sep=0] at (#1,#4+1.25*\dist) {#6}; +} +% +\newcommand{\pwr}[5]{% 1:x1 2:y1 3:x2 4:y2 5:percent + \pgfmathsetlengthmacro \val {(#1)+(#5)*((#3)-(#1))} + \fill[gray] (#1,#2) rectangle (\val,#4); + \draw[very thick] (#1,#2) rectangle (#3,#4); + \foreach \l [count=\i from 1] in {\ifthenelse{\boolean{labels}}{}{P}1,5,10,15,20} { + \pgfmathsetlengthmacro \x {(#1)+(\i-1)*((#3)-(#1))/4} + \node at (\x,#2-1.25*\dist) {\l}; + } + \foreach \l [count=\i from 1] in {\ifthenelse{\boolean{labels}}{}{S}1,3,5,7,9,+20,+40} { + \pgfmathsetlengthmacro \x {(#1)+(\i-1)*((#3)-(#1))/6} + \node at (\x,#4+1.25*\dist) {\l}; + } +} +% +\newcommand{\vol}[5]{% 1:x1 2:y1 3:x2 4:y2 5:percent + \pgfmathsetlengthmacro \val {(#1)+(#5)*((#3)-(#1))} + \fill[gray] (#1,#2) rectangle (\val,#4); + \draw[very thick] (#1,#2) rectangle (#3,#4); + \node at (#1,#2-1.25*\dist) {0}; + \node at (#3,#2-1.25*\dist) {100}; + \draw (#1,#4+\dist) node [loudspeakershape, rotate=-90, scale=0.5*\getDarcImageFactor, anchor=south east] {}; +} +% +\newcommand{\qrg}[2]{% 1:x1 2:y1 + \node[circuitikz/seven seg/color on=black, seven segment val=1 dot none box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (#1,#2) (z1) {}; + \node[circuitikz/seven seg/color on=black, seven segment val=4 dot none box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z1.east) (z2){}; + \node[circuitikz/seven seg/color on=black, seven segment val=4 dot on box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z2.east) (z3){}; + \node[circuitikz/seven seg/color on=black, seven segment val=3 dot none box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z3.east) (z4){}; + \node[circuitikz/seven seg/color on=black, seven segment val=1 dot none box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z4.east) (z5){}; + \node[circuitikz/seven seg/color on=black, seven segment val=5 dot on box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z5.east) (z6){}; + \node[circuitikz/seven seg/color on=black, seven segment val=0 dot none box off, anchor=west, circuitikz/displays/scale=0.9*\getDarcImageFactor, circuitikz/seven seg/thickness=4pt*0.9*\getDarcImageFactor] at (z6.east) (z7){}; +} +% +\newcommand{\mdl}[4] {% 1:mod 2:tx/rx + \draw ($(z7.east)+(0,\dist)$) node[anchor=west](){#1}; %mod + \draw ($(z7.east)-(0,\dist)$) node[anchor=west](){#2}; % rx tx +} + + +\makeatletter +\pgfdeclareshape{semi}{% + \inheritsavedanchors[from=circle] + \inheritanchorborder[from=circle] + \inheritanchor[from=circle]{center} + \inheritanchor[from=circle]{north} + \inheritanchor[from=circle]{south} + \inheritanchor[from=circle]{west} + \inheritanchor[from=circle]{east} + \backgroundpath{% + \centerpoint + \pgfsetlinewidth{2pt} + \pgfsetstrokecolor{DARCgray} + \pgfpathcircle{\pgfpoint{\pgf@x}{\pgf@y}}{\radius} + \pgfusepath{stroke} + \pgfsetfillcolor{DARCblue} + \pgfpathcircle{\pgf@anchor@semi@north}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@semi@south}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@semi@east}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@semi@west}{0.25*\radius} + \pgfusepath{fill} + } +} +\makeatother + +\makeatletter +\pgfdeclareshape{donn}{% + \inheritsavedanchors[from=circle] + \inheritanchorborder[from=circle] + \inheritanchor[from=circle]{center} + \inheritanchor[from=circle]{north} + \inheritanchor[from=circle]{south} + \inheritanchor[from=circle]{west} + \inheritanchor[from=circle]{east} + \backgroundpath{% + \centerpoint + \pgfsetlinewidth{2pt} + \pgfsetstrokecolor{DARCgray} + \pgfpathcircle{\pgfpoint{\pgf@x}{\pgf@y}}{\radius} + \pgfusepath{stroke} + \pgfsetfillcolor{DARCblue} + \pgfpathcircle{\pgf@anchor@donn@north}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@donn@south}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@donn@east}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@donn@west}{0.25*\radius} + \pgfusepath{fill} + \pgfpathmoveto{\centerpoint} + \pgfpathcircle{\pgfpointpolar{45}{2*\radius}}{0.25*\radius} + \pgfusepath{fill} + } +} +\makeatother + +\makeatletter +\pgfdeclareshape{acce}{% + \inheritsavedanchors[from=circle] + \inheritanchorborder[from=circle] + \inheritanchor[from=circle]{center} + \inheritanchor[from=circle]{north} + \inheritanchor[from=circle]{south} + \inheritanchor[from=circle]{west} + \inheritanchor[from=circle]{east} + \backgroundpath{% + \centerpoint + \pgfsetlinewidth{2pt} + \pgfsetstrokecolor{DARCgray} + \pgfpathcircle{\pgfpoint{\pgf@x}{\pgf@y}}{\radius} + \pgfusepath{stroke} + \pgfsetfillcolor{DARCblue} + \pgfpathcircle{\pgf@anchor@acce@north}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@acce@south}{0.25*\radius} + \pgfpathcircle{\pgf@anchor@acce@west}{0.25*\radius} + \pgfusepath{fill} + \pgfsetlinewidth{1pt} + \pgfsetstrokecolor{DARCred} + \pgfpathcircle{\pgf@anchor@acce@east}{0.25*\radius} + \pgfusepath{stroke} + } +} +\makeatother + + +\makeatletter + +%% Solar Panel +\ctikzset{bipoles/solar/height/.initial=.6} +\ctikzset{bipoles/solar/width/.initial=.3} + +\pgfcircdeclarebipolescaled{batteries} +{} +{\ctikzvalof{bipoles/solar/height}} +{solar} +{\ctikzvalof{bipoles/solar/height}} +{\ctikzvalof{bipoles/solar/width}} +{ + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}} + \pgfusepath{draw} + + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \ifpgf@circ@fixbatteries + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfsetlinewidth{3\pgflinewidth} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{.5\pgf@circ@res@down}} + \else + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfusepath{draw} + \pgfsetlinewidth{3\pgflinewidth} + \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}} + \fi + + \pgfusepath{draw} + + \pgfsetlinewidth{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor + \pgf@circ@set@optoarrow@style + + \pgfpathmoveto{\pgfpoint{0.6\pgf@circ@res@right}{2.2\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{1.2\pgf@circ@res@up}} + + \pgfusepath{draw} + + \pgfpathmoveto{\pgfpoint{1.2\pgf@circ@res@right}{2.0\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.2\pgf@circ@res@right}{1.0\pgf@circ@res@up}} + + \pgfusepath{draw} +} + +\pgfcirc@activate@bipole@opt{v}{batteries}{solar}{solar}{\circuitikzbasekey/bipole/is voltage=true, + \circuitikzbasekey/bipole/is voltageoutsideofsymbol=true} + +\makeatother