Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

[WIP] Pebble integration #45

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

[WIP] Pebble integration #45

wants to merge 2 commits into from

Conversation

rubdos
Copy link

@rubdos rubdos commented Dec 7, 2019

  1. Explanation:

    1. Bare-minimum UX for Notifications #14: keep track of "favorite connections" to receive notifications through a long press on a connection. Connections are stored in a QMap at C++-side, and Connections have a Uuid based on a hash of departure, arrivals and vias.
    2. Connections are stored behind QSharedPointer because of the shared ownership (ConnectionListModel and ConnectionTracker share the data).
  2. Fixed issues:

  3. Testing environment:

    • Sailfish OS version: 3.2
    • Sailfish OS hardware: Xperia 10 (21:1 screen)
    • Pebble Steel, Pebble Time.

I have two working Pebble watches to test since date of posting. Seems like the Toaster I generate also generates a notification on the watch; maybe @abranson might take a look at how a toaster à la here generates an (in my opinion) unneeded notification.

@rubdos
Copy link
Author

rubdos commented Dec 7, 2019

Seems like Connection.id is not a great choice for the key, seems like it's just a counter for the found connections :'-)

Is there something universally unique returned by iRail that we could use?

@rubdos
Copy link
Author

rubdos commented Dec 9, 2019

I'm going to put the tracking of connections in C++ code, if that's okay for you. Given that that would require shared resource ownership between the ConnectionTracker and the ConnectionListModel, I've put all use of Connection behind QSharedPointer<> now.

In a later stage, we need to store multiple references to shared
`Connection`s.
@rubdos rubdos force-pushed the pebble branch 2 times, most recently from 34f5088 to 9046e69 Compare December 9, 2019 14:12
@rubdos
Copy link
Author

rubdos commented Dec 9, 2019

I have a working prototype, see demo video! The strange empty toaster-notification is still there, but I guess I can disable that by disabling berail notifications in rockpool.

Still to do:

  • Delete pins when unfollowing a connection.
  • Somehow generate IDs such that re-following a connection is possible.
  • Integrate and test delays. Maybe some input from @DylanVanAssche would be cool here: can I "just" subscribe on the signals such as StopAbstract::departureDelayChanged, or do I need some more integration?
  • Advertise with other cool apps, such as Passbook (to do the same with airplanes).

@DylanVanAssche
Copy link
Contributor

Really nice work @rubdos ! Love it!
id of a connection is just the number indeed, We could generate IDs though using the departure and arrival time of each route together with arrival and departure stations?

Sure, modify whatever you need, I know the C++ code isn't great, but I'm not a C++ expert either :)

I really love the demo! The departureChanged signal can be used, but I don't think the current backend updates it (replaces the data I think).

@abranson
Copy link

Hmm, that transient hint should make rockpool ignore the notification. might be good to check the rockpoold log in /tmp/ to see what's going on. Sounds like you've been having fun though!

@rubdos
Copy link
Author

rubdos commented Dec 11, 2019

Really nice work @rubdos ! Love it!
id of a connection is just the number indeed, We could generate IDs though using the departure and arrival time of each route together with arrival and departure stations?

It's what I do now; I added a SHA3 of some Connection data to generate an ID. I added a field uuid for that.

Sure, modify whatever you need, I know the C++ code isn't great, but I'm not a C++ expert either :)

I really love the demo! The departureChanged signal can be used, but I don't think the current backend updates it (replaces the data I think).

Hmm, so I somehow have to connect the replacement of the Connection list with the ConnectionTracker. Shouldn't be difficult.

Hmm, that transient hint should make rockpool ignore the notification. might be good to check the rockpoold log in /tmp/ to see what's going on. Sounds like you've been having fun though!

Ah, there is the log. I was always starting rockpoold manually and starting/stopping the service when I was debugging :-D I also have issues with an Android app dumping a persistent notification, so I can find that out too. Thanks.

@rubdos
Copy link
Author

rubdos commented Dec 11, 2019

Hmm, that transient hint should make rockpool ignore the notification. might be good to check the rockpoold log in /tmp/ to see what's going on. Sounds like you've been having fun though!

I just had some more fun, and here's the (I think) relevant part of the log: https://pastebin.com/V1LnPBwe

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants