Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tool for pressurecurve debugging #326

Merged
merged 2 commits into from
Nov 17, 2023

Conversation

whot
Copy link
Member

@whot whot commented Nov 14, 2023

This tool takes (one or multiple) sets of 4 coordinate that represent
the second and third point for our pressure curve (first and fourth
points are hardcoded to 0/0 and 1/1 like the driver does)

It spits out gnuplot-compatible lines that can be printed for visual
debugging. Usage to print the GNOME default curves:

./pressurecurve \
    0 .75 .25 1 \
    0 .5 .5 1  \
    0 .25 .75 1 \
    0 0 1 1 \
    .25 0 1 .75 \
    .5 0 1 .5 \
    .75 0 1 .25 > gnuplot.data

And that gnuplot data can then be printed with:

 #!/usr/bin/gnuplot
 set terminal qt persist
 set style data lines
 set xrange [0:1]
 set yrange [0:1]
 plot \
  "gnuplot.data" using 1:2 title "  0, .75, .25, 1", \
  "gnuplot.data" using 1:3 title "  0, .50, .50, 1", \
  "gnuplot.data" using 1:4 title "  0, .25, .75, 1", \
  "gnuplot.data" using 1:5 title "  0,   0,   1, 1", \
  "gnuplot.data" using 1:6 title ".25, 0,   1, .75", \
  "gnuplot.data" using 1:7 title ".50, 0,   1, .50", \
  "gnuplot.data" using 1:8 title ".75, 0,   1, .25

whot added 2 commits November 14, 2023 14:13
There's nothing driver-specific about this and it allows us to test it
separately or write tools to test it.
This tool takes (one or multiple) sets of 4 coordinate that represent
the second and third point for our pressure curve (first and fourth
points are hardcoded to 0/0 and 1/1 like the driver does)

It spits out gnuplot-compatible lines that can be printed for visual
debugging. Usage to print the GNOME default curves:

./build/pressurecurve \
    0 .75 .25 1 \
    0 .5 .5 1  \
    0 .25 .75 1 \
    0 0 1 1 \
    .25 0 1 .75 \
    .5 0 1 .5 \
    .75 0 1 .25 > gnuplot.data

And that gnuplot data can then be printed with:

 #!/usr/bin/gnuplot
 set terminal qt persist
 set style data lines
 set xrange [0:1]
 set yrange [0:1]
 plot \
  "gnuplot.data" using 1:2 title "  0, .75, .25, 1", \
  "gnuplot.data" using 1:3 title "  0, .50, .50, 1", \
  "gnuplot.data" using 1:4 title "  0, .25, .75, 1", \
  "gnuplot.data" using 1:5 title "  0,   0,   1, 1", \
  "gnuplot.data" using 1:6 title ".25, 0,   1, .75", \
  "gnuplot.data" using 1:7 title ".50, 0,   1, .50", \
  "gnuplot.data" using 1:8 title ".75, 0,   1, .25"
@whot whot force-pushed the wip/pressurecurve-debugging branch from d18c09b to 6471457 Compare November 14, 2023 06:11
@whot whot merged commit 3d3b474 into linuxwacom:master Nov 17, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant