Skip to content

Commit

Permalink
- add verification curve to library trends (set to 0 now if it doesn'…
Browse files Browse the repository at this point in the history
…t exist)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25133 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 18, 2015
1 parent b53a961 commit 514d1ee
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Examples/PlotLibraryTrend.sh
Expand Up @@ -22,6 +22,7 @@ fi
GOAL=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,.*/,,`
CURS=`grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,`
CURC=`grep -H "BuildModel Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,,`
CURV=`(grep -H "Verified Results:" "$HISTORY/${LIB}"-*.html | tail -n1 | grep -o "[0-9][0-9]*/[0-9][0-9]*" | sed s,/.*,, ) || 0`
cat > "$HISTORY/${LIB}-trend.gnuplot" <<EOF
set term png
set datafile separator ","
Expand All @@ -31,7 +32,7 @@ set xdata time
set timefmt "%Y-%m-%d"
set format x "%m-%d"
set xrange ["$FIRST_DATE":"$LAST_DATE"]
# set yrange [0:$(( (($GOAL+9)/10)*10 ))]
# set yrange [0:$(( (($GOAL+9)/10)*10 + 1))]
set yrange [0:]
# set ytics 10
# set xtics rotate by -13 font "Helvetica,8"
Expand All @@ -40,13 +41,16 @@ set output "${LIB}-trend.png"
goal(x) = $GOAL
currentC(x) = $CURC
currentS(x) = $CURS
currentV(x) = $CURV
set key right bottom Left title 'Legend'
set style line 1 linecolor rgb "red" pt 1 ps 1
set style line 2 linecolor rgb "blue" pt 1 ps 1
set style line 3 linecolor rgb "green" pt 1 ps 1
set style line 4 linecolor rgb "orange" pt 1 ps 1
plot "${LIB}-trend.csv" using 1:2 title 'Target: $GOAL' with lines ls 1, \
"${LIB}-trend.csv" using 1:3 title 'Compile: $CURC' with lines ls 2, \
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3, \
"${LIB}-trend.csv" using 1:4 title 'Verified: $CURS' with lines ls 4
EOF

cat > "$HISTORY/${LIB}-trend-detailed.gnuplot" <<EOF
Expand All @@ -58,7 +62,7 @@ set xdata time
set timefmt "%Y-%m-%d"
set format x "%m-%d"
set xrange ["$FIRST_DATE_DETAILED":"$LAST_DATE"]
# set yrange [0:$(( (($GOAL+9)/10)*10 ))]
# set yrange [0:$(( (($GOAL+9)/10)*10 + 1))]
set yrange [0:]
# set ytics 10
# set xtics rotate by -13 font "Helvetica,8"
Expand All @@ -67,23 +71,27 @@ set output "${LIB}-trend-detailed.png"
goal(x) = $GOAL
currentC(x) = $CURC
currentS(x) = $CURS
currentV(x) = $CURV
set key right bottom Left title 'Legend'
set style line 1 linecolor rgb "red" pt 1 ps 1
set style line 2 linecolor rgb "blue" pt 1 ps 1
set style line 3 linecolor rgb "green" pt 1 ps 1
set style line 4 linecolor rgb "orange" pt 1 ps 1
plot "${LIB}-trend.csv" using 1:2 title 'Target: $GOAL' with lines ls 1, \
"${LIB}-trend.csv" using 1:3 title 'Compile: $CURC' with lines ls 2, \
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3
"${LIB}-trend.csv" using 1:4 title 'Simulate: $CURS' with lines ls 3, \
"${LIB}-trend.csv" using 1:4 title 'Verified: $CURV' with lines ls 4
EOF
rm -f "$HISTORY/${LIB}"-trend.csv
for f in `grep -H "Simulation Results:" "$HISTORY/${LIB}"-*.html | cut -d: -f1` ; do
DATE=`echo "$f" | grep -o "20[0-9-]*"`
BUILD=`grep "BuildModel Results:" "$f" | cut -d: -f2 | cut -d/ -f1 | tr -d \ `
SIM=`grep "Simulation Results:" "$f" | cut -d: -f2`
SIMSUC=`echo "$SIM" | cut -d/ -f1`
VER=`(grep "Verified Results:" "$f" | cut -d: -f2 | cut -d/ -f1 | tr -d) || 0`
TOT=`echo "$SIM" | cut -d/ -f2 | cut -d" " -f1`
REV=`grep -o "[(]r[0-9]*" "$f" | tr -d "("`
echo "$DATE,$TOT,$BUILD,$SIMSUC" >> "$HISTORY/${LIB}-trend.csv"
echo "$DATE,$TOT,$BUILD,$SIMSUC,$VER" >> "$HISTORY/${LIB}-trend.csv"
done
(cd "$HISTORY"; gnuplot "${LIB}-trend.gnuplot" ; gnuplot "${LIB}-trend-detailed.gnuplot")
sed -i s/png/svg/ "$HISTORY/${LIB}-trend.gnuplot"
Expand Down

0 comments on commit 514d1ee

Please sign in to comment.