Hey, so today we'll try to replicate a PFE (embedded system that links buses and dispatching for tracking, communication, etc.).
Before diving into the code, let's talk about the technology we'll use. As far as I know, they use C++ for the PFE, so we'll use C++ too. I've been eager to try out new C++ libraries like FLTK for UI development. To keep things simple, we'll rely on the standard library as much as possible, so no asio or boost. For the database, SQLite will be our choice, and instead of using an ORM, we'll handle database operations manually.
Before starting to code, we need a clear plan. So here's the outline:
I don't have much info about the actual PFE, so I'll base my assumptions on pictures I found on the internet.
The "billetique" (ticketing) part will be excluded, as I don't have a thermal printer and don't plan on buying one to make a real prototype.
Maintenance will also be left out, as its function isn't clear to me.
Finally we end up with a simple prototype that can be used to track buses delays, positions and allow a driver to start a trip.
There's no remote verification nor communication with the dispatching center. It's mostly a local system.
To kick things off, we'll create a new project and familiarize ourselves with FLTK, which I've never used before.
A few hours in, and I've got a basic window set up with a menu and a tab bar. I've also added the current time and the service indicator.
Now that I've gotten the hang of FLTK, I'll start designing the UI for the other tabs.
Each sub page is wrapped around a Fl_Group and for edge cases I use custom elements.
Results:
It's not identical to the original design – I made some changes to suit my preferences (like centering elements and adding a keypad).