1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 03:12:49 +02:00

schhist2web: column sharing with SCHHIST_ORDER=...:first=next=...:... (WIP)

This only shows the first name in the header. Should generate a new header
line when a sheet is a column changes. Should also complain when sheets
collide. Needs more testing.
This commit is contained in:
Werner Almesberger 2012-05-11 02:47:18 -03:00
parent b7816b9dad
commit 1468a33268

View File

@ -96,12 +96,23 @@ EOF
} }
#
# Add extra : for :name: and :name= because they consume the leading : while
# =name: and =name= don't and would therefore be placed one position later.
#
ordered_names() ordered_names()
{ {
ls -1 "$out/names" | ( ls -1 "$out/names" | (
order=:$SCHHIST_ORDER:
while read n; do while read n; do
echo "${order%%:$n:*}" | tr -cd : | wc -c | tr '\n' ' ' if [ "${order%%:$n=*}" != "$order" ]; then
echo "${order%%:$n=*}":
elif [ "${order%%=$n:*}" != "$order" ]; then
echo "${order%%=$n:*}"
elif [ "${order%%=$n=*}" != "$order" ]; then
echo "${order%%=$n:*}"
else
echo "${order%%:$n:*}":
fi | tr -cd : | wc -c | tr '\n' ' '
echo "$n" echo "$n"
done; ) | done; ) |
sort -n -s | sed 's/^[^ ]* //' sort -n -s | sed 's/^[^ ]* //'
@ -215,6 +226,7 @@ fi
PATH=`dirname "$0"`:"$PATH" PATH=`dirname "$0"`:"$PATH"
first=`gitenealogy "$dir" "$sch" | sed '$s/ .*//p;d'` first=`gitenealogy "$dir" "$sch" | sed '$s/ .*//p;d'`
schname=`gitenealogy "$dir" "$sch" | sed '$s/^.* //p;d'` schname=`gitenealogy "$dir" "$sch" | sed '$s/^.* //p;d'`
order=:$SCHHIST_ORDER:
rm -rf "$out/*/"{diff,thumb,html,pdf} "$out/names" rm -rf "$out/*/"{diff,thumb,html,pdf} "$out/names"
$no_cache && rm -rf "$cache" $no_cache && rm -rf "$cache"
@ -347,6 +359,7 @@ EOF
<TR bgcolor="$FNAME_COLOR"> <TR bgcolor="$FNAME_COLOR">
EOF EOF
while read m; do while read m; do
[ "${order%%=$m[:=]*}" = "$order" ] || continue
ps="$cache/$head/ps/$m.ps" ps="$cache/$head/ps/$m.ps"
if [ -r "$ps" ]; then if [ -r "$ps" ]; then
# #
@ -392,8 +405,14 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do
thumb="$out/$next/thumb/$m.png" thumb="$out/$next/thumb/$m.png"
pdf="$out/$next/pdf/$m.pdf" pdf="$out/$next/pdf/$m.pdf"
if [ "${order%%=$m[:=]*}" = "$order" ]; then
td=true
else
td=false
fi
if [ -f "$a0" -a -f "$b0" ]; then if [ -f "$a0" -a -f "$b0" ]; then
s="$s<TD align=\"center\" valign=\"middle\">" $td && s="$s<TD align=\"center\" valign=\"middle\">"
if ! pngdiff cat "$diff" "$a1" "$b1" "$a0" "$b0"; then if ! pngdiff cat "$diff" "$a1" "$b1" "$a0" "$b0"; then
s="$s<IMG src=\"unchanged.png\">" s="$s<IMG src=\"unchanged.png\">"
continue continue
@ -402,19 +421,19 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do
exit exit
schps2pdf -T BEFORE -T AFTER -o "$pdf" "$aps" "$bps" || exit schps2pdf -T BEFORE -T AFTER -o "$pdf" "$aps" "$bps" || exit
elif [ -f "$a0" ]; then elif [ -f "$a0" ]; then
s="$s<TD>" $td && s="$s<TD>"
pngdiff cat "$diff" -f -c 1,0,0 "$a1" "$a1" || exit pngdiff cat "$diff" -f -c 1,0,0 "$a1" "$a1" || exit
pngdiff shrink "$thumb" -f $THUMB_OPTS -c 1,0,0 "$a2" "$a2" || pngdiff shrink "$thumb" -f $THUMB_OPTS -c 1,0,0 "$a2" "$a2" ||
exit exit
schps2pdf -T DELETED -o "$pdf" "$aps" || exit schps2pdf -T DELETED -o "$pdf" "$aps" || exit
elif [ -f "$b0" ]; then elif [ -f "$b0" ]; then
s="$s<TD>" $td && s="$s<TD>"
pngdiff cat "$diff" -f -c 0,1,0 "$b1" "$b1" || exit pngdiff cat "$diff" -f -c 0,1,0 "$b1" "$b1" || exit
pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$b2" "$b2" || pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$b2" "$b2" ||
exit exit
schps2pdf -T NEW -o "$pdf" "$bps" || exit schps2pdf -T NEW -o "$pdf" "$bps" || exit
else else
s="$s<TD>" $td && s="$s<TD>"
continue continue
fi fi
echo "$s" echo "$s"
@ -445,7 +464,7 @@ if [ -d "$cache/$next/ppm0" ]; then # could this ever be false ?
thumb="$out/$next/thumb/$m.png" thumb="$out/$next/thumb/$m.png"
pdf="$out/$next/pdf/$m.pdf" pdf="$out/$next/pdf/$m.pdf"
echo "<TD>" [ "${order%%=$m[:=]*}" = "$order" ] && echo "<TD>"
[ -f "$p1" ] || continue [ -f "$p1" ] || continue
pngdiff cat "$diff" -f -c 0,1,0 "$p1" "$p1" || exit pngdiff cat "$diff" -f -c 0,1,0 "$p1" "$p1" || exit
pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$p2" "$p2" || pngdiff shrink "$thumb" -f $THUMB_OPTS -c 0,1,0 "$p2" "$p2" ||