mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-25 17:01:53 +02:00
Added a data sheet viewer. It improves upon the design used in gta02-core by
allowing a hierarchy of caches, by using only one directory for each cache, and by putting only one command in the PATH. - scripts/dsv: new and improved data sheet viewer (successor of gta02-core's dsv) - Makefile: added "dsv" target to update the bookshelf - ds/INFO, components/INFO, modules/INFO: ds/INFO moved to BOOKSHELF - components/INFO, modules/INFO: renamed "D" tag to "N", for consistency with BOOKSHELF - BOOKSHELF: changed "stdpass" URL to the actual PDF
This commit is contained in:
parent
42e8ecb722
commit
6ec22bc755
@ -1,3 +1,11 @@
|
||||
#
|
||||
# Tags:
|
||||
#
|
||||
# N name to use for dsv (must be first)
|
||||
# A alias name(s)
|
||||
# D data sheet url
|
||||
#
|
||||
|
||||
N: at86rf230
|
||||
A: transceiver
|
||||
A: txrx
|
||||
@ -30,5 +38,4 @@ D: http://jae-connector.com/en/pdf/SJ037525.pdf
|
||||
|
||||
# Footprints of standard rectangular passive components
|
||||
N: stdpass
|
||||
D: http://www.vishay.com/doc?20035
|
||||
|
||||
D: http://www.vishay.com/docs/20035/dcrcwe3.pdf
|
13
Makefile
13
Makefile
@ -1,18 +1,21 @@
|
||||
.PHONY: all gen generate sch brd xpdf
|
||||
.PHONY: all gen generate sch brd xpdf dsv
|
||||
|
||||
all:
|
||||
@echo "make what ? target: gen sch xpdf brd"
|
||||
@echo "make what ? target: gen sch brd xpdf dsv"
|
||||
@exit 1
|
||||
|
||||
gen generate:
|
||||
eeschema --plot `pwd`/wpan-atrf.sch
|
||||
# need scripts
|
||||
|
||||
xpdf:
|
||||
xpdf wpan-atrf.pdf
|
||||
|
||||
sch:
|
||||
eeschema `pwd`/wpan-atrf.sch
|
||||
|
||||
brd:
|
||||
pcbnew `pwd`/wpan-atrf.brd
|
||||
|
||||
xpdf:
|
||||
xpdf wpan-atrf.pdf
|
||||
|
||||
dsv:
|
||||
scripts/dsv setup BOOKSHELF
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# S Symbol name (must be first)
|
||||
# M Package marking
|
||||
# D Data sheet identifier (N tag of ds/INFO; can be omitted if equal to S)
|
||||
# N Data sheet identifier (N tag of BOOKSHELF; can be omitted if equal to S)
|
||||
#
|
||||
|
||||
# C8051F326 MCU
|
||||
|
@ -2,12 +2,12 @@
|
||||
# Tags:
|
||||
#
|
||||
# F Footprint name (must be first)
|
||||
# D Data sheet identifier (N tag of ds/INFO; can be omitted if equal to F)
|
||||
# N Data sheet identifier (N tag of BOOKSHELF; can be omitted if equal to F)
|
||||
#
|
||||
|
||||
# TI meandered inverted F antenna
|
||||
F: meander
|
||||
D: AN043
|
||||
N: AN043
|
||||
|
||||
# Mini-USB B receptable (SMT; almost generic)
|
||||
F: mini_usb_b
|
||||
|
151
scripts/dsv
Executable file
151
scripts/dsv
Executable file
@ -0,0 +1,151 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# dsv - Improved data sheet viewer
|
||||
#
|
||||
|
||||
#
|
||||
# Theory of operation:
|
||||
#
|
||||
# We download data sheets from the Internet into local caches and provide a
|
||||
# quick access mechanism for viewing the data sheets. A cache is a directory
|
||||
# called .dsv/. Caches can be hierarchical. "dsv setup" generates a cache in
|
||||
# the local directory. "dsv <component>" and "dsv ls" search the hierarchy,
|
||||
# starting with the current directory.
|
||||
#
|
||||
# Caches contain two types of files: dsv-<ref> is the name or alias with
|
||||
# which a data sheet is referenced. <ref>-<filename> is the actual data
|
||||
# sheet, with <filename> being the name of the file we downloaded.
|
||||
#
|
||||
|
||||
DSV_DIR=.dsv
|
||||
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: $0 <component>" 2>&1
|
||||
echo " $0 help" 2>&1
|
||||
echo " $0 [ls]" 2>&1
|
||||
echo " $0 setup <info-file> .." 2>&1
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
up()
|
||||
{
|
||||
old="`pwd`"
|
||||
cd ..
|
||||
new="`pwd`"
|
||||
[ "$old" != "$new" ]
|
||||
}
|
||||
|
||||
|
||||
flush()
|
||||
{
|
||||
[ -z "$name" ] && return
|
||||
if [ -z "$url" ]; then
|
||||
echo "$name: no URL" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
ds="$name-`basename "$url"`"
|
||||
mkdir -p $DSV_DIR
|
||||
if [ ! -r "$DSV_DIR/$ds" ]; then
|
||||
wget -nv -O "$DSV_DIR/$ds" "$url"
|
||||
# @@@ should handle error
|
||||
fi
|
||||
for n in $name $alias; do
|
||||
echo "$ds" >$DSV_DIR/dsv-$n
|
||||
done
|
||||
name=
|
||||
alias=
|
||||
url=
|
||||
}
|
||||
|
||||
|
||||
set_value()
|
||||
{
|
||||
case "$tag" in
|
||||
N:|n:) flush
|
||||
name="$value";;
|
||||
A:|a:) alias="$alias $value";;
|
||||
D:|d:) url="$value";;
|
||||
"")
|
||||
;; # first iteration
|
||||
*) echo "unrecognized tag \"$tag\"" 2>&1
|
||||
exit 1;;
|
||||
esac
|
||||
value=
|
||||
}
|
||||
|
||||
|
||||
eof()
|
||||
{
|
||||
flush
|
||||
tag=
|
||||
}
|
||||
|
||||
|
||||
setup()
|
||||
{
|
||||
for n in "$@"; do
|
||||
if [ ! -r "$n" ]; then
|
||||
echo "$n: not found" 2>&1
|
||||
continue
|
||||
fi
|
||||
while read line; do
|
||||
[ "$line" = "${line###}" ] || continue
|
||||
tmp=`echo "$line" | awk '/^[^\t ]/ { print $1 }'`
|
||||
tail="`echo "$line" | sed 's/^[^\t ]*[\t ]*//'`"
|
||||
if [ -z "$tmp" ]; then
|
||||
[ -z "$tail" ] || value="$value $tail"
|
||||
else
|
||||
set_value
|
||||
tag=$tmp
|
||||
value="$tail"
|
||||
fi
|
||||
done <"$n"
|
||||
set_value
|
||||
eof
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
list()
|
||||
{
|
||||
while true; do
|
||||
if [ -d $DSV_DIR ]; then
|
||||
ls -1 $DSV_DIR | sed 's/^dsv-//p;d'
|
||||
fi
|
||||
up || break
|
||||
done | sort | uniq | column
|
||||
}
|
||||
|
||||
|
||||
search()
|
||||
{
|
||||
while true; do
|
||||
if [ -d $DSV_DIR ]; then
|
||||
if [ -r "$DSV_DIR/dsv-$1" ]; then
|
||||
file="`cat $DSV_DIR/dsv-$1`"
|
||||
if [ ! -r "$DSV_DIR/$file" ]; then
|
||||
echo "$1 -> $file: does not exist" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
xpdf "$DSV_DIR/$file"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
if ! up; then
|
||||
echo "no data sheet found for \"$1\"" 2>&1
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
help|-*) usage;;
|
||||
""|ls) list;;
|
||||
setup) shift
|
||||
setup "$@";;
|
||||
*) search "$@";;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user