Index: util/pcblib-static.cgi =================================================================== --- util/pcblib-static.cgi (nonexistent) +++ util/pcblib-static.cgi (revision 444) @@ -0,0 +1,215 @@ +#!/bin/bash + +ulimit -t 5 +ulimit -v 80000 + +CGI=/cgi-bin/pcblib-static.cgi +fpdir=/home/igor2/C/pcb-rnd/pcblib/ +sdir=/var/www/tmp/pcblib + +find_fp() +{ + awk -v "fp=$QS_fp" -v "fpdir=$fpdir" ' + BEGIN { + fp=tolower(fp) + } + ($1 == "S") { + n=tolower($2) + sub("^.*/", "", n) + sub(".fp$", "", n) + sub(".ele$", "", n) + if (n == fp) { + print fpdir $2 + exit + } + } + ' < $sdir/cache +} + +list_fps() +{ + echo TODO +} + +radio() +{ + local chk + if test "$3" = "$2" + then + chk=" checked=\"true\"" + fi + echo "" +} + +checked() +{ + if test ! -z "$1" + then + echo " checked=\"true\"" + fi +} + +fix_ltgt() +{ + sed "s/\</g;s/>/\>/g" +} + +qs=`echo "$QUERY_STRING" | tr "&" "\n"` + +for n in $qs +do + exp="QS_$n" + export $exp +done + +export QS_cmd=`echo "$QS_cmd" | /home/igor2/C/libporty/trunk/src/porty/c99tree/url.sh` + +if test -z "$QS_fp" +then + export QS_fp='TO220' + export QS_diamond=1 + gen=connector +fi + +fn=`find_fp` +if test ! "$?" = 0 +then + echo "Content-type: text/plain" + echo "" + echo "Error: couldn't find $QS_fp" + exit +fi + +fptext=`cat $fn` +if test ! "$?" = 0 +then + echo "Content-type: text/plain" + echo "" + echo "Error reading footprint file for $QS_fp $fn" + exit +fi + +if test "$QS_output" = "text" +then + echo "Content-type: text/plain" + echo "" + echo "$fptext" + exit +fi + +if test "$QS_output" = "png" +then + echo "Content-type: image/png" + echo "" + cparm="" + if test ! -z "$QS_mm" + then + cparm="$cparm --mm" + fi + if test ! -z "$QS_diamond" + then + cparm="$cparm --diamond" + fi + if test ! -z "$QS_photo" + then + cparm="$cparm --photo" + fi + (echo "$fptext" | /home/igor2/C/pcb-rnd/util/fp2anim $cparm; echo 'screenshot "/dev/stdout"') | /usr/local/bin/animator -H + exit +fi + +echo "Content-type: text/html" +echo "" + +echo "" +echo "
" +echo "
+
+An outburst while looking for a powerjack connector +footprint in the stock library: +"What on earth is an MSP430F1121 footprint and +why do I need it in the default library?!" + |
+ +
+pcblib++The default library in pcb-rnd +is called the "pcblib" (lib and newlib are already used by vanilla pcb). +Pcblib content consists of +parametric (generated) footprints +and static footprints ("file elements"). This page queries static footprints. + +The goal of pcblib is to ship a minimalistic library of the real essential +parts, targeting small projects and hobbysts. Pcblib assumes users can +grow their own library by downloading footprints from various online sources +(e.g. gedasymbols) or draw their own +as needed. Thus instead of trying to be a complete collection of footprints +ever drawn, it tries to collect the common base so that it is likely that 90% +of pcblib users will use 90% of the footprints in their projects. + + | + |
+List of static footprints+
|
" + echo "" + + echo " | " + + echo " | "
+ echo "" + echo "$fptext" + echo "" + echo " Downloads:"
+ echo " |