xcompass

Table of contents
3.Introduction
4.Specification requirements
5.Solutions suggestions
6.The magnetic fields sensors
7.The inclination measurement system
8.The gyroscope
9.The data acquisition system
10.Communication system
11.The power supply
12.Realisation of the PCB
13.The embedded system
14.Static Library Util.a
15.ViewPort
16.Xcompass
17.Sensors controller commands
18.Test
19.Future improvements
20.Conclusion
21.References

16.           Xcompass

Xcompass is the second front-end program. It uses the QT library to display the different graphical component.

16.1.                Dialogs

The first dialog is open when the program starts. It setup the communication parameters. The main dialog is the displayed. A graphical picture is used to indicate the azimuth, the inclination and the angular rate. An edit box is also available to log the state of the system and the errors.

snapshot1

                Figure 34: Connection to the Smart Compass

snapshot1

snapshot5

snapshot6

Figure 35: Xcompass dialogs

The calibration could easily be done by checking the modules that want be calibrated.

snapshot8

In addition, the Value dialog returns the quick way to monitor the card measurement.

All these dialog have been realized thanks to Qt. Qt is a cross platform user interface toolkit that supports, apart from graphical user interfaces, also database, files, filesystems, sockets and much more in a platform independent manner. Qt is written in C++, but there are bindings for many other languages such as C, Python, C#, etc. It is fully object orientated and can be considered to be event driven. Qt also extends C++ with signals and slots using the moc, the meta object compiler. This allows the creation of loosely coupled components that can be reused.

16.2.                Signals and Slots

The signals and slots are what make the different Qt components as reusable as they are. They provide a mechanism through which it is possible to expose interfaces that can be freely interconnected. For example a menu item, push button, toolbar button and any other item can expose signal corresponding to "activated", "clicked" or any other appropriate event. By connecting such a signal to slots of any other items and the event automatically calls the slots.

The key advantage of the signals and slots is that the caller does not have to know anything about the receiver and vice versa. This makes it possible to integrate many components easily without the component's designer having actually thought about the used configuration. This is truly loose coupling.

16.3.                Generation of object files

In order to be able to use the signals and slots each class has to be declared in a header file. The implementation is best placed in a separate ui.h file. The header file is then passed through a Qt tool known as the moc. The moc produces a cpp containing the code that makes the signals and slots happen (and more). This way of creating object file is used to not lose the handmade code when generating CPP and h files by UI tool.

Figure 36

To generate the executable, the file Xcompass.pro can be executed by qmake (on QT_DIR/bin) to generate the make file.

Once generated, the make file will automatically construct the dependant object and generate the binary file.

contact - link to this site