Skip to content

Commit

Permalink
Schematic drawing objects (lines and rects), Opamp label placement
Browse files Browse the repository at this point in the history
  • Loading branch information
CKuhlmann committed May 5, 2017
1 parent c95e7d8 commit c61527a
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 12 deletions.
21 changes: 21 additions & 0 deletions examples/Draft2.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Version 4
SHEET 1 880 680
WIRE 272 144 272 112
WIRE 240 160 208 160
WIRE 320 176 304 176
WIRE 240 192 208 192
WIRE 272 224 272 208
SYMBOL Opamps\\UniversalOpamp2 272 176 R0
SYMATTR InstName U1
LINE Normal 80 96 0 96 2
LINE Normal 80 128 0 112 1
LINE Normal 80 144 0 160 2
LINE Normal 112 176 0 176 3
LINE Normal 112 192 0 208 4
LINE Normal 144 240 0 224
LINE Normal 128 288 0 304
LINE Normal 192 304 128 288
LINE Normal 272 288 192 304
LINE Normal 320 304 272 288
RECTANGLE Normal 320 224 208 112 2
RECTANGLE Normal 400 144 352 112 1
4 changes: 4 additions & 0 deletions examples/Draft3.asc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Version 4
SHEET 1 880 680
WIRE 160 144 144 144
LINE Normal 160 144 144 144 1
34 changes: 27 additions & 7 deletions examples/Test.asc
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ WIRE 1200 96 1152 96
WIRE 1312 96 1264 96
WIRE 32 112 32 64
WIRE 80 112 32 112
WIRE 224 112 160 112
WIRE 192 112 160 112
WIRE 224 112 192 112
WIRE 288 112 224 112
WIRE 400 112 368 112
WIRE 432 112 368 112
WIRE 496 112 432 112
WIRE 880 112 880 96
WIRE 1040 112 1040 96
WIRE 1152 112 1152 96
Expand All @@ -64,8 +66,8 @@ WIRE 96 160 -128 160
WIRE 224 160 224 112
WIRE 224 160 96 160
WIRE 288 160 224 160
WIRE 400 160 400 112
WIRE 400 160 288 160
WIRE 496 160 496 112
WIRE 496 160 288 160
WIRE 224 176 224 160
WIRE 288 176 288 160
WIRE 96 192 96 160
Expand Down Expand Up @@ -380,22 +382,24 @@ FLAG 800 816 +in
FLAG 96 192 COM
FLAG 112 272 o
FLAG 192 640 o
FLAG 432 112 netLabel_gy
FLAG 192 112 Net5
SYMBOL res 64 128 R270
WINDOW 0 32 56 VTop 2
WINDOW 3 0 56 VBottom 2
SYMATTR InstName R1
SYMATTR Value 1k
SYMATTR Value 1k5
SYMATTR Value2 someoption,another
SYMBOL res 384 96 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R2
SYMATTR Value 2k
SYMBOL res 512 176 R180
SYMBOL res 624 176 R180
WINDOW 0 36 76 Left 2
WINDOW 3 36 40 Left 2
SYMATTR InstName R3
SYMBOL res 640 112 R90
SYMBOL res 752 112 R90
WINDOW 0 0 56 VBottom 2
WINDOW 3 32 56 VTop 2
SYMATTR InstName R4
Expand All @@ -407,6 +411,7 @@ SYMBOL circuiTikz\\res_eu -48 224 R90
WINDOW 0 -10 0 VBottom 2
WINDOW 3 10 0 VTop 2
SYMATTR InstName R5
SYMATTR Value $\SI{10}{\kilo\ohm}$
SYMBOL circuiTikz\\res_eu2 -16 304 R90
WINDOW 0 -10 32 VBottom 2
WINDOW 3 21 32 VTop 2
Expand Down Expand Up @@ -780,3 +785,18 @@ TEXT -224 1008 Left 2 ;270rot,mir
TEXT -352 672 Center 2 ;P
TEXT -432 704 Left 2 ;orig
TEXT 0 896 Center 2 ;P16b
TEXT 496 176 Left 2 ;Testtext
TEXT 560 176 Left 4 ;Testtext2
LINE Normal 1392 1104 1312 1104 2
LINE Normal 1392 1136 1312 1120 1
LINE Normal 1392 1152 1312 1168 2
LINE Normal 1424 1184 1312 1184 3
LINE Normal 1424 1200 1312 1216 4
LINE Normal 1456 1248 1312 1232
LINE Normal 1440 1296 1312 1312
LINE Normal 1504 1312 1440 1296
LINE Normal 1584 1296 1504 1312
LINE Normal 1632 1312 1584 1296
RECTANGLE Normal 1632 1232 1520 1120 2
RECTANGLE Normal 1712 1152 1664 1120 1
RECTANGLE Normal 16 176 -160 16 2
2 changes: 1 addition & 1 deletion examples/translate.asy2tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Type {Node|Bipole|Tripole|<N>pole}
Type {Node|Bipole|Tripole|<N>pole|Graphical}
Origin <x1> <y1> <rot> <mirror>
BeginPinList (optional: otherwise created from ASC pin locations
PinNum x1 y1 rot length PinName
Expand Down
9 changes: 9 additions & 0 deletions sym32a/SchLine.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) -- (#self.texx2#,#self.texy2#); % sch Line
EndTex
9 changes: 9 additions & 0 deletions sym32a/SchRect.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) rectangle (#self.texx2#,#self.texy2#); % sch Rect
EndTex
2 changes: 2 additions & 0 deletions sym32a/latex_preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
}
\pgfkeys{/lt2ti/netlabel/font/.initial= \small}
\pgfkeys{/lt2ti/text/font/.initial= \small}
\tikzstyle{dashdotdotted}=[dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt]
\definecolor{netlabelcolor}{rgb}{0, 0, 0.25}
\definecolor{lttotitextcolor}{rgb}{0, 0.4, 0.25}
\definecolor{lttotidrawcolor}{rgb}{0.6, 0.6, 0.6}

\begin{document}%
%\centering%
Expand Down
2 changes: 1 addition & 1 deletion sym32a/opamps/UniversalOpamp2.asy2tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeginPinList
EndPinList
TexElementName op amp
BeginTex
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(0.0,0.0) node {#self.name# #self.value#};
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(##labelmirrorx##*0.75, ##labelmirrory##*1.25) node {#self.name# #self.value#};
\draw (#V+:x1#,#V+:y1#) to [*short, -] (#self.name#.up); \draw (#V-:x1#,#V-:y1#) to [*short, -] (#self.name#.down); % supply
\draw (#In+:x1#,#In+:y1#) to [*short, -] (#self.name#.+); \draw (#In-:x1#,#In-:y1#) to [*short, -] (#self.name#.-); \draw (#OUT:x1#,#OUT:y1#) to [*short, -] (#self.name#.out); % in/out
EndTex
2 changes: 1 addition & 1 deletion sym32a/opamps/differential/fullydifferentialop.asy2tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeginPinList
EndPinList
TexElementName fd op amp
BeginTex
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(0.0,0.0) node {#self.name# #self.value#};
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(##labelmirrorx##*0.75, ##labelmirrory##*1.25) node {#self.name# #self.value#};
\draw (#V+:x1#,#V+:y1#) to [*short, -] (#self.name#.up); \draw (#V-:x1#,#V-:y1#) to [*short, -] (#self.name#.down); % supply
\draw (#In+:x1#,#In+:y1#) to [*short, -] (#self.name#.+); \draw (#In-:x1#,#In-:y1#) to [*short, -] (#self.name#.-); \draw (#OUT+:x1#,#OUT+:y1#) to [*short, -] (#self.name#.out +); \draw (#OUT-:x1#,#OUT-:y1#) to [*short, -] (#self.name#.out -);% in/out
EndTex
9 changes: 9 additions & 0 deletions sym32b/SchLine.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) -- (#self.texx2#,#self.texy2#); % sch Line
EndTex
9 changes: 9 additions & 0 deletions sym32b/SchRect.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) rectangle (#self.texx2#,#self.texy2#); % sch Rect
EndTex
2 changes: 2 additions & 0 deletions sym32b/latex_preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
}
\pgfkeys{/lt2ti/netlabel/font/.initial= \small}
\pgfkeys{/lt2ti/text/font/.initial= \small}
\tikzstyle{dashdotdotted}=[dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt]
\definecolor{netlabelcolor}{rgb}{0, 0, 0.25}
\definecolor{lttotitextcolor}{rgb}{0, 0.4, 0.25}
\definecolor{lttotidrawcolor}{rgb}{0.6, 0.6, 0.6}

\begin{document}%
%\centering%
Expand Down
2 changes: 1 addition & 1 deletion sym32b/opamps/UniversalOpamp2.asy2tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeginPinList
EndPinList
TexElementName op amp
BeginTex
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(0.0,0.0) node {#self.name# #self.value#};
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(##labelmirrorx##*0.75, ##labelmirrory##*1.25) node {#self.name# #self.value#};
\draw (#V+:x1#,#V+:y1#) to [*short, -] (#self.name#.up); \draw (#V-:x1#,#V-:y1#) to [*short, -] (#self.name#.down); % supply
\draw (#In+:x1#,#In+:y1#) to [*short, -] (#self.name#.+); \draw (#In-:x1#,#In-:y1#) to [*short, -] (#self.name#.-); \draw (#OUT:x1#,#OUT:y1#) to [*short, -] (#self.name#.out); % in/out
EndTex
2 changes: 1 addition & 1 deletion sym32b/opamps/differential/fullydifferentialop.asy2tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BeginPinList
EndPinList
TexElementName fd op amp
BeginTex
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(0.0,0.0) node {#self.name# #self.value#};
\draw (#self.texx1#, #self.texy1#) node[#self.symbol.latexElementName#, xscale=##mirror_xscale_value##, rotate=##rotate##, ##options##] (#self.name#) {} (#self.name#)++(##labelmirrorx##*0.75, ##labelmirrory##*1.25) node {#self.name# #self.value#};
\draw (#V+:x1#,#V+:y1#) to [*short, -] (#self.name#.up); \draw (#V-:x1#,#V-:y1#) to [*short, -] (#self.name#.down); % supply
\draw (#In+:x1#,#In+:y1#) to [*short, -] (#self.name#.+); \draw (#In-:x1#,#In-:y1#) to [*short, -] (#self.name#.-); \draw (#OUT+:x1#,#OUT+:y1#) to [*short, -] (#self.name#.out +); \draw (#OUT-:x1#,#OUT-:y1#) to [*short, -] (#self.name#.out -);% in/out
EndTex
9 changes: 9 additions & 0 deletions sym48/SchLine.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) -- (#self.texx2#,#self.texy2#); % sch Line
EndTex
9 changes: 9 additions & 0 deletions sym48/SchRect.asy2tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Type Graphical
TexOrigin 0 0 0 False
SymOrigin 0 0 0 False
BeginPinList
EndPinList
TexElementName None
BeginTex
\draw [#self.texlinestyle#] (#self.texx1#,#self.texy1#) rectangle (#self.texx2#,#self.texy2#); % sch Rect
EndTex
2 changes: 2 additions & 0 deletions sym48/latex_preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
}
\pgfkeys{/lt2ti/netlabel/font/.initial= \small}
\pgfkeys{/lt2ti/text/font/.initial= \small}
\tikzstyle{dashdotdotted}=[dash pattern=on 3pt off 2pt on \the\pgflinewidth off 2pt on \the\pgflinewidth off 2pt]
\definecolor{netlabelcolor}{rgb}{0, 0, 0.25}
\definecolor{lttotitextcolor}{rgb}{0, 0.4, 0.25}
\definecolor{lttotidrawcolor}{rgb}{0.6, 0.6, 0.6}

\begin{document}%
%\centering%
Expand Down

0 comments on commit c61527a

Please sign in to comment.