This takes the raw log YAML file tuhi saves for each interaction, extracts the
pen data and then creates an SVG from that. Good for testing whether the
stroke parsing is sane.
Where --all is given, it will search through the directory that tuhi uses to
store the raw logs.
Two fixmes: the pointsize is hardcoded to 5 (intuos pro) because there's no
easy way here to get the point size. Same for the pressure range.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Not actually used at this point, but this way we have default
width/height/orientation etc. all in one place.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is a slightly different model as the messages, primarily because it's not
quite as model-specific. So there's only one parse function and it can handle
both file types that we currently support (intuos pro and the spark/slate
bits).
All wrapped into their own classes to make future extensions a bit easier.
It's not a 1:1 implementation of the tuhi/wacom.py bits either because we now
know about a few extra bits like the flags in stroke headers.
Most importantly though, this can be easily tested now, with one test case
searching for raw logs in $XDG_DATA_HOME/tuhi/raw and parsing all of those. So
the more files are sitting in there (i.e. the more the tablet is used), the
better the test suite becomes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Use __new__ instead of instance(), this way we can just use the same config
object as Config().do_something.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>k
A few minor changes like passing in a filename and fixing the different
spellings of the orientations.
In order to use it from kete though we have to mess with the PYTHONPATH. But
since it's a in-tree tool only anyway... meh.
This loses the ability to disable pressure on tablets. I think that's just a
leftover from before we knew how to handle pressure in SVG exports. We should
just fix that properly instead of having a config option here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make sure our dimensions are in actual µm.
Note that this will mess with any cached JSON files since they are now on a
different scale.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The dimensions of the tablet are in device units, the point size tells us how
big the actual tablet is.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
A few messages where we assumed the argument is a single byte are actually
little-endian 16 bits. let's add easy-to-use wrappers.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Storage is $XDG_DATA_HOME/tuhi/session-logs/tuhi-$DATE.log
Because it's really useful to have the logs of an old session around when
something goes wrong. Even for simple things like "what uuid was I using
again?"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Have this in the effective main() methods (or close to that anyway) instead of
hidden away in the config implementations.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Unsure how to trigger this case but I have all my devices (not recently
connected) with a vendor ID of None.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
gresources and svgwrite don't (yet?) take a Path though, so we have to use
os.fspath() to convert those.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The reachable range is 2100x14800, highest pressure is 1023. Unlike the slate
the paper block still affords to address almost the whole range even though
the paper is slightly narrower than the range - but it can slide left/right by
about 5mm.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Because it's annoying when there's an issue with the timestamp in the file and
you have to grep for the file name.
And while we're there, change the human readable date to be actually readable.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's the same message with a different argument, let's try not to do
gymnastics in the Msg code just so we can return a tuple.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We can hook into the ProtocolVersion here, so let's de-duplicate this.
Should be backwards-compatible for config files but new config files will have
the uppercase name written now.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is still a bit awkward because the communication of the spark especially
is so strange. It sends a (rejected) uuid, then a single command to register
that UUID. The Slate and the IntuosPro are more sensible, they seem to have a
special message to register a UUID - that one either fails or succeeds.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>