Skip to content

Commit

Permalink
tools: fix units for trackpoint accel graph
Browse files Browse the repository at this point in the history
We use speed now and trackpoints are in units/ms

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Jul 11, 2018
1 parent 6dca5df commit 5f9c985
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/make-ptraccel-graphs.sh
Expand Up @@ -76,13 +76,13 @@ done
$gnuplot <<EOF
set terminal svg enhanced background rgb 'white'
set output "$outfile.svg"
set xlabel "delta (units)"
set xlabel "delta (units/ms)"
set ylabel "accel factor"
set style data lines
set yrange [0:5]
set xrange [0:20]
speeds="$speeds"
fname(s)=sprintf("$outfile-%s.gnuplot", s)
plot for [s in speeds] fname(s) using 1:2 title s, \
plot for [s in speeds] fname(s) using 4:2 title s, \
EOF
5 changes: 3 additions & 2 deletions tools/ptraccel-debug.c
Expand Up @@ -161,11 +161,12 @@ print_accel_func(struct motion_filter *filter,
printf("# set style data lines\n");
printf("# plot \"gnuplot.data\" using 1:2 title 'accel factor'\n");
printf("#\n");
printf("# data: velocity(mm/s) factor velocity(units/us)\n");
printf("# data: velocity(mm/s) factor velocity(units/us) velocity(units/ms)\n");
for (mmps = 0.0; mmps < 1000.0; mmps += 1) {
double units_per_us = mmps_to_upus(mmps, dpi);
double units_per_ms = units_per_us * 1000.0;
double result = profile(filter, NULL, units_per_us, 0 /* time */);
printf("%.8f\t%.4f\t%.8f\n", mmps, result, units_per_us);
printf("%.8f\t%.4f\t%.8f\t%.8f\n", mmps, result, units_per_us, units_per_ms);
}
}

Expand Down

0 comments on commit 5f9c985

Please sign in to comment.