Commit Graph

608 Commits (master)

Author SHA1 Message Date
Peter Hutterer e30787234c wacom: change the data logger to take a request msg instead of just raw data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-26 09:05:17 +10:00
Peter Hutterer 9a21c2318a wacom: store the default point size for each tablet
It'll be overwritten by the messages anyway but for the converter tool this is
handy.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 11:31:30 +02:00
Peter Hutterer 35a0727f4e flatpak: update pyparsing to latest release
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 11:03:14 +02:00
Peter Hutterer f9f58c0fbd flatpak: update to GNOME runtime 3.32
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 11:03:14 +02:00
Peter Hutterer a8fb795b58 data: add screenshot links to the appdata file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 11:03:14 +02:00
Peter Hutterer 8eea6468b7 wacom: add a session id field to make it easier to find log files
The session id is a UUID, postfixed by an incrementing number. The UUID stays
the same for Tuhi's livetime, the number increments with every bluetooth
connect/disconnect. Result is e.g. 4e55c30035d043ce9f6f4914fb223820-2.

This session id is printed to the log file, added to the YAML raw logs and to
the JSON file, making it easier which log part resulted in which drawing, etc.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:46:14 +02:00
Peter Hutterer 44d2018f1c protocol: assume the initial stroke point to be 0, 0, 0
Reproduced on the Spark, first bytes in a new file recording were
- file header: 0x62, 0x38, 0x62, 0x74
- stroke point: 0xbf, 0xff, 0xff, 0x4a, 0x14, 0x29, 0x31, 0x6a
- stroke delta: 0xa8, 0x02, 0x04, 0xc3,

The initial point thus has a delta pressure value 0x6a which must be added to
*something*. And zero is the most sensible *something* that I can think of.

Fixes #111

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:44:55 +02:00
Peter Hutterer c466c7d431 protocol: handle error code 0x7
Deprecated, but still exists on the Slate so let's wrap the connect attempt
so we throw the right error.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 02ca3a7058 gui: hook up the auth signal with a re-register workflow
When we get an authorization error, show a revealer to re-register the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer f21af42131 protocol: on the spark treat a general error during connect as wrong uuid
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 7a121cfe6c protocol: print the DeviceError as something useful
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 88d9cf14bd wacom: move an assignment to a shared path
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer daac9114e1 gui: pass a dbus device error on as signal
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 1ddf899d3e protocol: augment the new exceptions with errnos
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 14da500310 dbus: change EAGAIN to EBUSY for "already listening"
Seems like a more precise description.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer ebf48be0ad wacom: replace the last exception with a protocol exception
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer be38e1a781 wacom: replace one 'old' exception with the new protocol one
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 22673b9e5a wacom.py: drop two now-unused functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 77048d572d protocol: use a MisingReplyError instead of timeout exceptions
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>
2019-08-23 10:38:36 +02:00
Peter Hutterer 4eee838d94 protocol: implement the message to wait for the end of pen data
This pushes the CRC fetching into the messages, making the caller code more
generic.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer fc280ce555 wacom: use the DeviceError for the invalid state message
Nothing throws the previous exception anymore anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:38:36 +02:00
Peter Hutterer 723b4fec35 tools: add a format toggle for switching between json and svg
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:17:17 +10:00
Peter Hutterer 6a1c2bb4d9 meson.build: hook up the tools for flake8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:17:17 +10:00
Peter Hutterer ff7bdffc70 tools: rename the test-svg tool to something more descriptive
And add a long description and a flake8 fix while we're there.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 10:17:17 +10:00
Peter Hutterer 6c0507abe6 tools: use the json file timestamp where the strokes have none
Cause for the issue in #179

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 08:48:19 +10:00
Peter Hutterer 06aa5b05b1 tools: handle empty files in the test-svg tool
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-23 08:48:19 +10:00
Peter Hutterer cdb7f905ca Store the raw logs in the specified config dir too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 17:20:13 +10:00
Peter Hutterer d514aa2224 gui: rename refresh() to process_svg()
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>
2019-08-22 15:52:25 +10:00
Peter Hutterer 8c9454a298 gui: don't regenerate the SVG when the rotate button is clicked
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>
2019-08-22 15:52:25 +10:00
Peter Hutterer abe96aa4eb data: add some margins to the SetupPerspective
Bit of space between the writing and the edges is a nice luxury to have.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 13:31:31 +10:00
Peter Hutterer 8a3a8f0456 meson.build: bump the timeout for pytest
The more logs one collects, the longer it takes. I'm up to ~30s now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 13:13:22 +10:00
Peter Hutterer bad7aa4554 wacom: treat any settings.ini misconfigurations as unregistered
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>
2019-08-22 12:53:47 +10:00
Peter Hutterer fe75fc4342 wacom: be more specific in the spark's original error code
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 10:52:30 +10:00
Peter Hutterer 9fcd2b9517 protocol: make the auth error a subclass of our protocol error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 10:52:30 +10:00
Peter Hutterer 354c84d750 wacom: switch two exceptions to a the protocol types
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 10:52:30 +10:00
Peter Hutterer 0b8d3773d7 wacom: drop now-unused check_ack function
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>
2019-08-22 10:52:30 +10:00
Jakub Steiner 417bf14f91 data: add the logos
Attributing this commit to jimmac, he's designed the logo.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:59:50 +10:00
Peter Hutterer f7f6d02a37 wacom: drop now unnecessary transaction count
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:59:14 +10:00
Peter Hutterer e030b0b3ea base: add an argument to peek at the first drawing only
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>
2019-08-22 09:59:14 +10:00
Peter Hutterer 23989e4291 config: make the TuhiConfig a singleton object too
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>
2019-08-22 09:59:14 +10:00
Peter Hutterer 6e4b190169 protocol: rename a few protocol messages to better reflect what they do
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>
2019-08-22 09:59:14 +10:00
Peter Hutterer 8690e305cf test: ignore empty files
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>
2019-08-22 09:50:40 +10:00
Peter Hutterer 6c94898458 test: print the file name that triggered an exception on error
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:50:40 +10:00
Peter Hutterer 31d352bb1f test: remove unused idx variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-22 09:50:40 +10:00
Peter Hutterer d633637899 gui: initialize the drawing with the right zoom factor
Fixes #172

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 11:49:26 +02:00
Benjamin Tissoires a8d8641442
Add the logo to the Readme
now we have a logo, so use it

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2019-08-21 09:43:47 +02:00
Peter Hutterer fa888b742f wacom: switch to the new protocol stroke parsers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 09:31:52 +02:00
Peter Hutterer a24c54a570 tools: add an svg generation tool
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>
2019-08-21 09:31:52 +02:00
Peter Hutterer 07dba6c892 wacom: store the default orientation for each tablet
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>
2019-08-21 09:31:52 +02:00
Peter Hutterer e420b04fda protocol: add stroke parsing
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>
2019-08-21 09:31:52 +02:00