Thursday 14 February 2008

Basic GUI working

Didn't get much time over the last few days to work on the project, but spent todays evening on getting a basic GUI on the tablet to work. It needs a lot of cleaning up to do, mainly trying to use the Hildon theme that applications developed for the Maemo platform should use to make everything look integrated, everything lining up, etc.

Screen shot of the VNC session to the device, with GPS coordinates removed:



And what it looks like on Linux machine with just 1 data line which is repeated that I basically randomly picked:



most notably the column names are missing on the tablet.

Will have to clean up some of the code, and move on the next task.

Project PC

Ended up getting a project machine from Sean. and had successfully set up Ubuntu on it and have installed postgis that I had trouble on my laptop earlier.

Project size

What I currently have:

aten% wc -l *.py
55 bt_scanner.py
42 collect_data.py
142 gps_reader.py
168 gui.py
41 listener.py
76 logger.py
23 sender.py
80 test.py
627 total


So less than 600 lines of Python when excluding the testing code, seems fairly efficient!

To recap what is done and how much lines of code it is:
  • 55 lines, bt_scanner.py - Periodically scanning in a thread of the Bluetooth neighborhood. Using PyBluez library
  • 142 lines, gps_reader.py - Parsing of NMEA strings from the Bluetooth GPS device.
  • 42 lines, collect_data.py - Bridge every thing together.
  • 76 lines, logger.py - Saving the data(GPS coordinates, Bluetooth neighborhood) into :
    • Simple text file
    • SQLite database
    • Sending it to the GUI thread via a network socket
  • 41 lines, listener.py - Listening for incoming connections from the logger, and calling the appropriate method to update the TreeStore GTK object.
  • 168 lines, gui.py - Show the data collected in TreeStore using TreeView(basically, MVC pattern that is available in GTK) as picture above.

    Well, this doesn't count the Glade XML file(currently at 192 lines) for the simple GUI - it has menus and stuff which are currently disabled because they take up valueble space and don't actually provide anything

From previous experience, in any other language like Java or C/C++, it would have taken me good few more times to achieve the same end result if not more!

No comments: