graph script
This commit is contained in:
parent
4ff34a227f
commit
7305833c6a
@ -7,50 +7,40 @@ fi
|
||||
|
||||
echo "font : $FONT"
|
||||
|
||||
DIAG=diag
|
||||
for i in *\.$DIAG
|
||||
do
|
||||
PNG=$(echo ${i} | sed "s/$DIAG$/pdf/")
|
||||
|
||||
if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ]
|
||||
# $1 = program, $2 = filename extension
|
||||
function graphit()
|
||||
{
|
||||
PROG=$1
|
||||
FNEXT=$2
|
||||
ls *.$FNEXT 2>/dev/null 1>&2
|
||||
if [ $? -eq 0 ]; then
|
||||
for i in *\.$FNEXT
|
||||
do
|
||||
PDF=$(echo ${i} | sed "s/$FNEXT$/pdf/")
|
||||
if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ]
|
||||
then
|
||||
|
||||
echo seqdiag ${i}
|
||||
seqdiag -Tpdf -a -f $FONT ${i}
|
||||
PROGOPT="-Tpdf"
|
||||
case $PROG in
|
||||
"seqdiag" | "packetdiag" | "nwdiag")
|
||||
PROGOPT="$PROGOPT -a -f $FONT"
|
||||
echo ${PROG} ${PROGOPT} ${i}
|
||||
${PROG} ${PROGOPT} ${i}
|
||||
;;
|
||||
"dot")
|
||||
echo "${PROG} ${PROGOPT} ${i} > ${PDF}"
|
||||
${PROG} ${PROGOPT} ${i} > ${PDF}
|
||||
;;
|
||||
esac
|
||||
|
||||
echo touch ${PNG}
|
||||
touch ${PNG}
|
||||
echo touch ${PDF}
|
||||
touch ${PDF}
|
||||
fi
|
||||
done
|
||||
|
||||
PKTDIAG=pktdiag
|
||||
for i in *\.$PKTDIAG
|
||||
do
|
||||
PNG=$(echo ${i} | sed "s/$PKTDIAG$/pdf/")
|
||||
|
||||
if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ]
|
||||
then
|
||||
|
||||
echo seqdiag ${i}
|
||||
packetdiag -Tpdf -a -f $FONT ${i}
|
||||
|
||||
echo touch ${PNG}
|
||||
touch ${PNG}
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# GDOT="gviz-dot"
|
||||
# for i in *\.$GDOT
|
||||
# do
|
||||
# PDF=$(echo ${i} | sed "s/$GDOT$/pdf/")
|
||||
#
|
||||
# if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ]
|
||||
# then
|
||||
#
|
||||
# echo dot ${i}
|
||||
# dot -Tpdf ${i} > ${PDF}
|
||||
#
|
||||
# echo touch ${PDF}
|
||||
# touch ${PDF}
|
||||
# fi
|
||||
# done
|
||||
graphit "seqdiag" "diag"
|
||||
graphit "packetdiag" "pktdiag"
|
||||
graphit "nwdiag" "nwdiag"
|
||||
graphit "dot" "gviz-dot"
|
||||
|
Reference in New Issue
Block a user