Saturday, 30 June 2018

TrafficControl: NetworkDesigner - First Step

For this summer, I'll focus on making TrafficControl demonstrable. During the last year, I've made a lot of improvements on the program:
  • I made the map useful, with symbols of tracks, trains and stations.
  • I refined the user interface, adding dock widgets and toolbars.
  • I added test cases using Google Test
  • I presented the system load and the simulated time to the program
The process of creating the input files is still manual and complex:
  1. The user must create a KML file using Google Earth. Each track (polyline) must start and end at a station/junction (placemark). 
  2. The user must run a python script that extracts the coordinates for the tracks and stations and connects them.
  3. The user must save the output to a file (TNM - Traffic Network Map). 
  4. The user must append information about the trains to that file. (TNO - Traffic Network Operations). The combined file is named TNF -  Traffic Network File.
TNM is generated from the KML map. The TNF file is a combination of the TNM and TNO files. The user won't need to keep track of the different files.

I'll simplify and clarify this process in the program the new dockWidget Design Window. 

The first step is to add an action that will let the user specify which KML file to convert to TNM format. Once that file is selected, TrafficControl will call a Python script that converts the file to the TNM format. The result is presented in the left textbox.

Until the user has imported a file, there is an explaining text in the text field.
After the script has been run successfully, the information about the stations and tracks has been created.

Future work:
  • Add error checking of TNF file and add TNO handling. 
  • The solution is dependent on a Python installation on the users computer. Having an embedded Python interpreter would be better. This seems to be difficult to implement
  • The program is using some hard coded absolute paths to the script. I need to specify the file in relation to the program's working directory.
  • To be testable, the network designer must be independent from the user interface. I'll refactor the code and add signals/slots to communicate. For example, a signal will be trigged once the python script has converted the KML file to TNM format, so that the user inter face will be updated.

No comments:

Post a Comment