
%% This is file `pst-circ.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-circ.tex'
%%
%% Original idea: A.Premoli I.Maio, M.Luque,
%%
%% Christophe Jorssen <CJ@PSTricks.de>
%% Herbert Voss <voss@PSTricks.de>
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory CTAN:/macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-circ' is a PSTricks package to draw electric circuits
%%
%% For a ChangeLog go the the end
%%
\csname PSTcircLoaded\endcsname
\let\PSTcircLoaded\endinput
%
% Require PSTricks and pst-node packages
%
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodeLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
\ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
%
\def\fileversion{1.51}
\def\filedate{2009/02/20}
\message{`pst-circ' v\fileversion (CJ,hv,pd)}
%
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\pst@addfams{pst-circ}
%
\pstheader{pst-circ.pro}
\SpecialCoor

%
\newdimen\Pst@position
%
\newcount\pst@count@i
\newcount\pst@count@ii
\newcount\pst@count@iii
%
\newif\ifPst@Dconvention
\newif\ifPst@parallel
\newif\ifPst@parallel@node
\newif\ifPst@T@changeLR
\newif\ifPst@Ttype
\newif\ifPst@FETchanneltype% Ted
\newif\ifPst@Trafo@iprimary
\newif\ifPst@Trafo@isecondary
%
\def\pst@Dconvention@receptor{receptor}
\def\pst@Dconvention@generator{generator}
\def\pst@Ttype@PNP{PNP}
\def\pst@Ttype@NPN{NPN}
\def\pst@Ttype@FET{FET}
\def\pst@FETchanneltype@P{P}% Ted
\def\pst@FETchanneltype@N{N}% Ted
% start  Herbert 2003-07-17
\def\pst@Dstyle@twoCircles{twoCircles}
\def\pst@Dstyle@varistor{varistor}
\def\pst@Dstyle@thyristor{thyristor}
\def\pst@Dstyle@GTO{GTO}
\def\pst@Dstyle@triac{triac}
\def\pst@Dstyle@Z{Z}
% end  Herbert 2003-07-17
\def\pst@Dstyle@normal{normal}
\def\pst@Dstyle@chemical{chemical}
\def\pst@Dstyle@elektor{elektor}
\def\pst@Dstyle@crystal{crystal}
\def\pst@Dstyle@elektorchemical{elektorchemical}
\def\pst@Dstyle@elektorcurved{elektorcurved}
\def\pst@Dstyle@curved{curved}
\def\pst@Dstyle@rectangle{rectangle}
\def\pst@Dstyle@open{open}
\def\pst@Dstyle@close{close}
\def\pst@Dstyle@zigzag{zigzag}
\def\pst@Dstyle@diamond{diamond}
\def\pst@tripole@style@left{left}
\def\pst@tripole@style@right{right}
\def\pst@tripole@style@center{center}
\def\pst@tripole@style@french{french}
%
\define@boolkey[psset]{pst-circ}[Pst@]{intensity}[true]{}
\define@key[psset]{pst-circ}{intensitylabel}[]{\def\psk@I@label{#1}}
\define@key[psset]{pst-circ}{intensitylabelcolor}[black]{\def\psk@I@labelcolor{#1}}
\define@key[psset]{pst-circ}{intensitylabeloffset}[0.5]{\def\psk@I@label@offset{#1}}
\define@key[psset]{pst-circ}{intensitycolor}[black]{\def\psk@I@color{#1}}
\define@key[psset]{pst-circ}{intensitywidth}[\pslinewidth]{\def\psk@I@width{#1}}
\define@boolkey[psset]{pst-circ}[Pst@]{tension}[true]{}
\define@key[psset]{pst-circ}{tensionlabel}[]{\def\psk@tension@label{#1}}
\define@key[psset]{pst-circ}{tensionlabelcolor}[black]{\def\psk@tension@labelcolor{#1}}
\define@key[psset]{pst-circ}{tensionoffset}[1]{\def\psk@tension@offset{#1}}
\define@key[psset]{pst-circ}{tensionlabeloffset}[1.2]{\def\psk@tension@label@offset{#1}}
\define@key[psset]{pst-circ}{tensioncolor}[black]{\def\psk@tension@color{#1}}
\define@key[psset]{pst-circ}{tensionwidth}[\pslinewidth]{\def\psk@tension@width{#1}}
\define@key[psset]{pst-circ}{labeloffset}[0.7]{\def\psk@label@offset{#1}}
\define@key[psset]{pst-circ}{labelangle}[0]{\def\psk@label@angle{#1}}
\define@key[psset]{pst-circ}{labelInside}[0]{\def\psk@labelInside{#1}}
\define@key[psset]{pst-circ}{dipoleconvention}[receptor]{\def\psk@Dconvention{#1}}
\define@boolkey[psset]{pst-circ}[Pst@]{directconvention}[true]{}
\define@key[psset]{pst-circ}{dipolestyle}[normal]{\def\psk@Dstyle{#1}}
\define@key[psset]{pst-circ}{parallel}[true]{\@nameuse{Pst@parallel#1}}
\define@key[psset]{pst-circ}{parallelarm}[1.5]{\def\psk@parallel@arm{#1}}
\define@key[psset]{pst-circ}{parallelsep}[0]{\def\psk@parallel@sep{#1}}
\define@key[psset]{pst-circ}{parallelnode}[true]{\@nameuse{Pst@parallel@node#1}}
\define@boolkey[psset]{pst-circ}[Pst@wire@]{intersect}[true]{}
\define@key[psset]{pst-circ}{intersectA}{\def\psk@wire@intersectA{#1}}
\define@key[psset]{pst-circ}{intersectB}{\def\psk@wire@intersectB{#1}}
\define@boolkey[psset]{pst-circ}[Pst@]{OAperfect}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{OApower}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{OAinvert}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{OAiplus}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{OAiminus}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{OAiout}[true]{}
\define@key[psset]{pst-circ}{OAipluslabel}[]{\def\psk@label@OAiplus{#1}}
\define@key[psset]{pst-circ}{OAiminuslabel}[]{\def\psk@label@OAiminus{#1}}
\define@key[psset]{pst-circ}{OAioutlabel}[]{\def\psk@label@OAiout{#1}}
\define@boolkey[psset]{pst-circ}[Pst@]{transistorcircle}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{transistorinvert}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{transistoribase}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{transistoricollector}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{transistoriemitter}[true]{}
\define@key[psset]{pst-circ}{transistoribaselabel}[]{\def\psk@labeltransistoribase{#1}}
\define@key[psset]{pst-circ}{transistoricollectorlabel}[]{\def\psk@labeltransistoricollector{#1}}
\define@key[psset]{pst-circ}{transistoriemitterlabel}[]{\def\psk@labeltransistoriemitter{#1}}
\define@key[psset]{pst-circ}{FETchanneltype}{\def\psk@FETchanneltype{#1}}% Ted 2007-10-15
\define@boolkey[psset]{pst-circ}[Pst@]{FETmemory}[true]{}
\define@key[psset]{pst-circ}{transistortype}[NPN]{%
  \def\psk@Ttype{#1}%
  \ifx\psk@Ttype\pst@Ttype@FET \Pst@transistorcirclefalse\fi}
\newdimen\Pst@basesep
\define@key[psset]{pst-circ}{basesep}[0]{\pst@getlength{#1}\Pst@basesep}
\define@key[psset]{pst-circ}{TRot}[0]{\pst@checknum{#1}\Pst@TRot}
\define@key[psset]{pst-circ}{circedge}[\pcangle]{%
  \let\pscirc@edge#1%
  \ifx\pscirc@edge\@none\def\pscirc@edge(##1)(##2){}\fi%
  \ifx\pscirc@edge\pcangles\def\pscirc@edge@sector{2.5}\else\def\pscirc@edge@sector{1.5}\fi%
}
%
\define@key[psset]{pst-circ}{primarylabel}[]{\def\psk@Trafo@primary@label{#1}}
\define@key[psset]{pst-circ}{secondarylabel}[]{\def\psk@Trafo@secondary@label{#1}}
\define@key[psset]{pst-circ}{transformeriprimary}[true]{\@nameuse{Pst@Trafo@iprimary#1}}
\define@key[psset]{pst-circ}{transformerisecondary}[true]{\@nameuse{Pst@Trafo@isecondary#1}}
\define@key[psset]{pst-circ}{transformeriprimarylabel}[]{\def\psk@Trafo@iprimary@label{#1}}
\define@key[psset]{pst-circ}{transformerisecondarylabel}[]{\def\psk@Trafo@isecondary@label{#1}}
\define@key[psset]{pst-circ}{tripolestyle}[normal]{\def\psk@tripole@style{#1}}
\define@boolkey[psset]{pst-circ}[Pst@]{variable}[true]{}
%
\define@boolkey[psset]{pst-circ}[Pst@]{logicChangeLR}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{logicShowDot}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{logicShowNode}[true]{}
\define@key[psset]{pst-circ}{logicWidth}[1.5]{\def\psk@logic@width{#1}}% hv
\define@key[psset]{pst-circ}{logicHeight}[2.5]{\def\psk@logic@height{#1}}% hv
\define@key[psset]{pst-circ}{logicType}[and]{\def\psk@logic@type{#1}}% hv
\define@key[psset]{pst-circ}{logicNInput}[2]{\def\psk@logic@nInput{#1}}% hv
\define@key[psset]{pst-circ}{logicJInput}[2]{\def\psk@logic@JInput{#1}}% hv
\define@key[psset]{pst-circ}{logicKInput}[2]{\def\psk@logic@KInput{#1}}% hv
\define@key[psset]{pst-circ}{logicWireLength}[0.5]{\def\psk@logic@wireLength{#1}}% hv
\define@key[psset]{pst-circ}{logicLabelstyle}[\small]{\def\psk@logic@labelstyle{#1}}% hv
\define@key[psset]{pst-circ}{logicSymbolstyle}[\large]{\def\psk@logic@symbolstyle{#1}}% hv
\define@key[psset]{pst-circ}{logicSymbolpos}[0.5]{\def\psk@logic@symbolpos{#1}}% hv
\define@key[psset]{pst-circ}{logicNodestyle}[\footnotesize]{\def\psk@logic@nodestyle{#1}}% hv

%
\def\pst@logic@type@and{and}
\def\pst@logic@type@or{or}
\def\pst@logic@type@nand{nand}
\def\pst@logic@type@nor{nor}
\def\pst@logic@type@not{not}
\def\pst@logic@type@exor{exor}
\def\pst@logic@type@exnor{exnor}
%
\def\pst@logic@type@RS{RS}
\def\pst@logic@type@D{D}
\def\pst@logic@type@JK{JK}
%
\psset[pst-circ]{%
  labelInside=0,circedge=\pcangle,
  intensity=false,intensitylabel={},
  intensitylabeloffset=0.5,
  intensitycolor=black,intensitylabelcolor=black,intensitywidth=\pslinewidth,
  tension=false,tensionlabel={},tensionoffset=1,tensionlabeloffset=1.2,
  tensioncolor=black,tensionlabelcolor=black,tensionwidth=\pslinewidth,
  labeloffset=0.7,labelangle=0,dipoleconvention=receptor,directconvention=true,dipolestyle=normal
  parallel=false,parallelarm=1.5,parallelsep=0,parallelnode=false,
  intersect=false,OAperfect=true,OAinvert=true,
  OAiplus=false,OAiminus=false,OAiout=false,OAipluslabel={},
  OAiminuslabel={},OAioutlabel={},OApower=false,%
  transistorcircle=true, transistorinvert=false, % hv 2003-07-23
  transistoribase=false,transistoricollector=false,transistoriemitter=false,%
  transistoribaselabel={},basesep=0pt,
  transistoricollectorlabel={},transistoriemitterlabel={},
  transistortype=NPN,TRot=0,%
  FETmemory=false,						% atosch
  primarylabel={},secondarylabel={},transformeriprimary=false,transformerisecondary=false,
  transformeriprimarylabel={},transformerisecondarylabel={},
  tripolestyle=normal,variable=false,
  logicShowDot=false, logicShowNode=false, logicChangeLR=false, % hv
  logicWireLength=0.5, logicWidth=1.5, logicHeight=2.5,       	% hv
  logicNInput=2, logicJInput=2, logicKInput=2, logicType=and, 	% hv
  logicLabelstyle=\small, logicSymbolstyle=\large,
  logicSymbolpos=0.5,logicNodestyle=\footnotesize
}% hv

%
\newpsstyle{baseOpt}{circedge=\pcline,arrows=-,arm=.5,angleA=0,angleB=180}
\newpsstyle{emitterOpt}{arrows=-,arm=.5,angleA=180,angleB=-90}%
\newpsstyle{collectorOpt}{arrows=-,arm=.5,angleA=180,angleB=90}
%
\def\wire{\@ifnextchar[{\pst@draw@wire}{\pst@draw@wire[]}}
\def\tension{\@ifnextchar[{\pst@draw@tension@}{\pst@draw@tension@[]}}
%
\def\RFLine{\@ifnextchar[{\pst@RFLine}{\pst@RFLine[]}}
\def\pst@RFLine[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@RFLine}\ignorespaces}
%
\def\resistor{\@ifnextchar[{\pst@resistor}{\pst@resistor[]}}
\def\pst@resistor[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@resistor}\ignorespaces}
%
\def\capacitor{\@ifnextchar[{\pst@capacitor}{\pst@capacitor[]}}
\def\pst@capacitor[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@capacitor}\ignorespaces}
%
\def\battery{\@ifnextchar[{\pst@battery}{\pst@battery[]}}
\def\pst@battery[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@battery}\ignorespaces}
%
\def\coil{\@ifnextchar[{\pst@coil}{\pst@coil[]}}
\def\pst@coil[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@coil}\ignorespaces}
%
\def\Ucc{\@ifnextchar[{\pst@Ucc}{\pst@Ucc[]}}
\def\pst@Ucc[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@Ucc}\ignorespaces}
%
\def\Icc{\@ifnextchar[{\pst@Icc}{\pst@Icc[]}}
\def\pst@Icc[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@Icc}\ignorespaces}
%
\def\switch{\@ifnextchar[{\pst@switch}{\pst@switch[]}}
\def\pst@switch[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@switch}\ignorespaces}
%
\def\diode{\@ifnextchar[{\pst@diode}{\pst@diode[]}}
\def\pst@diode[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@diode}\ignorespaces}
%
\def\Zener{\@ifnextchar[{\pst@Zener}{\pst@Zener[]}}
\def\pst@Zener[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@Zener}\ignorespaces}
%
\def\lamp{\@ifnextchar[{\pst@lamp}{\pst@lamp[]}}
\def\pst@lamp[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@lamp}\ignorespaces}
%
\def\circledipole{\@ifnextchar[{\pst@circledipole}{\pst@circledipole[]}}
\def\pst@circledipole[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@circledipole}\ignorespaces}
%
\def\LED{\@ifnextchar[{\pst@LED}{\pst@LED[]}}
\def\pst@LED[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@LED}\ignorespaces}
%
% pd start ====================================================
\def\dashpot{\@ifnextchar[{\pst@dashpot}{\pst@dashpot[]}}
\def\pst@dashpot[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@dashpot}\ignorespaces}
% pd end ======================================================
%
\def\OA{\pst@object{OA}}
\def\OA@i(#1)(#2)(#3){%
  \addbefore@par{dimen=middle}%
  \begin@ClosedObj%
  \if\psk@label@OAiplus\@empty\else\psset{OAiplus=true}\fi%
  \if\psk@label@OAiminus\@empty\else\psset{OAiminus=true}\fi%
  \if\psk@label@OAiout\@empty\else\psset{OAiout=true}\fi%
  \ifPst@intensity\psset{OAiplus=true,OAiminus=true,OAiout=true}\fi%
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /XC X1 X2 lt {X3 X2} {X3 X1} ifelse add 2 div def
    /YC Y1 Y2 add 2 div def
    XC YC){C@}
  \rput(C@){\pst@draw@OA}
  \ncangle[arrows=-,arm=.5,angleA=0,angleB=180]{#1}{\ifPst@OAinvert Minus@\else Plus@\fi}
  \ncput[npos=2]{\pnode{\ifPst@OAinvert Minus@@\else Plus@@\fi}}
  \ifPst@OAiplus
    \ifPst@OAinvert\else
      \ncput[npos=2.5]{%
        \psline[linecolor=\psk@I@color,
          linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
      \naput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@label@OAiplus}
    \fi
  \fi
  \ifPst@OAiminus
    \ifPst@OAinvert
      \ncput[npos=2.5]{%
        \psline[linecolor=\psk@I@color,
          linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
      \naput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@label@OAiminus}
    \fi
  \fi
  \ncangle[arrows=-,arm=.5,angleA=0,angleB=180]{#2}{\ifPst@OAinvert Plus@\else Minus@\fi}
  \ncput[npos=2]{\pnode{\ifPst@OAinvert Plus@@\else Minus@@\fi}}
  \ifPst@OAiplus
    \ifPst@OAinvert
      \ncput[npos=2.5]{%
        \psline[linecolor=\psk@I@color,
          linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
      \nbput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@label@OAiplus}
    \fi
  \fi
  \ifPst@OAiminus
    \ifPst@OAinvert\else
      \ncput[npos=2.5]{%
        \psline[linecolor=\psk@I@color,
          linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
      \nbput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@label@OAiminus}
    \fi
  \fi
  \ncangle[arrows=-,arm=.5,angleA=180,angleB=0]{#3}{S@}
  \ncput[npos=2]{\pnode{S@@}}
  \ifPst@OAiout
    \ncput[npos=2.5]{%
      \psline[linecolor=\psk@I@color,
        linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
    \naput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@label@OAiout}
  \fi
  \psline[linestyle=none](#1)(#2)% for the end arrows
  \psline[linestyle=none](#1)(#3)% for the end arrows
  \end@ClosedObj
  \ignorespaces%
}
%
\newif\ifPst@temp
\def\transistor{\def\pst@par{}\pst@object{transistor}}
\def\transistor@i(#1){%
%  \addbefore@par{circedge=\pcangle}
  \pst@killglue
  \begingroup
  \use@par%
  \@ifnextchar({\transistor@iii(#1)}{\Pst@tempfalse\transistor@ii(#1)}}
%
\def\transistor@ii(#1)#2#3{% with one node, the base
  \pst@killglue%
  \ifPst@temp\pnode(#1){TBaseNode}%
  \else%
    \pst@getcoor{#1}\pst@tempA%
    \pnode(!
      \pst@tempA /YB exch \pst@number\psyunit div def
      /XB exch \pst@number\psxunit div def
      /basesep \Pst@basesep\space \pst@number\psxunit div def
      XB basesep \Pst@TRot\space cos mul add
      YB basesep \Pst@TRot\space sin mul add){TBaseNode}% base node
  \fi%
  \psdot(#1)%
  \rput[c]{\Pst@TRot}(TBaseNode){%(#1){%
    \ifPst@transistorcircle\pscircle(0.3,0){0.7}\fi%
    \ifx\psk@Ttype\pst@Ttype@FET\relax%
      \ifPst@FETmemory% atosch
        \psline[arrows=-,linewidth=\psk@I@width](-0.15,0.5)(-0.15,-0.5)%
      \fi%
      \psline[arrows=-,linewidth=\psk@I@width](TBaseNode|0,0.5)(TBaseNode|0,-0.5)%
    \else%
      \psline[arrows=-,linewidth=4\pslinewidth](TBaseNode|0,0.4)(TBaseNode|0,-0.4)%
    \fi%
    \ifnum180=\Pst@TRot\relax%
      \ifx\psk@Ttype\pst@Ttype@FET\relax%
        \ifPst@transistorinvert\pnode(0.75,-0.5){#2}\else\pnode(0.75,-0.5){#3}\fi%
        \ifPst@transistorinvert\pnode(0.75,0.5){#3}\else\pnode(0.75,0.5){#2}\fi%
      \else%
        \ifPst@transistorinvert\pnode(0.5,-0.5){#2}\else\pnode(0.5,-0.5){#3}\fi%
        \ifPst@transistorinvert\pnode(0.5,0.5){#3}\else\pnode(0.5,0.5){#2}\fi%
      \fi%
    \else%
      \ifx\psk@Ttype\pst@Ttype@FET\relax%
        \ifPst@transistorinvert\pnode(0.65,0.5){#2}\else\pnode(0.65,0.5){#3}\fi%
        \ifPst@transistorinvert\pnode(0.65,-0.5){#3}\else\pnode(0.65,-0.5){#2}\fi%
      \else%
        \ifPst@transistorinvert\pnode(0.5,0.5){#2}\else\pnode(0.5,0.5){#3}\fi%
        \ifPst@transistorinvert\pnode(0.5,-0.5){#3}\else\pnode(0.5,-0.5){#2}\fi%
      \fi%
    \fi%
    \ifx\psk@Ttype\pst@Ttype@FET\relax%
      \ifnum180=\Pst@TRot\relax
        \psline[arrows=-](0.6,0.5)(0.05,0.5)(0.05,-0.5)(0.6,-0.5)%
      \else 
        \psline[arrows=-](0.65,0.5)(0.15,0.5)(0.15,-0.5)(0.65,-0.5)%
      \fi%
    \else%
      \psline[arrows=-](0.5,0.5)(TBaseNode)(0.5,-0.5)%
    \fi%
    \ifx\psk@Ttype\pst@Ttype@FET\relax%
%      \ifx\psk@Ttype\pst@Ttype@PNP\relax%
      \ifx\psk@FETchanneltype\pst@FETchanneltype@P\relax% Ted 2007-10-15
        \psline[origin={#3},arrowinset=0,arrowsize=8\pslinewidth]{->}(-0.5,0)%
      \else%
        \psline[origin={#2},arrowinset=0,arrowsize=8\pslinewidth]{<-}(-0.5,0)%
      \fi%
    \else%
      \ifx\psk@Ttype\pst@Ttype@PNP\relax%
        \psline[arrowinset=0,arrowsize=8\pslinewidth]{->}(#3)(TBaseNode)%
      \else%
         \psline[arrowinset=0,arrowsize=8\pslinewidth]{->}(TBaseNode)(#2)%
      \fi%
    \fi%
  }%
  \ifPst@temp\else\endgroup\fi%
  \ignorespaces%
}
%
\def\transistor@iii(#1)(#2)(#3){% with three nodes
  \pst@getcoor{#1}\pst@tempA%
  \pst@getcoor{#2}\pst@tempB%
  \pst@getcoor{#3}\pst@tempC%
  \pnode(!%
    \pst@tempA /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempB /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempC /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /LR X1 X2 lt { false }{ true } ifelse def % change left-right
    /basesep \Pst@basesep\space \pst@number\psxunit div def
    /XBase X1 basesep \Pst@TRot\space cos mul add def
    /YBase Y1 basesep \Pst@TRot\space sin mul add def
    XBase YBase ){@@base}% base node
%
  \Pst@temptrue%
  \transistor@ii(@@base){@@emitter}{@@collector}%
%
  \if\psk@labeltransistoribase\@empty\else\psset{transistoribase=true}\fi%
  \if\psk@labeltransistoriemitter\@empty\else\psset{transistoriemitter=true}\fi%
  \if\psk@labeltransistoricollector\@empty\else\psset{transistoricollector=true}\fi%
  \ifPst@intensity\psset{transistoribase=true,transistoriemitter=true,transistoricollector=true}\fi%
%
  \bgroup\psset{style=baseOpt}\pscirc@edge(#1)(TBaseNode)\egroup%
  \ifPst@transistoribase% base current?
    \ncput[npos=0.5,nrot=\Pst@TRot]{%
      \psline[linecolor=\psk@I@color,linewidth=\psk@I@width,%
        arrowsize=6\pslinewidth,arrowinset=0]{->}(-.1,0)(.1,0)}%
    \naput[npos=0.5]{\csname\psk@I@labelcolor\endcsname\psk@labeltransistoribase}%
  \fi%
  \bgroup%
    \psset{style=collectorOpt}%
    \ifPst@transistorinvert\pscirc@edge(#3)(@@emitter)\else\pscirc@edge(#3)(@@collector)\fi%
  \egroup%
  \ncput[npos=2]{\pnode{\ifPst@transistorinvert @@emitter\else @@collector\fi}}%
  \ifPst@transistoriemitter% emitter current?
    \ifPst@transistorinvert% emitter/collector changed?
      \ncput[npos=\pscirc@edge@sector,nrot=:U]{%
        \psline[linecolor=\psk@I@color,linewidth=\psk@I@width,%
    arrowsize=6\pslinewidth,arrowinset=0]{->}(-0.1,0)(0.1,0)}
      \nbput[npos=\pscirc@edge@sector]{\csname\psk@I@labelcolor\endcsname\psk@labeltransistoriemitter}
    \fi\fi%
  \ifPst@transistoricollector% collector current?
    \ifPst@transistorinvert\else% emitter/collector changed?
      \ncput[npos=\pscirc@edge@sector,nrot=:U]{%
        \psline[linecolor=\psk@I@color,linewidth=\psk@I@width,%
    arrowsize=6\pslinewidth,arrowinset=0]{->}(-.1,0)(.1,0)}
      \nbput[npos=\pscirc@edge@sector]{\csname\psk@I@labelcolor\endcsname\psk@labeltransistoricollector}
    \fi\fi%
  \bgroup
  \psset{style=emitterOpt}
  \ifPst@transistorinvert\pscirc@edge(#2)(@@collector)\else\pscirc@edge(#2)(@@emitter)\fi
  \egroup
  \ncput[npos=2]{\pnode{\ifPst@transistorinvert @@collector\else @@emitter\fi}}
  \ifPst@transistoriemitter
    \ifPst@transistorinvert\else
      \ncput[npos=\pscirc@edge@sector,nrot=:U]{%
        \psline[linecolor=\psk@I@color,linewidth=\psk@I@width,
    arrowsize=6\pslinewidth,arrowinset=0]{<-}(-.1,0)(.1,0)}
      \naput[npos=\pscirc@edge@sector]{\csname\psk@I@labelcolor\endcsname\psk@labeltransistoriemitter}
    \fi\fi%
  \ifPst@transistoricollector% collector current?
    \ifPst@transistorinvert% emitter/collector changed?
      \ncput[npos=\pscirc@edge@sector,nrot=:U]{%
        \psline[linecolor=\psk@I@color,linewidth=\psk@I@width,
    arrowsize=6\pslinewidth,arrowinset=0]{<-}(-.1,0)(.1,0)}
      \naput[npos=\pscirc@edge@sector]{\csname\psk@I@labelcolor\endcsname\psk@labeltransistoricollector}
    \fi\fi
  \psline[linestyle=none](#1)(#2)% for the end arrows
  \psline[linestyle=none](#1)(#3)% for the end arrows
  \endgroup
  \ignorespaces%
}
%
\def\Tswitch{\pst@object{Tswitch}}
\def\Tswitch@i(#1)(#2)(#3)#4{%
  \addbefore@par{dimen=middle}%
  \begin@ClosedObj
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /XC X1 X2 add 2 div def
    /YC Y2 def
    XC YC){C@}
  \rput(C@){\pst@draw@Tswitch}
  \ncangle[arrows=-,arm=0.5,angleB=180]{#1}{Tswi@left}
  \ncangle[arrows=-,arm=0.5,angleB=0]{#2}{Tswi@right}
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#3}{Tswi@center}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{Tswi@left}{Tswi@right}
  \naput{#4}
  \pcline[linestyle=none](#1)(#2)% for the endarrows
  \pcline[linestyle=none](#2)(#3)% for the endarrows
  \end@ClosedObj
  \ignorespaces%
}
%
% 20030830 hv
%
\def\potentiometer{\pst@object{potentiometer}}
\def\potentiometer@i(#1)(#2)(#3)#4{%
  \begin@ClosedObj
    \resistor(#1)(#2){#4}
    \pst@getcoor{#1}\pst@tempa
    \pst@getcoor{#2}\pst@tempb
    \pst@getcoor{#3}\pst@tempc
    \pnode(!%
        \pst@tempa /Y1 exch \pst@number\psyunit div def
        /X1 exch \pst@number\psxunit div def
        \pst@tempb /Y2 exch \pst@number\psyunit div def
        /X2 exch \pst@number\psxunit div def
        \pst@tempc /Y3 exch \pst@number\psyunit div def
        /X3 exch \pst@number\psxunit div def
        /dx X2 X1 sub def
        /dy Y2 Y1 sub def
        dx 2 div X1 add
        dy 2 div Y1 add ){Center@}
    \pst@getcoor{Center@}\pst@tempd
    \pnode(!%
        \pst@tempd /Y4 exch \pst@number\psyunit div def
        /X4 exch \pst@number\psxunit div def
        dx abs 0.01 lt{
            X3 Y4
        }{dy abs 0.01 lt {
            X4 Y3
            }{/m dy dx div def
                /x Y4 Y3 sub m X3 mul add X4 m div add m 1 m div add div def
                x dup X3 sub m mul Y3 add
            } ifelse
        }ifelse){@tempNodeB}
    \pnode(!%
        /Alpha dy dx atan def
        /dx Alpha sin 0.25 mul def
        /dy Alpha cos 0.25 mul def
        Y3 Y2 gt {X4 dx sub Y4 dy add}{X4 dx add Y4 dy sub}ifelse ){@tempNodeC}
    \psline[arrows=->,arrowsize=0.2](#3)(@tempNodeB)(@tempNodeC)
    \pcline[linestyle=none](#1)(#3)% for the endarrows
  \end@ClosedObj%
  \ignorespaces%
}
%
% quadrupoles
%
\def\transformer{\pst@object{transformer}}
\def\transformer@i(#1)(#2)(#3)(#4)#5{%
  \addbefore@par{dimen=middle,arm=0}%
  \begin@ClosedObj%
  \if\psk@Trafo@iprimary@label\@empty\else
    \psset{transformeriprimary=true}%
  \fi
  \if\psk@Trafo@isecondary@label\@empty\else
    \psset{transformerisecondary=true}%
  \fi
  \ifPst@intensity
    \psset{transformeriprimary=true,transformerisecondary=true}%
  \fi
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pst@getcoor{#4}\pst@tempd
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    \pst@tempc /Y4 exch \pst@number\psyunit div def
    /X4 exch \pst@number\psxunit div def
    /XC X1 X2 lt {X2} {X1} ifelse X3 X4 lt {X3} {X4} ifelse add 2 div def
    /YC Y1 Y3 lt {Y1} {Y3} ifelse Y2 Y4 lt {Y2} {Y4} ifelse add 2 div def
    XC YC){C@}
  \rput(C@){\pst@draw@transformer}
  \ncangle[arrows=-,arm=0.5,angleB=90]{#1}{inup@}
  \ifPst@Trafo@iprimary
    \ncput[npos=2.5,nrot=:U]{\psline[linecolor=\psk@I@color,
      linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
    \nbput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@Trafo@iprimary@label}
  \fi
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#2}{indown@}
  \ncangle[arrows=-,arm=0.5,angleB=90]{#3}{outup@}
  \ifPst@Trafo@iprimary
    \ncput[npos=2.5,nrot=:U]{\psline[linecolor=\psk@I@color,
      linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
    \naput[npos=2.5]{\csname\psk@I@labelcolor\endcsname\psk@Trafo@isecondary@label}
  \fi
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#4}{outdown@}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{indown@}{inup@}
  \naput{\psk@Trafo@primary@label}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{outdown@}{outup@}
  \nbput{\psk@Trafo@secondary@label}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{indown@}{outdown@}
  \nbput{#5}
  \pcline[linestyle=none](#1)(#3)% for the end arrows
  \pcline[linestyle=none](#2)(#4)% for the end arrows
  \end@ClosedObj%
  \ignorespaces%
}
%
% Start hv 2003-07-23
\def\optoCoupler{\pst@object{optoCoupler}}
\def\optoCoupler@i(#1)(#2)(#3)(#4)#5{%
  \addbefore@par{dimen=middle,arm=0}%
  \begin@ClosedObj%
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pst@getcoor{#4}\pst@tempd
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    \pst@tempc /Y4 exch \pst@number\psyunit div def
    /X4 exch \pst@number\psxunit div def
    /XC X1 X2 lt {X2} {X1} ifelse X3 X4 lt {X3} {X4} ifelse add 2 div def
    /YC Y1 Y3 lt {Y1} {Y3} ifelse Y2 Y4 lt {Y2} {Y4} ifelse add 2 div def
    XC YC){C@}
  \rput(C@){\pst@draw@optoCoupler}
  \ncangle[arrows=-,arm=0.5,angleB=90]{#1}{inup@}
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#2}{indown@}
  \ncangle[arrows=-,arm=0.5,angleB=90]{#3}{outup@}
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#4}{outdown@}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{indown@}{outdown@}
  \nbput{#5}
  \pcline[linestyle=none](#1)(#3)% for the end arrows
  \pcline[linestyle=none](#2)(#4)% for the end arrows
  \end@ClosedObj%
  \ignorespaces%
}
%
% The logical circuits part
%
\def\logic{\@ifnextchar[{\pst@draw@logic}{\pst@draw@logic[]}}
%
\def\ground{\@ifnextchar[{\pst@ground}{\pst@ground[]}}
\def\pst@ground[#1]{%
    \@ifnextchar({\pst@groundi[#1]{0}}{\pst@groundi[#1]}%
}
\def\pst@groundi[#1]#2(#3){{%
    \psset{#1}%
    \rput{#2}(#3){%
        \psframe[fillstyle=vlines,%
            linestyle=none,%
            fillstyle=none,%
            hatchwidth=0.5\pslinewidth](-0.5,-0.7)(0.5,-0.5)
        \psline[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,-0.5)
        \psline(0,0)(0,-0.5)
         \ifPst@connectingdot
            \pscircle*(0,0){2\pslinewidth}
        \fi
    }
    \ignorespaces%
}}
%
% end hv 2003-08-29
%
%% SQUID def added 2009-02-18 Amit Finkler
\def\SQUID{\@ifnextchar[{\pst@SQUID}{\pst@SQUID[]}}
\def\pst@SQUID[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@SQUID}\ignorespaces}
%
\def\pst@multidipole@SQUID{\@ifnextchar[{\pst@multidipole@SQUID@}{\pst@multidipole@SQUID@[]}}
%
\def\pst@multidipole@SQUID@[#1]#2{%
  \expandafter\def\csname pst@circ@tmp@\number\pst@circ@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@circ@parallel\aftergroup\advance\aftergroup\pst@circ@count@i\aftergroup\
     m@ne\fi}%
  \pst@circ@count@ii=\pst@circ@count@i%
  \advance\pst@circ@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\SQUID[#1]%
  (! X@\the\pst@circ@count@i\space Y@\the\pst@circ@count@i)%
  (! X@\the\pst@circ@count@ii\space Y@\the\pst@circ@count@ii)%
      {\noexpand\csname pst@circ@tmp@\number\pst@circ@count@iii\endcsname}%
  }%
  \pst@multidipole@}
%
\def\pst@draw@SQUID{%
  \pscircle[linewidth=1.5\pslinewidth](0,0){0.5}
  \psline(0.1,-0.6)(-0.1,-0.4)
  \psline(0.1,-0.4)(-0.1,-0.6)
  \psline(0.1,0.6)(-0.1,0.4)
  \psline(0.1,0.4)(-0.1,0.6)
  \pnode(-0.5,0){dipole@1}
  \pnode(0.5,0){dipole@2}%
}
%% End of SQUID def

%
%%%%%%%%%%%%%
\def\multidipole{\@ifnextchar[{\pst@multidipole}{\pst@multidipole[]}}
\def\pst@multidipole[#1](#2)(#3)#4{%
  \psset{#1}%
  \pst@getcoor{#2}\pst@tempA
  \pst@getcoor{#3}\pst@tempB
  \pst@Verb{%
    gsave
      STV CP T
      \pst@tempA /Ybegin@ exch \pst@number\psyunit div def
      /Xbegin@ exch \pst@number\psxunit div def
      \pst@tempB /Yend@ exch \pst@number\psyunit div def
      /Xend@ exch \pst@number\psxunit div def
      /Xbegin Xbegin@ Xend@ lt {Xbegin@} {Xend@} ifelse def
      /Xend Xbegin@ Xend@ lt {Xend@} {Xbegin@} ifelse def
      /Ybegin Ybegin@ Yend@ lt {Ybegin@} {Yend@} ifelse def
      /Yend Ybegin@ Yend@ lt {Yend@} {Ybegin@} ifelse def
      /@angle Yend Ybegin sub Xend Xbegin sub Atan def
      /X@length Xend Xbegin sub Yend Ybegin sub Pyth @angle cos mul Xend@ Xbegin@ lt {neg} if def
      /Y@length Xend Xbegin sub Yend Ybegin sub Pyth @angle sin mul Yend@ Ybegin@ lt {neg} if def
    grestore}%
  \pst@count@i=\z@
  \let\pst@multidipole@output\@empty
  \ifx\resistor         #4\let\pscirc@next\pst@multidipole@resistor%       1
  \else\ifx\RFLine      #4\let\pscirc@next\pst@multidipole@RFLine
  \else\ifx\capacitor   #4\let\pscirc@next\pst@multidipole@capacitor
  \else\ifx\battery     #4\let\pscirc@next\pst@multidipole@battery
  \else\ifx\coil        #4\let\pscirc@next\pst@multidipole@coil
  \else\ifx\Ucc         #4\let\pscirc@next\pst@multidipole@Ucc
  \else\ifx\Icc         #4\let\pscirc@next\pst@multidipole@Icc
  \else\ifx\switch      #4\let\pscirc@next\pst@multidipole@switch
  \else\ifx\diode       #4\let\pscirc@next\pst@multidipole@diode
  \else\ifx\Zener       #4\let\pscirc@next\pst@multidipole@Zener%       10
  \else\ifx\wire        #4\let\pscirc@next\pst@multidipole@wire
  \else\ifx\lamp        #4\let\pscirc@next\pst@multidipole@lamp
  \else\ifx\circledipole#4\let\pscirc@next\pst@multidipole@circledipole
  \else\ifx\LED         #4\let\pscirc@next\pst@multidipole@LED
  \else\ifx\dashpot     #4\let\pscirc@next\pst@multidipole@dashpot	%15
  \else\ifx\filter      #4\let\pscirc@next\pst@multidipole@filter
  \else\ifx\isolator    #4\let\pscirc@next\pst@multidipole@isolator%   
  \else\ifx\freqmult    #4\let\pscirc@next\pst@multidipole@freqmult%   
  \else\ifx\phaseshifter#4\let\pscirc@next\pst@multidipole@phaseshifter% 
  \else\ifx\vco         #4\let\pscirc@next\pst@multidipole@vco %   	20
  \else\ifx\amplifier   #4\let\pscirc@next\pst@multidipole@amplifier%   
  \else\ifx\detector    #4\let\pscirc@next\pst@multidipole@detector%   22
  \else\ifx\SQUID       #4\let\pscirc@next\pst@multidipole@SQUID%   23
  \else\let\pscirc@next\ignorespaces
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% 1..10
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%11..20 
  \fi\fi\fi%			 21..23
  \advance\pst@count@i\@ne
  \advance\pst@count@iii\@ne
  \pscirc@next}
%
\def\pst@multidipole@#1{%
  \ifx\resistor#1\let\pscirc@next\pst@multidipole@resistor	%1
  \else\ifx\RFLine#1\let\pscirc@next\pst@multidipole@RFLine
  \else\ifx\capacitor#1\let\pscirc@next\pst@multidipole@capacitor
  \else\ifx\battery#1\let\pscirc@next\pst@multidipole@battery
  \else\ifx\coil#1\let\pscirc@next\pst@multidipole@coil		%5
  \else\ifx\Ucc      #1\let\pscirc@next\pst@multidipole@Ucc
  \else\ifx\Icc      #1\let\pscirc@next\pst@multidipole@Icc
  \else\ifx\switch   #1\let\pscirc@next\pst@multidipole@switch %off
  \else\ifx\diode#1\let\pscirc@next\pst@multidipole@diode
  \else\ifx\Zener    #1\let\pscirc@next\pst@multidipole@Zener	%10
  \else\ifx\wire     #1\let\pscirc@next\pst@multidipole@wire
  \else\ifx\lamp     #1\let\pscirc@next\pst@multidipole@lamp
  \else\ifx\circledipole#1\let\pscirc@next\pst@multidipole@circledipole
  \else\ifx\LED      #1\let\pscirc@next\pst@multidipole@LED
  \else\ifx\dashpot  #1\let\pscirc@next\pst@multidipole@dashpot	%15
  \else\ifx\filter   #1\let\pscirc@next\pst@multidipole@filter
  \else\ifx\isolator #1\let\pscirc@next\pst@multidipole@isolator
  \else\ifx\freqmult #1\let\pscirc@next\pst@multidipole@freqmult%   
  \else\ifx\phaseshifter#1\let\pscirc@next\pst@multidipole@phaseshifter% 
  \else\ifx\vco      #1\let\pscirc@next\pst@multidipole@vco %   	20
  \else\ifx\amplifier#1\let\pscirc@next\pst@multidipole@amplifier%   
  \else\ifx\detector #1\let\pscirc@next\pst@multidipole@detector%   22
  \else\ifx\SQUID    #1\let\pscirc@next\pst@multidipole@SQUID%   23
  \else\let\pscirc@next\ignorespaces\pst@multidipole@output
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  \fi\fi\fi
  \advance\pst@count@i\@ne
  \advance\pst@count@iii\@ne
  \pscirc@next
}
%
\def\pst@multidipole@resistor{\@ifnextchar[{\pst@multidipole@resistor@}{\pst@multidipole@resistor@[]}}
%
\def\pst@multidipole@resistor@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\resistor[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@RFLine{\@ifnextchar[{\pst@multidipole@RFLine@}{\pst@multidipole@RFLine@[]}}
\def\pst@multidipole@RFLine@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\RFLine[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
% pd start ====================================================
\def\pst@multidipole@dashpot{\@ifnextchar[{\pst@multidipole@dashpot@}{\pst@multidipole@dashpot@[]}}
%
\def\pst@multidipole@dashpot@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\dashpot[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
% pd end ======================================================
\def\pst@multidipole@capacitor{\@ifnextchar[{\pst@multidipole@capacitor@}{\pst@multidipole@capacitor@[]}}
%
\def\pst@multidipole@capacitor@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\capacitor[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@battery{\@ifnextchar[{\pst@multidipole@battery@}{\pst@multidipole@battery@[]}}
%
\def\pst@multidipole@battery@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\battery[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@coil{\@ifnextchar[{\pst@multidipole@coil@}{\pst@multidipole@coil@[]}}
%
\def\pst@multidipole@coil@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\coil[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@Ucc{\@ifnextchar[{\pst@multidipole@Ucc@}{\pst@multidipole@Ucc@[]}}
%
\def\pst@multidipole@Ucc@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\Ucc[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@Icc{\@ifnextchar[{\pst@multidipole@Icc@}{\pst@multidipole@Icc@[]}}
%
\def\pst@multidipole@Icc@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\Icc[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@switch{\@ifnextchar[{\pst@multidipole@switch@}{\pst@multidipole@switch@[]}}
%
\def\pst@multidipole@switch@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\switch[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@diode{\@ifnextchar[{\pst@multidipole@diode@}{\pst@multidipole@diode@[]}}
%
\def\pst@multidipole@diode@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\diode[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@Zener{\@ifnextchar[{\pst@multidipole@Zener@}{\pst@multidipole@Zener@[]}}
\def\pst@multidipole@Zener@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\Zener[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@lamp{\@ifnextchar[{\pst@multidipole@lamp@}{\pst@multidipole@lamp@[]}}
%
\def\pst@multidipole@lamp@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\lamp[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@circledipole{\@ifnextchar[{\pst@multidipole@circledipole@}{\pst@multidipole@circledipole@[]}}
%
\def\pst@multidipole@circledipole@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\circledipole[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@LED{\@ifnextchar[{\pst@multidipole@LED@}{\pst@multidipole@LED@[]}}
%
\def\pst@multidipole@LED@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\LED[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@wire{\@ifnextchar[{\pst@multidipole@wire@}{\pst@multidipole@wire@[]}}
%
\def\pst@multidipole@wire@[#1]{%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i
  \advance\pst@count@ii\@ne
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0
    \pst@multidipole@def@coor
    \noexpand\wire[#1]%
      (! X@\the\pst@count@i\space Y@\the\pst@count@i)(! X@\the\pst@count@ii\space Y@\the\pst@count@ii)
  }%
  \pst@multidipole@
}
%
\def\pst@multidipole@def@coor{%
  \noexpand\pst@Verb{%
    /X@\the\pst@count@i\space \the\pst@count@i\space 1 sub X@length \noexpand\the\pst@count@i\space div mul Xbegin@ add def
    /Y@\the\pst@count@i\space \the\pst@count@i\space 1 sub Y@length \noexpand\the\pst@count@i\space div mul Ybegin@ add def
    /X@\the\pst@count@ii\space \the\pst@count@i\space X@length \noexpand\the\pst@count@i\space div mul Xbegin@ add def
    /Y@\the\pst@count@ii\space \the\pst@count@i\space Y@length \noexpand\the\pst@count@i\space div mul Ybegin@ add def
    }%
\ignorespaces}
%
%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\pst@draw@dipole#1#2#3#4#5{%   suggestion by Alain Ristow
  \psset{dimen=middle,#1}%
  \if\psk@I@label\@empty\else\psset[pst-circ]{intensity=true}\fi
  \if\psk@tension@label\@empty\else\psset[pst-circ]{tension=true}\fi
  \ifx\psk@Dconvention\pst@Dconvention@generator
     \Pst@Dconventiontrue
  \else
     \ifx\psk@Dconvention\pst@Dconvention@receptor\Pst@Dconventionfalse\fi
  \fi
  \pcline[arrowscale=1,arrows=-,linestyle=none,fillstyle=none](#2)(#3)
  \ncput[nrot=:U]{\pnode{dipole@M}}
  \ifPst@parallel
     \pcline[arrows=-,linestyle=none,fillstyle=none](#2)(dipole@M)
     \ncput[npos=\psk@parallel@sep]{\pnode{dipole@@1}}
     \pcline[arrows=-,linestyle=none,fillstyle=none](#3)(dipole@M)
     \ncput[npos=\psk@parallel@sep]{\pnode{dipole@@2}}
     \pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk@parallel@arm](dipole@@1)(dipole@@2)
     \ncput[npos=0]{\pnode{dipole@@@1}}
     \ncput[npos=1]{\pnode{dipole@@@2}}
     \ncput[nrot=:U]{#5}
     \pcline[arrows=-](dipole@@1)(dipole@@@1)
     \pcline[arrows=-](dipole@@@1)(dipole@1)
     \pcline[arrows=-](dipole@2)(dipole@@@2)
     \pcline[arrows=-](dipole@@@2)(dipole@@2)
     \ifPst@parallel@node
       \pscircle*(dipole@@1){2\pslinewidth}
       \pscircle*(dipole@@2){2\pslinewidth}
     \fi
     \pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk@label@offset](dipole@@@1)(dipole@@@2)
     \ncput[nrot=\psk@label@angle]{#4}
     \pst@intensity{dipole@@@1}{dipole@@@2}
     \pst@tension{dipole@@@1}{dipole@@@2}
   \else
     \ncput[nrot=:U]{#5}
     \pcline[arrowscale=1,arrows=-,linestyle=none,fillstyle=none,offset=\psk@label@offset](#2)(#3)
     \ncput[nrot=\psk@label@angle]{#4}
%%%%%
     \ifPst@inputarrow
        \ifx\psk@Dinput\pst@Dinput@right
            \pcline[fillstyle=none,arrows=-C](#2)(dipole@1)
            \pcline[fillstyle=none,arrows=->,arrowinset=0](#3)(dipole@2)
         \else
            \pcline[fillstyle=none,arrows=->,arrowinset=0](#2)(dipole@1)
            \pcline[fillstyle=none,arrows=C-](dipole@2)(#3)
        \fi
     \else
        \pcline[arrowscale=1,fillstyle=none,arrows=-C](#2)(dipole@1)
        \pcline[arrowscale=1,fillstyle=none,arrows=C-](dipole@2)(#3)
     \fi
     \pcline[fillstyle=none,linestyle=none](#2)(#3)
%%%%%
     \pst@intensity{#2}{#3}
     \pst@tension{#2}{#3}
   \fi%
}%
%
\def\pst@intensity#1#2{%
  \ifPst@intensity
    \ifPst@directconvention
      \pcline[arrows=-,linestyle=none,fillstyle=none](#1)(dipole@1)
      \ncput[nrot=:U]{%
        \psline[linecolor=\psk@I@color,
          linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
      \pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk@I@label@offset](#1)(dipole@1)
      \ncput[nrot=\psk@label@angle]{\csname\psk@I@labelcolor\endcsname\psk@I@label}
    \else
      \pcline[arrows=-,linestyle=none,fillstyle=none](dipole@2)(#2)
      \ncput[nrot=:U]{%
        \psline[linecolor=\psk@I@color,linewidth=\psk@I@width]{<-}(-.1,0)(.1,0)}
      \pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk@I@label@offset](dipole@2)(#2)
      \ncput[nrot=\psk@label@angle]{\csname\psk@I@labelcolor\endcsname\psk@I@label}
    \fi
  \fi
}
%
\def\pst@tension#1#2{%
  \ifPst@tension
    \pcline[arrows=-,linestyle=none,fillstyle=none,%
      offset=\psk@tension@offset](#1)(dipole@1)
    \ncput[npos=.5]{\pnode{tension@1}}
    \pcline[arrows=-,linestyle=none,fillstyle=none,
      offset=-\psk@tension@offset](#2)(dipole@2)
    \ncput[npos=.5]{\pnode{tension@2}}
    \ifPst@directconvention
      \ifPst@Dconvention
        \pcline[linecolor=\psk@tension@color,
          linewidth=\psk@tension@width,arrowinset=0]{<-}(tension@1)(tension@2)
      \else
        \pcline[linecolor=\psk@tension@color,
          linewidth=\psk@tension@width,arrowinset=0]{->}(tension@1)(tension@2)
      \fi
    \else
      \ifPst@Dconvention
        \pcline[linecolor=\psk@tension@color,
          linewidth=\psk@tension@width,arrowinset=0]{->}(tension@1)(tension@2)
      \else
        \pcline[linecolor=\psk@tension@color,
          linewidth=\psk@tension@width,arrowinset=0]{<-}(tension@1)(tension@2)
      \fi
    \fi
    \pcline[arrows=-,linestyle=none,fillstyle=none,%
      offset=\psk@tension@label@offset](dipole@1)(dipole@2)
    \ncput[nrot=\psk@label@angle]{%
  \csname\psk@tension@labelcolor\endcsname\psk@tension@label}
  \fi
}
%
\def\pst@draw@resistor{%
  \ifx\psk@Dstyle\pst@Dstyle@zigzag
    \pnode(-0.75,0){dipole@1}
    \pnode(0.75,0){dipole@2}
    \multips(-0.75,0)(0.5,0){3}{%
      \psline[arrows=-,linewidth=1.5\pslinewidth]%
          (0,0)(0.125,0.25)(0.375,-0.25)(0.5,0)}%
  \else
    \pnode(-0.5,0){dipole@1}\pnode(0.5,0){dipole@2}
    \psframe[linewidth=1.5\pslinewidth](-0.5,-0.25)(0.5,0.25)
  \fi
  \ifPst@variable\psline{->}(-0.5,-0.55)(0.5,0.55)\fi
  \ifx\psk@Dstyle\pst@Dstyle@varistor
    \psline[linewidth=0.8pt](-0.75,-0.55)(-0.5,-0.55)(0.5,0.55)%
  \fi
}
%
\def\pst@draw@RFLine{%
  \pnode(-1.5,0){dipole@1} \pnode(1.5,0){dipole@2}
  \pscustom[arrows=-]{%
    \psellipticarcn(-0.8,0)(0.2,0.3){90}{-90}
    \psline(-0.8,-.3)(0.8,-.3)
    \psellipticarc(0.8,0)(0.2,0.3){-90}{90}
    \psline(-0.8,.3)(0.8,.3)}
  \psellipse(-0.8,0)(0.2,0.3)
  \pcline[arrows=-](dipole@1)(-0.8,0)\pcline[arrows=-](dipole@2)(1,0)}
%
% pd start ====================================================
\def\pst@draw@dashpot{%
  \pnode(0,0){dipole@1}%
  \pnode(0.5,0){dipole@2}%
  \psline[linewidth=1.5\pslinewidth]%
  (-0.5,-0.5)(0.5,-0.5)(0.5,0.5)(-0.5,0.5)%
  \psline[linewidth=1.5\pslinewidth](0,-0.4)(0,0.4)%
}
% pd end ======================================================
\def\pst@draw@capacitor{%
  \bgroup
  \psset{linewidth=1.5\pslinewidth}%
  \ifx\psk@Dstyle\pst@Dstyle@chemical
    \psline[arrows=-](-0.2,-0.5)(-0.2,0.5)
    \psarc[arrows=-](1.1875,0){1.0625}{154.8}{205.2}
    \pnode(-0.2,0){dipole@1}
    \pnode(0.125,0){dipole@2}
  \else
    \ifx\psk@Dstyle\pst@Dstyle@elektorchemical
      \psframe[framearc=0.01,dimen=outer](-0.2284123,0.2743733)(-0.0557103,-0.2743733)
      \psframe[framearc=0.01,dimen=outer,fillstyle=solid,fillcolor=black](0.0557103,0.2743733)(0.2284123,-0.2743733)
      \pnode(-0.2284123,0){dipole@1}
      \pnode(0.2284123,0){dipole@2}
    \else
      \ifx\psk@Dstyle\pst@Dstyle@elektor
        \psframe[framearc=0.01,dimen=outer,fillstyle=solid,fillcolor=black](-0.2284123,0.2743733)(-0.0557103,-0.2743733)
        \psframe[framearc=0.01,dimen=outer,fillstyle=solid,fillcolor=black](0.0557103,0.2743733)(0.2284123,-0.2743733)
        \pnode(-0.2284123,0){dipole@1}
        \pnode(0.2284123,0){dipole@2}
      \else
        \ifx\psk@Dstyle\pst@Dstyle@crystal
          \psline[arrows=-](-0.3,-0.4)(-0.3,0.4)
          \psline[arrows=-](0.3,-0.4)(0.3,0.4)
	  \psframe(-0.2,-0.5)(0.2,0.5)
          \pnode(-0.3,0){dipole@1}
          \pnode(0.3,0){dipole@2}
	\else
          \psline[arrows=-](-0.2,-0.5)(-0.2,0.5)
          \psline[arrows=-](0.2,-0.5)(0.2,0.5)
          \pnode(-0.2,0){dipole@1}
          \pnode(0.2,0){dipole@2}
	\fi
      \fi
    \fi
  \fi
  \ifPst@variable%
    \psline[arrows=->](-0.5,-0.55)(0.5,0.55)%
  \fi
  \egroup
}
%
\def\pst@draw@OA{%
  \ifx\psk@tripole@style\pst@tripole@style@french
    \psframe[linewidth=1.5\pslinewidth](-1,-0.75)(1,0.75)
    \pspolygon(-0.4,-0.2)(-0.4,0.2)(-0.05,0)
  \else
    \pspolygon[arrows=-](-1,-0.75)(-1,0.75)(1,0)(-1,-0.75)
    \ifPst@OApower
      \psline{-o}(0,0.375)(0,0.75)\uput[90](0,0.75){$+$}
      \psline{-o}(0,-0.375)(0,-0.75)\uput[-90](0,-0.75){$-$}
    \fi
  \fi
  \pnode(-1,0.25){\ifPst@OAinvert Minus@\else Plus@\fi}
  \pnode(-1,-0.25){\ifPst@OAinvert Plus@\else Minus@\fi}
  \pnode(1,0){S@}
  \uput{0.1}[0](-1,0.25){\ifPst@OAinvert$-$\else$+$\fi}
  \uput{0.1}[0](-1,-0.25){\ifPst@OAinvert$+$\else$-$\fi}
  \ifPst@OAperfect\rput(0.25,0){$\infty$}\fi%
}
%
\def\pst@draw@battery{%
  \psline[arrows=-,linewidth=1.5\pslinewidth](-0.10,-0.5)(-0.10,0.5)
  \psline[arrows=-,linewidth=3\pslinewidth](0.10,-0.25)(0.10,0.25)
  \pnode(-0.1,0){dipole@1}
  \pnode(0.1,0){dipole@2}
  \ifPst@variable%
    \psline{->}(-0.75,-0.5)(0.75,0.5)%
  \fi
  }
%
\def\pst@draw@coil{%
  \ifx\psk@Dstyle\pst@Dstyle@curved
    \pscurve[arrows=-](-0.7,0)(-0.6,0.3)(-0.35,0)(-0.4,-0.2)
      (-0.5,0)(-0.4,0.3)(-0.15,0)(-0.2,-0.2)(-0.3,0)
      (-0.2,0.3)(0.05,0)(0,-0.2)(-0.1,0)
      (0,0.3)(0.25,0)(0.2,-0.2)(0.1,0)
      (0.2,0.3)(0.45,0)(0.4,-0.2)(0.3,0)
      (0.4,0.3)(0.65,0)(0.6,-0.2)(0.5,0)
    \pnode(-0.7,0){dipole@1}
    \pnode(0.5,0){dipole@2}
  \else
    \ifx\psk@Dstyle\pst@Dstyle@elektor
      \psarcn[arrows=c-](-0.3885794,0){0.1295265}{-180}{0}
      \psarcn(-0.1295265,0){0.1295265}{-180}{0}
      \psarcn(0.1295265,0){0.1295265}{-180}{0}
      \psarcn[arrows=-c](0.3885794,0){0.1295265}{-180}{0}
      \pnode(-0.5181058,0){dipole@1}
      \pnode(0.5181058,0){dipole@2}
    \else
      \ifx\psk@Dstyle\pst@Dstyle@elektorcurved
        \psarcn[arrows=c-c](-0.408167,0.089453){0.211665}{-155}{-410}
        \psarcn[arrows=-c](-0.136056,0.089453){0.211665}{-130}{-410}
        \psarcn[arrows=-c](0.136055,0.089453){0.211665}{-130}{-410}
        \psarcn[arrows=-c](0.408167,0.089453){0.211665}{-130}{-385}
        \pnode(-0.6,0){dipole@1}
        \pnode(0.6,0){dipole@2}
    \else
      \ifx\psk@Dstyle\pst@Dstyle@rectangle
        \pnode(-0.5,0){dipole@1}
        \pnode(0.5,0){dipole@2}
        \psframe[linewidth=1.5\pslinewidth,fillstyle=solid,fillcolor=black](-0.5,-0.25)(0.5,0.25)
    \else
      \pscurve[arrows=-,linewidth=1.5\pslinewidth](-1,0)(-0.75,0.5)(-0.5,0)
      \pscurve[arrows=-,linewidth=1.5\pslinewidth](-0.5,0)(-0.25,0.5)(0,0)
      \pscurve[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.25,0.5)(0.5,0)
      \pscurve[arrows=-,linewidth=1.5\pslinewidth](0.5,0)(0.75,0.5)(1,0)
      \pnode(-1,0){dipole@1}
      \pnode(1,0){dipole@2}
    \fi\fi\fi\fi%
  \ifPst@variable\psline{->}(-0.75,-0.5)(0.75,0.5)\fi%
  }
%
\def\pst@draw@Ucc{%
  \pnode(-0.5,0){dipole@1}
  \pnode(0.5,0){dipole@2}
  \ifx\psk@Dstyle\pst@Dstyle@diamond
    \pspolygon[linewidth=1.5\pslinewidth](-0.5,0)(0,0.5)(0.5,0)(0,-0.5)
  \else
    \pscircle[linewidth=1.5\pslinewidth](0,0){0.5}
  \fi
  \ifcase\psk@labelInside\or% do nothing
    \psline[arrows=-,linewidth=2\pslinewidth]{->}(-0.35,0)(0.35,0)\or% case 1
    \uput{0.1}[0]{90}(-0.5,0){$-$}% case 2
    \uput{0.1}[0]{90}(0,0){$+$}\or% case 3
    \rput(0,0){\large\bf =}
  \fi
}
%
\def\pst@draw@Icc{%
  \ifx\psk@Dstyle\pst@Dstyle@twoCircles
    \pnode(-0.7,0){dipole@1}
    \pnode(0.7,0){dipole@2}
    \pscircle[linewidth=1.5\pslinewidth](-0.175,0){0.5}
    \pscircle[linewidth=1.5\pslinewidth](0.175,0){0.5}
  \else
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \pscircle[linewidth=1.5\pslinewidth](0,0){0.5}
    \psline[arrows=-,linewidth=1.5\pslinewidth](0,-0.5)(0,0.5)
  \fi%
}
%
\def\pst@draw@switch{%
  \ifx\psk@Dstyle\pst@Dstyle@close
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \qdisk(-0.5,0){1.5pt}
    \qdisk(0.5,0){1.5pt}
    \psline[arrows=-,linewidth=2\pslinewidth](-0.5,0.05)(0.5,0.05)
  \else
    \pnode(-0.55,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \psline[arrows=-,linewidth=2\pslinewidth](-0.5,0)(0.5,0.5)
    \psarcn[arrowinset=0]{->}(-0.5,0){0.75}{45}{-45}
    \pscircle[fillstyle=solid](-0.5,0){0.07}
    \qdisk(0.5,0){1.5pt}
  \fi
}
%
\def\pst@draw@diode{%
  \ifx\psk@Dstyle\pst@Dstyle@triac
    \pspolygon[linewidth=1.5\pslinewidth](-0.25,-0.4)(-0.25,0)(0.25,-0.2)
    \pspolygon[linewidth=1.5\pslinewidth](0.25,0)(-0.25,0.2)(0.25,0.4)
    \psline[arrows=-,linewidth=1.5\pslinewidth](-0.25,-0.4)(-0.25,0.4)
    \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,-0.4)(0.25,0.4)
    \psline[arrows=-,linewidth=\pslinewidth](0.25,-0.2)(0.5,-0.3)(0.5,-0.6)
  \else
    \pspolygon[arrows=-,linewidth=1.5\pslinewidth](-0.25,-0.2)(-0.25,0.2)(0.25,0)
    \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,0.2)(0.25,-0.2)
    \ifx\psk@Dstyle\pst@Dstyle@thyristor
      \psline[arrows=-,linewidth=1.5\pslinewidth](0,-0.1)(0,-0.35)
    \fi
    \ifx\psk@Dstyle\pst@Dstyle@GTO
      \psline[arrows=-,linewidth=1.5\pslinewidth](-0.1,-0.12)(-0.1,-0.35)
      \psline[arrows=-,linewidth=1.5\pslinewidth](0,-0.1)(0,-0.35)
    \fi
  \fi
  \pnode(-0.25,0){dipole@1}
  \pnode(0.25,0){dipole@2}
  }
%
\def\pst@draw@Zener{%
  \pspolygon[linewidth=1.5\pslinewidth](-0.25,-0.2)(-0.25,0.2)(0.25,0)
  \ifx\psk@Dstyle\pst@Dstyle@Z
    \psline[arrows=-,linewidth=1.5\pslinewidth](0.1,0.35)(0.25,0.25)(0.25,-0.25)(0.4,-0.35)
  \else
    \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,0.25)(0.25,-0.25)(0,-0.25)
  \fi
  \pnode(-0.25,0){dipole@1}
  \pnode(0.25,0){dipole@2}
}
%
\def\pst@draw@lamp{%
  \pscircle[linewidth=1.5\pslinewidth]{0.5}
  \psline[arrows=-,linewidth=1.5\pslinewidth](0.5;45)(0.5;225)
  \psline[arrows=-,linewidth=1.5\pslinewidth](0.5;135)(0.5;315)
  \pnode(-0.5,0){dipole@1}
  \pnode(0.5,0){dipole@2}
}
%
\def\pst@draw@circledipole{%
  \pscircle[linewidth=1.5\pslinewidth]{0.5}
  \pnode(-0.5,0){dipole@1}
  \pnode(0.5,0){dipole@2}
}
%
\def\pst@draw@LED{%
  \pspolygon[arrows=-,linewidth=1.5\pslinewidth](-0.25,-0.2)(-0.25,0.2)(0.25,0)
  \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,0.2)(0.25,-0.2)
  \pnode(-0.25,0){dipole@1}
  \pnode(0.25,0){dipole@2}
  \multips(-0.25,0.3)(0.25,0){3}{\psline[arrows=->](0.25,0.22)}%
}
%
\def\pst@draw@Tswitch{%
  \ifx\psk@tripole@style\pst@tripole@style@right
    \psline[arrows=-,linewidth=2\pslinewidth](0.5,0)(0,-1)
    \psarcn[arrowinset=0]{<-}(0,-1){0.75}{135}{45}
  \else
    \ifx\psk@tripole@style\pst@tripole@style@left
      \psline[arrows=-,linewidth=2\pslinewidth](-0.5,0)(0,-1)
      \psarcn[arrowinset=0]{->}(0,-1){0.75}{135}{45}
    \else
      \psline[arrows=-,linewidth=2\pslinewidth](0,0.1)(0,-1)
      \psarcn[linewidth=1pt,arrowinset=0]{<->}(0,-1){0.75}{135}{45}
    \fi
  \fi
  \qdisk(-0.5,0){1.5pt}
  \qdisk(0.5,0){1.5pt}
  \pscircle[fillstyle=solid](0,-1){0.07}
  \pnode(-0.5,0){Tswi@left}
  \pnode(0.5,0){Tswi@right}
  \pnode(0,-1.05){Tswi@center}
}
%
\def\pst@draw@transformer{
  \ifx\psk@Dstyle\pst@Dstyle@rectangle
    \psframe[fillstyle=solid,fillcolor=black](-0.7,-0.75)(-0.2,0.75)
    \psframe[fillstyle=solid,fillcolor=black](0.7,-0.75)(0.2,0.75)
    \psline[arrows=-,linewidth=0.1cm](0,-0.75)(0,0.75)
    \pnode(-0.5,0.75){inup@}
    \pnode(-0.5,-0.75){indown@}
  \else
    \pscurve[arrows=-](-0.5,0.9)(-0.2,0.8)(-0.5,0.7)(-0.7,0.8)(-0.5,0.82)(-0.2,0.6)
      (-0.5,0.5)(-0.7,0.6)(-0.5,0.62)(-0.2,0.4)
      (-0.5,0.3)(-0.7,0.4)(-0.5,0.42)(-0.2,0.2)
      (-0.5,0.1)(-0.7,0.2)(-0.5,0.22)(-0.2,0)
      (-0.5,-0.1)(-0.7,0)(-0.5,0.02)(-0.2,-0.2)
      (-0.5,-0.3)(-0.7,-0.2)(-0.5,-0.18)(-0.2,-0.4)
      (-0.5,-0.5)(-0.7,-0.4)(-0.5,-0.38)(-0.2,-0.6)
      (-0.5,-0.7)(-0.7,-0.6)(-0.5,-0.58)(-.2,-0.8)(-0.5,-0.9)
    \pscurve[arrows=-](0.5,0.7)(0.2,0.6)(0.5,0.5)(0.7,0.6)(0.5,0.62)
      (0.2,0.4)(0.5,0.3)(0.7,0.4)(0.5,0.42)
      (0.2,0.2)(0.5,0.1)(0.7,0.2)(0.5,0.22)
      (0.2,0.)(0.5,-0.1)(0.7,0)(0.5,0.02)
      (0.2,-0.2)(0.5,-0.3)(0.7,-0.2)(0.5,-0.18)
      (0.2,-0.4)(0.5,-0.5)(0.7,-0.4)(0.5,-0.38)
      (0.2,-0.6)(0.5,-0.7)
    \psline[arrows=-](-0.1,0.7)(-0.1,-0.7)
    \psline[arrows=-](0,0.7)(0,-0.7)
    \psline[arrows=-](0.1,0.7)(0.1,-0.7)
    \pnode(-0.5,0.9){inup@}
    \pnode(-0.5,-0.9){indown@}
  \fi
  \pnode(0.5,-0.7){outdown@}
  \pnode(0.5,0.7){outup@}
}
% start hv 2003-07-23
\def\pst@draw@optoCoupler{%
% diode
  \pspolygon[linewidth=1.5\pslinewidth](-0.5,-0.25)(-0.7,0.25)(-0.3,0.25)
  \psline[arrows=-,linewidth=1.5\pslinewidth](-0.7,-0.25)(-0.3,-0.25)
  \psline{->}(-0.2,0.2)(0,0.1)
  \psline{->}(-0.2,0)(0,-0.1)
% transistor
  \psline[arrows=-,linewidth=4\pslinewidth](0.25,-0.3)(0.25,0.3)
  \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,0)(0.75,0.5)
  \psline[arrows=-,linewidth=1.5\pslinewidth](0.25,0)(0.75,-0.5)
  \pnode(0.75,-0.5){d@1}
  \pnode(0.25,0){d@2}
  \ifx\psk@Ttype\pst@Ttype@PNP
    \ncline[arrows=-,linestyle=none,fillstyle=none]{d@1}{d@2}
  \else
    \ncline[arrows=-,linestyle=none,fillstyle=none]{d@2}{d@1}
  \fi
  \ncput[nrot=:U]{\psline[arrowinset=0,arrowscale=2]{->}(0,0)(.2,0)}
  \pnode(-0.5,0.25){inup@}
  \pnode(-0.5,-0.25){indown@}
  \pnode(0.75,-0.5){outdown@}
  \pnode(0.75,0.5){outup@}
}
%
\def\pst@draw@logic[#1]{\@ifnextchar({\pst@draw@logici[#1]}{\pst@draw@logici[#1](0,0)}}
%
\def\pst@draw@logici[#1](#2)#3{{%
  \psset{#1}%
  \rput[lb](#2){%
    \psframe[linewidth=2\pslinewidth](0,0)(\psk@logic@width,\psk@logic@height)%
  }
  \pst@getcoor{#2}\pst@tempa
  \ifPst@logicChangeLR\def\logic@LR{true}\else\def\logic@LR{false}\fi%
  \pstVerb{
    /YA \pst@tempa exch pop \pst@number\psyunit div def
    /YB YA \psk@logic@height\space add def
    \logic@LR {%
      /XB \pst@tempa pop \pst@number\psxunit div def
      /XA XB \psk@logic@width\space add def
    }{%
      /XA \pst@tempa pop \pst@number\psxunit div def
      /XB XA \psk@logic@width\space add def
    } ifelse
    /dy YB YA sub def
  }
  \ifx\psk@logic@type\pst@logic@type@RS%---------------- RS -----------------
    \pnode(! XA YA dy 4 div add){#3S}
    \pnode(! XA YA dy 4 div 3 mul add){#3R}
    \psline(#3R)(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 4 div 3 mul add)
    \psline(#3S)(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 4 div add)
    \uput[\ifPst@logicChangeLR 180\else 0\fi](#3R){\psk@logic@nodestyle R}
    \uput[\ifPst@logicChangeLR 180\else 0\fi](#3S){\psk@logic@nodestyle S}
    \pnode(! XB 0.2 \logic@LR {sub}{add} ifelse YA dy 4 div add){#3Qneg}
    \pscircle[linewidth=0.5pt](! XB 0.1 \logic@LR {sub}{add} ifelse YA dy 4 div add){0.1}
    \pnode(! XB YA dy 4 div 3 mul add){#3Q}
    \psline(#3Q)(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add)
    \psline(#3Qneg)(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 4 div add)
    \uput[\ifPst@logicChangeLR 0\else 180\fi](#3Q){\psk@logic@nodestyle Q}
    \uput{0.4}[\ifPst@logicChangeLR 0\else 180\fi](#3Qneg){\psk@logic@nodestyle $\mathrm{\overline{Q}}$}
    \ifPst@logicShowDot
      \qdisk(! XA \psk@logic@wireLength\space \logic@LR {add}{sub} ifelse YA dy 4 div 3 mul add){3pt}
      \qdisk(! XA \psk@logic@wireLength\space \logic@LR {add}{sub} ifelse YA dy 4 div add){3pt}
      \qdisk(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add){3pt}
      \qdisk(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 4 div add){3pt}
    \fi
    \rput[b](!%
      /dx XB XA sub 2 div def
      XA dx add YA 0.1 add){\psk@logic@labelstyle #3}
  \else
    \ifx\psk@logic@type\pst@logic@type@D%---------------- D -----------------
      \pnode(! XA YA dy 2 div add){#3C}
      \pnode(! XA YA dy 4 div 3 mul add){#3D}
      \psline(#3D)(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 4 div 3 mul add)
      \psline(#3C)(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 2 div add)
      \psline[linewidth=0.5pt](! XA YA dy 2 div add 0.15 add)
        (! XA 0.4 \logic@LR {sub}{add} ifelse YA dy 2 div add)(! XA YA dy 2 div add 0.15 sub)
      \uput[\ifPst@logicChangeLR 180\else 0\fi](#3D){\psk@logic@nodestyle D}
      \uput{0.5}[\ifPst@logicChangeLR 180\else 0\fi](#3C){\psk@logic@nodestyle C}
      \pnode(! XB 0.2 \logic@LR {sub}{add} ifelse YA dy 4 div add){#3Qneg}
      \pscircle[linewidth=0.5pt](! XB 0.1 \logic@LR {sub}{add} ifelse YA dy 4 div add){0.1}
      \pnode(! XB YA dy 4 div 3 mul add){#3Q}
      \psline(#3Q)(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add)
      \psline(#3Qneg)(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div add)
      \uput[\ifPst@logicChangeLR 0\else 180\fi](#3Q){\psk@logic@nodestyle Q}
      \uput{0.4}[\ifPst@logicChangeLR 0\else 180\fi](#3Qneg){\psk@logic@nodestyle $\mathrm{\overline{Q}}$}
      \ifPst@logicShowDot
        \qdisk(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 4 div 3 mul add){3pt}
        \qdisk(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 2 div add){3pt}
        \qdisk(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add){3pt}
        \qdisk(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div add){3pt}
      \fi
      \rput[b](!%
        /dx XB XA sub 2 div def
        XA dx add YA 0.1 add){\psk@logic@labelstyle #3}
    \else
      \ifx\psk@logic@type\pst@logic@type@JK%---------------- JK -----------------
        \multido{\n=1+1}{\psk@logic@JInput}{%
          \pnode(!%
            /Step dy 2 div \psk@logic@JInput\space div def
            /yNew Step \n\space mul def
            XA YA yNew add Step 2 div sub){#3J\n}
          \pst@getcoor{#3J\n}\pst@tempc
          \uput[\ifPst@logicChangeLR 180\else 0\fi](#3J\n){\psk@logic@nodestyle J\n}
          \pnode(!
            /YC \pst@tempc exch pop \pst@number\psyunit div def
            /XC \pst@tempc pop \pst@number\psxunit div def
            XC 0.5 \logic@LR {add}{sub} ifelse YC){tempJ\n}
          \psline(#3J\n)(tempJ\n)% input
          \ifPst@logicShowDot
            \qdisk(tempJ\n){3pt}
          \fi
        }
        \multido{\n=1+1}{\psk@logic@KInput}{%
          \pnode(!%
            /Step dy 2 div \psk@logic@KInput\space div def
            /yNew Step \n\space mul def
            XA YB yNew sub Step 2 div add){#3K\n}
          \pst@getcoor{#3K\n}\pst@tempc
          \uput[\ifPst@logicChangeLR 180\else 0\fi](#3K\n){\psk@logic@nodestyle K\n}
          \pnode(!
            /YC \pst@tempc exch pop \pst@number\psyunit div def
            /XC \pst@tempc pop \pst@number\psxunit div def
            XC 0.5 \logic@LR {add}{sub} ifelse YC){tempK\n}
          \psline(#3K\n)(tempK\n)% input
          \ifPst@logicShowDot
            \qdisk(tempK\n){3pt}
          \fi
        }
        \psline[linewidth=0.5pt](! XA YA dy 2 div add 0.15 add)
          (! XA 0.4 \logic@LR {sub}{add} ifelse YA dy 2 div add)(! XA YA dy 2 div add 0.15 sub)
        \pnode(! XA YA dy 2 div add){#3C}
        \psline(#3C)(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 2 div add)
        \uput{0.5}[\ifPst@logicChangeLR 180\else 0\fi](#3C){\psk@logic@nodestyle C}
        \pnode(! XB 0.2 \logic@LR {sub}{add} ifelse YA dy 4 div add){#3Qneg}
        \pscircle[linewidth=0.5pt](! XB 0.1 \logic@LR {sub}{add} ifelse YA dy 4 div add){0.1}
        \pnode(! XB YA dy 4 div 3 mul add){#3Q}
        \psline(#3Q)(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add)
        \psline(#3Qneg)(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div add)
        \uput[\ifPst@logicChangeLR 0\else 180\fi](#3Q){\psk@logic@nodestyle Q}
        \uput{0.4}[\ifPst@logicChangeLR 0\else 180\fi](#3Qneg){\psk@logic@nodestyle $\mathrm{\overline{Q}}$}
        \ifPst@logicShowDot
          \qdisk(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div 3 mul add){3pt}
          \qdisk(! XB 0.5 \logic@LR {sub}{add} ifelse YA dy 4 div add){3pt}
          \qdisk(! XA 0.5 \logic@LR {add}{sub} ifelse YA dy 2 div add){3pt}
    \fi
        \rput[b](!%
          /dx XB XA sub 2 div def
          XA dx add YA 0.1 add){\psk@logic@labelstyle #3}
      \else%---------------- default AND/NAND/OR/NOR/NOT/EXOR/ENOR -----------------
        \ifx\psk@logic@type\pst@logic@type@not
          \def\@nMax{1}
    \else
      \def\@nMax{\psk@logic@nInput}
    \fi
        \multido{\n=1+1}{\@nMax}{%
          \pnode(!%
            /Step dy \psk@logic@nInput\space div def
            /yNew Step \n\space mul def
            XA YA yNew add \@nMax\space 1 gt {Step 2 div sub} if){#3\n}
          \pst@getcoor{#3\n}\pst@tempc
          \pnode(!
            /YC \pst@tempc exch pop \pst@number\psyunit div def
            /XC \pst@tempc pop \pst@number\psxunit div def
            XC \psk@logic@wireLength\space \logic@LR {add}{sub} ifelse YC){temp#3\n}
          \psline(#3\n)(temp#3\n)% input
          \ifPst@logicShowDot
            \qdisk(temp#3\n){3pt}
          \fi
          \ifPst@logicShowNode
            \uput[\ifPst@logicChangeLR 180\else 0\fi](#3\n){\psk@logic@nodestyle\n}
          \fi
        }
        \ifx\psk@logic@type\pst@logic@type@not\else
          \ifx\psk@logic@type\pst@logic@type@nand\else
            \ifx\psk@logic@type\pst@logic@type@nor\else
              \ifx\psk@logic@type\pst@logic@type@exnor\else
                \pnode(! XB YA dy 2 div add){#3Q}
                \psline(#3Q)(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 2 div add)% output
                \ifPst@logicShowDot
                  \qdisk(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 2 div add){3pt}
                \fi
                \ifPst@logicShowNode
                  \uput[\ifPst@logicChangeLR 0\else 180\fi](#3Q){\psk@logic@nodestyle Q}
                \fi
          \fi
        \fi
      \fi
    \fi
        \ifx\psk@logic@type\pst@logic@type@and\else%  NotX output
          \ifx\psk@logic@type\pst@logic@type@or\else
            \ifx\psk@logic@type\pst@logic@type@exor\else
              \pnode(! XB 0.2 \logic@LR {sub}{add} ifelse YA dy 2 div add){#3Q}
              \pscircle[linewidth=0.5pt](! XB 0.1 \logic@LR {sub}{add} ifelse YA dy 2 div add){0.1}
              \psline(#3Q)(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 2 div add)% output
              \ifPst@logicShowDot
                \qdisk(! XB \psk@logic@wireLength\space \logic@LR {sub}{add} ifelse YA dy 2 div add){3pt}
              \fi
              \ifPst@logicShowNode
                \uput{0.4}[\ifPst@logicChangeLR 0\else 180\fi](#3Q){\psk@logic@nodestyle Q}
              \fi
            \fi
          \fi
    \fi
        \ifx\psk@logic@type\pst@logic@type@or
          \def\logic@type{$\ge\kern-5pt 1$}
        \else
          \ifx\psk@logic@type\pst@logic@type@not
            \def\logic@type{1}
          \else
            \ifx\psk@logic@type\pst@logic@type@nand
              \def\logic@type{\&}
            \else
              \ifx\psk@logic@type\pst@logic@type@nor
                \def\logic@type{$\ge\kern-5pt 1$}
              \else
                \ifx\psk@logic@type\pst@logic@type@exor
                  \def\logic@type{=1}
                \else
                  \ifx\psk@logic@type\pst@logic@type@exnor
                    \def\logic@type{=}
                  \else
                    \def\logic@type{\&}
          \fi
        \fi
          \fi
            \fi
      \fi
        \fi
        \rput(!%
          /dx XB XA sub \psk@logic@symbolpos\space mul def
          XA dx add YB 0.3 sub){\psk@logic@symbolstyle\textbf{\logic@type}}
        \rput[b](!%
          /dx XB XA sub 2 div def
          XA dx add YA 0.1 add){\psk@logic@labelstyle #3}
      \fi
    \fi
  \fi% end of no special RS/JK/D
}\ignorespaces}
%
% end hv 2003-07-28
%
\def\pst@draw@wire[#1](#2)(#3){{%
  \psset{#1}%
  \ifx\psk@I@label\@empty\else\psset{intensity=true}\fi
  \ifx\psk@Dconvention\pst@Dconvention@generator
    \Pst@Dconventiontrue
  \else\ifx\psk@Dconvention\pst@Dconvention@receptor\Pst@Dconventionfalse\fi
  \fi
  \bgroup
  \pnode(#2){Inter@1}
  \pnode(#3){Inter@2}
  \psset{arrows=-}
  \ifPst@wire@intersect
    \rput(!
     /N@Inter@1 GetNode /N@Inter@2 GetNode /N@\psk@wire@intersectA\space
     GetNode /N@\psk@wire@intersectB\space GetNode InterLines
     \pst@number\psyunit div exch \pst@number\psxunit div exch){\pnode{@M}}%
    \ncline[linestyle=none,fillstyle=none]{Inter@1}{@M}
    \ncput[nrot=:U,npos=.85]{\pnode{@M1}}
    \ncline[linestyle=none,fillstyle=none]{@M}{Inter@2}
    \ncput[nrot=:U,npos=.15]{\pnode{@M2}}
    \psline(Inter@1)(@M1)
    \psline(@M2)(Inter@2)
    \ncarc[arcangle=90]{@M1}{@M2}
  \else
    \pcline(#2)(#3)
    \ifPst@intensity
      \ifPst@directconvention
        \ncput[nrot=:U]{%
          \psline[linecolor=\psk@I@color,
            linewidth=\psk@I@width,arrowinset=0]{->}(-.1,0)(.1,0)}
        \pcline[linestyle=none,fillstyle=none,offset=\psk@I@label@offset](#2)(#3)
        \ncput[nrot=\psk@label@angle]{\csname\psk@I@labelcolor\endcsname\psk@I@label}
      \else
        \ncput[nrot=:U]{%
          \psline[linecolor=\psk@I@color,linewidth=\psk@I@width]{<-}(-.1,0)(.1,0)}
        \pcline[linestyle=none,fillstyle=none,offset=\psk@I@label@offset](#2)(#3)
        \ncput[nrot=\psk@label@angle]{\csname\psk@I@labelcolor\endcsname\psk@I@label}
      \fi
    \fi
  \fi
  \egroup
  \ncline[linestyle=none]{Inter@1}{Inter@2}
}\ignorespaces}
%
%
\def\pst@draw@tension@[#1](#2)(#3)#4{{%
  \psset{#1}%
  \pnode(#2){pst@tempa} % hv
  \pnode(#3){pst@tempb} % hv
  \ncline[linestyle=none,fillstyle=none]{pst@tempa}{pst@tempb}
  \ncput[nrot=:U,npos=0.05]{\pnode{@M1}}
  \ncput[nrot=:U,npos=0.95]{\pnode{@M2}}
  \ncline[arrowinset=0,linecolor=\psk@tension@color]{->}{@M1}{@M2}
  \pcline[arrows=-,linestyle=none,fillstyle=none,offset=\psk@label@offset](@M1)(@M2)
  \ncput[nrot=\psk@label@angle]{\csname\psk@tension@labelcolor\endcsname #4}
}\ignorespaces}
%
\def\node(#1){\pscircle*(#1){2\pslinewidth}}
%
%
%
\define@boolkey[psset]{pst-circ}[Pst@]{inputarrow}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{programmable}[true]{}
\define@boolkey[psset]{pst-circ}[Pst@]{connectingdot}[true]{}
%
\def\pst@Gstyle@old{old}          \def\pst@Gstyle@ads{ads}       \def\pst@Gstyle@triangle{triangle}
\def\pst@Astyle@two{two}          \def\pst@Astyle@three{three}   \def\pst@Astyle@triangle{triangle}
\def\pst@LOoutput@left{left}      \def\pst@LOoutput@top{top}     \def\pst@LOoutput@right{right}
\def\pst@LOoutput@bottom{bottom}  \def\pst@LOstyle@crystal{crystal}\def\pst@Dstyle@lowpass{lowpass}
\def\pst@Dstyle@highpass{highpass}\def\pst@Dinput@right{right}   \def\pst@Dinput@left{left}
\def\pst@Dstyle@multiplier{multiplier}\def\pst@Dstyle@divider{divider}\def\pst@FMvalue@value{0}
\def\pst@tripole@style@bottom{bottom}\def\pst@tripole@style@top{top}\def\pst@Tinput@left{left}
\def\pst@Tinput@right{right}      \def\pst@tripole@style@circulator{circulator}
\def\pst@tripole@style@isolator{isolator}\def\pst@Tconfig@left{left}\def\pst@Tconfig@right{right}
\def\pst@Qstyle@directional{directional}\def\pst@Qstyle@hybrid{hybrid}\def\pst@Qinput@left{left}
\def\pst@Qinput@right{right}
\define@key[psset]{pst-circ}{groundstyle}[ads]{\def\psk@Gstyle{#1}}
\define@key[psset]{pst-circ}{antennastyle}[two]{\def\psk@Astyle{#1}}
\define@key[psset]{pst-circ}{output}[top]{\def\psk@LOoutput{#1}}
\define@key[psset]{pst-circ}{LOstyle}[]{\def\psk@LOstyle{#1}}
\define@key[psset]{pst-circ}{dipoleinput}[left]{\def\psk@Dinput{#1}}
\define@key[psset]{pst-circ}{value}[0]{\def\psk@FMvalue{#1}}
\define@key[psset]{pst-circ}{tripoleinput}[left]{\def\psk@Tinput{#1}}
\define@key[psset]{pst-circ}{tripoleconfig}[left]{\def\psk@Tconfig{#1}}
\define@key[psset]{pst-circ}{couplerstyle}[hxbrid]{\def\psk@Qstyle{#1}}
\define@key[psset]{pst-circ}{quadripoleinput}[left]{\def\psk@Qinput{#1}}
%
%
\psset{groundstyle=ads,     antennastyle=two,       output=top,%
        dipoleinput=left,   dipolestyle=multiplier, value=0,%
        dipoleinput=left,   inputarrow=false,       tripoleinput=left,%
        tripolestyle=bottom,tripoleconfig=left,     quadripoleinput=left,%
        couplerstyle=hybrid, connectingdot=true,    LOstyle={} }
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% monopole
%%% newground: groundstyle: (ads), old, triangle
%%% Antenna: antennastyle: (two), three, triangle
%%% Oscillator: oscioutput: (top), right, bottom, left, 
%%%             inputarrow: (false), true
%%% connectingdot: (true), false
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% newground %%%
\def\newground{\@ifnextchar[{\pst@newground}{\pst@newground[]}}
\def\pst@newground[#1]{%
    \@ifnextchar({\pst@newgroundi[#1]{0}}{\pst@newgroundi[#1]}%
}
\def\pst@newgroundi[#1]#2(#3){%
    \psset{#1}%
    \rput{#2}(#3){%
        \ifx\psk@Gstyle\pst@Gstyle@ads
            \psline[linewidth=1.5\pslinewidth]{c-c}(-0.3,-0.5)(0.3,-0.5)
            \psline[linewidth=1.5\pslinewidth]{c-c}(-0.2,-0.6)(0.2,-0.6)
            \psline[linewidth=1.5\pslinewidth]{c-c}(-0.1,-0.7)(0.1,-0.7)
        \fi
        \ifx\psk@Gstyle\pst@Gstyle@old
            \psline[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,-0.5)
        \fi
        \ifx\psk@Gstyle\pst@Gstyle@triangle
            \pstriangle[linewidth=1.5\pslinewidth](0,-0.5)(0.4,-0.4)
        \fi
        \psline(0,0)(0,-0.5)
         \ifPst@connectingdot
            \pscircle*(0,0){2\pslinewidth}
        \fi
    }
    \ignorespaces%
}
%
%%% antenna %%%
%
\def\antenna{\@ifnextchar[{\pst@antenna}{\pst@antenna[]}}
\def\pst@antenna[#1]{%
    \@ifnextchar({\pst@antennai[#1]{0}}{\pst@antennai[#1]}%
}
\def\pst@antennai[#1]#2(#3){%
    \psset{#1}%
    \rput{#2}(#3){%
        \ifx\psk@Astyle\pst@Astyle@two
            \psline[linewidth=1.5\pslinewidth](0,.75)(-0.2,1.25)
            \psline[linewidth=1.5\pslinewidth](0,.75)(0.2,1.25)
        \fi
        \ifx\psk@Astyle\pst@Astyle@three
            \psline[linewidth=1.5\pslinewidth](0,.75)(-0.2,1.25)
            \psline[linewidth=1.5\pslinewidth](0,.75)(0,1.25)
            \psline[linewidth=1.5\pslinewidth](0,.75)(0.2,1.25)
        \fi
        \ifx\psk@Astyle\pst@Astyle@triangle
            \pstriangle[linewidth=1.5\pslinewidth](0,1.25)(0.4,-0.5)
        \fi
        \psline(0,0)(0,.75)
    }
    \ignorespaces%
}
%
%%% oscillator %%%
%
\def\oscillator{\@ifnextchar[{\pst@oscillator}{\pst@oscillator[]}}
\def\pst@oscillator[#1]{%
    \@ifnextchar({\pst@oscillatori[#1]{0}}{\pst@oscillatori[#1]}%
}
\def\pst@oscillatori[#1]#2(#3)#4#5{%
    \psset{#1}%
    \rput{#2}(#3){%
        \pscircle[#5,linewidth=1.5\pslinewidth](0,0){0.5}
        \ifx\psk@LOstyle\pst@LOstyle@crystal
            \psline(-0.2,-0.35)(-0.2,0.35)
            \psframe(-0.15,-0.3)(0.15,0.3)
            \psline(0.2,-0.35)(0.2,0.35)
        \else
            \pscurve[linewidth=1.5\pslinewidth]{c-c}(-0.3,0.000)(-0.225,0.088375)(-0.15,0.1250)(-0.075,0.088375)%
                                    (0,0.000)(0.075,-0.088375)(0.15,-0.125)(0.225,-0.088375)(0.3,0.000)
        \fi
        \ifx\psk@LOoutput\pst@LOoutput@left
            \pst@getcoor{#3}\pst@tempa
            \pnode(!%
              \pst@tempa /Y1 exch \pst@number\psyunit div def
              /X1 exch \pst@number\psxunit div def
              /XC X1 def
              /YC Y1 -0.6 add def
              XC YC){C@}
            \rput[t]{#2}(C@){#4}
            \ifPst@inputarrow
                \psline[arrows=->,arrowinset=0](-0.5,0)(-1,0)
            \else
                \psline(-0.5,0)(-1,0)
            \fi
        \fi
        \ifx\psk@LOoutput\pst@LOoutput@top
            \pst@getcoor{#3}\pst@tempa
            \pnode(!%
              \pst@tempa /Y1 exch \pst@number\psyunit div def
              /X1 exch \pst@number\psxunit div def
              /XC X1 def
              /YC Y1 -0.6 add def
              XC YC){C@}
            \rput[t]{#2}(C@){#4}
            \ifPst@inputarrow
                \psline[arrows=->,arrowinset=0](0,0.5)(0,1)
            \else
                \psline(0,0.5)(0,1)
            \fi
        \fi
        \ifx\psk@LOoutput\pst@LOoutput@right
            \pst@getcoor{#3}\pst@tempa
            \pnode(!%
              \pst@tempa /Y1 exch \pst@number\psyunit div def
              /X1 exch \pst@number\psxunit div def
              /XC X1 def
              /YC Y1 -0.6 add def
              XC YC){C@}
            \rput[t]{#2}(C@){#4}
            \ifPst@inputarrow
                \psline[arrows=->,arrowinset=0](0.5,0)(1,0)
            \else
                \psline(0.5,0)(1,0)
            \fi
        \fi
        \ifx\psk@LOoutput\pst@LOoutput@bottom
            \pst@getcoor{#3}\pst@tempa
            \pnode(!%
              \pst@tempa /Y1 exch \pst@number\psyunit div def
              /X1 exch \pst@number\psxunit div def
              /XC X1 def
              /YC Y1 0.6 add def
              XC YC){C@}
            \rput[b]{#2}(C@){#4}
            \ifPst@inputarrow
                \psline[arrows=->,arrowinset=0](0,-0.5)(0,-1)
            \else
                \psline(0,-0.5)(0,-1)
            \fi
        \fi
    }
    \ignorespaces%
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Dipole
%%% filtre:    dipolestyle: (bandpass), lowpass, highpass
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%% isolator:  dipoleinput: (left), right
%%%             inputarrow: (false), true
%%% freqmult:    dipolestyle: (multiplier), divider, 
%%%                    value: (N), integer
%%%             programmable: (false) true
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%% phaseshifter:
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%% vco:
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%% amplifier: 
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%% detector: 
%%%             inputarrow: (false), true
%%%             dipoleinput: (left), right
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% FILTER %%%
%
\def\filter{\@ifnextchar[{\pst@filter}{\pst@filter[]}}
%
\def\pst@filter[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@filter%
  }\ignorespaces}
%
\def\pst@multidipole@filter{\@ifnextchar[{\pst@multidipole@filter@}%
{\pst@multidipole@filter@[]}}
%
\def\pst@multidipole@filter@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\filter[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@filter{%
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \psframe[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,0.5)
    \pscurve[linewidth=1.5\pslinewidth]{c-c}(-0.4,0.250)(-0.2,0.3750)(0,0.250)(0.2,0.1250)(0.4,0.250)
    \pscurve[linewidth=1.5\pslinewidth]{c-c}(-0.4,0.000)(-0.2,0.1250)(0,0.000)(0.2,-0.125)(0.4,0.000)
    \pscurve[linewidth=1.5\pslinewidth]{c-c}(-0.4,-0.25)(-0.2,-0.125)(0,-0.25)(0.2,-0.375)(0.4,-0.25)
%        \psline{c-c}(-0.1,0.2)(0.1,0.3)
    \ifx\psk@Dstyle\pst@Dstyle@lowpass
        \psline[fillstyle=none]{c-c}(-0.1,0.2)(0.1,0.3)
        \psline[fillstyle=none]{c-c}(-0.1,-0.05)(0.1,0.05)
    \else
        \ifx\psk@Dstyle\pst@Dstyle@highpass
            \psline[fillstyle=none]{c-c}(-0.1,-0.3)(0.1,-0.2)
            \psline[fillstyle=none]{c-c}(-0.1,-0.05)(0.1,0.05)
        \else
            \psline[fillstyle=none]{c-c}(-0.1,0.2)(0.1,0.3)
            \psline[fillstyle=none]{c-c}(-0.1,-0.3)(0.1,-0.2)
        \fi
    \fi
}

%%% ISOLATOR %%%
%
\def\isolator{\@ifnextchar[{\pst@isolator}{\pst@isolator[]}}
%
\def\pst@isolator[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@isolator%
  }\ignorespaces}
%
\def\pst@multidipole@isolator{\@ifnextchar[{\pst@multidipole@isolator@}%
{\pst@multidipole@isolator@[]}}
%
\def\pst@multidipole@isolator@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\isolator[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@isolator{%
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \psframe[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,0.5)
    \ifx\psk@Dinput\pst@Dinput@right
        \psline[fillstyle=none,linewidth=1.5\pslinewidth,arrowinset=0]{<-}(-0.4,0)(0.4,0)
    \else
        \psline[fillstyle=none,linewidth=1.5\pslinewidth,arrowinset=0]{->}(-0.4,0)(0.4,0)
    \fi
}
%
%%% Frequency Multiplier or Divider %%%
\def\freqmult{\@ifnextchar[{\pst@freqmult}{\pst@freqmult[]}}
%
\def\pst@freqmult[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@freqmult%
  }\ignorespaces}
%
\def\pst@multidipole@freqmult{\@ifnextchar[{\pst@multidipole@freqmult@}%
{\pst@multidipole@freqmult@[]}}
%
\def\pst@multidipole@freqmult@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\freqmult[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@freqmult{%
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \psframe[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,0.5)
    \ifPst@programmable%
        \psline[fillstyle=none](-0.4,-0.75)(-0.4,-0.5)
        \psline[fillstyle=none](-0.2,-0.75)(-0.2,-0.5)
        \psline(0,-0.75)(0,-0.5)
        \psline[fillstyle=none](0.2,-0.75)(0.2,-0.5)
        \psline[fillstyle=none](0.4,-0.75)(0.4,-0.5)
        \ifx\psk@Dstyle\pst@Dstyle@divider
            \rput(0,0){$\div\textrm{N}$}
        \else
            \rput(0,0){$\times\textrm{N}$}
        \fi
    \else
        \ifx\psk@FMvalue\pst@FMvalue@value
            \ifx\psk@Dstyle\pst@Dstyle@divider
                \rput(0,0){$\div\textrm{N}$}
            \else
                \rput(0,0){$\times\textrm{N}$}
            \fi
        \else
            \ifx\psk@Dstyle\pst@Dstyle@divider
                \rput(0,0){$\div\textrm{\psk@FMvalue}$}
            \else
                \rput(0,0){$\times\textrm{\psk@FMvalue}$}
            \fi
        \fi
    \fi%
}
%
%%% phaseshifter
\def\phaseshifter{\@ifnextchar[{\pst@phaseshifter}{\pst@phaseshifter[]}}
%
\def\pst@phaseshifter[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@phaseshifter%
  }\ignorespaces}
%
\def\pst@multidipole@phaseshifter{\@ifnextchar[{\pst@multidipole@phaseshifter@}%
{\pst@multidipole@phaseshifter@[]}}
%
\def\pst@multidipole@phaseshifter@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\phaseshifter[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@phaseshifter{%
    \pnode(-0.4,0){dipole@1}
    \pnode(0.4,0){dipole@2}
    \pscircle[linewidth=1.5\pslinewidth](0,0){0.4}
    \psline[fillstyle=none,linewidth=1.5\pslinewidth,arrowinset=0]{->}(-0.5,-0.5)(0.5,0.5)
}
%
%%% VCO
\def\vco{\@ifnextchar[{\pst@vco}{\pst@vco[]}}
%
\def\pst@vco[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@vco%
  }\ignorespaces}
%
\def\pst@multidipole@vco{\@ifnextchar[{\pst@multidipole@vco@}%
{\pst@multidipole@vco@[]}}
%
\def\pst@multidipole@vco@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\vco[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@vco{%
    \pnode(-0.5,0){dipole@1}
    \pnode(0.5,0){dipole@2}
    \pscircle[linewidth=1.5\pslinewidth](0,0){0.5}
    \pscurve[linewidth=1.5\pslinewidth]{c-c}(-0.3,0.000)(-0.225,0.088375)(-0.15,0.1250)(-0.075,0.088375)%
                                    (0,0.000)(0.075,-0.088375)(0.15,-0.125)(0.225,-0.088375)(0.3,0.000)
}
%
%%% amplifier %%%
%
\def\amplifier{\@ifnextchar[{\pst@amplifier}{\pst@amplifier[]}}
%
\def\pst@amplifier[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@amplifier%
  }\ignorespaces}
%
\def\pst@multidipole@amplifier{\@ifnextchar[{\pst@multidipole@amplifier@}%
{\pst@multidipole@amplifier@[]}}
%
\def\pst@multidipole@amplifier@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\amplifier[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@amplifier{%
    \pnode(-0.433,0){dipole@1}
    \pnode(0.433,0){dipole@2}
    \ifx\psk@Dinput\pst@Dinput@right
        \pstriangle[gangle=90,linewidth=1.5\pslinewidth](0.433,0)(1,0.866)
    \else
        \pstriangle[gangle=-90,linewidth=1.5\pslinewidth](-0.433,0)(1,0.866)
    \fi
}
%
%%% detector %%%
%
\def\detector{\@ifnextchar[{\pst@detector}{\pst@detector[]}}
%
\def\pst@detector[#1](#2)(#3)#4{{%
  \pst@draw@dipole{#1}{#2}{#3}{#4}\pst@draw@detector%
  }\ignorespaces}
%
\def\pst@multidipole@detector{\@ifnextchar[{\pst@multidipole@detector@}%
{\pst@multidipole@detector@[]}}
%
\def\pst@multidipole@detector@[#1]#2{%
  \expandafter\def\csname pst@tmp@\number\pst@count@iii\endcsname{#2}%
  {\psset{#1}%
  \ifPst@parallel\aftergroup\advance\aftergroup\pst@count@i\aftergroup\m@ne\fi}%
  \pst@count@ii=\pst@count@i%
  \advance\pst@count@ii\@ne%
  \toks0\expandafter{\pst@multidipole@output}%
  \edef\pst@multidipole@output{%
    \the\toks0%
    \pst@multidipole@def@coor%
    \noexpand\detector[#1]%
  (! X@\the\pst@count@i\space Y@\the\pst@count@i)%
  (! X@\the\pst@count@ii\space Y@\the\pst@count@ii)%
      {\noexpand\csname pst@tmp@\number\pst@count@iii\endcsname}%
  }%
  \pst@multidipole@
}
%
\def\pst@draw@detector{%
    \pnode(-0.5,0){dipole@1}
    \psline[fillstyle=none](-0.5,0)(-0.2165,0)
    \pnode(0.5,0){dipole@2}
    \psline[fillstyle=none](0.5,0)(0.2165,0)
    \psframe[linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,0.5)
    \ifx\psk@Dinput\pst@Dinput@right
        \pstriangle[gangle=90,linewidth=1.5\pslinewidth,fillstyle=none](0.2165,0)(0.5,0.433)
        \psline[fillstyle=none,linewidth=1.5\pslinewidth](-0.2165,-0.25)(-0.2165,0.25)
    \else
        \pstriangle[gangle=-90,linewidth=1.5\pslinewidth,fillstyle=none](-0.2165,0)(0.5,0.433)
        \psline[fillstyle=none,linewidth=1.5\pslinewidth](0.2165,-0.25)(0.2165,0.25)
    \fi
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Tripole
%%% mixer: tripolestyle:(bottom), top
%%%          inputarrow: (false) | true
%%%       tripoleinput: (left) | right
%%% Circulator: tripolestyle=(circulator), isolator
%%%       tripoleconfig: (left) | right
%%%          inputarrow: (false) | true
%%%       tripoleinput: (left) | right
%%% AGC: tripoleinput=(left)|right
%%%          inputarrow: (false) | true
%%%       tripoleinput: (left) | right
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\mixer{\pst@object{mixer}}
\def\mixer@i(#1)(#2)(#3)#4#5{%
  \addbefore@par{dimen=middle}%
  \begin@ClosedObj
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /XC X1 X2 add 2 div def
    /YC Y2 def
    XC YC){C@}
  \rput(C@){\pst@draw@mixer{#3}{#4}{#5}}
  \ifx\psk@Tinput\pst@Tinput@left%
    \ifPst@inputarrow
        \ncangle[arrows=->,arrowinset=0,arm=0.5,angleB=180]{#1}{Tport@left}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=180]{#1}{Tport@left}
    \fi
    \ncangle[arrows=-,arm=0.5,angleB=0]{#2}{Tport@right}
  \else
    \ifPst@inputarrow
        \ncangle[arrows=<-,arrowinset=0,arm=0.5,angleB=180]{Tport@right}{#2}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=180]{Tport@right}{#2}
    \fi
    \ncangle[arrows=-,arm=0.5,angleB=180]{#1}{Tport@left}
  \fi
  \pcline[linestyle=none](#1)(#2)% for the endarrows
  \pcline[linestyle=none](#2)(#3)% for the endarrows
  \end@ClosedObj
  \ignorespaces%
}
\def\pst@draw@mixer#1#2#3{%
  \pscircle[#3,linewidth=1.5\pslinewidth](0,0){0.5}
  \psline[linewidth=1.5\pslinewidth](-0.3535,-0.3535)(0.3535,0.3535)
  \psline[linewidth=1.5\pslinewidth](-0.3535,0.3535)(0.3535,-0.3535)
  \pnode(-0.5,0){Tport@left}%
  \pnode(0.5,0){Tport@right}%
  \ifx\psk@tripole@style\pst@tripole@style@top%
    \rput[t](0,-0.6){#2}
    \pnode(0,0.5){Tport@center}
    \ifPst@inputarrow
        \ncangle[arrows=->,arrowinset=0,arm=0.5,angleB=90]{#1}{Tport@center}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=90]{#1}{Tport@center}
    \fi
  \else
    \rput[b](0,0.6){#2}
    \pnode(0,-0.5){Tport@center}
    \ifPst@inputarrow
        \ncangle[arrows=->,arrowinset=0,arm=0.5,angleB=-90]{#1}{Tport@center}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=-90]{#1}{Tport@center}
    \fi%
  \fi%
}
%
%%% Circulator
%
\def\circulator{\pst@object{circulator}}
\def\circulator@i#1(#2)(#3)(#4)#5#6{%
  \addbefore@par{dimen=middle}%
  \begin@ClosedObj
  \pst@getcoor{#2}\pst@tempa
  \pst@getcoor{#3}\pst@tempb
  \pst@getcoor{#4}\pst@tempc
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /XC X1 X2 add 2 div def
    /YC Y1 Y2 add 2 div def
    XC YC){C@}
  \rput{#1}(C@){\pst@draw@circulator{#4}{#5}{#6}}
  \nput{! 90 #1 add}{Tport@label}{#5}
  \ifPst@inputarrow
    \ncline[arrows=->,arrowinset=0]{#2}{Tport@input} %,arm=0.5,angleB=180
  \else
    \ncline[arrows=-]{#2}{Tport@input}
  \fi
  \ncline[arrows=-]{#3}{Tport@output} %,arm=0.5,angleB=0
  \pcline[linestyle=none](#2)(#3)% for the endarrows
  \pcline[linestyle=none](#3)(#4)% for the endarrows
  \end@ClosedObj
  \ignorespaces%
}
\def\pst@draw@circulator#1#2#3{%
  \pscircle[#3,linewidth=1.5\pslinewidth](0,0){0.5}%
  \pnode(0,0.6){Tport@label}%
  \ifx\psk@Tconfig\pst@Tconfig@left%
    \psarc[linewidth=1.5\pslinewidth,arrowinset=0]{<-}{0.35}{15}{155}
    \pnode(-0.5,0){Tport@input}
    \pnode(0.5,0){Tport@output}
  \else
    \psarc[linewidth=1.5\pslinewidth,arrowinset=0]{->}{0.35}{25}{165}
    \pnode(-0.5,0){Tport@output}
    \pnode(0.5,0){Tport@input}
  \fi%
  \ifx\psk@tripole@style\pst@tripole@style@isolator%
    \psline(0,-0.5)(0,-0.95)%
    \multips{0}(-0.225,-1)(0.1,0){5}%
        {\psline[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.025,0.05)(0.075,-0.05)(0.1,0)}%
  \else
    \pnode(0,-0.5){Tport@center}%
    \ncline[arrows=-]{#1}{Tport@center}
  \fi%
}
%
%%% AGC
\def\agc{\pst@object{agc}}
\def\agc@i(#1)(#2)(#3)#4#5{%
  \addbefore@par{dimen=middle}%
  \begin@ClosedObj
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    /XC X1 X2 add 2 div def
    /YC Y2 def
    XC YC){C@}
  \rput(C@){\pst@draw@agc{#1}{#2}{#4}{#5}}
  \ncangle[arrows=-,arm=0.5,angleB=-90]{#3}{Tport@center}
  \pcline[linestyle=none](#1)(#2)% for the endarrows
  \pcline[linestyle=none](#2)(#3)% for the endarrows
  \end@ClosedObj
  \ignorespaces%
}
\def\pst@draw@agc#1#2#3#4{%
  \pnode(-0.433,0){Tport@left}
  \pnode(0.433,0){Tport@right}
  \pnode(0,-0.5){Tport@center}
  \rput[b](0,0.6){#3}
  \psline[arrows=->,arrowinset=0](0,-0.5)(0,-0.25)
  \ifx\psk@Tinput\pst@Tinput@left%
    \pstriangle[#4,gangle=-90,linewidth=1.5\pslinewidth](-0.433,0)(1,0.866)
    \psline[linewidth=1.5\pslinewidth,arrows=->,arrowinset=0](-0.55,-0.5)(0.25,0.5)
    \ifPst@inputarrow
        \ncangle[arrows=->,arrowinset=0,arm=0.5,angleB=180]{#1}{Tport@left}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=180]{#1}{Tport@left}
    \fi
    \ncangle[arrows=-,arm=0.5,angleB=0]{#2}{Tport@right}
  \else
    \pstriangle[#4,gangle=90,linewidth=1.5\pslinewidth](0.433,0)(1,0.866)
    \psline[linewidth=1.5\pslinewidth,arrows=->,arrowinset=0](0.55,-0.5)(-0.25,0.5)
    \ifPst@inputarrow
        \ncangle[arrows=<-,arrowinset=0,arm=0.5,angleB=180]{Tport@right}{#2}
    \else
        \ncangle[arrows=-,arm=0.5,angleB=180]{Tport@right}{#2}
    \fi
    \ncangle[arrows=-,arm=0.5,angleB=180]{#1}{Tport@left}%
  \fi%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Quadripole
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Coupler %%%
\def\coupler{\pst@object{coupler}}
\def\coupler@i(#1)(#2)(#3)(#4)#5#6{%
  \addbefore@par{dimen=middle,arm=0}%
  \begin@ClosedObj%
  \pst@getcoor{#1}\pst@tempa
  \pst@getcoor{#2}\pst@tempb
  \pst@getcoor{#3}\pst@tempc
  \pst@getcoor{#4}\pst@tempd
  \pnode(!%
    \pst@tempa /Y1 exch \pst@number\psyunit div def
    /X1 exch \pst@number\psxunit div def
    \pst@tempb /Y2 exch \pst@number\psyunit div def
    /X2 exch \pst@number\psxunit div def
    \pst@tempc /Y3 exch \pst@number\psyunit div def
    /X3 exch \pst@number\psxunit div def
    \pst@tempc /Y4 exch \pst@number\psyunit div def
    /X4 exch \pst@number\psxunit div def
    /XC X1 X2 lt {X2} {X1} ifelse X3 X4 lt {X3} {X4} ifelse add 2 div def
    /YC Y1 -0.4 add def
    XC YC){C@}
  \rput(C@){\pst@draw@coupler{#6}}
  \ncangle[arrows=-,angleA=0,angleB=-180]{#1}{inup@}
  \ncangle[arrows=-,angleA=180,angleB=0]{#3}{outup@}
  \ifx\psk@Qinput\pst@Qinput@left%
    \ifx\psk@Qstyle\pst@Qstyle@hybrid
        \ncangle[arrows=-,angleA=0,angleB=-180]{#2}{indown@}
    \fi
    \ncangle[arrows=-,angleA=180,angleB=0]{#4}{outdown@}
  \else
    \ncangle[arrows=-,angleA=0,angleB=-180]{#2}{indown@}
    \ifx\psk@Qstyle\pst@Qstyle@hybrid
        \ncangle[arrows=-,angleA=180,angleB=0]{#4}{outdown@}
    \fi
  \fi
%  \ncangle[arrows=-,angleA=180,angleB=0]{#4}{outdown@}
  \ncline[arrows=-,linestyle=none,fillstyle=none]{inup@}{outup@}
  \naput{#5}
  \pcline[linestyle=none](#1)(#3)% for the end arrows
  \pcline[linestyle=none](#2)(#4)% for the end arrows
  \end@ClosedObj%
  \ignorespaces%
}
%
\def\pst@draw@coupler#1{%
    \pnode(-0.75,0.4){inup@}
    \pnode(0.75,0.4){outup@}
    \psframe[#1,linewidth=1.5\pslinewidth](-0.5,-0.5)(0.5,0.5)
    \psline(-0.5,0.4)(0.5,0.4)
    \psline(-0.5,-0.4)(0.5,-0.4)
    \psline(-0.4,0.35)(0.4,-0.35)
    \psline(-0.4,-0.35)(0.4,0.35)
%
    \ifx\psk@Qinput\pst@Qinput@left%
        \pnode(0.75,-0.4){outdown@}
        \ifPst@inputarrow%
            \psline[arrows=->,arrowinset=0](-0.75,0.4)(-0.5,0.4)
        \else
            \psline(-0.75,0.4)(-0.5,0.4)
        \fi
        \psline(0.5,0.4)(0.75,0.4)
        \psline(0.5,-0.4)(0.75,-0.4)
        \ifx\psk@Qstyle\pst@Qstyle@hybrid
            \pnode(-0.75,-0.4){indown@}
            \ifPst@inputarrow%
                \psline[arrows=->,arrowinset=0](-0.75,-0.4)(-0.5,-0.4)
            \else
                \psline(-0.75,-0.4)(-0.5,-0.4)
            \fi
        \else
            \ifx\psk@Qstyle\pst@Qstyle@directional
                \psline[arrows=-,linewidth=1.5\pslinewidth](-0.8,-0.75)(-0.8,-0.675)
                \multips{90}(-0.8,-0.675)(0,0.1){4}%
                    {\psline[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.025,0.05)(0.075,-0.05)(0.1,0)}%
                \psline[arrows=-,linewidth=1.5\pslinewidth](-0.8,-0.275)(-0.8,-0.2)
                \psline(-0.75,-0.4)(-0.5,-0.4)
            \fi
        \fi
    \else
        \pnode(-0.75,-0.4){indown@}
        \ifPst@inputarrow
            \psline[arrows=->,arrowinset=0](0.75,0.4)(0.5,0.4)
        \else
            \psline(0.75,0.4)(0.5,0.4)
        \fi
        \psline(-0.5,0.4)(-0.75,0.4)
        \psline(-0.5,-0.4)(-0.75,-0.4)
        \ifx\psk@Qstyle\pst@Qstyle@hybrid
            \pnode(0.75,-0.4){outdown@}
            \ifPst@inputarrow%
                \psline[arrows=->,arrowinset=0](0.75,-0.4)(0.5,-0.4)
            \else
                \psline(0.75,-0.4)(0.5,-0.4)
            \fi
        \else
            \ifx\psk@Qstyle\pst@Qstyle@directional
                \psline[arrows=-,linewidth=1.5\pslinewidth](0.8,-0.75)(0.8,-0.675)
                \multips{90}(0.8,-0.675)(0,0.1){4}%
                    {\psline[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.025,0.05)(0.075,-0.05)(0.1,0)}%
                \psline[arrows=-,linewidth=1.5\pslinewidth](0.8,-0.275)(0.8,-0.2)
                \psline(0.75,-0.4)(0.5,-0.4)
            \fi%
        \fi%
    \fi%
}
%
\catcode`\@=\PstAtCode\relax
%
\endinput
%
