Index: util/pcblib-map/imgmap.sh
===================================================================
--- util/pcblib-map/imgmap.sh (revision 393)
+++ util/pcblib-map/imgmap.sh (nonexistent)
@@ -1,116 +0,0 @@
-#!/bin/sh
-png=map.png
-pcb=map.pcb
-
-png_dims=`file $png | awk -F "[,]" '{ sub("x", " ", $2); print $2}'`
-
-awk -v "png_dims=$png_dims" -v "png_url=$png" '
-BEGIN {
- q = "\""
- sub("^ *", "", png_dims)
- sub(" *$", "", png_dims)
- split(png_dims, A, " +")
- png_sx = A[1]
- png_sy = A[2]
- ne = 0
-}
-
-function bump(idx, x, y)
-{
- if ((E[idx, "minx"] == "") || (x < E[idx, "minx"]))
- E[idx, "minx"] = x
- if ((E[idx, "maxx"] == "") || (x > E[idx, "maxx"]))
- E[idx, "maxx"] = x
- if ((E[idx, "miny"] == "") || (y < E[idx, "miny"]))
- E[idx, "miny"] = y
- if ((E[idx, "maxy"] == "") || (y > E[idx, "maxy"]))
- E[idx, "maxy"] = y
-}
-
-# Element["" "rcy(150, bar-sign)" "C1" "acy150" 22500 95000 -2000 -4500 1 100 ""]
-/^Element *[[]/ {
- coords=$0
- sub("Element *[[]", "", coords)
- for(n = 1; n <= 4; n++) {
- match(coords, "[\"][^\"]*[\"]")
- P[n] = substr(coords, RSTART+1, RLENGTH-2)
- sub("[\"][^\"]*[\"]", "", coords)
- }
- split(coords, A, " ")
- E[ne, "cmd"] = P[2]
- E[ne, "cx"] = A[1]
- E[ne, "cy"] = A[2]
- ne++
- next
-}
-
-#ElementLine [-11811 -13006 -11811 -11250 3937]
-/^[ \t]*ElementLine *[[]/ {
- sub("ElementLine *[[]", "", $0)
- bump(ne-1, $1, $2)
- bump(ne-1, $3, $4)
- next
-}
-
-#ElementArc [-11811 -13006 -11811 -11250 3937]
-/^[ \t]*ElementArc *[[]/ {
- sub("ElementArc *[[]", "", $0)
- x = $1
- y = $2
- rx = $3
- ry = $4
- bump(ne-1, x-rx, y-ry)
- bump(ne-1, x+rx, y+ry)
- next
-}
-
-#Via[260000 120000 7874 4000 0 3150 "" ""]
-/^[ \t]*Via *[[]/ {
- sub("Via *[[]", "", $0)
- pcb_sx = $1
- pcb_sy = $2
- next
-}
-
-
-END {
- scale_x = png_sx/pcb_sx
- scale_y = png_sy/pcb_sy
-
- print ""
- print ""
-}
-
-' < $pcb > a.html
-
-
Property changes on: util/pcblib-map/imgmap.sh
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Index: util/pcblib-map/imgmap_fp.sh
===================================================================
--- util/pcblib-map/imgmap_fp.sh (nonexistent)
+++ util/pcblib-map/imgmap_fp.sh (revision 394)
@@ -0,0 +1,116 @@
+#!/bin/sh
+png=map.png
+pcb=map.pcb
+
+png_dims=`file $png | awk -F "[,]" '{ sub("x", " ", $2); print $2}'`
+
+awk -v "png_dims=$png_dims" -v "png_url=$png" '
+BEGIN {
+ q = "\""
+ sub("^ *", "", png_dims)
+ sub(" *$", "", png_dims)
+ split(png_dims, A, " +")
+ png_sx = A[1]
+ png_sy = A[2]
+ ne = 0
+}
+
+function bump(idx, x, y)
+{
+ if ((E[idx, "minx"] == "") || (x < E[idx, "minx"]))
+ E[idx, "minx"] = x
+ if ((E[idx, "maxx"] == "") || (x > E[idx, "maxx"]))
+ E[idx, "maxx"] = x
+ if ((E[idx, "miny"] == "") || (y < E[idx, "miny"]))
+ E[idx, "miny"] = y
+ if ((E[idx, "maxy"] == "") || (y > E[idx, "maxy"]))
+ E[idx, "maxy"] = y
+}
+
+# Element["" "rcy(150, bar-sign)" "C1" "acy150" 22500 95000 -2000 -4500 1 100 ""]
+/^Element *[[]/ {
+ coords=$0
+ sub("Element *[[]", "", coords)
+ for(n = 1; n <= 4; n++) {
+ match(coords, "[\"][^\"]*[\"]")
+ P[n] = substr(coords, RSTART+1, RLENGTH-2)
+ sub("[\"][^\"]*[\"]", "", coords)
+ }
+ split(coords, A, " ")
+ E[ne, "cmd"] = P[2]
+ E[ne, "cx"] = A[1]
+ E[ne, "cy"] = A[2]
+ ne++
+ next
+}
+
+#ElementLine [-11811 -13006 -11811 -11250 3937]
+/^[ \t]*ElementLine *[[]/ {
+ sub("ElementLine *[[]", "", $0)
+ bump(ne-1, $1, $2)
+ bump(ne-1, $3, $4)
+ next
+}
+
+#ElementArc [-11811 -13006 -11811 -11250 3937]
+/^[ \t]*ElementArc *[[]/ {
+ sub("ElementArc *[[]", "", $0)
+ x = $1
+ y = $2
+ rx = $3
+ ry = $4
+ bump(ne-1, x-rx, y-ry)
+ bump(ne-1, x+rx, y+ry)
+ next
+}
+
+#Via[260000 120000 7874 4000 0 3150 "" ""]
+/^[ \t]*Via *[[]/ {
+ sub("Via *[[]", "", $0)
+ pcb_sx = $1
+ pcb_sy = $2
+ next
+}
+
+
+END {
+ scale_x = png_sx/pcb_sx
+ scale_y = png_sy/pcb_sy
+
+ print ""
+ print ""
+}
+
+' < $pcb > a.html
+
+
Property changes on: util/pcblib-map/imgmap_fp.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: util/pcblib-map/imgmap_page.sh
===================================================================
--- util/pcblib-map/imgmap_page.sh (nonexistent)
+++ util/pcblib-map/imgmap_page.sh (revision 394)
@@ -0,0 +1,127 @@
+#!/bin/sh
+png=map.png
+pcb=map.pcb
+
+png_dims=`file $png | awk -F "[,]" '{ sub("x", " ", $2); print $2}'`
+
+awk -v "png_dims=$png_dims" -v "png_url=$png" '
+BEGIN {
+ q = "\""
+ sub("^ *", "", png_dims)
+ sub(" *$", "", png_dims)
+ split(png_dims, A, " +")
+ png_sx = A[1]
+ png_sy = A[2]
+ ne = 0
+ te = 0
+}
+
+
+# Polygon("clearpoly")
+# (
+# [5000 2500] [277500 2500] [277500 547500] [5000 547500]
+# )
+
+function bump(idx, x, y)
+{
+ if ((E[idx, "minx"] == "") || (x < E[idx, "minx"]))
+ E[idx, "minx"] = x
+ if ((E[idx, "maxx"] == "") || (x > E[idx, "maxx"]))
+ E[idx, "maxx"] = x
+ if ((E[idx, "miny"] == "") || (y < E[idx, "miny"]))
+ E[idx, "miny"] = y
+ if ((E[idx, "maxy"] == "") || (y > E[idx, "maxy"]))
+ E[idx, "maxy"] = y
+}
+
+/^[ \t]*Polygon[(]/ {
+ getline
+ getline
+ gsub("[[\\]]", "", $0)
+ for(n = 1; n < NF; n+=2)
+ bump(ne, $n, $(n+1))
+ ne++
+ next
+}
+
+# Text[296338 119704 0 670 "PARAMETRIC" "clearline"]
+/^[ \t]*Text[[]/ {
+ sub("^[ \t]*Text[[]", "", $0)
+ T[te, "x"] = $1
+ T[te, "y"] = $2
+ T[te, "text"] = $5
+ gsub("[\"]", "", T[te, "text"])
+ te++
+ next
+}
+
+#Via[260000 120000 7874 4000 0 3150 "" ""]
+/^[ \t]*Via *[[]/ {
+ sub("Via *[[]", "", $0)
+ pcb_sx = $1
+ pcb_sy = $2
+ next
+}
+
+
+END {
+ scale_x = png_sx/pcb_sx
+ scale_y = png_sy/pcb_sy
+
+ print ""
+ print ""
+}
+
+' < $pcb > map.html
+
+
Property changes on: util/pcblib-map/imgmap_page.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property