You are browsing as a guest. Sign up (or log in) to start making projects!

7h 7m 12s logged

Devlog 23 - More Refactoring


Hi!

In the past few days I have been making some core architectural changes to the project and I would like to explain them now.

Telemetry Provider


I have finally decided on how I am gonna handle telemetry in the long term. It’s a pretty simple concept but the implementation is pretty hard.

I have one object (the TelemetryProvider struct) that is in charge of getting and managing the telemetry. Right now it logs data from all cars and stores the best, last and current laps. If you wish it can save only your laps or laps of everybody. Each lap is a json file about 500kB - 1MB in size and holds all the data that can be displayed in the app. Notably the position ( so you can load that lap directly into the map page ) and the data displayed by the graphs (so you can load it as a reference there as well.)

Pointer to this struct is distributed to pages that need it so they can access it!

The provider has a core logging loop that is running on another thread so the whole UI doesn’t have to redraw each time you log new data. (About 60 times a second.)

State and Settings Providers


Next, I have implemented a StateProvider and an SettingsProvider. These two are basically a drop in replacement of what was stored in the Sidebar and SettingsPage respectively.

Difference between the two is that the StateProvider isn’t stored between app restarts.

Similarly to how the TelemetryProvider works, each of the pages that need these values get a shared pointer (or an Arc in rust) and can access the values.

What’s next


Going further I will keep my focus on the map page. Finish it, and then start polishing the app for the final ship! Wish me luck and have a nice day!

0
7

Comments 0

No comments yet. Be the first!