summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/dpv
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/circuit_macros/examples/dpv')
-rw-r--r--graphics/circuit_macros/examples/dpv/CanLogicDPV.m444
-rw-r--r--graphics/circuit_macros/examples/dpv/UNODPV.m42
-rw-r--r--graphics/circuit_macros/examples/dpv/examplesDPV.htmx10
-rw-r--r--graphics/circuit_macros/examples/dpv/examplesDPVs.htmx11
-rw-r--r--graphics/circuit_macros/examples/dpv/sfgDPV.m46
-rw-r--r--graphics/circuit_macros/examples/dpv/tstDPV.htmx11
6 files changed, 58 insertions, 26 deletions
diff --git a/graphics/circuit_macros/examples/dpv/CanLogicDPV.m4 b/graphics/circuit_macros/examples/dpv/CanLogicDPV.m4
index b6c1d02e2f..2f05d8e366 100644
--- a/graphics/circuit_macros/examples/dpv/CanLogicDPV.m4
+++ b/graphics/circuit_macros/examples/dpv/CanLogicDPV.m4
@@ -27,18 +27,18 @@ define(`CanLogic',
`define(`terms',`shift(shift(shift(shift($@))))')
# Determine required input variables and negated
# variables
- Loopover_(`t_',`varloop(`v_',`define(X`'v_)',`define(XN`'v_)',t_)',terms)
+ Loopover_(`t_',`CLvarloop(`v_',`define(X`'v_)',`define(XN`'v_)',t_)',terms)
# Draw the inputs with NOT gates as necessary
LastInput: Here-(inputsep,0)
- Loopover_(`t_',`varloop(`v_',
- `ifdef(D`'v_,,`ifdef(XN`'v_,`DrawInNotIn(v_)',`DrawIn(v_)')')',
- `ifdef(D`'v_,,`ifdef(X`'v_,`DrawInNotIn(v_)',`DrawNotIn(v_)')')', t_)',
+ Loopover_(`t_',`CLvarloop(`v_',
+ `ifdef(D`'v_,,`ifdef(XN`'v_,`CLDrawInNotIn(v_)',`CLDrawIn(v_)')')',
+ `ifdef(D`'v_,,`ifdef(X`'v_,`CLDrawInNotIn(v_)',`CLDrawNotIn(v_)')')', t_)',
terms)
# Draw 2nd-layer gates
right_
LastGateSE: LastInput+(5*jog,-(AND_wd*L_unit*1.5))
Loopover_(`t_',
- `define(`termcount',m4Lx)DrawLayerGate(G`'termcount,$1,$2,t_)',
+ `define(`termcount',m4Lx)CLDrawLayerGate(G`'termcount,$1,$2,t_)',
terms)
# Draw output gate
linethick = gatelineth
@@ -47,26 +47,26 @@ define(`CanLogic',
Out: Here
linethick = lineth
# Connect 2nd-layer gates to the output gate
- VectorConnect(G,termcount,OP)
+ CLVectorConnect(G,termcount,OP)
# Connect the inputs and negated inputs to
# 2nd-layer gates
- Loopover_(`t_',`ConnectInputs(G`'m4Lx,t_)',terms)
+ Loopover_(`t_',`CLConnectInputs(G`'m4Lx,t_)',terms)
# Clean up
- Loopover_(`t_',`DeleteLogDefs(t_)',terms)
+ Loopover_(`t_',`CLDeleteLogDefs(t_)',terms)
')
- `VectorConnect(number of 2nd layer gates,
+ `CLVectorConnect(number of 2nd layer gates,
common 2nd layer gate name,
output gate name)
Connect the 2nd-layer gate outputs to the
output gate inputs'
-define(`VectorConnect',
+define(`CLVectorConnect',
`for_(1,`$2',1,
`line from `$1'm4x.Out right `$3'.In1.x-`$1'm4x.Out.x \
- jog/2*(`$2'+1-abs(2*m4x-`$2'-1)) \
then down `$1'm4x.Out.y - `$3'.In`'m4x.y then to `$3'.In`'m4x ')')
Draw and label a non-inverted input
-define(`DrawIn',
+define(`CLDrawIn',
`LastInput: LastInput+(inputsep,0)
In`'$1: LastInput
"svg_it($1)" ljust at LastInput # Maybe labels should be done externally
@@ -74,7 +74,7 @@ define(`DrawIn',
define(D`'$1)')
Draw and label an inverted input
-define(`DrawNotIn',
+define(`CLDrawNotIn',
`LastInput: LastInput+(inputsep,0)
InN`'$1: LastInput
"svg_it($1)" ljust at LastInput # Maybe labels should be done externally
@@ -86,7 +86,7 @@ define(`DrawNotIn',
define(D`'$1)')
Draw and label an input that is required both
inverted and uninverted.
-define(`DrawInNotIn',
+define(`CLDrawInNotIn',
`LastInput: LastInput+(inputsep,0)
In`'$1: LastInput
"svg_it($1)" ljust at LastInput # Maybe labels should be done externally
@@ -99,23 +99,23 @@ define(`DrawInNotIn',
linethick = lineth
InNt`'$1: Here
define(D`'$1)')
- `varloop(`var',ifnotnegated,ifnegated,term)
+ `CLvarloop(`var',ifnotnegated,ifnegated,term)
Loop over term variables performing actions'
-define(`varloop',`ifelse(`$4',,,substr(`$4',0,1),~,
+define(`CLvarloop',`ifelse(`$4',,,substr(`$4',0,1),~,
`define(`$1',substr($4,1,1)) $3
- varloop(`$1',`$2',`$3',substr($4,2))',
+ CLvarloop(`$1',`$2',`$3',substr($4,2))',
`define(`$1',substr($4,0,1)) $2
- varloop(`$1',`$2',`$3',substr($4,1))')')')
+ CLvarloop(`$1',`$2',`$3',substr($4,1))')')')
Count gate inputs and mark last appearance
-define(`Countinputs',`varloop(`v_',
+define(`CLCountinputs',`CLvarloop(`v_',
`define(`incount',incr(incount)) define(Last`'v_,`$1')',
`define(`incount',incr(incount)) define(LastN`'v_,`$1')',$2)')
Draw a 2nd layer gate
-define(`DrawLayerGate',
+define(`CLDrawLayerGate',
`define(`incount',0)
- Countinputs($1,$4)
+ CLCountinputs($1,$4)
ifelse(incount,1,
`LastGateSE: LastGateSE-(0,jog)
$1: [ In1:Here; line right AND_wd*L_unit; Out: Here] \
@@ -126,7 +126,7 @@ define(`DrawLayerGate',
linethick = lineth ')')
Connect this gate to its input lines
-define(`ConnectInputs',`define(`innum',0) varloop(`v_',
+define(`CLConnectInputs',`define(`innum',0) CLvarloop(`v_',
`define(`innum',incr(innum))
line from `$1'.In`'innum to (In`'v_,`$1'.In`'innum)dnl
ifelse(`$1',m4xpand(Last`'v_),`then to In`'v_',`; dot')',
@@ -136,7 +136,7 @@ define(`ConnectInputs',`define(`innum',0) varloop(`v_',
Delete definitions to allow more than one
circuit per diagram
-define(`DeleteLogDefs',`varloop(`v_',
+define(`CLDeleteLogDefs',`CLvarloop(`v_',
`undefine(Last`'v_) undefine(D`'v_) undefine(X`'v_)',
`undefine(LastN`'v_) undefine(D`'v_) undefine(XN`'v_)',$1)')
diff --git a/graphics/circuit_macros/examples/dpv/UNODPV.m4 b/graphics/circuit_macros/examples/dpv/UNODPV.m4
index 86b5100f34..3e5fb11e93 100644
--- a/graphics/circuit_macros/examples/dpv/UNODPV.m4
+++ b/graphics/circuit_macros/examples/dpv/UNODPV.m4
@@ -153,7 +153,7 @@ divert(0)dnl
dot
dot(at R1.start-(2*del,0))
xtal(down_ 2*lg_pinsep)
- rlabel(16,,MHz); dot
+ rlabel(,16,MHz); dot
XT2: dot(at last line.start-(2*del,0)); { "XT2" at last [].n above }
Br1: jumper(left_ from U3.Pin33.end to (XT2,U3.Pin33))
diff --git a/graphics/circuit_macros/examples/dpv/examplesDPV.htmx b/graphics/circuit_macros/examples/dpv/examplesDPV.htmx
index 8d33b9f07e..84fb877209 100644
--- a/graphics/circuit_macros/examples/dpv/examplesDPV.htmx
+++ b/graphics/circuit_macros/examples/dpv/examplesDPV.htmx
@@ -21,6 +21,16 @@ flowcharts, picture overlay, ASME Y14.5' >
<link rel="shortcut icon" href="../Circuit_macros.ico" type="image/x-icon" />
</HEAD>
+`<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-HRS8TQGRE8"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', 'G-HRS8TQGRE8');
+</script>'
+
<!-- m4 macros: ------------------------------------------------------------
define(`ifinstr',`ifelse(`$2',,`$1',index(`$1',`$2'),-1,
`ifinstr(shift(shift(shift($@))))',`$3')')
diff --git a/graphics/circuit_macros/examples/dpv/examplesDPVs.htmx b/graphics/circuit_macros/examples/dpv/examplesDPVs.htmx
index 7ad5f84e9f..e46725b0d7 100644
--- a/graphics/circuit_macros/examples/dpv/examplesDPVs.htmx
+++ b/graphics/circuit_macros/examples/dpv/examplesDPVs.htmx
@@ -21,6 +21,17 @@ flowcharts, picture overlay, ASME Y14.5' >
<link rel="shortcut icon" href="../Circuit_macros.ico" type="image/x-icon" />
</HEAD>
+`<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-HRS8TQGRE8"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', 'G-HRS8TQGRE8');
+</script>'
+
+
<!-- m4 macros: ------------------------------------------------------------
define(`ifinstr',`ifelse(`$2',,`$1',index(`$1',`$2'),-1,
`ifinstr(shift(shift(shift($@))))',`$3')')
diff --git a/graphics/circuit_macros/examples/dpv/sfgDPV.m4 b/graphics/circuit_macros/examples/dpv/sfgDPV.m4
index 4e32981619..a516b3fb97 100644
--- a/graphics/circuit_macros/examples/dpv/sfgDPV.m4
+++ b/graphics/circuit_macros/examples/dpv/sfgDPV.m4
@@ -1,7 +1,7 @@
.PS
# sfgDPV.m4
gen_init(svg_font(Times,11bp__))
-sfg_init( 1.2 ) # scale default size by 1.2
+sfg_init( blen=1.2 ) # default edge length
textht = textht*0.9
@@ -71,7 +71,7 @@ define(`svg_choose',`[ P:"svg_fsize(( ),150)"
"svg_small(`$2')" at P-(0,3bp__)
]')
-G4: [sfg_init( 2.0,0.25/2 ) # change node spacing and increase node size
+G4: [sfg_init( blen=2;rad=0.25/2 ) # change node spacing and size
s1 = 0.9
s2 = 1.2
N0: sfgnode(,svg_fsize(0,120),,invis)
@@ -98,7 +98,7 @@ G4: [sfg_init( 2.0,0.25/2 ) # change node spacing and increase node size
] with .nw at G3.sw+(0,-0.1)
# https://tex.stackexchange.com/questions/637455/tikz-how-to-set-exact-position-of-node
-G5: [sfg_init( 1.75,0.25/2 ) # change node spacing and increase node size
+G5: [sfg_init( blen=1.75;rad=0.25/2 ) # change node spacing and size
Dstar: sfgnode(,* )
D0: sfgnode(at Dstar+(2,0),svg_small(&lt;&gt;)svg_sub(0) )
sfgline(,
diff --git a/graphics/circuit_macros/examples/dpv/tstDPV.htmx b/graphics/circuit_macros/examples/dpv/tstDPV.htmx
index 64d1753399..3859f9f30f 100644
--- a/graphics/circuit_macros/examples/dpv/tstDPV.htmx
+++ b/graphics/circuit_macros/examples/dpv/tstDPV.htmx
@@ -21,6 +21,17 @@ flowcharts, picture overlay, ASME Y14.5' >
<link rel="shortcut icon" href="../Circuit_macros.ico" type="image/x-icon" />
</HEAD>
+`<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-HRS8TQGRE8"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag(){dataLayer.push(arguments);}
+ gtag('js', new Date());
+
+ gtag('config', 'G-HRS8TQGRE8');
+</script>'
+
+
<!-- m4 macros: ------------------------------------------------------------
define(`ifinstr',`ifelse(`$2',,`$1',index(`$1',`$2'),-1,
`ifinstr(shift(shift(shift($@))))',`$3')')