To be useful, TrafficControl needs to present the stations on an interactive map. The program logic is currently implemented in C++ with some Qt Graphical User interfaces using model-view relations.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5YvyTarnQV0btgHWsPhyphenhyphenTzNaQFXa5BvMxFJLbTRT-iN6GqHRAxgHPidPHVrh2FBUfgEj94MTswB2emAvyx7Y6KJJQyKEFaONuxBqXprKvibozuC8EQ5BescLH-O7PFEGoCNAmBcLYZLY/s400/TC_Station_list.png) |
The original presentation of the stations and tracks, that were imported from a KML file.
A part of the user interface will be based on QML, that imports a map from OpenStreet maps. QML is a design language where one can add graphical elements easily. I will describe a simple QML demo program later and publish it on my github account.
The challenge for me has been to add components in QML dynamically from C++, when stations or tracks are found. The placemarks below are from Google Earth/KML.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmwwXALMiZihqJYYvXlgq-cKs5E05_uq6sER0WaT9Yu73uYGObuMwP0kRtV5wkuyyEcNcwiWWsDrxH-uPA72wG7pzaGBC_VxG9kL6XEcscf0lyUxnz1Kof9d_ibCKScuQmD3kilCDCS6s/s400/TC_Station_googleMaps.png) |
The yellow placemarks are representing stations. |
|
The stations has been identified and their coordinate has been sent to the QML part of the program,
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjB_afn_tROdi_GzueS6Iix_poEyDjM9sBMzdvLDnmX1LUCyMao5a6fgTMcgb6OiG8IFu57Ajq10CIMY8_jsfTbpWXwf7ZccCyt3QfFKBdxgmoEvoTr_bEfXgISaZwspvHbemM7MhP0Euk/s400/TC_Stations_added.png) |
The stations has been identified by trafficControl and dynamically added as circles |
Some of the next steps will be:
- Modifying the different stations individually
- Adding tracks
- Adding trains
- Showing status when hovering the mouse pointer over the items
- Modifying the components regarding their statuses
- Investigating model/view for QML map items
No comments:
Post a Comment