Archived
3
0

graph script

This commit is contained in:
Philippe PITTOLI 2017-09-26 14:57:35 +02:00
parent 4ff34a227f
commit 7305833c6a

View File

@ -7,50 +7,40 @@ fi
echo "font : $FONT" echo "font : $FONT"
DIAG=diag # $1 = program, $2 = filename extension
for i in *\.$DIAG function graphit()
{
PROG=$1
FNEXT=$2
ls *.$FNEXT 2>/dev/null 1>&2
if [ $? -eq 0 ]; then
for i in *\.$FNEXT
do do
PNG=$(echo ${i} | sed "s/$DIAG$/pdf/") PDF=$(echo ${i} | sed "s/$FNEXT$/pdf/")
if [ ! -f ${PDF} ] || [ $(stat -c "%X" ${PDF}) -lt $(stat -c "%X" ${i}) ]
if [ ! -f ${PNG} ] || [ $(stat -c "%X" ${PNG}) -lt $(stat -c "%X" ${i}) ]
then then
echo seqdiag ${i} PROGOPT="-Tpdf"
seqdiag -Tpdf -a -f $FONT ${i} 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} echo touch ${PDF}
touch ${PNG} touch ${PDF}
fi fi
done 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}
fi fi
done }
# GDOT="gviz-dot" graphit "seqdiag" "diag"
# for i in *\.$GDOT graphit "packetdiag" "pktdiag"
# do graphit "nwdiag" "nwdiag"
# PDF=$(echo ${i} | sed "s/$GDOT$/pdf/") graphit "dot" "gviz-dot"
#
# 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