It's caused by a timeout but the underlying issue is that we never got the
reply that we wanted.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
refresh was accurate when it ended up redrawing the screen but now that
redrawing is a separate function let's rename this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Do this when we're saving the file instead and rotate the pixbuf itself only.
For the tablet-wide orientation we regenerate the SVGs because this is
supposed to be a once-off setting so being smart here doesn't gain us
anything.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This situation will never be handled correctly b a GUI and there's no need to,
our settings aren't supposed to be edited by puny humans. So just log an error
and treat the device as unregistered.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
And since this function was the only one generating some of the exceptions,
let's remove those too.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Use --peek to download the first (oldest) drawing on the device but do not
delete it. This is primarily intended as a debugging option, so we can debug
the tablet handling without having to draw new drawings (which cause the
protocol messages to change slightly).
Since the tablet only has a "download oldest file" command this isn't very
useful to end users. If there are two or more files on the tablet, we can only
ever retrieve the oldest one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
We only ever have one of those anyway, so let's make it a singleton. This
patch keeps the self.config assignment and config passing to keep the churn at
at a minimum. But this way we can assign runtime options to the config and
have those as globally accessible options.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
0xc3 is 'download the oldest file'
0xca is 'delete the oldest file' (usually the one we just received) from the tablet.
0xc1 is 'how many files are there'
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Some raw log files may be empty if we cancelled tuhi at the wrong time. Skip
over those while testing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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>